Commit 894a6a67 authored by Reiner Jung's avatar Reiner Jung

update babsi

parent 756e0ec1
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="cau.swp.babsi.test"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="14" />
<instrumentation
android:name="android.test.InstrumentationTestRunner"
android:targetPackage="cau.swp.babsi" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<uses-library android:name="android.test.runner" />
</application>
</manifest>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/java"/>
<classpathentry kind="src" path="src/groovy"/>
<classpathentry kind="src" path="grails-app/conf"/>
<classpathentry kind="src" path="grails-app/controllers"/>
<classpathentry kind="src" path="grails-app/domain"/>
<classpathentry kind="src" path="grails-app/services"/>
<classpathentry kind="src" path="grails-app/taglib"/>
<classpathentry kind="src" path="grails-app/utils"/>
<classpathentry kind="src" path="test/integration"/>
<classpathentry kind="src" path="test/unit"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry excluding="BuildConfig.groovy|*DataSource.groovy|UrlMappings.groovy|Config.groovy|BootStrap.groovy|spring/resources.groovy" kind="src" path=".link_to_grails_plugins/cache-1.0.1/grails-app/conf">
<attributes>
<attribute name="org.grails.ide.eclipse.core.SOURCE_FOLDER" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path=".link_to_grails_plugins/cache-1.0.1/grails-app/services">
<attributes>
<attribute name="org.grails.ide.eclipse.core.SOURCE_FOLDER" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path=".link_to_grails_plugins/cache-1.0.1/grails-app/taglib">
<attributes>
<attribute name="org.grails.ide.eclipse.core.SOURCE_FOLDER" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path=".link_to_grails_plugins/cache-1.0.1/src/groovy">
<attributes>
<attribute name="org.grails.ide.eclipse.core.SOURCE_FOLDER" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path=".link_to_grails_plugins/cache-1.0.1/src/java">
<attributes>
<attribute name="org.grails.ide.eclipse.core.SOURCE_FOLDER" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="BuildConfig.groovy|*DataSource.groovy|UrlMappings.groovy|Config.groovy|BootStrap.groovy|spring/resources.groovy" kind="src" path=".link_to_grails_plugins/database-migration-1.3.2/grails-app/conf">
<attributes>
<attribute name="org.grails.ide.eclipse.core.SOURCE_FOLDER" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path=".link_to_grails_plugins/database-migration-1.3.2/grails-app/controllers">
<attributes>
<attribute name="org.grails.ide.eclipse.core.SOURCE_FOLDER" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path=".link_to_grails_plugins/database-migration-1.3.2/grails-app/views">
<attributes>
<attribute name="org.grails.ide.eclipse.core.SOURCE_FOLDER" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path=".link_to_grails_plugins/database-migration-1.3.2/src/groovy">
<attributes>
<attribute name="org.grails.ide.eclipse.core.SOURCE_FOLDER" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="BuildConfig.groovy|*DataSource.groovy|UrlMappings.groovy|Config.groovy|BootStrap.groovy|spring/resources.groovy" kind="src" path=".link_to_grails_plugins/jquery-1.8.3/grails-app/conf">
<attributes>
<attribute name="org.grails.ide.eclipse.core.SOURCE_FOLDER" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path=".link_to_grails_plugins/jquery-1.8.3/grails-app/i18n">
<attributes>
<attribute name="org.grails.ide.eclipse.core.SOURCE_FOLDER" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path=".link_to_grails_plugins/jquery-1.8.3/grails-app/services">
<attributes>
<attribute name="org.grails.ide.eclipse.core.SOURCE_FOLDER" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path=".link_to_grails_plugins/jquery-1.8.3/grails-app/taglib">
<attributes>
<attribute name="org.grails.ide.eclipse.core.SOURCE_FOLDER" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path=".link_to_grails_plugins/jquery-1.8.3/src/groovy">
<attributes>
<attribute name="org.grails.ide.eclipse.core.SOURCE_FOLDER" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="BuildConfig.groovy|*DataSource.groovy|UrlMappings.groovy|Config.groovy|BootStrap.groovy|spring/resources.groovy" kind="src" path=".link_to_grails_plugins/resources-1.2/grails-app/conf">
<attributes>
<attribute name="org.grails.ide.eclipse.core.SOURCE_FOLDER" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path=".link_to_grails_plugins/resources-1.2/grails-app/i18n">
<attributes>
<attribute name="org.grails.ide.eclipse.core.SOURCE_FOLDER" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path=".link_to_grails_plugins/resources-1.2/grails-app/resourceMappers">
<attributes>
<attribute name="org.grails.ide.eclipse.core.SOURCE_FOLDER" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path=".link_to_grails_plugins/resources-1.2/grails-app/taglib">
<attributes>
<attribute name="org.grails.ide.eclipse.core.SOURCE_FOLDER" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path=".link_to_grails_plugins/resources-1.2/src/groovy">
<attributes>
<attribute name="org.grails.ide.eclipse.core.SOURCE_FOLDER" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path=".link_to_grails_plugins/resources-1.2/src/java">
<attributes>
<attribute name="org.grails.ide.eclipse.core.SOURCE_FOLDER" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="BuildConfig.groovy|*DataSource.groovy|UrlMappings.groovy|Config.groovy|BootStrap.groovy|spring/resources.groovy" kind="src" path=".link_to_grails_plugins/webxml-1.4.1/grails-app/conf">
<attributes>
<attribute name="org.grails.ide.eclipse.core.SOURCE_FOLDER" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path=".link_to_grails_plugins/webxml-1.4.1/src/groovy">
<attributes>
<attribute name="org.grails.ide.eclipse.core.SOURCE_FOLDER" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.grails.ide.eclipse.core.CLASSPATH_CONTAINER"/>
<classpathentry exported="true" kind="con" path="GROOVY_DSL_SUPPORT"/>
<classpathentry kind="output" path="target-eclipse/classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>BabsiWeb</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.grails.ide.eclipse.core.nature</nature>
<nature>org.eclipse.jdt.groovy.core.groovyNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures>
<linkedResources>
<link>
<name>.link_to_grails_plugins</name>
<type>2</type>
<locationURI>GRAILS_ROOT/2.2.4/projects/BabsiWeb/plugins</locationURI>
</link>
</linkedResources>
</projectDescription>
eclipse.preferences.version=1
encoding//.link_to_grails_plugins/jquery-1.8.3/grails-app/i18n/messages.properties=UTF-8
encoding//.link_to_grails_plugins/resources-1.2/grails-app/i18n/messages.properties=UTF-8
encoding//grails-app/i18n/messages.properties=UTF-8
encoding//grails-app/i18n/messages_cs_CZ.properties=UTF-8
encoding//grails-app/i18n/messages_da.properties=UTF-8
encoding//grails-app/i18n/messages_de.properties=UTF-8
encoding//grails-app/i18n/messages_es.properties=UTF-8
encoding//grails-app/i18n/messages_fr.properties=UTF-8
encoding//grails-app/i18n/messages_it.properties=UTF-8
encoding//grails-app/i18n/messages_ja.properties=UTF-8
encoding//grails-app/i18n/messages_nb.properties=UTF-8
encoding//grails-app/i18n/messages_nl.properties=UTF-8
encoding//grails-app/i18n/messages_pl.properties=UTF-8
encoding//grails-app/i18n/messages_pt_BR.properties=UTF-8
encoding//grails-app/i18n/messages_pt_PT.properties=UTF-8
encoding//grails-app/i18n/messages_ru.properties=UTF-8
encoding//grails-app/i18n/messages_sv.properties=UTF-8
encoding//grails-app/i18n/messages_th.properties=UTF-8
encoding//grails-app/i18n/messages_zh_CN.properties=UTF-8
eclipse.preferences.version=1
groovy.compiler.level=20
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<installed facet="grails.app" version="1.0"/>
</faceted-project>
eclipse.preferences.version=1
org.grails.ide.eclipse.core.org.grails.ide.eclipse.core.install.name=grails 2.2.4
org.grails.ide.eclipse.core.use.default.install=false
#Grails Metadata file
#Wed Nov 20 15:38:39 CET 2013
app.grails.version=2.2.4
app.name=BabsiWeb
app.version=0.1
plugins.flot=0.2.3
plugins.platform-core=1.0.RC5
modules = {
application {
resource url:'js/application.js'
}
}
\ No newline at end of file
This diff is collapsed.
grails.servlet.version = "2.5" // Change depending on target container compliance (2.5 or 3.0)
grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
grails.project.target.level = 1.6
grails.project.source.level = 1.6
//grails.project.war.file = "target/${appName}-${appVersion}.war"
// uncomment (and adjust settings) to fork the JVM to isolate classpaths
//grails.project.fork = [
// run: [maxMemory:1024, minMemory:64, debug:false, maxPerm:256]
//]
grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits("global") {
// specify dependency exclusions here; for example, uncomment this to disable ehcache:
// excludes 'ehcache'
}
log "error" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
checksums true // Whether to verify checksums on resolve
legacyResolve false // whether to do a secondary resolve on plugin installation, not advised and here for backwards compatibility
repositories {
inherits true // Whether to inherit repository definitions from plugins
mavenRepo "http://maven.restlet.org/" //needed for JAX-RS plugin
grailsPlugins()
grailsHome()
grailsCentral()
mavenLocal()
mavenCentral()
// uncomment these (or add new ones) to enable remote dependency resolution from public Maven repositories
//mavenRepo "http://snapshots.repository.codehaus.org"
//mavenRepo "http://repository.codehaus.org"
//mavenRepo "http://download.java.net/maven/2/"
//mavenRepo "http://repository.jboss.com/maven2/"
}
dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes e.g.
runtime 'mysql:mysql-connector-java:5.1.22'
}
plugins {
runtime ":hibernate:$grailsVersion"
runtime ":jquery:1.8.3"
runtime ":resources:1.2"
// Uncomment these (or add new ones) to enable additional resources capabilities
//runtime ":zipped-resources:1.0"
//runtime ":cached-resources:1.0"
//runtime ":yui-minify-resources:0.1.5"
build ":tomcat:$grailsVersion"
runtime ":database-migration:1.3.2"
compile ":shiro:1.1.4"
compile ':cache:1.0.1'
}
}
// locations to search for config files that get merged into the main config;
// config files can be ConfigSlurper scripts, Java properties files, or classes
// in the classpath in ConfigSlurper format
// grails.config.locations = [ "classpath:${appName}-config.properties",
// "classpath:${appName}-config.groovy",
// "file:${userHome}/.grails/${appName}-config.properties",
// "file:${userHome}/.grails/${appName}-config.groovy"]
// if (System.properties["${appName}.config.location"]) {
// grails.config.locations << "file:" + System.properties["${appName}.config.location"]
// }
grails.project.groupId = appName // change this to alter the default package name and Maven publishing destination
grails.mime.file.extensions = true // enables the parsing of file extensions from URLs into the request format
grails.mime.use.accept.header = false
grails.mime.types = [
all: '*/*',
atom: 'application/atom+xml',
css: 'text/css',
csv: 'text/csv',
form: 'application/x-www-form-urlencoded',
html: ['text/html','application/xhtml+xml'],
js: 'text/javascript',
json: ['application/json', 'text/json'],
multipartForm: 'multipart/form-data',
rss: 'application/rss+xml',
text: 'text/plain',
xml: ['text/xml', 'application/xml']
]
// URL Mapping Cache Max Size, defaults to 5000
//grails.urlmapping.cache.maxsize = 1000
// What URL patterns should be processed by the resources plugin
grails.resources.adhoc.patterns = ['/images/*', '/css/*', '/js/*', '/plugins/*']
// The default codec used to encode data with ${}
grails.views.default.codec = "none" // none, html, base64
grails.views.gsp.encoding = "UTF-8"
grails.converters.encoding = "UTF-8"
// enable Sitemesh preprocessing of GSP pages
grails.views.gsp.sitemesh.preprocess = true
// scaffolding templates configuration
grails.scaffolding.templates.domainSuffix = 'Instance'
// Set to false to use the new Grails 1.2 JSONBuilder in the render method
grails.json.legacy.builder = false
// enabled native2ascii conversion of i18n properties files
grails.enable.native2ascii = true
// packages to include in Spring bean scanning
grails.spring.bean.packages = []
// whether to disable processing of multi part requests
grails.web.disable.multipart=false
// request parameters to mask when logging exceptions
grails.exceptionresolver.params.exclude = ['password']
// configure auto-caching of queries by default (if false you can cache individual queries with 'cache: true')
grails.hibernate.cache.queries = false
environments {
development {
grails.logging.jul.usebridge = true
}
production {
grails.logging.jul.usebridge = false
// TODO: grails.serverURL = "http://www.changeme.com"
}
}
// log4j configuration
log4j = {
// Example of changing the log pattern for the default console appender:
//
//appenders {
// console name:'stdout', layout:pattern(conversionPattern: '%c{2} %m%n')
//}
error 'org.codehaus.groovy.grails.web.servlet', // controllers
'org.codehaus.groovy.grails.web.pages', // GSP
'org.codehaus.groovy.grails.web.sitemesh', // layouts
'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping
'org.codehaus.groovy.grails.web.mapping', // URL mapping
'org.codehaus.groovy.grails.commons', // core / classloading
'org.codehaus.groovy.grails.plugins', // plugins
'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration
'org.springframework',
'org.hibernate',
'net.sf.ehcache.hibernate'
}
dataSource {
pooled = true
driverClassName = "org.h2.Driver"
username = "sa"
password = ""
}
hibernate {
cache.use_second_level_cache = true
cache.use_query_cache = false
cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory'
}
// environment specific settings
environments {
development {
dataSource {
dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', ''
url = "jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000"
}
// dataSource {
// pooled = true
// dbCreate = "create-drop"
// url = "jdbc:mysql://localhost/babsi?useUnicode=yes&characterEncoding=UTF-8"
// driverClassName = "com.mysql.jdbc.Driver"
// username = "root"
// password = "root"
// }
}
test {
dataSource {
dbCreate = "update"
url = "jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000"
}
}
production {
// dataSource {
// dbCreate = "update"
// url = "jdbc:h2:prodDb;MVCC=TRUE;LOCK_TIMEOUT=10000"
// pooled = true
// properties {
// maxActive = -1
// minEvictableIdleTimeMillis=1800000
// timeBetweenEvictionRunsMillis=1800000
// numTestsPerEvictionRun=3
// testOnBorrow=true
// testWhileIdle=true
// testOnReturn=true
// validationQuery="SELECT 1"
// }
// }
dataSource {
pooled = true
dbCreate = "create-drop"
url = "jdbc:mysql://localhost/babsi"
driverClassName = "com.mysql.jdbc.Driver"
username = "root"
password = "root"
}
}
}
class UrlMappings {
static mappings = {
"/$controller/$action?/$id?"{ constraints { // apply constraints here
}
}
"/" {
controller = "Dashboard"
action = "index"
}
/* get requests are mapped to standard (list) */
/* mapping for checklist post request */
"/checklist/post"(controller: "checklist", action: "consumeAsJSON", parseRequest:true)
// "/"(view:"/index")
"500"(view:'/error')
}
}
package babsi
/**
* Generated by the Shiro plugin. This filters class protects all URLs
* via access control by convention.
*/
class SecurityFilters {
/**
* Array of controller/action combinations which will be skipped from authentication
* if the controller and action names match. The action value can also be '*' if it
* encompasses all actions within the controller.
*/
static nonAuthenticatedActions = [
[controller: "checklist", action: "consumeAsJSON"],
[controller: "antibiotic", action: "getJSON"],
[controller: "station", action: "getJSON"],
[controller: "interventionType", action: "getJSON"],
[controller: "infection", action: "getJSON"],
[controller: "user", action: "getJSON"]
]
/**
* Array of controller/action combinations that will be authenticated against the user's
* role. The map also includes the roles which the controller/action pair will match
* against.
*/
static authenticatedActions = [
[controller: "dashboard", action: "*", roles:["absUser"]],
[controller: "data", action: "*", roles:["absUser"]],
[controller: "station", action: "*", roles:["absUser"]],
[controller: "statistic", action: "*", roles:["absUser"]],
[controller: "user", action: "*", roles:["absUser"]],
[controller: "antibiotic", action: "*", roles:["absUser"]],
[controller: "interventionType", action: "*", roles:["absUser"]],
[controller: "checklist", action: "*", roles:["absUser"]],
[controller: "cycle", action: "*", roles:["absUser"]],
[controller: "infection", action: "*", roles:["absUser"]],
[controller: "wardRound", action: "*", roles:["absUser"]]
]
def filters = {
// so können weiter Checklisten gesendet werden...
// notPost(controller: "checklist", action: "consumeAsJSON", invert: true) {
// before = {
// accessControl()
// }
//
// }
// schnell mal auskommentiert ...
// all(uri: "/**") {
// before = {
// // Ignore direct views (e.g. the default main index page).
// // if (!controllerName) return true
//
// accessControl() }
// }
all(controller: '*', action: '*') {
before = {
// Determine if the controller/action belongs is not to be authenticated
def needsAuth = !nonAuthenticatedActions.find {
(it.controller == controllerName) &&
((it.action == '*') || (it.action == actionName))
}
if (needsAuth) {
// Get the map within the authenticated actions which pertain to the current
// controller and view.
def authRoles = authenticatedActions.find {
(it.controller == controllerName) &&
((it.action == '*') || (it.action == actionName))
}
if (authRoles) {
// Perform the access control for each of the roles provided in the authRoles
accessControl {
authRoles.roles.each { roleName -> role(roleName) }
}
}
// Skip authentication if the authRoles was not found
else {
return true
}
}
// Skip authentication if no auth is needed
else {
return true
}
}
}
}
}
// Place your Spring DSL code here
beans = {
}
package cau.swp.babsi
import org.apache.shiro.SecurityUtils
import org.apache.shiro.authc.AuthenticationException
import org.apache.shiro.authc.UsernamePasswordToken
import org.apache.shiro.web.util.SavedRequest
import org.apache.shiro.web.util.WebUtils
import org.apache.shiro.grails.ConfigUtils
/**
* Babsi Controller AuthController:
*
* Managed die Authentifizierung der Benutzer
*
* @package cau.swp.babsi
* @author Babsi Team
*/
class AuthController {
def shiroSecurityManager
static navigationScope = 'debug'
def index = { redirect(action: "login", params: params) }
def login = {
return [ username: params.username, rememberMe: (params.rememberMe != null), targetUri: params.targetUri ]
}
def signIn = {
def authToken = new UsernamePasswordToken(params.username, params.password as String)
// Support for "remember me"
if (params.rememberMe) {
authToken.rememberMe = true
}
// If a controller redirected to this page, redirect back