Move modules to attic
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1811948 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/usermanager-ui/README.md b/usermanager-ui/README.md
deleted file mode 100644
index a8cf2ab..0000000
--- a/usermanager-ui/README.md
+++ /dev/null
@@ -1,45 +0,0 @@
-# Apache Sling User Manager UI sample
-
-This module is part of the [Apache Sling](https://sling.apache.org) project.
-
-## WHY THIS SAMPLE?
-
-This demonstrates some sample UI for user/group discovery, creation and update.
-
-## PRE-REQUISITES
-
-This sample uses the i18n support provided by the org.apache.sling.i18n bundle,
-so that bundle must be installed into your sling instance first.
-
-## HOW TO INSTALL
-
-Build this bundle and install it in Sling.
-
-For example, if Sling is running on port 8080 (which happens if you start
-the launchpad/testing module with
- "java -jar target/org.apache.sling.launchpad-<version>-standalone.jar"),
-this will build and install it:
-
- mvn -P autoInstallBundle clean install -Dsling.url=http://localhost:8080/system/console
-
-To verify that the bundle is correctly installed:
-
-1) http://localhost:8080/libs/sling/usermgmt/page.html.esp must return the page.html.esp
- script.
-
-2) The console at http://localhost:8080/system/console/bundles must
- list the bundle named "Apache Sling User Manager UI sample" as active.
-
-## HOW TO TEST
-
-Login to sling as the admin user.
-
-Open http://localhost:8080/system/userManager.html
-
-Use the links in the left sidebar to get to the pages that enable you to
-find, update or create users/groups.
-
-## SEE ALSO
-
-This demo can also be used in combination with the accessmanager-ui demo. For more
-information see there.
\ No newline at end of file
diff --git a/usermanager-ui/pom.xml b/usermanager-ui/pom.xml
deleted file mode 100644
index ac26c90..0000000
--- a/usermanager-ui/pom.xml
+++ /dev/null
@@ -1,152 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for
- additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not
- use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
- applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
- -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.sling</groupId>
- <artifactId>sling</artifactId>
- <version>26</version>
- <relativePath/>
- </parent>
-
- <groupId>org.apache.sling.samples</groupId>
- <artifactId>org.apache.sling.samples.usermanager.ui</artifactId>
- <packaging>bundle</packaging>
- <version>0.9-SNAPSHOT</version>
- <name>Apache Sling User Manager UI sample</name>
- <description>
- Sample Sling UI for user manager operations.
- </description>
-
- <scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/samples/usermanager-ui</connection>
- <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/samples/usermanager-ui</developerConnection>
- <url>http://svn.apache.org/viewvc/sling/trunk/samples/usermanager-ui</url>
- </scm>
-
- <pluginRepositories>
- <!-- for yui-compressor-maven-plugin -->
- <pluginRepository>
- <name>oss.sonatype.org</name>
- <id>oss.sonatype.org</id>
- <url>http://oss.sonatype.org/content/groups/public</url>
- </pluginRepository>
- </pluginRepositories>
-
- <build>
- <plugins>
- <!-- use the yui-compressor to minify the js and css files -->
- <plugin>
- <groupId>net.alchim31.maven</groupId>
- <artifactId>yuicompressor-maven-plugin</artifactId>
- <executions>
- <execution>
- <phase>process-resources</phase>
- <goals>
- <goal>compress</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <sourceDirectory>${basedir}/src/main/resources</sourceDirectory>
- <outputDirectory>${basedir}/src/main/resources</outputDirectory>
- <suffix>.min</suffix>
- <excludes>
- <exclude>**/*.min.*</exclude>
- </excludes>
- <!--
- <aggregations>
- <aggregation>
- <insertNewLine>true</insertNewLine>
- <output>${basedir}/src/main/resources/js/usermanager/usermanager.all.min.js</output>
- <includes>
- <include>jquery/jquery-1.5.1.min.js</include>
- <include>jquery/jquery-ui-1.8.11.custom.min.js</include>
- <include>jquery/jquery-validate/jquery.validate.min.js</include>
- <include>usermanager.min.js</include>
- </includes>
- </aggregation>
- <aggregation>
- <insertNewLine>true</insertNewLine>
- <output>${basedir}/src/main/resources/js/usermanager/usermanager.all.js</output>
- <includes>
- <include>jquery/jquery-1.5.1.min.js</include>
- <include>jquery/jquery-ui-1.8.11.custom.min.js</include>
- <include>jquery/jquery-validate/jquery.validate.js</include>
- <include>usermanager.js</include>
- </includes>
- </aggregation>
- </aggregations>
- -->
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-scr-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Export-Package>
- org.apache.sling.usermgr
- </Export-Package>
- <Sling-Bundle-Resources>
- /images,
- /css/usermanager,
- /js/usermanager,
- /libs/sling/group,
- /libs/sling/groups,
- /libs/sling/user,
- /libs/sling/userManager,
- /libs/sling/usermgmt,
- /libs/sling/users
- </Sling-Bundle-Resources>
- <Sling-Initial-Content>
- SLING-INF/i18n;overwrite:=false;uninstall:=false;path:=/etc/i18n/org.apache.sling.samples.usermanager.ui
- </Sling-Initial-Content>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <excludePackageNames></excludePackageNames>
- </configuration>
- </plugin>
- </plugins>
- </reporting>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.scr.annotations</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.jackrabbit</groupId>
- <artifactId>jackrabbit-api</artifactId>
- <version>2.2.5</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.jcr</groupId>
- <artifactId>jcr</artifactId>
- </dependency>
- </dependencies>
-</project>
diff --git a/usermanager-ui/src/main/java/org/apache/sling/usermgr/FindPeopleQuery.java b/usermanager-ui/src/main/java/org/apache/sling/usermgr/FindPeopleQuery.java
deleted file mode 100644
index a8696b2..0000000
--- a/usermanager-ui/src/main/java/org/apache/sling/usermgr/FindPeopleQuery.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.sling.usermgr;
-
-import org.apache.jackrabbit.api.security.user.Group;
-import org.apache.jackrabbit.api.security.user.Query;
-import org.apache.jackrabbit.api.security.user.QueryBuilder;
-import org.apache.jackrabbit.api.security.user.User;
-import org.apache.jackrabbit.api.security.user.UserManager;
-import org.apache.jackrabbit.api.security.user.QueryBuilder.Direction;
-
-/**
- * Simple Query to find Users/Groups
- */
-public class FindPeopleQuery implements Query {
-
- private int searchType;
- private String searchQuery;
- private boolean isPrefixQuery;
- private long offset;
- private long maxResults;
-
- /**
- * Constructor. The parameters specify what to query for.
- *
- * @param searchType the type to search for.
- * One of: {@link UserManager#SEARCH_TYPE_USER}, {@link UserManager#SEARCH_TYPE_GROUP}
- * or {@link UserManager#SEARCH_TYPE_AUTHORIZABLE}
- * @param searchQuery the term to search for
- * @param isPrefixQuery true if this is a simple prefix query
- * @param offset the offset to start the results from
- * @param maxResults the maximum number of rows to retrieve
- */
- public FindPeopleQuery(int searchType, String searchQuery,
- boolean isPrefixQuery, long offset, long maxResults) {
- this.searchType = searchType;
- this.searchQuery = searchQuery;
- this.isPrefixQuery = isPrefixQuery;
- this.offset = offset;
- this.maxResults = maxResults;
- }
-
- /* (non-Javadoc)
- * @see org.apache.jackrabbit.api.security.user.Query#build(org.apache.jackrabbit.api.security.user.QueryBuilder)
- */
- public <T> void build(QueryBuilder<T> builder) {
- if (UserManager.SEARCH_TYPE_USER == searchType) {
- builder.setSelector(User.class);
- } else if (UserManager.SEARCH_TYPE_GROUP == searchType) {
- builder.setSelector(Group.class);
- }
-
- //JCR-952: case-insensive sort needs jackrabbit 2.3+
- // builder.setSortOrder("fn:lower-case(@rep:principalName)", Direction.ASCENDING);
- builder.setSortOrder("@rep:principalName", Direction.ASCENDING);
- builder.setLimit(offset, maxResults + 1); //max + 1 so we can tell if there are more on the next page
-
- String encodedTerm = encodeForLikeClause(searchQuery);
- if (isPrefixQuery) {
- String lcEncodedTerm = encodedTerm.toLowerCase();
- //check for a case insensitive match in principalName
- builder.setCondition(builder.or(builder.nameMatches(encodedTerm + "%"),
- builder.nameMatches(lcEncodedTerm + "%"))
- );
- } else {
- //check for a match in the name or displayName
- builder.setCondition(builder.or(builder.nameMatches("%" + encodedTerm + "%"),
- builder.like("@displayName", "%" + encodedTerm + "%")));
- }
- }
-
- /**
- * Encodes the special characters of a term to provide a valid like clause
- * @param rawValue the value to encode
- * @return encoded value safe to use in a query like clause
- */
- static String encodeForLikeClause(String rawValue) {
- if (rawValue == null || rawValue.length() == 0) {
- return rawValue;
- }
-
- char wrappingQuoteChar = '\'';
- // encode
- StringBuffer encoded = new StringBuffer();
- for (int i = 0; i < rawValue.length(); i++) {
- char c = rawValue.charAt(i);
- if (c == '%' || c == '_' || c == '\\') {
- encoded.append('\\'); //escape the special character
- } else if (c == wrappingQuoteChar) {
- encoded.append(c); //double up the character to match the literal quote character
- }
- if (c == '*') {
- //change the '*' wildcard to '%'
- encoded.append('%');
- } else if (c == '?') {
- //change the '?' wildcard to '_'
- encoded.append('_');
- } else {
- encoded.append(c);
- }
- }
- return encoded.toString();
- }
-}
diff --git a/usermanager-ui/src/main/resources/SLING-INF/i18n/resources.json b/usermanager-ui/src/main/resources/SLING-INF/i18n/resources.json
deleted file mode 100644
index d538a02..0000000
--- a/usermanager-ui/src/main/resources/SLING-INF/i18n/resources.json
+++ /dev/null
@@ -1,465 +0,0 @@
-{
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- "en": {
- "jcr:mixinTypes": [
- "mix:language"
- ],
- "jcr:language": "en",
- "sling:basename": "org.apache.sling.usermgr.Resources",
-
- "page.template.title": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "page.template.title",
- "sling:message": "{0} : Sling"
- },
- "msg.noscript": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "msg.noscript",
- "sling:message": "Your browser has scripting disabled. Please enable scripting for a better experience."
- },
-
- "link.login": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "link.login",
- "sling:message": "Login"
- },
- "link.logout": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "link.logout",
- "sling:message": "Logout"
- },
- "logo.alt": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "logo.alt",
- "sling:message": "Apache Sling"
- },
-
-
- "page.title.update.group": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "page.title.update.group",
- "sling:message": "Update Group"
- },
-
- "header.update.group": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "header.update.group",
- "sling:message": "Update Group: {0}"
- },
-
- "page.title.view.group": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "page.title.view.group",
- "sling:message": "View Group"
- },
-
- "header.view.group": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "header.view.group",
- "sling:message": "View Group: {0}"
- },
-
- "prop.label.loginEnabled": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "prop.label.loginEnabled",
- "sling:message": "Is Login Enabled"
- },
- "prop.label.loginEnabled.yes": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "prop.label.loginEnabled.yes",
- "sling:message": "Yes"
- },
- "prop.label.loginEnabled.no": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "prop.label.loginEnabled.no",
- "sling:message": "No"
- },
- "prop.label.loginDisabled.reason": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "prop.label.loginDisabled.reason",
- "sling:message": "Reason"
- },
-
- "prop.label.email": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "prop.label.email",
- "sling:message": "E-Mail"
- },
- "prop.label.displayName": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "prop.label.displayName",
- "sling:message": "Display Name"
- },
- "prop.label.password": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "prop.label.password",
- "sling:message": "Password"
- },
- "prop.label.confirmPassword": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "prop.label.confirmPassword",
- "sling:message": "Confirm Password"
- },
- "prop.label.memberOf": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "prop.label.memberOf",
- "sling:message": "Member Of"
- },
- "prop.label.declaredMembers": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "prop.label.declaredMembers",
- "sling:message": "Declared Members"
- },
-
- "button.save": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "button.save",
- "sling:message": "Save"
- },
- "link.remove": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "link.remove",
- "sling:message": "Remove"
- },
- "link.add.property": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "link.add.property",
- "sling:message": "Add Property"
- },
- "link.add.member": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "link.add.member",
- "sling:message": "Add Member"
- },
- "tooltip.removeMember": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "tooltip.removeMember",
- "sling:message": "Remove Member"
- },
-
- "dialog.title.add.property": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "dialog.title.add.property",
- "sling:message": "Add New Property"
- },
- "label.property.name": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "label.property.name",
- "sling:message": "Name"
- },
-
- "dialog.title.confirm.remove": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "dialog.title.confirm.remove",
- "sling:message": "Confirm Remove"
- },
- "msg.group.confirm.remove": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "msg.group.confirm.remove",
- "sling:message": "Are you sure you want to delete this group?"
- },
-
- "dialog.title.add.member": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "dialog.title.add.member",
- "sling:message": "Add Group Member"
- },
- "label.group.name": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "label.group.name",
- "sling:message": "Name"
- },
-
-
-
- "page.title.find.groups": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "page.title.find.groups",
- "sling:message": "Find Groups"
- },
- "button.search": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "button.search",
- "sling:message": "Search"
- },
- "label.column.name": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "label.column.name",
- "sling:message": "Name"
- },
- "label.column.displayName": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "label.column.displayName",
- "sling:message": "Display Name"
- },
- "msg.readyToSearch": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "msg.readyToSearch",
- "sling:message": "Ready to Search"
- },
- "msg.noMatchesFound": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "msg.noMatchesFound",
- "sling:message": "No Matches Found"
- },
-
- "csv.quicksearch.items": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "csv.quicksearch.items",
- "sling:message": "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z"
- },
-
- "quicksearch.label.all": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "quicksearch.label.all",
- "sling:message": "All"
- },
-
-
- "page.title.create.group": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "page.title.create.group",
- "sling:message": "Create Group"
- },
- "prop.label.groupid": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "prop.label.groupid",
- "sling:message": "Group ID"
- },
- "prop.label.displayName": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "prop.label.displayName",
- "sling:message": "Display Name"
- },
- "button.create": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "button.create",
- "sling:message": "Create"
- },
-
-
-
- "page.title.update.user": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "page.title.update.user",
- "sling:message": "Update User"
- },
- "header.update.user": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "header.update.user",
- "sling:message": "Update User: {0}"
- },
- "page.title.view.user": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "page.title.view.user",
- "sling:message": "View User"
- },
- "header.view.user": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "header.view.user",
- "sling:message": "View User: {0}"
- },
-
- "msg.user.confirm.remove": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "msg.user.confirm.remove",
- "sling:message": "Are you sure you want to delete this user?"
- },
-
- "header.change.password": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "header.change.password",
- "sling:message": "Change Password"
- },
- "prop.label.oldPwd": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "prop.label.oldPwd",
- "sling:message": "Old Password"
- },
- "prop.label.newPwd": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "prop.label.newPwd",
- "sling:message": "New Password"
- },
- "prop.label.newPwdConfirm": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "prop.label.newPwdConfirm",
- "sling:message": "Confirm Password"
- },
- "button.updatePwd": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "button.updatePwd",
- "sling:message": "Update"
- },
-
- "csv.static.group.prop.keys": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "csv.static.group.prop.keys",
- "sling:message": "displayName"
- },
- "csv.static.user.prop.keys": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "csv.static.user.prop.keys",
- "sling:message": "displayName,email"
- },
-
-
- "tooltip.removeProperty": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "tooltip.removeProperty",
- "sling:message": "Remove Property"
- },
-
-
-
- "menu.link.authorizables": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "menu.link.authorizables",
- "sling:message": "Authorizables"
- },
- "menu.link.users": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "menu.link.users",
- "sling:message": "Users"
- },
- "menu.link.groups": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "menu.link.groups",
- "sling:message": "Groups"
- },
- "menu.link.createUser": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "menu.link.createUser",
- "sling:message": "Create User"
- },
- "menu.link.createGroup": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "menu.link.createGroup",
- "sling:message": "Create Group"
- },
- "menu.link.updateUser": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "menu.link.updateUser",
- "sling:message": "Update User"
- },
- "menu.link.updateGroup": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "menu.link.updateGroup",
- "sling:message": "Update Group"
- },
- "menu.link.viewUser": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "menu.link.viewUser",
- "sling:message": "View User"
- },
- "menu.link.viewGroup": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "menu.link.viewGroup",
- "sling:message": "View Group"
- },
-
- "page.title.find.authorizables": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "page.title.find.authorizables",
- "sling:message": "Find Authorizables"
- },
-
-
- "page.title.find.users": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "page.title.find.users",
- "sling:message": "Find Users"
- },
-
- "page.title.create.user": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "page.title.create.user",
- "sling:message": "Create User"
- },
- "prop.label.userid": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "prop.label.userid",
- "sling:message": "User ID"
- },
- "prop.label.email": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "prop.label.email",
- "sling:message": "E-Mail"
- },
- "prop.label.pwd": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "prop.label.pwd",
- "sling:message": "Password"
- },
- "prop.label.pwdConfirm": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "prop.label.pwdConfirm",
- "sling:message": "Confirm Password"
- },
-
- "declaredMembers.empty": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "declaredMembers.empty",
- "sling:message": "No Members"
- },
- "memberOf.empty": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "memberOf.empty",
- "sling:message": "No Groups"
- },
-
-
-
- "paging.current.page": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "paging.current.page",
- "sling:message": "{0} to {1}"
- },
- "label.paging.first.page": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "label.paging.first.page",
- "sling:message": "|<"
- },
- "label.paging.prev.page": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "label.paging.prev.page",
- "sling:message": "<<"
- },
- "label.paging.next.page": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "label.paging.next.page",
- "sling:message": ">>"
- },
- "tooltip.paging.first.page": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "tooltip.paging.first.page",
- "sling:message": "First Page"
- },
- "tooltip.paging.prev.page": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "tooltip.paging.prev.page",
- "sling:message": "Previous Page"
- },
- "tooltip.paging.next.page": {
- "jcr:primaryType": "sling:MessageEntry",
- "sling:key": "tooltip.paging.next.page",
- "sling:message": "Next Page"
- }
-
- }
-}
diff --git a/usermanager-ui/src/main/resources/css/usermanager/usermanager.css b/usermanager-ui/src/main/resources/css/usermanager/usermanager.css
deleted file mode 100644
index 8f7cf9e..0000000
--- a/usermanager-ui/src/main/resources/css/usermanager/usermanager.css
+++ /dev/null
@@ -1,465 +0,0 @@
-/*!
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-body {
- background-color: #ffffff;
- color: #3b3b3b;
- font-family: Tahoma, Arial, sans-serif;
- font-size: 10pt;
- line-height: 140%;
- margin: 0;
- padding: 0;
-}
-
-a {
- color: #1980af;
- text-decoration: none;
-}
-
-a:visited {
- color: #1980af;
-}
-
-a:hover {
- color: #1faae9;
- text-decoration: underline;
-}
-
-img, a img
-{
- border: none;
-}
-
-.title {
- position: absolute;
- left: 1px;
- right: 1px;
- top: 25px;
- height: 81px;
- background: url(../../images/gradient.png)
- repeat-x;
- background-position: bottom;
-}
-
-.logo {
- position: absolute;
- width: 15em;
- height: 81px;
- text-align: center;
-}
-
-.header {
- text-align: right;
- margin-right: 20pt;
-}
-
-.menu {
- border-top: 10px solid #f9bb00;
- position: absolute;
- top: 107px;
- left: 1px;
- width: 15em;
- bottom: 0px;
- padding: 0px;
- background-color: #fcfcfc
-}
-
-.menu ul {
- background-color: #fdf5d9;
- list-style: none;
- padding-left: 0px;
- margin-top: 0px;
- padding-top: 2em;
- padding-bottom: 2em;
- margin-left: 0px;
- color: #4a4a43
-}
-
-.menu ul li {
- padding-left: 4em;
- padding-top: 2px;
- padding-bottom: 2px;
-}
-
-.menu ul li.ui-state-highlight {
- font-weight: bold;
-}
-
-.menu a {
- color: #4a4a43
-}
-
-.main {
- position: absolute;
- border-top: 10px solid #cde0ea;
- top: 107px;
- left: 15em;
- right: 1px;
- margin-left: 2px;
- padding: 10px 10px;
-}
-
-
-/* ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: */
-/* --- Login/Logout Links ---*/
-/* ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: */
-
-#menu_login
-{
- display: inline;
- margin: 10px 20px;
- font-size: 11px;
- padding: 5px 7px;
- position: absolute;
- right: 0;
- top: 0;
- z-index: 10;
-}
-
-/* ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: */
-/* --- User Manager Pages ---*/
-/* ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: */
-
-.usermgmt-body
-{
- padding: 5px;
-}
-
-.usermgmt-header
-{
- font-size: 14px;
- padding: 5px 10px;
- margin: 0 0 10px 0;
-}
-
-.info-msg-block
-{
- margin-left: 10px;
- margin-right: 10px;
- margin-bottom: 10px;
-}
-.info-msg-block p
-{
- margin: 5px;
-}
-.info-msg-block span.ui-icon
-{
- float: left;
-}
-.info-msg-text
-{
- margin-left: 5px;
-}
-
-/* ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: */
-/* --- User/Group Search Pages ---*/
-/* ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: */
-
-#find-authorizables-form fieldset
-{
- border: none;
- margin: 0;
- padding: 0;
- line-height: 20px;
-}
-
-.search-empty-msg {
- line-height: 100px;
- font-size: large;
- font-weight: bold;
- text-align: center;
-}
-
-#find-authorizables-quick-nav
-{
- padding: 2px 4px;
-}
-
-#authorizables-results-body,
-#authorizables-results-progress
-{
- margin-top: 5px;
-}
-
-#find-authorizables-quick-nav label
-{
- width: auto;
- padding: 3px 5px;
-}
-
-#find-authorizables-quick-nav .ui-button-text-only .ui-button-text
-{
- line-height: 1;
- padding: 1px 1px;
- font-size: 10pt;
-}
-#find-authorizables-block .ui-button-text-only .ui-button-text
-{
- line-height: 1;
- padding: 5px 5px;
- font-size: 10pt;
-}
-
-#search-result-paging .ui-button-text-only .ui-button-text
-{
- line-height: 1;
- font-size: 10pt;
-}
-#search-result-paging span#current_page {
- margin-left: 6px;
- margin-right: 6px;
-}
-
-#find-authorizables-block
-{
- float: right;
- line-height: 33px;
- padding-right: 10px;
-}
-
-#find-authorizables-block input
-{
- padding: 0 4px;
- font-size: 10pt;
-}
-
-#search-result td,
-#search-result th
-{
- padding: 5px;
-}
-
-#search-result tr.odd
-{
- background-color: #eee;
-}
-
-#find-authorizables-header
-{
- margin-bottom: 5px;
-}
-
-#find-authorizables-header h3
-{
- font-size: 14px;
- font-weight: bold;
- display: inline;
- line-height: 33px;
- border-style: none;
-}
-
-
-/* ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: */
-/* --- Create User/Group Pages ---*/
-/* ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: */
-
-#create-user-form,
-#create-group-form
-{
- margin: 0px;
- padding: 0px;
-}
-
-#create-user-form fieldset,
-#create-group-form fieldset
-{
- border: none;
- margin: 0;
- padding: 0;
- line-height: 20px;
-}
-
-#create-user-form label,
-#create-group-form label
-{
- float: left;
- display: inline;
- width: 20%;
- text-align: right;
-}
-
-#create-user-form input,
-#create-group-form input
-{
- margin-left: 10px;
- width: 70%;
-}
-
-#create-user-form button,
-#create-group-form button
-{
- margin-left: 10px;
-}
-
-/* ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: */
-/* --- Update User/Group Pages ---*/
-/* ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: */
-
-#update-user-form,
-#update-password-form,
-#update-group-form
-{
- margin: 0px;
- padding: 0px;
-}
-
-#update-user-form fieldset,
-#update-password-form fieldset,
-#update-group-form fieldset,
-#remove-user-form fieldset,
-#remove-group-form fieldset,
-#add-property-form fieldset,
-#add-group-member-form fieldset
-{
- border: none;
- margin: 0;
- padding: 0;
- line-height: 20px;
-}
-
-#update-user-form label,
-#update-password-form label,
-#update-group-form label,
-#add-property-form label,
-#add-group-member-form label
-{
- float: left;
- display: inline;
- width: 20%;
- text-align: right;
-}
-
-#update-user-form input,
-#update-password-form input,
-#update-group-form input,
-#add-property-form input,
-#add-group-member-form input
-{
- margin-left: 10px;
- width: 70%;
-}
-
-#update-user-form button,
-#update-password-form button,
-#update-group-form button
-{
- margin-left: 10px;
-}
-
-#update-user-form ol,
-#update-group-form ol
-{
- float: left;
- display: inline;
- width: 65%;
- margin: 0 5px 0 10px;
- padding-left: 0;
- list-style-position: inside;
- list-style-type: none;
-}
-
-#update-password-body
-{
- margin-top: 10px;
-}
-
-#update-password-form label
-{
- width: 20%;
- text-align: right;
-}
-
-#update-password-form input
-{
- margin-left: 10px;
- width: 70%;
-}
-
-#update-password-form button
-{
- margin-left: 10px;
-}
-
-#loginStatusInput label,
-#loginStatusInput input
-{
- width: auto;
- float: none;
-}
-
-#loginStatusInput
-{
- width: 75%;
-}
-
-#disabledReasonPanel label
-{
- width: auto;
- margin-left: 15px;
- float: none;
-}
-
-#disabledReasonPanel input
-{
- width: 42%;
-}
-
-.prop-line
-{
- margin-bottom: 5px;
- line-height: 26px;
-}
-
-.prop-line .remove-property,
-.prop-line .remove-member
-{
- position: absolute;
- margin: 5px 5px;
-}
-
-/* ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: */
-/* --- Widget style tweaks ---*/
-/* ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: */
-
-.ui-autocomplete-loading
-{
- background: white url('../../images/ui-anim_basic_16x16.gif') right center no-repeat;
-}
-
-.noscript-hide
-{
- display:none;
-}
-
-
-/* ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: */
-/* --- Validation error styles ---*/
-/* ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: */
-input.error, textarea.error
-{
- border: 1px dotted red;
-}
-
-label.error, label.error
-{
- color: red;
- font-style: italic;
- font-weight: bold;
- margin-left: 20%;
- padding-left: 10px;
- text-align: left !important;
- width: auto !important;
-}
\ No newline at end of file
diff --git a/usermanager-ui/src/main/resources/css/usermanager/usermanager.min.css b/usermanager-ui/src/main/resources/css/usermanager/usermanager.min.css
deleted file mode 100644
index ee4cc76..0000000
--- a/usermanager-ui/src/main/resources/css/usermanager/usermanager.min.css
+++ /dev/null
@@ -1,76 +0,0 @@
-/*!
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */body{background-color:#fff;color:#3b3b3b;font-family:Tahoma,Arial,sans-serif;font-size:10pt;line-height:140%;margin:0;padding:0}
-a{color:#1980af;text-decoration:none}
-a:visited{color:#1980af}
-a:hover{color:#1faae9;text-decoration:underline}
-img,a img{border:0}
-.title{position:absolute;left:1px;right:1px;top:25px;height:81px;background:url(../../images/gradient.png) repeat-x;background-position:bottom}
-.logo{position:absolute;width:15em;height:81px;text-align:center}
-.header{text-align:right;margin-right:20pt}
-.menu{border-top:10px solid #f9bb00;position:absolute;top:107px;left:1px;width:15em;bottom:0;padding:0;background-color:#fcfcfc}
-.menu ul{background-color:#fdf5d9;list-style:none;padding-left:0;margin-top:0;padding-top:2em;padding-bottom:2em;margin-left:0;color:#4a4a43}
-.menu ul li{padding-left:4em;padding-top:2px;padding-bottom:2px}
-.menu ul li.ui-state-highlight{font-weight:bold}
-.menu a{color:#4a4a43}
-.main{position:absolute;border-top:10px solid #cde0ea;top:107px;left:15em;right:1px;margin-left:2px;padding:10px 10px}
-#menu_login{display:inline;margin:10px 20px;font-size:11px;padding:5px 7px;position:absolute;right:0;top:0;z-index:10}
-.usermgmt-body{padding:5px}
-.usermgmt-header{font-size:14px;padding:5px 10px;margin:0 0 10px 0}
-.info-msg-block{margin-left:10px;margin-right:10px;margin-bottom:10px}
-.info-msg-block p{margin:5px}
-.info-msg-block span.ui-icon{float:left}
-.info-msg-text{margin-left:5px}
-#find-authorizables-form fieldset{border:0;margin:0;padding:0;line-height:20px}
-.search-empty-msg{line-height:100px;font-size:large;font-weight:bold;text-align:center}
-#find-authorizables-quick-nav{padding:2px 4px}
-#authorizables-results-body,#authorizables-results-progress{margin-top:5px}
-#find-authorizables-quick-nav label{width:auto;padding:3px 5px}
-#find-authorizables-quick-nav .ui-button-text-only .ui-button-text{line-height:1;padding:1px 1px;font-size:10pt}
-#find-authorizables-block .ui-button-text-only .ui-button-text{line-height:1;padding:5px 5px;font-size:10pt}
-#search-result-paging .ui-button-text-only .ui-button-text{line-height:1;font-size:10pt}
-#search-result-paging span#current_page{margin-left:6px;margin-right:6px}
-#find-authorizables-block{float:right;line-height:33px;padding-right:10px}
-#find-authorizables-block input{padding:0 4px;font-size:10pt}
-#search-result td,#search-result th{padding:5px}
-#search-result tr.odd{background-color:#eee}
-#find-authorizables-header{margin-bottom:5px}
-#find-authorizables-header h3{font-size:14px;font-weight:bold;display:inline;line-height:33px;border-style:none}
-#create-user-form,#create-group-form{margin:0;padding:0}
-#create-user-form fieldset,#create-group-form fieldset{border:0;margin:0;padding:0;line-height:20px}
-#create-user-form label,#create-group-form label{float:left;display:inline;width:20%;text-align:right}
-#create-user-form input,#create-group-form input{margin-left:10px;width:70%}
-#create-user-form button,#create-group-form button{margin-left:10px}
-#update-user-form,#update-password-form,#update-group-form{margin:0;padding:0}
-#update-user-form fieldset,#update-password-form fieldset,#update-group-form fieldset,#remove-user-form fieldset,#remove-group-form fieldset,#add-property-form fieldset,#add-group-member-form fieldset{border:0;margin:0;padding:0;line-height:20px}
-#update-user-form label,#update-password-form label,#update-group-form label,#add-property-form label,#add-group-member-form label{float:left;display:inline;width:20%;text-align:right}
-#update-user-form input,#update-password-form input,#update-group-form input,#add-property-form input,#add-group-member-form input{margin-left:10px;width:70%}
-#update-user-form button,#update-password-form button,#update-group-form button{margin-left:10px}
-#update-user-form ol,#update-group-form ol{float:left;display:inline;width:65%;margin:0 5px 0 10px;padding-left:0;list-style-position:inside;list-style-type:none}
-#update-password-body{margin-top:10px}
-#update-password-form label{width:20%;text-align:right}
-#update-password-form input{margin-left:10px;width:70%}
-#update-password-form button{margin-left:10px}
-#loginStatusInput label,#loginStatusInput input{width:auto;float:none}
-#loginStatusInput{width:75%}
-#disabledReasonPanel label{width:auto;margin-left:15px;float:none}
-#disabledReasonPanel input{width:42%}
-.prop-line{margin-bottom:5px;line-height:26px}
-.prop-line .remove-property,.prop-line .remove-member{position:absolute;margin:5px 5px}
-.ui-autocomplete-loading{background:white url('../../images/ui-anim_basic_16x16.gif') right center no-repeat}
-.noscript-hide{display:none}
-input.error,textarea.error{border:1px dotted red}
-label.error,label.error{color:red;font-style:italic;font-weight:bold;margin-left:20%;padding-left:10px;text-align:left!important;width:auto!important}
\ No newline at end of file
diff --git a/usermanager-ui/src/main/resources/images/gradient.png b/usermanager-ui/src/main/resources/images/gradient.png
deleted file mode 100644
index 6ddc10b..0000000
--- a/usermanager-ui/src/main/resources/images/gradient.png
+++ /dev/null
Binary files differ
diff --git a/usermanager-ui/src/main/resources/images/sling-logo.png b/usermanager-ui/src/main/resources/images/sling-logo.png
deleted file mode 100644
index 0de4b3a..0000000
--- a/usermanager-ui/src/main/resources/images/sling-logo.png
+++ /dev/null
Binary files differ
diff --git a/usermanager-ui/src/main/resources/images/ui-anim_basic_16x16.gif b/usermanager-ui/src/main/resources/images/ui-anim_basic_16x16.gif
deleted file mode 100644
index 084ecb8..0000000
--- a/usermanager-ui/src/main/resources/images/ui-anim_basic_16x16.gif
+++ /dev/null
Binary files differ
diff --git a/usermanager-ui/src/main/resources/js/usermanager/usermanager.js b/usermanager-ui/src/main/resources/js/usermanager/usermanager.js
deleted file mode 100644
index 3107c73..0000000
--- a/usermanager-ui/src/main/resources/js/usermanager/usermanager.js
+++ /dev/null
@@ -1,1180 +0,0 @@
-/*!
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * Holds some common functions used by other user management objects
- */
-UserManager = {
- /**
- * Holds the servlet context path of the web application
- */
- contextPath: "",
-
- /**
- * Format a string by replacing tokens with the passed in arguments.
- *
- * @param {String} msg The message pattern. Use {n} for replacable arguments where n is the arg index.
- * @param {Array} args array of arguments to apply to the message pattern
- */
- formatMsg: function(msg, args) {
- var regex = /{(\d+)}/g;
- return msg.replace(regex, function() {
- var index = parseInt(arguments[1]);
- return args[index];
- });
- },
-
- /**
- * Resource strings for usermgmt that can be localized for other languages
- */
- messages: {
- "error.dlg.title": "Error",
- "confirm.yes": "Yes",
- "confirm.no": "No",
- "button.add": "Add",
-
- "searching.progress.msg": "Searching, please wait...",
-
- "tooltip.removeProperty": "Remove Property",
- "tooltip.removeMember": "Remove Member",
-
- "group.updated.msg": "Updated the group",
- "user.updated.msg": "Updated the user",
- "user.pwd.updated.msg": "Updated the password",
-
- "group.created.msg": "Created the group",
- "user.created.msg": "Created the user"
- }
-}
-
-/**
- * For the navigation links in the left side of the page.
- */
-UserManager.SideBar = {
- /**
- * Initialize SideBar elements
- */
- init: function() {
- var i, navLinks, url, hash, nav;
-
- // highlight the link for the current page
- navLinks = $("ul#sidebar-nav li a");
- url = location.href;
- hash = location.hash;
- if (hash != null && hash.length > 0) {
- url = url.substring(0, url.length - hash.length);
- }
- for (i=0; i < navLinks.length; i++) {
- nav = navLinks[i];
- if (url == nav.href) {
- $(nav.parentNode).addClass("ui-corner-all ui-state-highlight");
- }
- }
- }
-}
-
-/**
- * For showing an error dialog when something goes wrong.
- */
-UserManager.ErrorDlg = {
- /**
- * Show a modal dialog with the supplied content.
- * @param {String} title The title text of the dialog
- * @param {String} msg The html markup of the dialog body
- */
- showError: function(title, msg) {
- // add an error_dialog div to the page if it doesn't already exist
- if ($('#error_dialog').length == 0) {
- $('body').append('<div id="error_dialog" style="display:none;"></div>');
- }
- //fill in the dialog body
- $('#error_dialog').html( msg );
- $('#error_dialog').dialog({
- title: title,
- bgiframe: true,
- autoOpen: false,
- width: 400,
- maxHeight: 500,
- modal: true
- });
- //show the modal dialog
- $('#error_dialog').dialog('open');
- },
-
- /**
- * Handles an error from an AJAX call by showing the error information
- * in a modal dialog.
- */
- errorHandler: function( xmlHttpRequest, textStatus, errorThrown ) {
- var title, obj;
- try {
- title = UserManager.messages["error.dlg.title"];
- //see if the response is a JSON resoponse with an error field
- obj = $.parseJSON(xmlHttpRequest.responseText);
- if (obj.error) {
- //found error field, so show the error message
- UserManager.ErrorDlg.showError(title, obj.error.message);
- } else {
- //no error field, so show the whole response text
- UserManager.ErrorDlg.showError(title, xmlHttpRequest.responseText);
- }
- } catch (e) {
- //Not JSON? Show the whole response text.
- UserManager.ErrorDlg.showError(title, xmlHttpRequest.responseText);
- }
- }
-};
-
-/**
- * For pages the that search for Users or Groups.
- */
-UserManager.Authorizables = {
- /**
- * Holds the id of the searching progress function (if any).
- */
- progressFnId: null,
-
- /**
- * Initializes the elements for the User/Group search page
- */
- init: function() {
- //apply styles to the quick-nav radio buttons
- $('#find-authorizables-quick-nav').buttonset().show();
-
- //apply styles and handlers to the search result table
- UserManager.Authorizables.applyResultStylesAndHandlers();
-
- /**
- * Attach event handlers to the quick-hav radio buttons
- */
- $('#find-authorizables-quick-nav input[type = "radio"]').change( function (e) {
- //reset the paging to the first page
- $('#searchOffset').val(0);
-
- //clear value from the search input
- $("#findAuthorizablesQuery").val("");
-
- //do the search
- UserManager.Authorizables.runSearchFn();
- return false;
- });
-
- //apply jquery-ui styles to the search button
- $('button#findAuthorizablesBtn').button();
-
- //attach event handler to the search button
- $('button#findAuthorizablesBtn').click( function(e) {
- if ($('#findAuthorizablesQuery').val() == '') {
- //empty query == 'All'
- $('#radioAll').attr('checked', true);
- $('#radioAll').button('refresh');
- } else {
- //uncheck all the quick-nav radio buttons
- $('#radioNone').attr('checked', true);
- $('#radioNone').button('refresh');
- }
-
- //do the search
- UserManager.Authorizables.runSearchFn(0);
- return false;
- });
-
- /**
- * Listen for changes to the location hash. This is to
- * make the browser history work (back button).
- */
- $(window).bind('hashchange', UserManager.Authorizables.runSearchFromHashFn);
-
- //trigger the search now in case we got here from the back button
- $(window).trigger("hashchange");
- },
-
- /**
- * Displays a 'Loading...' progress animation if the search is taking
- * a while to return.
- */
- progressFn: function() {
- //inject a progress block
- $('#authorizables-results-body')
- .after('<div id="authorizables-results-progress" class="search-empty-msg ui-corner-all ui-state-highlight">' + UserManager.messages["searching.progress.msg"] + '</div>');
-
- //done with this.
- UserManager.Authorizables.progressFnId = null;
- },
-
- /**
- * Removes the progress animation if it is present.
- */
- clearProgressFn: function() {
- if (UserManager.Authorizables.progressFnId != null) {
- //stop the progress animation if it hasn't started yet.
- clearTimeout(UserManager.Authorizables.progressFnId);
- UserManager.Authorizables.progressFnId = null;
- }
- //remove the old progress element from the page (if there)
- $('#authorizables-results-progress').remove();
- },
-
- /**
- * Executes the search, showing results starting at the
- * specified offset
- * @param {Number} offset the index of the first row to render
- */
- runSearchFn: function(offset) {
- var form, formData;
-
- //update the offset field in the form
- $('#searchOffset').val(offset == undefined ? "0" : offset);
-
- form = $("#find-authorizables-form");
- //serialize the form data to set as the location hash
- formData = form.serialize();
-
- //changing the location hash triggers the ajax search call
- // using the location hash here to make the browser back button work.
- window.location.hash = formData;
- },
-
- /**
- * Parse the location hash and extract the name/value pairs
- */
- parseHashParams: function() {
- var hashParams = {},
- e,
- a = /\+/g, // Regex for replacing addition symbol with a space
- r = /([^&;=]+)=?([^&;]*)/g,
- d = function (s) { return decodeURIComponent(s.replace(a, " ")); },
- q = window.location.hash.substring(1);
-
- while (e = r.exec(q))
- hashParams[d(e[1])] = d(e[2]);
-
- return hashParams;
- },
-
- /**
- * Executes the search when a change to the location hash has
- * been detected.
- */
- runSearchFromHashFn: function() {
- var form, action, hashParams;
-
- form = $("#find-authorizables-form");
- action = form.attr('action');
- //change the target sling selector to the searchresult fragment
- action = action.substring(0, action.length - 4) + "searchresult.html";
-
- //get the map of parameters in the hash string
- hashParams = UserManager.Authorizables.parseHashParams()
-
- //fill the query text into the search input
- $("#findAuthorizablesQuery").val(hashParams.q == undefined ? "" : hashParams.q);
- //select the correct quick-nav radio button
- $('#find-authorizables-quick-nav input[value="' + (hashParams.sp == undefined ? "" : hashParams.sp) + '"]')
- .attr("checked", true)
- .button('refresh');
-
- //fill in the offset value
- $('#searchOffset').val(hashParams.o == undefined ? "0" : hashParams.o);
-
- if (hashParams.q == undefined && hashParams.sp == undefined) {
- //the hashCode doesn't have a query, so don't to a search
- if ($("#search-result-ready-to-search").length == 0) {
- // not on the ready-to-search page so we need to refresh the
- // result panel to get the right UI.
- $.ajax({
- url: action,
- type: 'get',
- success: UserManager.Authorizables.searchDoneFn,
- error: UserManager.ErrorDlg.errorHandler
- });
- }
- return;
- }
-
- //the hashCode has a query, so proceed..
-
- //hide the old results table
- $('#authorizables-results-body').hide();
-
- //show a progress animation if the search takes longer than 200ms to return
- UserManager.Authorizables.clearProgressFn();
- UserManager.Authorizables.progressFnId = setTimeout(UserManager.Authorizables.progressFn, 200);
-
- //do the search request.
- $.ajax({
- url: action,
- type: 'get',
- data: form.serialize(),
- cache: false,
- success: UserManager.Authorizables.searchDoneFn,
- error: function(xmlHttpRequest, textStatus, errorThrown) {
- //clear the progress animation if it is there.
- UserManager.Authorizables.clearProgressFn();
-
- //delegate the rest to the generic error handler
- UserManager.ErrorDlg.errorHandler(xmlHttpRequest, textStatus, errorThrown);
- }
- });
- },
-
- /**
- * Callback function for a successful search request
- */
- searchDoneFn: function( data, textStatus, xmlHttpRequest ) {
- //clear the progress animation if it is there.
- UserManager.Authorizables.clearProgressFn();
-
- //inject the results table into the page
- $('#authorizables-results-body').replaceWith(data);
-
- //apply extra styles and event handlers to the results table
- UserManager.Authorizables.applyResultStylesAndHandlers();
- },
-
- /**
- * Apply styles and event handlers to the result table rows
- */
- applyResultStylesAndHandlers: function( data, textStatus, xmlHttpRequest ) {
- //highlight the table row onHover
- $("#search-result-body tr")
- .mouseover(function(){
- $(this).addClass("ui-state-highlight");
- })
- .mouseout(function(){
- $(this).removeClass("ui-state-highlight");
- })
- .click(function(){
- var href = $(this).find("td a")[0].href;
- window.location = href;
- return false;
- });
-
- //attach event handlers to the paging buttons
- $("#first_page").button()
- .click(function() {
- UserManager.Authorizables.runSearchFn(0);
- return false;
- });
- $("#prev_page").button()
- .click(function() {
- UserManager.Authorizables.runSearchFn($("#prev_page").val());
- return false;
- });
- $("#next_page").button()
- .click(function() {
- UserManager.Authorizables.runSearchFn($("#next_page").val());
- return false;
- });
- }
-};
-
-
-/**
- * Holds some common functions for Group related pages
- */
-UserManager.Group = {
-
-};
-
-/**
- * For the Group create page.
- */
-UserManager.Group.Create = {
- /**
- * Initializes the elements for the create Group page
- */
- init: function() {
- //apply jquery-ui styles to create button
- $('button#createGroupBtn').button();
-
- // validate form
- /*var validator = */$("#create-group-form").validate({
- rules: {
- ":name": "required"
- }/*,
- messages: {
- }*/
- });
-
- //apply event handler to the create button
- $('button#createGroupBtn').click( function(e) {
- var form, actionUrl, formData;
-
- form = $("#create-group-form");
-
- //client side validation
- if (!form.valid()) {
- return false;
- }
-
- actionUrl = form.attr('action');
-
- //switch to a json response
- actionUrl = actionUrl.substring(0, actionUrl.length - 4) + "json";
-
- //turn off redirect in this context
- $('#redirect').attr('disabled', true);
- formData = form.serialize();
- $('#redirect').removeAttr('disabled');
-
- //hide the info msg from a previous action
- $("#create-group-body div.info-msg-block").hide();
-
- //submit the create request
- $.ajax({
- url: actionUrl,
- type: 'POST',
- data: formData,
- success: function( data, textStatus, xmlHttpRequest ) {
- //clear the inputs
- $("#create-group-form input[type='text']").val('');
-
- //inject a success message
- $("#create-group-body span.info-msg-text").html(UserManager.messages["group.created.msg"]);
- $("#create-group-body div.info-msg-block").show();
- },
- error: UserManager.ErrorDlg.errorHandler
- });
-
- return false;
- });
- }
-};
-
-/**
- * For the Group update page.
- */
-UserManager.Group.Update = {
- /**
- * Initializes the elements for the create Group page
- */
- init: function() {
- //apply jquery-ui styles to the update button
- $('button#updateGroupBtn').button();
-
- // validate form
- /*var validator = */$("#update-group-form").validate({
- rules: {
- }/*,
- messages: {
- }*/
- });
-
- //hover states on the remove member icons
- $('.remove-member').hover(
- function() { $(this).addClass('ui-state-hover'); },
- function() { $(this).removeClass('ui-state-hover'); }
- ).click(
- function(e) {
- //mark the member for deletion when the update is saved
- var memberItem = $(e.currentTarget.parentNode);
- memberItem.hide('slow', function() {
- if ($('ol#declaredMembers li:visible').length == 0) {
- $("#declaredMembers__empty").show();
- }
- });
- memberItem.find('input').attr("name", ":member@Delete");
-
- return false;
- }
- );
-
- //hover states on the remove property icons
- $('.remove-property').hover(
- function() { $(this).addClass('ui-state-hover'); },
- function() { $(this).removeClass('ui-state-hover'); }
- ).click(
- function(e) {
- var memberItem, input, key;
-
- //mark the property for deletion when the update is saved
- memberItem = $(e.currentTarget.parentNode);
- memberItem.hide('slow');
- input = memberItem.find('input');
- key = input.attr("name");
- input.attr("name", key + "@Delete");
- return false;
- }
- );
-
- //attach event handler to the update button
- $('button#updateGroupBtn').click( function(e) {
- var form, actionUrl, formData;
-
- form = $("#update-group-form");
-
- //client side validation
- if (!form.valid()) {
- return false;
- }
-
- actionUrl = form.attr('action');
-
- //switch to a json response
- actionUrl = actionUrl.substring(0, actionUrl.length - 4) + "json";
-
- //turn off redirect in this context
- $('#redirect').attr('disabled', true);
- formData = form.serialize();
- $('#redirect').removeAttr('disabled');
-
- //hide the info msg from a previous action
- $("#update-group-body div.info-msg-block").hide();
-
- //submit the update request
- $.ajax({
- url: actionUrl,
- type: 'POST',
- data: formData,
- success: function( data, textStatus, xmlHttpRequest ) {
- $("#update-group-body").parent().load(UserManager.contextPath + data.path + ".update_body.html", function() {
- $("#update-group-body span.info-msg-text").html(UserManager.messages["group.updated.msg"]);
- $("#update-group-body div.info-msg-block").show();
- });
-
- setTimeout(function() {
- //re-init since we just replaced the body
- UserManager.Group.Update.init();
-
- //make visible any elements that require scripting to be enabled
- $(".noscript-hide").removeClass("noscript-hide");
- }, 100);
- },
- error: UserManager.ErrorDlg.errorHandler
- });
- return false;
- });
-
-
- //attach a confirmation dialog to the 'Remove' link
- $('a#removeGroupLink').click( function(e) {
- //initialize the confirmation dialog
- $("#remove-group-dialog").dialog({
- autoOpen: false,
- height: 'auto',
- width: 350,
- modal: true,
- resizable: false,
- buttons: [
- {
- text: UserManager.messages["confirm.yes"],
- click: function() {
- $("#remove-group-form").submit();
- }
- },
- {
- text: UserManager.messages["confirm.no"],
- click: function() {
- $("#remove-group-dialog").dialog("close");
- }
- }
- ]
- });
-
- //show the dialog
- $('#remove-group-dialog').dialog('open');
- return false;
- });
-
- //attach a prompt dialog to the 'Add Property' link
- $('a#add_property').click( function(e) {
- //initialize the dialog
- $("#add-property-dialog").dialog({
- autoOpen: false,
- height: 'auto',
- width: 350,
- modal: true,
- resizable: false,
- buttons: [
- {
- text: UserManager.messages["button.add"],
- click: function() {
- var form, name, label, newItem;
-
- form = $("#add-property-form");
- //client side validation
- if (!form.valid()) {
- return false;
- }
-
- //get new property name
- name=$("#newPropName").val();
- label = name;
-
- //inject property line for the new property
- $("#updateSubmitBtns").before('<div class="prop-line ui-helper-clearfix"><label for="' + name + '">' + label + ':</label> <input id="' + name + '" type="text" name="' + name + '" /> <a href="#" class="remove-property" title="' + UserManager.messages["tooltip.removeProperty"] + '"><span class="ui-icon ui-icon-circle-close"></span></a></div>');
-
- newItem = $("#updateSubmitBtns").prev();
-
- //add hover states on the remove property icons
- newItem.find('a.remove-property').hover(
- function() { $(this).addClass('ui-state-hover'); },
- function() { $(this).removeClass('ui-state-hover'); }
- ).click(
- function(e) {
- var propItem = $(e.currentTarget.parentNode);
- //haven't saved yet on server, so just remove this element from the page.
- propItem.hide('slow', function() {
- propItem.remove();
- });
- return false;
- }
- );
-
- //close the dialog
- $("#add-property-dialog").dialog( "close" );
-
- //give focus to the new property line
- newItem.find('input').focus();
- }
- }
- ]
- });
-
- //clear old value from the dialog (if there)
- $("#newPropName").val('');
-
- //open the dialog
- $('#add-property-dialog').dialog('open');
- return false;
- });
-
- //forward the form submit event to the button handler to handle 'Enter' key in the
- // prompt field
- $("#add-property-form").submit(function (e) {
- var buttons = $("#add-property-dialog").dialog( "option", "buttons" );
- buttons[0].click();
- return false;
- })
- .validate({
- rules: {
- "name": "required"
- }/*,
- messages: {
- }*/
- });
-
- //attach a member selection dialog
- $('a#add_member').click( function(e) {
- //initialize the dialog
- $("#add-member-dialog").dialog({
- autoOpen: false,
- height: 'auto',
- width: 350,
- modal: true,
- resizable: false,
- buttons: [
- {
- text: UserManager.messages["button.add"],
- click: function() {
- var form, name, label, itemHtml, newItem, item;
-
- form = $("#add-group-member-form");
- //client side validation
- if (!form.valid()) {
- return false;
- }
-
- //get the selected member info
- name = $("#memberName").val();
- label = name;
- item = $("#memberName").data("item");
- if (item) {
- if (item.label && item.value == name) {
- label = item.label;
- }
- }
-
- //inject a new member item into the page
- itemHtml = '<li><input type="hidden" name=":member" value="' + name + '" /><span>' + label + '</span> <a href="#" class="remove-member" title="' + UserManager.messages['tooltip.removeMember'] + '"><span class="ui-icon ui-icon-circle-close"></span></a></li>';
- //not empty, so remove the empty message if it is there
- $("#declaredMembers__empty").hide();
- $("#declaredMembers").append(itemHtml);
-
- newItem = $("#declaredMembers").find('li').last();
-
- //add hover states on the remove member icons
- newItem.find('a.remove-member').hover(
- function() { $(this).addClass('ui-state-hover'); },
- function() { $(this).removeClass('ui-state-hover'); }
- ).click(
- function(e) {
- var memberItem = $(e.currentTarget.parentNode);
- memberItem.hide('slow', function() {
- //haven't submittted to the server yet, so just remove the item from the page
- memberItem.remove();
- if ($('ol#declaredMembers li:visible').length == 0) {
- //after removing the member, the list is empty, so
- // show the empty message.
- $("#declaredMembers__empty").show();
- }
- });
- return false;
- }
- );
-
- //close the dialog
- $("#add-member-dialog").dialog( "close" );
- return false;
- }
- }
- ]
- });
-
- //clear old member value
- $("#memberName").val('');
-
- //open the dialog
- $('#add-member-dialog').dialog('open');
- return false;
- });
-
- //forward the form submit event to the button handler to handle 'Enter' key in the
- // prompt field
- $("#add-group-member-form").submit(function (e) {
- var buttons = $("#add-member-dialog").dialog( "option", "buttons" );
- buttons[0].click();
- return false;
- })
- .validate({
- rules: {
- ":member": "required"
- }/*,
- messages: {
- }*/
- });
-
- //attach an autocomplete handler to the member name field in
- // the add member dialog
- if ($("#memberName").length > 0) {
- $( "#memberName" ).autocomplete({
- source: UserManager.contextPath + "/system/userManager.autocomplete.json",
- minLength: 1,
- select: function(event, ui) {
- var item = ui.item;
- $("#memberName")
- .val(item.value)
- .data("item", item);
- }
- })
- .data( "autocomplete" )._renderItem = function( ul, item ) {
- return $( "<li></li>" )
- .data( "item.autocomplete", item )
- .append( "<a>" + (item.label ? (item.label + " (" + item.value + ")") : item.value) + "</a>" )
- .appendTo( ul );
- };
- }
- }
-};
-
-
-/**
- * Holds some common functions for User related pages
- */
-UserManager.User = {
-
-};
-
-/**
- * For the User create page.
- */
-UserManager.User.Create = {
- /**
- * Initializes the elements for the create User page
- */
- init: function() {
- //apply jquery-ui styles to the create button
- $('button#createUserBtn').button();
-
- // validate form
- /*var validator = */$("#create-user-form").validate({
- rules: {
- ":name": "required",
- "pwd": "required",
- "pwdConfirm": {
- equalTo: "#pwd"
- }
- }/*,
- messages: {
- }*/
- });
-
- //attach event handler to the create button
- $('button#createUserBtn').click( function(e) {
- var form, actionUrl, formData;
-
- form = $("#create-user-form");
-
- //client side validation
- if (!form.valid()) {
- return false;
- }
-
- actionUrl = form.attr('action');
-
- //switch to a json response
- actionUrl = actionUrl.substring(0, actionUrl.length - 4) + "json";
-
- //turn off redirect in this context
- $('#redirect').attr('disabled', true);
- formData = form.serialize();
- $('#redirect').removeAttr('disabled');
-
- //hide the info msg from a previous action
- $("#create-user-body div.info-msg-block").hide();
-
- //submit the create request
- $.ajax({
- url: actionUrl,
- type: 'POST',
- data: formData,
- success: function( data, textStatus, xmlHttpRequest ) {
- //clear the inputs
- $("#create-user-form input[type='text']").val('');
- $("#create-user-form input[type='password']").val('');
-
- //inject a success message
- $("#create-user-body span.info-msg-text").html(UserManager.messages["user.created.msg"]);
- $("#create-user-body div.info-msg-block").show();
- },
- error: UserManager.ErrorDlg.errorHandler
- });
- return false;
- });
- }
-};
-
-/**
- * For the User update page.
- */
-UserManager.User.Update = {
- /**
- * Initializes the elements for the User update page
- */
- init: function() {
- //apply jquery-ui styles to the update button
- $('button#updateUserBtn').button();
-
- // validate form
- /*var validator = */$("#update-user-form").validate({
- rules: {
- }/*,
- messages: {
- }*/
- });
-
- var disabledRadioFn = function (e) {
- var disabled = $('input:radio[name=":disabled"]:checked').val();
- if (disabled == "true") {
- $("#disabledReasonPanel").show();
- } else {
- $("#disabledReasonPanel").hide();
- }
- return false;
- };
-
- /*
- * Attach event handlers to the status radio buttons
- */
- $('input:radio[name=":disabled"]').change(disabledRadioFn);
- disabledRadioFn();
-
- //hover states on the remove member icons
- $('.remove-property').hover(
- function() { $(this).addClass('ui-state-hover'); },
- function() { $(this).removeClass('ui-state-hover'); }
- ).click(
- function(e) {
- var memberItem, input, key;
-
- //mark the member for removal
- memberItem = $(e.currentTarget.parentNode);
- memberItem.hide('slow');
- input = memberItem.find('input');
- key = input.attr("name");
- input.attr("name", key + "@Delete");
- return false;
- }
- );
-
- //attach the event handler to the update button
- $('button#updateUserBtn').click( function(e) {
- var form, actionUrl, formData;
-
- form = $("#update-user-form");
-
- //client side validation
- if (!form.valid()) {
- return false;
- }
-
- actionUrl = form.attr('action');
-
- //switch to a json response
- actionUrl = actionUrl.substring(0, actionUrl.length - 4) + "json";
-
- //turn off redirect in this context
- $('#redirect').attr('disabled', true);
- formData = form.serialize();
- $('#redirect').removeAttr('disabled');
-
- //hide the info msg from a previous action
- $("#update-user-body div.info-msg-block").hide();
-
- //submit the update request
- $.ajax({
- url: actionUrl,
- type: 'POST',
- data: formData,
- success: function( data, textStatus, xmlHttpRequest ) {
- //reload the update body content
- $("#update-user-body").parent().load(UserManager.contextPath + data.path + ".update_body.html", function() {
- //inject a success message
- $("#update-user-body span.info-msg-text").html(UserManager.messages["user.updated.msg"]);
- $("#update-user-body div.info-msg-block").show();
- });
-
- setTimeout(function() {
- //re-init the page since we just replaced the body
- UserManager.User.Update.init();
-
- if ($("#update-password-form").length > 0) {
- UserManager.User.UpdatePassword.init();
- }
-
- //make visible any elements that require scripting to be enabled
- $(".noscript-hide").removeClass("noscript-hide");
- }, 100);
- },
- error: UserManager.ErrorDlg.errorHandler
- });
- return false;
- });
-
- //attach a confirmation dialog to the 'Remove' link
- $('a#removeUserLink').click( function(e) {
- //prepare the confirmation dialog
- $("#remove-user-dialog").dialog({
- autoOpen: false,
- height: 'auto',
- width: 350,
- modal: true,
- resizable: false,
- buttons: [
- {
- text: UserManager.messages["confirm.yes"],
- click: function() {
- $("#remove-user-form").submit();
- }
- },
- {
- text: UserManager.messages["confirm.no"],
- click: function() {
- $("#remove-user-dialog").dialog("close");
- }
- }
- ]
- });
-
- //open the dialog
- $('#remove-user-dialog').dialog('open');
- return false;
- });
-
- //attach a prompt dialog to the 'Add Property' link
- $('a#add_property').click( function(e) {
- //prepare the dialog
- $("#add-property-dialog").dialog({
- autoOpen: false,
- height: 'auto',
- width: 350,
- modal: true,
- resizable: false,
- buttons: [
- {
- text: UserManager.messages["button.add"],
- click: function() {
- var form, name, label, newItem;
-
- form = $("#add-property-form");
- //client side validation
- if (!form.valid()) {
- return false;
- }
-
- name=$("#newPropName").val();
- label = name;
- $("#updateSubmitBtns").before('<div class="prop-line ui-helper-clearfix"><label for="' + name + '">' + label + ':</label> <input id="' + name + '" type="text" name="' + name + '" /> <a href="#" class="remove-property" title="' + UserManager.messages["tooltip.removeProperty"] + '"><span class="ui-icon ui-icon-circle-close"></span></a></div>');
-
- newItem = $("#updateSubmitBtns").prev();
-
- //add hover states on the remove property icons
- newItem.find('a.remove-property').hover(
- function() { $(this).addClass('ui-state-hover'); },
- function() { $(this).removeClass('ui-state-hover'); }
- ).click(
- function(e) {
- var propItem = $(e.currentTarget.parentNode);
- propItem.hide('slow', function() {
- propItem.remove();
- });
- return false;
- }
- );
-
- $("#add-property-dialog").dialog( "close" );
-
- newItem.find('input').focus();
- }
- }
- ]
- });
-
-
- //clear the old value (if any)
- $("#newPropName").val('');
-
- //open the dialog
- $('#add-property-dialog').dialog('open');
- return false;
- });
-
- //forward the form submit event to the button handler to handle 'Enter' key in the
- // prompt field
- $("#add-property-form").submit(function (e) {
- var buttons = $("#add-property-dialog").dialog( "option", "buttons" );
- buttons[0].click();
- return false;
- })
- .validate({
- rules: {
- "name": "required"
- }/*,
- messages: {
- }*/
- });
- }
-};
-
-/**
- * For the User update password page.
- */
-UserManager.User.UpdatePassword = {
- /**
- * Initializes the elements for the User update password page
- */
- init: function() {
- //apply jquery-ui styles to the update button
- $('button#updatePasswordBtn').button();
-
- // validate form
- /*var validator = */$("#update-password-form").validate({
- rules: {
- "oldPwd": "required",
- "newPwd": "required",
- "newPwdConfirm": {
- equalTo: "#newPwd"
- }
- }/*,
- messages: {
- }*/
- });
-
- //clear input values if the browser auto-filled them.
- $("#update-password-form input[type='password']").val("");
-
- //attach event handler to the update button
- $('button#updatePasswordBtn').click( function(e) {
- var form, actionUrl, formData;
-
- form = $("#update-password-form");
-
- //client side validation
- if (!form.valid()) {
- return false;
- }
-
- actionUrl = form.attr('action');
-
- //switch to a json response
- actionUrl = actionUrl.substring(0, actionUrl.length - 4) + "json";
-
- //turn off redirect in this context
- $('#pwdRedirect').attr('disabled', true);
- formData = form.serialize();
- $('#pwdRedirect').removeAttr('disabled');
-
- //hide the info msg from a previous action
- $("#update-password-body div.info-msg-block").hide();
-
- //submit the update request
- $.ajax({
- url: actionUrl,
- type: 'POST',
- data: formData,
- success: function( data, textStatus, xmlHttpRequest ) {
- //clear the inputs
- $("#update-password-form input[type='password']").val('');
-
- //inject a success message
- $("#update-password-body span.info-msg-text").html(UserManager.messages["user.pwd.updated.msg"]);
- $("#update-password-body div.info-msg-block").show();
- },
- error: UserManager.ErrorDlg.errorHandler
- });
- return false;
- });
- }
-};
-
-
-/**
- * Initialize any objects that are active on the current page
- */
-$(function() {
- //make visible any elements that require scripting to be enabled
- $(".noscript-hide").removeClass("noscript-hide");
-
- if ($("#sidebar-nav").length > 0) {
- UserManager.SideBar.init();
- }
-
- if ($("#find-authorizables-form").length > 0) {
- UserManager.Authorizables.init();
- }
-
- if ($("#update-group-form").length > 0) {
- UserManager.Group.Update.init();
- }
-
- if ($("#create-group-form").length > 0) {
- UserManager.Group.Create.init();
- }
-
- if ($("#update-user-form").length > 0) {
- UserManager.User.Update.init();
- }
-
- if ($("#update-password-form").length > 0) {
- UserManager.User.UpdatePassword.init();
- }
-
- if ($("#create-user-form").length > 0) {
- UserManager.User.Create.init();
- }
-});
diff --git a/usermanager-ui/src/main/resources/js/usermanager/usermanager.min.js b/usermanager-ui/src/main/resources/js/usermanager/usermanager.min.js
deleted file mode 100644
index 3603e1c..0000000
--- a/usermanager-ui/src/main/resources/js/usermanager/usermanager.min.js
+++ /dev/null
@@ -1,349 +0,0 @@
-/*!
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-UserManager={contextPath:"",formatMsg:function(c,a){var b=/{(\d+)}/g;
-return c.replace(b,function(){var d=parseInt(arguments[1]);
-return a[d]
-})
-},messages:{"error.dlg.title":"Error","confirm.yes":"Yes","confirm.no":"No","button.add":"Add","searching.progress.msg":"Searching, please wait...","tooltip.removeProperty":"Remove Property","tooltip.removeMember":"Remove Member","group.updated.msg":"Updated the group","user.updated.msg":"Updated the user","user.pwd.updated.msg":"Updated the password","group.created.msg":"Created the group","user.created.msg":"Created the user"}};
-UserManager.SideBar={init:function(){var c,b,a,d,e;
-b=$("ul#sidebar-nav li a");
-a=location.href;
-d=location.hash;
-if(d!=null&&d.length>0){a=a.substring(0,a.length-d.length)
-}for(c=0;
-c<b.length;
-c++){e=b[c];
-if(a==e.href){$(e.parentNode).addClass("ui-corner-all ui-state-highlight")
-}}}};
-UserManager.ErrorDlg={showError:function(b,a){if($("#error_dialog").length==0){$("body").append('<div id="error_dialog" style="display:none;"></div>')
-}$("#error_dialog").html(a);
-$("#error_dialog").dialog({title:b,bgiframe:true,autoOpen:false,width:400,maxHeight:500,modal:true});
-$("#error_dialog").dialog("open")
-},errorHandler:function(d,g,c){var f,b;
-try{f=UserManager.messages["error.dlg.title"];
-b=$.parseJSON(d.responseText);
-if(b.error){UserManager.ErrorDlg.showError(f,b.error.message)
-}else{UserManager.ErrorDlg.showError(f,d.responseText)
-}}catch(a){UserManager.ErrorDlg.showError(f,d.responseText)
-}}};
-UserManager.Authorizables={progressFnId:null,init:function(){$("#find-authorizables-quick-nav").buttonset().show();
-UserManager.Authorizables.applyResultStylesAndHandlers();
-$('#find-authorizables-quick-nav input[type = "radio"]').change(function(a){$("#searchOffset").val(0);
-$("#findAuthorizablesQuery").val("");
-UserManager.Authorizables.runSearchFn();
-return false
-});
-$("button#findAuthorizablesBtn").button();
-$("button#findAuthorizablesBtn").click(function(a){if($("#findAuthorizablesQuery").val()==""){$("#radioAll").attr("checked",true);
-$("#radioAll").button("refresh")
-}else{$("#radioNone").attr("checked",true);
-$("#radioNone").button("refresh")
-}UserManager.Authorizables.runSearchFn(0);
-return false
-});
-$(window).bind("hashchange",UserManager.Authorizables.runSearchFromHashFn);
-$(window).trigger("hashchange")
-},progressFn:function(){$("#authorizables-results-body").after('<div id="authorizables-results-progress" class="search-empty-msg ui-corner-all ui-state-highlight">'+UserManager.messages["searching.progress.msg"]+"</div>");
-UserManager.Authorizables.progressFnId=null
-},clearProgressFn:function(){if(UserManager.Authorizables.progressFnId!=null){clearTimeout(UserManager.Authorizables.progressFnId);
-UserManager.Authorizables.progressFnId=null
-}$("#authorizables-results-progress").remove()
-},runSearchFn:function(c){var a,b;
-$("#searchOffset").val(c==undefined?"0":c);
-a=$("#find-authorizables-form");
-b=a.serialize();
-window.location.hash=b
-},parseHashParams:function(){var c={},h,b=/\+/g,f=/([^&;=]+)=?([^&;]*)/g,i=function(a){return decodeURIComponent(a.replace(b," "))
-},g=window.location.hash.substring(1);
-while(h=f.exec(g)){c[i(h[1])]=i(h[2])
-}return c
-},runSearchFromHashFn:function(){var b,c,a;
-b=$("#find-authorizables-form");
-c=b.attr("action");
-c=c.substring(0,c.length-4)+"searchresult.html";
-a=UserManager.Authorizables.parseHashParams();
-$("#findAuthorizablesQuery").val(a.q==undefined?"":a.q);
-$('#find-authorizables-quick-nav input[value="'+(a.sp==undefined?"":a.sp)+'"]').attr("checked",true).button("refresh");
-$("#searchOffset").val(a.o==undefined?"0":a.o);
-if(a.q==undefined&&a.sp==undefined){if($("#search-result-ready-to-search").length==0){$.ajax({url:c,type:"get",success:UserManager.Authorizables.searchDoneFn,error:UserManager.ErrorDlg.errorHandler})
-}return
-}$("#authorizables-results-body").hide();
-UserManager.Authorizables.clearProgressFn();
-UserManager.Authorizables.progressFnId=setTimeout(UserManager.Authorizables.progressFn,200);
-$.ajax({url:c,type:"get",data:b.serialize(),cache:false,success:UserManager.Authorizables.searchDoneFn,error:function(e,f,d){UserManager.Authorizables.clearProgressFn();
-UserManager.ErrorDlg.errorHandler(e,f,d)
-}})
-},searchDoneFn:function(a,c,b){UserManager.Authorizables.clearProgressFn();
-$("#authorizables-results-body").replaceWith(a);
-UserManager.Authorizables.applyResultStylesAndHandlers()
-},applyResultStylesAndHandlers:function(a,c,b){$("#search-result-body tr").mouseover(function(){$(this).addClass("ui-state-highlight")
-}).mouseout(function(){$(this).removeClass("ui-state-highlight")
-}).click(function(){var d=$(this).find("td a")[0].href;
-window.location=d;
-return false
-});
-$("#first_page").button().click(function(){UserManager.Authorizables.runSearchFn(0);
-return false
-});
-$("#prev_page").button().click(function(){UserManager.Authorizables.runSearchFn($("#prev_page").val());
-return false
-});
-$("#next_page").button().click(function(){UserManager.Authorizables.runSearchFn($("#next_page").val());
-return false
-})
-}};
-UserManager.Group={};
-UserManager.Group.Create={init:function(){$("button#createGroupBtn").button();
-$("#create-group-form").validate({rules:{":name":"required"}});
-$("button#createGroupBtn").click(function(d){var b,a,c;
-b=$("#create-group-form");
-if(!b.valid()){return false
-}a=b.attr("action");
-a=a.substring(0,a.length-4)+"json";
-$("#redirect").attr("disabled",true);
-c=b.serialize();
-$("#redirect").removeAttr("disabled");
-$("#create-group-body div.info-msg-block").hide();
-$.ajax({url:a,type:"POST",data:c,success:function(e,g,f){$("#create-group-form input[type='text']").val("");
-$("#create-group-body span.info-msg-text").html(UserManager.messages["group.created.msg"]);
-$("#create-group-body div.info-msg-block").show()
-},error:UserManager.ErrorDlg.errorHandler});
-return false
-})
-}};
-UserManager.Group.Update={init:function(){$("button#updateGroupBtn").button();
-$("#update-group-form").validate({rules:{}});
-$(".remove-member").hover(function(){$(this).addClass("ui-state-hover")
-},function(){$(this).removeClass("ui-state-hover")
-}).click(function(b){var a=$(b.currentTarget.parentNode);
-a.hide("slow",function(){if($("ol#declaredMembers li:visible").length==0){$("#declaredMembers__empty").show()
-}});
-a.find("input").attr("name",":member@Delete");
-return false
-});
-$(".remove-property").hover(function(){$(this).addClass("ui-state-hover")
-},function(){$(this).removeClass("ui-state-hover")
-}).click(function(d){var c,a,b;
-c=$(d.currentTarget.parentNode);
-c.hide("slow");
-a=c.find("input");
-b=a.attr("name");
-a.attr("name",b+"@Delete");
-return false
-});
-$("button#updateGroupBtn").click(function(d){var b,a,c;
-b=$("#update-group-form");
-if(!b.valid()){return false
-}a=b.attr("action");
-a=a.substring(0,a.length-4)+"json";
-$("#redirect").attr("disabled",true);
-c=b.serialize();
-$("#redirect").removeAttr("disabled");
-$("#update-group-body div.info-msg-block").hide();
-$.ajax({url:a,type:"POST",data:c,success:function(e,g,f){$("#update-group-body").parent().load(UserManager.contextPath+e.path+".update_body.html",function(){$("#update-group-body span.info-msg-text").html(UserManager.messages["group.updated.msg"]);
-$("#update-group-body div.info-msg-block").show()
-});
-setTimeout(function(){UserManager.Group.Update.init();
-$(".noscript-hide").removeClass("noscript-hide")
-},100)
-},error:UserManager.ErrorDlg.errorHandler});
-return false
-});
-$("a#removeGroupLink").click(function(a){$("#remove-group-dialog").dialog({autoOpen:false,height:"auto",width:350,modal:true,resizable:false,buttons:[{text:UserManager.messages["confirm.yes"],click:function(){$("#remove-group-form").submit()
-}},{text:UserManager.messages["confirm.no"],click:function(){$("#remove-group-dialog").dialog("close")
-}}]});
-$("#remove-group-dialog").dialog("open");
-return false
-});
-$("a#add_property").click(function(a){$("#add-property-dialog").dialog({autoOpen:false,height:"auto",width:350,modal:true,resizable:false,buttons:[{text:UserManager.messages["button.add"],click:function(){var e,c,b,d;
-e=$("#add-property-form");
-if(!e.valid()){return false
-}c=$("#newPropName").val();
-b=c;
-$("#updateSubmitBtns").before('<div class="prop-line ui-helper-clearfix"><label for="'+c+'">'+b+':</label> <input id="'+c+'" type="text" name="'+c+'" /> <a href="#" class="remove-property" title="'+UserManager.messages["tooltip.removeProperty"]+'"><span class="ui-icon ui-icon-circle-close"></span></a></div>');
-d=$("#updateSubmitBtns").prev();
-d.find("a.remove-property").hover(function(){$(this).addClass("ui-state-hover")
-},function(){$(this).removeClass("ui-state-hover")
-}).click(function(f){var g=$(f.currentTarget.parentNode);
-g.hide("slow",function(){g.remove()
-});
-return false
-});
-$("#add-property-dialog").dialog("close");
-d.find("input").focus()
-}}]});
-$("#newPropName").val("");
-$("#add-property-dialog").dialog("open");
-return false
-});
-$("#add-property-form").submit(function(b){var a=$("#add-property-dialog").dialog("option","buttons");
-a[0].click();
-return false
-}).validate({rules:{name:"required"}});
-$("a#add_member").click(function(a){$("#add-member-dialog").dialog({autoOpen:false,height:"auto",width:350,modal:true,resizable:false,buttons:[{text:UserManager.messages["button.add"],click:function(){var f,c,b,g,d,e;
-f=$("#add-group-member-form");
-if(!f.valid()){return false
-}c=$("#memberName").val();
-b=c;
-e=$("#memberName").data("item");
-if(e){if(e.label&&e.value==c){b=e.label
-}}g='<li><input type="hidden" name=":member" value="'+c+'" /><span>'+b+'</span> <a href="#" class="remove-member" title="'+UserManager.messages["tooltip.removeMember"]+'"><span class="ui-icon ui-icon-circle-close"></span></a></li>';
-$("#declaredMembers__empty").hide();
-$("#declaredMembers").append(g);
-d=$("#declaredMembers").find("li").last();
-d.find("a.remove-member").hover(function(){$(this).addClass("ui-state-hover")
-},function(){$(this).removeClass("ui-state-hover")
-}).click(function(i){var h=$(i.currentTarget.parentNode);
-h.hide("slow",function(){h.remove();
-if($("ol#declaredMembers li:visible").length==0){$("#declaredMembers__empty").show()
-}});
-return false
-});
-$("#add-member-dialog").dialog("close");
-return false
-}}]});
-$("#memberName").val("");
-$("#add-member-dialog").dialog("open");
-return false
-});
-$("#add-group-member-form").submit(function(b){var a=$("#add-member-dialog").dialog("option","buttons");
-a[0].click();
-return false
-}).validate({rules:{":member":"required"}});
-if($("#memberName").length>0){$("#memberName").autocomplete({source:UserManager.contextPath+"/system/userManager.autocomplete.json",minLength:1,select:function(b,c){var a=c.item;
-$("#memberName").val(a.value).data("item",a)
-}}).data("autocomplete")._renderItem=function(a,b){return $("<li></li>").data("item.autocomplete",b).append("<a>"+(b.label?(b.label+" ("+b.value+")"):b.value)+"</a>").appendTo(a)
-}
-}}};
-UserManager.User={};
-UserManager.User.Create={init:function(){$("button#createUserBtn").button();
-$("#create-user-form").validate({rules:{":name":"required",pwd:"required",pwdConfirm:{equalTo:"#pwd"}}});
-$("button#createUserBtn").click(function(d){var b,a,c;
-b=$("#create-user-form");
-if(!b.valid()){return false
-}a=b.attr("action");
-a=a.substring(0,a.length-4)+"json";
-$("#redirect").attr("disabled",true);
-c=b.serialize();
-$("#redirect").removeAttr("disabled");
-$("#create-user-body div.info-msg-block").hide();
-$.ajax({url:a,type:"POST",data:c,success:function(e,g,f){$("#create-user-form input[type='text']").val("");
-$("#create-user-form input[type='password']").val("");
-$("#create-user-body span.info-msg-text").html(UserManager.messages["user.created.msg"]);
-$("#create-user-body div.info-msg-block").show()
-},error:UserManager.ErrorDlg.errorHandler});
-return false
-})
-}};
-UserManager.User.Update={init:function(){$("button#updateUserBtn").button();
-$("#update-user-form").validate({rules:{}});
-var a=function(c){var b=$('input:radio[name=":disabled"]:checked').val();
-if(b=="true"){$("#disabledReasonPanel").show()
-}else{$("#disabledReasonPanel").hide()
-}return false
-};
-$('input:radio[name=":disabled"]').change(a);
-a();
-$(".remove-property").hover(function(){$(this).addClass("ui-state-hover")
-},function(){$(this).removeClass("ui-state-hover")
-}).click(function(f){var d,b,c;
-d=$(f.currentTarget.parentNode);
-d.hide("slow");
-b=d.find("input");
-c=b.attr("name");
-b.attr("name",c+"@Delete");
-return false
-});
-$("button#updateUserBtn").click(function(f){var c,b,d;
-c=$("#update-user-form");
-if(!c.valid()){return false
-}b=c.attr("action");
-b=b.substring(0,b.length-4)+"json";
-$("#redirect").attr("disabled",true);
-d=c.serialize();
-$("#redirect").removeAttr("disabled");
-$("#update-user-body div.info-msg-block").hide();
-$.ajax({url:b,type:"POST",data:d,success:function(e,h,g){$("#update-user-body").parent().load(UserManager.contextPath+e.path+".update_body.html",function(){$("#update-user-body span.info-msg-text").html(UserManager.messages["user.updated.msg"]);
-$("#update-user-body div.info-msg-block").show()
-});
-setTimeout(function(){UserManager.User.Update.init();
-if($("#update-password-form").length>0){UserManager.User.UpdatePassword.init()
-}$(".noscript-hide").removeClass("noscript-hide")
-},100)
-},error:UserManager.ErrorDlg.errorHandler});
-return false
-});
-$("a#removeUserLink").click(function(b){$("#remove-user-dialog").dialog({autoOpen:false,height:"auto",width:350,modal:true,resizable:false,buttons:[{text:UserManager.messages["confirm.yes"],click:function(){$("#remove-user-form").submit()
-}},{text:UserManager.messages["confirm.no"],click:function(){$("#remove-user-dialog").dialog("close")
-}}]});
-$("#remove-user-dialog").dialog("open");
-return false
-});
-$("a#add_property").click(function(b){$("#add-property-dialog").dialog({autoOpen:false,height:"auto",width:350,modal:true,resizable:false,buttons:[{text:UserManager.messages["button.add"],click:function(){var f,d,c,e;
-f=$("#add-property-form");
-if(!f.valid()){return false
-}d=$("#newPropName").val();
-c=d;
-$("#updateSubmitBtns").before('<div class="prop-line ui-helper-clearfix"><label for="'+d+'">'+c+':</label> <input id="'+d+'" type="text" name="'+d+'" /> <a href="#" class="remove-property" title="'+UserManager.messages["tooltip.removeProperty"]+'"><span class="ui-icon ui-icon-circle-close"></span></a></div>');
-e=$("#updateSubmitBtns").prev();
-e.find("a.remove-property").hover(function(){$(this).addClass("ui-state-hover")
-},function(){$(this).removeClass("ui-state-hover")
-}).click(function(g){var h=$(g.currentTarget.parentNode);
-h.hide("slow",function(){h.remove()
-});
-return false
-});
-$("#add-property-dialog").dialog("close");
-e.find("input").focus()
-}}]});
-$("#newPropName").val("");
-$("#add-property-dialog").dialog("open");
-return false
-});
-$("#add-property-form").submit(function(c){var b=$("#add-property-dialog").dialog("option","buttons");
-b[0].click();
-return false
-}).validate({rules:{name:"required"}})
-}};
-UserManager.User.UpdatePassword={init:function(){$("button#updatePasswordBtn").button();
-$("#update-password-form").validate({rules:{oldPwd:"required",newPwd:"required",newPwdConfirm:{equalTo:"#newPwd"}}});
-$("#update-password-form input[type='password']").val("");
-$("button#updatePasswordBtn").click(function(d){var b,a,c;
-b=$("#update-password-form");
-if(!b.valid()){return false
-}a=b.attr("action");
-a=a.substring(0,a.length-4)+"json";
-$("#pwdRedirect").attr("disabled",true);
-c=b.serialize();
-$("#pwdRedirect").removeAttr("disabled");
-$("#update-password-body div.info-msg-block").hide();
-$.ajax({url:a,type:"POST",data:c,success:function(e,g,f){$("#update-password-form input[type='password']").val("");
-$("#update-password-body span.info-msg-text").html(UserManager.messages["user.pwd.updated.msg"]);
-$("#update-password-body div.info-msg-block").show()
-},error:UserManager.ErrorDlg.errorHandler});
-return false
-})
-}};
-$(function(){$(".noscript-hide").removeClass("noscript-hide");
-if($("#sidebar-nav").length>0){UserManager.SideBar.init()
-}if($("#find-authorizables-form").length>0){UserManager.Authorizables.init()
-}if($("#update-group-form").length>0){UserManager.Group.Update.init()
-}if($("#create-group-form").length>0){UserManager.Group.Create.init()
-}if($("#update-user-form").length>0){UserManager.User.Update.init()
-}if($("#update-password-form").length>0){UserManager.User.UpdatePassword.init()
-}if($("#create-user-form").length>0){UserManager.User.Create.init()
-}});
\ No newline at end of file
diff --git a/usermanager-ui/src/main/resources/libs/sling/group/html.esp b/usermanager-ui/src/main/resources/libs/sling/group/html.esp
deleted file mode 100644
index 6bdc0b1..0000000
--- a/usermanager-ui/src/main/resources/libs/sling/group/html.esp
+++ /dev/null
@@ -1,41 +0,0 @@
-<%
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var rb = request.getResourceBundle("org.apache.sling.usermgr.Resources", null);
-
-var authorizable = resource.adaptTo(Packages.org.apache.jackrabbit.api.security.user.Authorizable);
-var privilegesInfo = sling.getService(Packages.org.apache.sling.jackrabbit.usermanager.AuthorizablePrivilegesInfo);
-var canEdit = privilegesInfo.canUpdateProperties(currentSession, authorizable.getID());
-
-//header options
-request.setAttribute("page.title", rb.getString(canEdit ? "page.title.update.group" : "page.title.view.group"));
-
-//page sidebar template
-request.setAttribute("sidebar.template", resource.path + ".sidebar.html");
-request.setAttribute("sidebar.template.options", "sling/usermgmt");
-
-//page body template
-request.setAttribute("body.template", resource.path + ".update_body.html");
-request.setAttribute("body.template.options", null);
-
-//override the logout target since the anonymous user usually can't view groups
-request.setAttribute("logout.target", request.contextPath + "/system/userManager/group.html");
-
-//render the page using the default page template
-sling.include(resource.path + ".page.html", "sling/usermgmt");
-%>
\ No newline at end of file
diff --git a/usermanager-ui/src/main/resources/libs/sling/group/update_body.html.esp b/usermanager-ui/src/main/resources/libs/sling/group/update_body.html.esp
deleted file mode 100644
index 711f57a..0000000
--- a/usermanager-ui/src/main/resources/libs/sling/group/update_body.html.esp
+++ /dev/null
@@ -1,196 +0,0 @@
-<%
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var privilegesInfo = sling.getService(Packages.org.apache.sling.jackrabbit.usermanager.AuthorizablePrivilegesInfo);
-var authorizable = resource.adaptTo(Packages.org.apache.jackrabbit.api.security.user.Authorizable);
-var canEdit = privilegesInfo.canUpdateProperties(currentSession, authorizable.getID());
-var canModifyMembers = privilegesInfo.canUpdateGroupMembers(currentSession, authorizable.getID());
-var canRemove = privilegesInfo.canRemove(currentSession, authorizable.getID());
-var valueMap = resource.adaptTo(Packages.org.apache.sling.api.resource.ValueMap);
-
-var rb = request.getResourceBundle("org.apache.sling.usermgr.Resources", null);
-
-var propNameSet = new Packages.java.util.TreeSet(valueMap.keySet());
-propNameSet.remove("declaredMemberOf");
-propNameSet.remove("members");
-propNameSet.remove("declaredMembers");
-propNameSet.remove("memberOf");
-
-var propKeysCsv = rb.getString("csv.static.group.prop.keys");
-var items = [];
-if (propKeysCsv != null && propKeysCsv.length() > 0 && !propKeysCsv.equals("csv.static.group.prop.keys")) {
- items = propKeysCsv.split(",");
-}
-for (var i=0; i < items.length; i++) {
- propNameSet.add(items[i]);
-}
-
-function propLabel(propName) {
- var key = "prop.label." + propName;
- var value = rb.getString(key);
- if (value == key) {
- return propName;
- }
- return value;
-};
-function format(key, args) {
- var value = rb.getString(key);
- return Packages.java.text.MessageFormat.format(value, args);
-}
-function displayName(path) {
- var res = request.getResourceResolver().resolve(path);
- var resValueMap = res.adaptTo(Packages.org.apache.sling.api.resource.ValueMap);
- var value = resValueMap.get("displayName");
- if (value == null) {
- value = path.substring(path.lastIndexOf('/') + 1)
- }
- return value;
-}
-%>
-<div class="ui-widget ui-widget-content ui-corner-all usermgmt-body" id="update-group-body" >
- <h3 class="ui-widget-header ui-corner-all usermgmt-header"><%=format(canEdit ? "header.update.group" : "header.view.group", authorizable.getID())%></h3>
-
- <div class="info-msg-block" style="display:none;">
- <div class="ui-state-highlight ui-corner-all">
- <p>
- <span class="ui-icon ui-icon-info"></span>
- <span class="info-msg-text"></span>
- </p>
- </div>
- </div>
-
- <form id="update-group-form" accept-charset="UTF-8"
- action="<%=request.contextPath%><%=resource.path %>.update.html"
- method="post">
- <fieldset>
- <input type="hidden" value="UTF-8" name="_charset_" />
- <input id="redirect" type="hidden" name=":redirect" value="<%=request.contextPath%><%=resource.path %>.html" />
-
- <%-- Declared Members --%>
- <% var key = "declaredMembers";
- var value = valueMap.get(key);
- %>
- <div class="prop-line ui-helper-clearfix">
- <label for="<%=key%>"><%=propLabel(key)%>:</label>
-
- <ol id="<%=key%>">
- <li id="<%=key%>__empty" <%= value.length == 0 ? "" : "style='display:none'" %>><%=rb.getString("declaredMembers.empty")%></li>
- <%
- for (i = 0; i < value.length; i++) {
- var group = value[i];
- %>
- <li>
- <a href="<%=request.contextPath%><%=group%>.html"><%=displayName(group)%></a>
- <% if (canModifyMembers) { %>
- <input type="hidden" name=":member" value="<%=group%>" />
- <a href='#' class="noscript-hide remove-member" title='<%=rb.getString("tooltip.removeMember")%>'><span class="ui-icon ui-icon-circle-close"></span></a>
- <% } /* endif(canModifyMembers) */ %>
- </li>
- <%
- }/* endfor */
- %>
- </ol>
- </div>
-
- <%-- Member Of --%>
- <% key = "memberOf";
- value = valueMap.get(key);
- %>
- <div class="prop-line ui-helper-clearfix">
- <label for="<%=key%>"><%=propLabel(key)%>:</label>
-
- <ol id="<%=key%>">
- <li id="<%=key%>__empty" <%= value.length == 0 ? "" : "style='display:none'" %>><%=rb.getString("memberOf.empty")%></li>
- <%
- for (i = 0; i < value.length; i++) {
- var group = value[i];
- %>
- <li>
- <a href="<%=request.contextPath%><%=group%>.html"><%=displayName(group)%></a>
- </li>
- <%
- }/* endfor */
- %>
- </ol>
- </div>
-
- <%
- var it = propNameSet.iterator();
- while (it.hasNext()) {
- key = it.next();
- value = valueMap.get(key);
- if (value == null) {
- value = "";
- }
- %>
- <div class="prop-line ui-helper-clearfix">
- <label for="<%=key%>"><%=propLabel(key) %>:</label>
- <input id="<%=key%>" type="text" name="<%=key%>" value='<%=value%>' <%= canEdit ? "" : "disabled=\"disabled\" readonly=\"readonly\" class=\"disabled\""%>/>
- <% if (canEdit) { %><a href='#' class="noscript-hide remove-property" title='<%=rb.getString("tooltip.removeProperty")%>'><span class="ui-icon ui-icon-circle-close"></span></a><% } %>
- </div>
- <%
- } /* endwhile */
- %>
-
- <div id="updateSubmitBtns" class="ui-helper-clearfix">
- <label> </label>
- <% if (canEdit) { %><button accesskey="u" id="updateGroupBtn" type="submit"><%=rb.getString("button.save")%></button><% } %>
- <span class="noscript-hide">
- <% if (canRemove) { %><a href="#" id="removeGroupLink"><%=rb.getString("link.remove")%></a><% } %>
- <% if (canEdit) { %>| <a href="#" id="add_property"><%=rb.getString("link.add.property")%></a><% } %>
- <% if (canModifyMembers) { %>| <a href="#" id="add_member"><%=rb.getString("link.add.member")%></a><% } %>
- </span>
- </div>
- </fieldset>
- </form>
-</div>
-
-<% if (canEdit) { %>
-<div id="add-property-dialog" title='<%=rb.getString("dialog.title.add.property")%>' style="display:none">
- <form id='add-property-form' action="#">
- <fieldset>
- <label for="newPropName"><%=rb.getString("label.property.name")%></label>
- <input type="text" name="name" id="newPropName" />
- </fieldset>
- </form>
-</div>
-<% } /*endif(canEdit) */ %>
-
-<% if (canRemove) { %>
-<div id="remove-group-dialog" title='<%=rb.getString("dialog.title.confirm.remove")%>' style="display:none">
- <form id='remove-group-form' action="<%=request.contextPath%><%=resource.path%>.delete.html" method="post">
- <fieldset>
- <input type="hidden" name=":redirect" value="<%=request.contextPath%>/system/userManager/group.html" />
- <p>
- <%=rb.getString("msg.group.confirm.remove") %>
- </p>
- </fieldset>
- </form>
-</div>
-<% } /*endif(canRemove) */ %>
-
-<% if (canModifyMembers) { %>
-<div id="add-member-dialog" title='<%=rb.getString("dialog.title.add.member") %>' style="display:none">
- <form id='add-group-member-form' action="#" >
- <fieldset>
- <label for="memberName"><%=rb.getString("label.group.name") %></label>
- <input type="text" name=":member" id="memberName" />
- </fieldset>
- </form>
-</div>
-<% } /*endif(canModifyMembers) */ %>
\ No newline at end of file
diff --git a/usermanager-ui/src/main/resources/libs/sling/groups/body.html.esp b/usermanager-ui/src/main/resources/libs/sling/groups/body.html.esp
deleted file mode 100644
index 592e08a..0000000
--- a/usermanager-ui/src/main/resources/libs/sling/groups/body.html.esp
+++ /dev/null
@@ -1,36 +0,0 @@
-<%
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var isLoggedIn = request.getUserPrincipal() != null && !"anonymous".equals(request.getRemoteUser());
-if (!isLoggedIn) {
- //anonymous user can't do anything here, so don't show a page.
- response.sendError(404);
-} else {
-
-var rb = request.getResourceBundle("org.apache.sling.usermgr.Resources", null);
-
-var searchType = 2; //search only groups
-request.setAttribute("search.type", searchType);
-
-var title = rb.getString("page.title.find.groups");
-request.setAttribute("page.title", title);
-
-//delegate the 'authorizables' script to render the page
-sling.include(resource.path + ".body.html", "sling/userManager");
-
-} /* endelse */
-%>
\ No newline at end of file
diff --git a/usermanager-ui/src/main/resources/libs/sling/groups/create.html.esp b/usermanager-ui/src/main/resources/libs/sling/groups/create.html.esp
deleted file mode 100644
index 54b94cf..0000000
--- a/usermanager-ui/src/main/resources/libs/sling/groups/create.html.esp
+++ /dev/null
@@ -1,40 +0,0 @@
-<%
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var privilegesInfo = sling.getService(Packages.org.apache.sling.jackrabbit.usermanager.AuthorizablePrivilegesInfo);
-if (!privilegesInfo.canAddGroup(currentSession)) {
- //user can't create groups.
- response.sendError(403);
-} else {
- var rb = request.getResourceBundle("org.apache.sling.usermgr.Resources", null);
-
- //header options
- request.setAttribute("page.title", rb.getString("page.title.create.group"));
-
- //page sidebar template
- request.setAttribute("sidebar.template", resource.path + ".sidebar.html");
- request.setAttribute("sidebar.template.options", "sling/usermgmt");
-
- //page body template
- request.setAttribute("body.template", resource.path + ".create_body.html");
- //request.setAttribute("body.template.options", null);
-
- //render the page using the default page template
- sling.include(resource.path + ".page.html", "sling/usermgmt");
-}
-%>
\ No newline at end of file
diff --git a/usermanager-ui/src/main/resources/libs/sling/groups/create_body.html.esp b/usermanager-ui/src/main/resources/libs/sling/groups/create_body.html.esp
deleted file mode 100644
index 1558a2f..0000000
--- a/usermanager-ui/src/main/resources/libs/sling/groups/create_body.html.esp
+++ /dev/null
@@ -1,61 +0,0 @@
-<%
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var privilegesInfo = sling.getService(Packages.org.apache.sling.jackrabbit.usermanager.AuthorizablePrivilegesInfo);
-if (!privilegesInfo.canAddGroup(currentSession)) {
- //user can't create groups.
- response.sendError(403);
-} else {
- var rb = request.getResourceBundle("org.apache.sling.usermgr.Resources", null);
-%>
-<div class="ui-widget ui-widget-content ui-corner-all usermgmt-body" id="create-group-body" >
- <h3 class="ui-widget-header ui-corner-all usermgmt-header"><%=rb.getString("page.title.create.group")%></h3>
-
- <div class="info-msg-block" style="display:none;">
- <div class="ui-state-highlight ui-corner-all">
- <p>
- <span class="ui-icon ui-icon-info"></span>
- <span class="info-msg-text"></span>
- </p>
- </div>
- </div>
-
- <form id="create-group-form" accept-charset="UTF-8"
- action="<%=request.contextPath%><%=resource.path%>.create.html"
- method="post">
- <fieldset>
- <input type="hidden" value="UTF-8" name="_charset_" />
-
- <div class="prop-line ui-helper-clearfix">
- <label for="groupId" accesskey="n"><%=rb.getString("prop.label.groupid")%>:</label>
- <input id="groupId" type="text" name=":name" />
- </div>
-
- <div class="prop-line ui-helper-clearfix">
- <label for="displayName" accesskey="n"><%=rb.getString("prop.label.displayName")%>:</label>
- <input id="displayName" type="text" name="displayName" />
- </div>
-
- <div class="ui-helper-clearfix">
- <label> </label>
- <button accesskey="r" id="createGroupBtn" type="submit"><%=rb.getString("button.create")%></button>
- </div>
- </fieldset>
- </form>
-</div>
-<% } /*endif (canAddGroup) */ %>
\ No newline at end of file
diff --git a/usermanager-ui/src/main/resources/libs/sling/groups/html.esp b/usermanager-ui/src/main/resources/libs/sling/groups/html.esp
deleted file mode 100644
index cf3ce75..0000000
--- a/usermanager-ui/src/main/resources/libs/sling/groups/html.esp
+++ /dev/null
@@ -1,41 +0,0 @@
-<%
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var isLoggedIn = request.getUserPrincipal() != null && !"anonymous".equals(request.getRemoteUser());
-if (!isLoggedIn) {
- //anonymous user can't do anything here, so don't show a page.
- response.sendError(404);
-} else {
-
-var rb = request.getResourceBundle("org.apache.sling.usermgr.Resources", null);
-
-//header options
-request.setAttribute("page.title", rb.getString("page.title.find.groups"));
-
-//page sidebar template
-request.setAttribute("sidebar.template", resource.path + ".sidebar.html");
-request.setAttribute("sidebar.template.options", "sling/usermgmt");
-
-//page body template
-request.setAttribute("body.template", resource.path + ".body.html");
-//request.setAttribute("body.template.options", "sling/groups");
-
-//render the page using the default page template
-sling.include(resource.path + ".page.html", "sling/usermgmt");
-
-} /*endelse */
-%>
\ No newline at end of file
diff --git a/usermanager-ui/src/main/resources/libs/sling/groups/searchresult.html.esp b/usermanager-ui/src/main/resources/libs/sling/groups/searchresult.html.esp
deleted file mode 100644
index efe00ac..0000000
--- a/usermanager-ui/src/main/resources/libs/sling/groups/searchresult.html.esp
+++ /dev/null
@@ -1,31 +0,0 @@
-<%
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var isLoggedIn = request.getUserPrincipal() != null && !"anonymous".equals(request.getRemoteUser());
-if (!isLoggedIn) {
- //anonymous user can't do anything here, so don't show a page.
- response.sendError(404);
-} else {
-
-var searchType = 2; //search only groups
-request.setAttribute("search.type", searchType);
-
-//delegate the 'authorizables' script to render the page
-sling.include(resource.path + ".searchresult.html", "sling/userManager");
-
-} /* endelse (isLoggedIn) */
-%>
\ No newline at end of file
diff --git a/usermanager-ui/src/main/resources/libs/sling/user/html.esp b/usermanager-ui/src/main/resources/libs/sling/user/html.esp
deleted file mode 100644
index ceebfd4..0000000
--- a/usermanager-ui/src/main/resources/libs/sling/user/html.esp
+++ /dev/null
@@ -1,41 +0,0 @@
-<%
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var rb = request.getResourceBundle("org.apache.sling.usermgr.Resources", null);
-
-var authorizable = resource.adaptTo(Packages.org.apache.jackrabbit.api.security.user.Authorizable);
-var privilegesInfo = sling.getService(Packages.org.apache.sling.jackrabbit.usermanager.AuthorizablePrivilegesInfo);
-var canEdit = privilegesInfo.canUpdateProperties(currentSession, authorizable.getID());
-
-//header options
-request.setAttribute("page.title", rb.getString(canEdit ? "page.title.update.user" : "page.title.view.user"));
-
-//page sidebar template
-request.setAttribute("sidebar.template", resource.path + ".sidebar.html");
-request.setAttribute("sidebar.template.options", "sling/usermgmt");
-
-//page body template
-request.setAttribute("body.template", resource.path + ".update_body.html");
-request.setAttribute("body.template.options", null);
-
-//override the logout target since the anonymous user usually can't view groups
-request.setAttribute("logout.target", request.contextPath + "/system/userManager/user.html");
-
-//render the page using the default page template
-sling.include(resource.path + ".page.html", "sling/usermgmt");
-%>
\ No newline at end of file
diff --git a/usermanager-ui/src/main/resources/libs/sling/user/update_body.html.esp b/usermanager-ui/src/main/resources/libs/sling/user/update_body.html.esp
deleted file mode 100644
index aaf2f0f..0000000
--- a/usermanager-ui/src/main/resources/libs/sling/user/update_body.html.esp
+++ /dev/null
@@ -1,243 +0,0 @@
-<%
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var privilegesInfo = sling.getService(Packages.org.apache.sling.jackrabbit.usermanager.AuthorizablePrivilegesInfo);
-var authorizable = resource.adaptTo(Packages.org.apache.jackrabbit.api.security.user.Authorizable);
-var canEdit = privilegesInfo.canUpdateProperties(currentSession, authorizable.getID());
-var canRemove = privilegesInfo.canRemove(currentSession, authorizable.getID());
-var canUpdateMembers = privilegesInfo.canUpdateGroupMembers(currentSession, authorizable.getID());
-var valueMap = resource.adaptTo(Packages.org.apache.sling.api.resource.ValueMap);
-
-var rb = request.getResourceBundle("org.apache.sling.usermgr.Resources", null);
-
-var propNameSet = new Packages.java.util.TreeSet(valueMap.keySet());
-propNameSet.remove("declaredMemberOf");
-propNameSet.remove("memberOf");
-
-var propKeysCsv = rb.getString("csv.static.user.prop.keys");
-var items = [];
-if (propKeysCsv != null && propKeysCsv.length() > 0 && !propKeysCsv.equals("csv.static.user.prop.keys")) {
- items = propKeysCsv.split(",");
-}
-for (var i=0; i < items.length; i++) {
- propNameSet.add(items[i]);
-}
-
-function propLabel(propName) {
- var key = "prop.label." + propName;
- var value = rb.getString(key);
- if (value == key) {
- return propName;
- }
- return value;
-};
-function format(key, args) {
- var value = rb.getString(key);
- return Packages.java.text.MessageFormat.format(value, args);
-}
-function displayName(path) {
- var res = request.getResourceResolver().resolve(path);
- var resValueMap = res.adaptTo(Packages.org.apache.sling.api.resource.ValueMap);
- var value = resValueMap.get("displayName");
- if (value == null) {
- value = path.substring(path.lastIndexOf('/') + 1)
- }
- return value;
-}
-
-var isAdmin = false;
-if ("admin".equals(request.getRemoteUser())) {
- isAdmin = true;
-} else {
- //if the current user is a member of the UserAdmin group, then allow changing the password of other users.
- var currentUserRes = request.getResourceResolver().resolve("/system/userManager/user/" + request.getRemoteUser());
- var currentUserAuthorizable = currentUserRes.adaptTo(Packages.org.apache.jackrabbit.api.security.user.Authorizable);
-
- var userAdminRes = request.getResourceResolver().resolve("/system/userManager/group/UserAdmin");
- var group = userAdminRes.adaptTo(Packages.org.apache.jackrabbit.api.security.user.Group);
- if (group) {
- isAdmin = group.isMember(currentUserAuthorizable);
- }
-}
-
-%>
-<div class="ui-widget ui-widget-content ui-corner-all usermgmt-body" id="update-user-body" >
- <h3 class="ui-widget-header ui-corner-all usermgmt-header"><%=format(canEdit ? "header.update.user" : "header.view.user", authorizable.getID())%></h3>
-
- <div class="info-msg-block" style="display:none;">
- <div class="ui-state-highlight ui-corner-all">
- <p>
- <span class="ui-icon ui-icon-info"></span>
- <span class="info-msg-text"></span>
- </p>
- </div>
- </div>
-
- <form id="update-user-form" accept-charset="UTF-8"
- action="<%=request.contextPath%><%=resource.path %>.update.html"
- method="post" >
- <fieldset>
- <input type="hidden" value="UTF-8" name="_charset_" />
- <input id="redirect" type="hidden" name=":redirect" value="<%=request.contextPath%><%=resource.path %>.html" />
-
- <%-- Enabled/Disabled Status --%>
- <% if (isAdmin) { %>
- <div class="prop-line ui-helper-clearfix">
- <label><%=propLabel("loginEnabled")%>:</label>
- <span id="loginStatusInput">
- <label for="enabled"><input id="enabled" type="radio" name=":disabled" value='false' <%=authorizable.isDisabled() ? "" : "checked='checked'" %>/> <%=propLabel("loginEnabled.yes")%></label>
- <label for="disabled"><input id="disabled" type="radio" name=":disabled" value='true' <%=authorizable.isDisabled() ? "checked='checked'" : "" %>/> <%=propLabel("loginEnabled.no")%></label>
- </span>
- <span id="disabledReasonPanel" style="display:none">
- <label for="disabledReason"><%=propLabel("loginDisabled.reason")%>:</label>
- <input id="disabledReason>" type="text" name=":disabledReason" value='<%=authorizable.getDisabledReason()== null ? "" : authorizable.getDisabledReason()%>'/>
- </span>
- </div>
- <% } /*endif(isAdmin) */ %>
-
- <%-- Member Of --%>
- <% var key = "memberOf";
- var value = valueMap.get(key);
- %>
- <div class="prop-line ui-helper-clearfix">
- <label for="<%=key%>"><%=propLabel(key)%>:</label>
-
- <ol id="<%=key%>">
- <li id="<%=key%>__empty" <%= value.length == 0 ? "" : "style='display:none'" %>><%=rb.getString("memberOf.empty")%></li>
- <%
- for (i = 0; i < value.length; i++) {
- var group = value[i];
- %>
- <li>
- <a href="<%=request.contextPath%><%=group%>.html"><%=displayName(group)%></a>
- </li>
- <%
- }/* endfor */
- %>
- </ol>
- </div>
-
- <%
- var it = propNameSet.iterator();
- while (it.hasNext()) {
- key = it.next();
- value = valueMap.get(key);
- if (value == null) {
- value = "";
- }
- %>
- <div class="prop-line ui-helper-clearfix">
- <label for="<%=key%>"><%=propLabel(key)%>:</label>
- <input id="<%=key%>" type="text" name="<%=key%>" value='<%=value%>' <%= canEdit ? "" : "disabled=\"disabled\" readonly=\"readonly\" class=\"disabled\""%>/>
- <% if (canEdit) { %>
- <a href='#' class="noscript-hide remove-property" title='<%=rb.getString("tooltip.removeProperty")%>'><span class="ui-icon ui-icon-circle-close"></span></a>
- <% } /* endif(canEdit) */ %>
- </div>
- <%
- } /* endwhile */
- %>
-
- <div id="updateSubmitBtns" class="ui-helper-clearfix">
- <label> </label>
- <% if (canEdit) { %><button accesskey="u" id="updateUserBtn" type="submit"><%=rb.getString("button.save")%></button><% } %>
- <span class="noscript-hide">
- <% if (canRemove) { %><a href="#" id="removeUserLink"><%=rb.getString("link.remove")%></a> | <% } %>
- <% if (canEdit) { %><a href="#" id="add_property"><%=rb.getString("link.add.property")%></a><% } %>
- </span>
- </div>
- </fieldset>
- </form>
-</div>
-
-<% if (canEdit) { %>
-<div id="add-property-dialog" title="<%=rb.getString("dialog.title.add.property")%>" style="display:none">
- <form id='add-property-form' action="#">
- <fieldset>
- <label for="newPropName"><%=rb.getString("label.property.name")%></label>
- <input type="text" name="name" id="newPropName" />
- </fieldset>
- </form>
-</div>
-<% } /*endif(canEdit) */ %>
-
-<% if (canRemove) { %>
-<div id="remove-user-dialog" title='<%=rb.getString("dialog.title.confirm.remove")%>' style="display:none">
- <form id='remove-user-form' action="<%=request.contextPath%><%=resource.path%>.delete.html" method="post">
- <fieldset>
- <input type="hidden" name=":redirect" value="<%=request.contextPath%>/system/userManager/user.html" />
- <p>
- <%=rb.getString("msg.user.confirm.remove") %>
- </p>
- </fieldset>
- </form>
-</div>
-<% } /*endif(canRemove) */ %>
-
-<%
-var canChangePwd = false;
-if (canEdit) {
- var isMe = authorizable.getID().equals(request.getRemoteUser());
- if (isMe || isAdmin) {
- //a user can always change their own password
- canChangePwd = true;
- }
-}
-if (canChangePwd) { %>
-<div class="ui-widget ui-widget-content ui-corner-all usermgmt-body" id="update-password-body" >
- <h3 class="ui-widget-header ui-corner-all usermgmt-header"><%=rb.getString("header.change.password")%></h3>
-
- <div class="info-msg-block" style="display:none;">
- <div class="ui-state-highlight ui-corner-all">
- <p>
- <span class="ui-icon ui-icon-info"></span>
- <span class="info-msg-text"></span>
- </p>
- </div>
- </div>
-
- <form id="update-password-form" accept-charset="UTF-8"
- action="<%=request.contextPath%><%=resource.path %>.changePassword.html"
- method="post">
- <fieldset>
- <input type="hidden" value="UTF-8" name="_charset_" />
- <input id="pwdRedirect" type="hidden" name=":redirect" value="<%=request.contextPath%><%=resource.path %>.html" />
- <% if (isMe) { %>
- <div class="prop-line ui-helper-clearfix">
- <label for="oldPwd" accesskey="o"><%=propLabel("oldPwd")%>:</label>
- <input id="oldPwd" type="password" name="oldPwd" value=''/>
- </div>
- <% } %>
-
- <div class="prop-line ui-helper-clearfix">
- <label for="newPwd" accesskey="p"><%=propLabel("newPwd")%>:</label>
- <input id="newPwd" type="password" name="newPwd" value=''/>
- </div>
-
- <div class="prop-line ui-helper-clearfix">
- <label for="newPwdConfirm" accesskey="c"><%=propLabel("newPwdConfirm")%>:</label>
- <input id="newPwdConfirm" type="password" name="newPwdConfirm" value=''/>
- </div>
-
- <div class="ui-helper-clearfix">
- <label> </label>
- <button accesskey="d" id="updatePasswordBtn" type="submit"><%=rb.getString("button.updatePwd")%></button>
- </div>
- </fieldset>
- </form>
-</div>
-<% } /*endif (canChangePwd)*/ %>
diff --git a/usermanager-ui/src/main/resources/libs/sling/userManager/autocomplete.json.esp b/usermanager-ui/src/main/resources/libs/sling/userManager/autocomplete.json.esp
deleted file mode 100644
index bb0fab6..0000000
--- a/usermanager-ui/src/main/resources/libs/sling/userManager/autocomplete.json.esp
+++ /dev/null
@@ -1,46 +0,0 @@
-<%
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var jsonArray = new Packages.org.apache.sling.commons.json.JSONArray();
-var offset = 0;
-var maxResults = 15;
-
-var term = request.getParameter("term");
-var searchResults;
-if (term != null && term.length() > 0) {
- var jcrSession = request.getResourceResolver().adaptTo(Packages.javax.jcr.Session);
- var userManager = Packages.org.apache.sling.jcr.base.util.AccessControlUtil.getUserManager(jcrSession);
-
- var query = new Packages.org.apache.sling.usermgr.FindPeopleQuery(3, term, true, offset, maxResults);
- searchResults = userManager.findAuthorizables(query);
-}
-if (searchResults) {
- while (searchResults.hasNext()) {
- var a = searchResults.next();
- var jsonObj = new Packages.org.apache.sling.commons.json.JSONObject();
- jsonObj.put("value", a.getID());
- var labelProp = a.getProperty("displayName");
- if (labelProp != null && labelProp.length > 0) {
- jsonObj.put("label", labelProp[0].getString());
- }
-
- jsonArray.put(jsonObj);
- }
-}
-response.getWriter().write(jsonArray.toString(2));
-%>
\ No newline at end of file
diff --git a/usermanager-ui/src/main/resources/libs/sling/userManager/body.html.esp b/usermanager-ui/src/main/resources/libs/sling/userManager/body.html.esp
deleted file mode 100644
index 05c5404..0000000
--- a/usermanager-ui/src/main/resources/libs/sling/userManager/body.html.esp
+++ /dev/null
@@ -1,80 +0,0 @@
-<%
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var isLoggedIn = request.getUserPrincipal() != null && !"anonymous".equals(request.getRemoteUser());
-if (!isLoggedIn) {
- //anonymous user can't do anything here, so don't show a page.
- response.sendError(404);
-} else {
-var rb = request.getResourceBundle("org.apache.sling.usermgr.Resources", null);
-
-var title = request.getAttribute("page.title");
-if (title == null) {
- title = rb.getString("page.title.find.authorizables");
-}
-
-var spParam = request.getParameter("sp");
-if (spParam == null) {
- spParam = "";
-}
-var qParam = request.getParameter("q");
-if (qParam == null) {
- qParam = "";
-}
-var oParam = request.getParameter("o");
-if (oParam == null) {
- oParam = "0";
-}
-%>
-<div class="ui-widget ui-widget-content ui-corner-all usermgmt-body" id="authorizables-body" >
- <form id="find-authorizables-form" accept-charset="UTF-8"
- action="<%=request.contextPath%><%=resource.path%>.html"
- method="get">
- <fieldset class="ui-helper-clearfix">
- <input type="hidden" value="UTF-8" name="_charset_" />
- <input type="hidden" id="searchOffset" name="o" value="<%=oParam%>" />
-
- <div id='find-authorizables-header' class="ui-widget-header ui-corner-all ui-helper-clearfix">
- <h3 class="ui-widget-header usermgmt-header"><%=title%></h3>
- <span id="find-authorizables-block">
- <input id="findAuthorizablesQuery" type="text" name="q" value="<%=qParam%>" />
- <button accesskey="s" id="findAuthorizablesBtn" type="submit"><%=rb.getString("button.search")%></button>
- </span>
- </div>
-
- <div id="find-authorizables-quick-nav" style="display:none">
- <%
- var csv = rb.getString("csv.quicksearch.items");
- var items = [];
- if (csv != null && csv.length() > 0 && !csv.equals("csv.quicksearch.items")) {
- items = csv.split(",");
- }
- for (var i = 0; i < items.length; i++) {
- var c = items[i];
- %>
- <input type="radio" id="radio<%=c%>" name="sp" value="<%=c%>" <%=c.equals(spParam) ? "checked='checked'" : "" %>/><label for="radio<%=c%>"><%=c%></label>
- <% } /*endfor*/%>
- <input type="radio" id="radioAll" name="sp" value="*" <%="*" == spParam ? "checked='checked'" : "" %>/><label id="radioAllLabel" for="radioAll"><%=rb.getString("quicksearch.label.all")%></label>
- <input type="radio" id="radioNone" name="sp" value="" <%="" == spParam ? "checked='checked'" : "" %> style="display:none;"/>
- </div>
- </fieldset>
- </form>
-
- <% sling.include(resource.path + ".searchresult.html"); %>
-</div>
-<% } /*endelse (isLoggedIn) */ %>
\ No newline at end of file
diff --git a/usermanager-ui/src/main/resources/libs/sling/userManager/html.esp b/usermanager-ui/src/main/resources/libs/sling/userManager/html.esp
deleted file mode 100644
index dcb4ce0..0000000
--- a/usermanager-ui/src/main/resources/libs/sling/userManager/html.esp
+++ /dev/null
@@ -1,39 +0,0 @@
-<%
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var isLoggedIn = request.getUserPrincipal() != null && !"anonymous".equals(request.getRemoteUser());
-if (!isLoggedIn) {
- //anonymous user can't do anything here, so don't show a page.
- response.sendError(404);
-} else {
- var rb = request.getResourceBundle("org.apache.sling.usermgr.Resources", null);
-
- //header options
- request.setAttribute("page.title", rb.getString("page.title.find.authorizables"));
-
- //page sidebar template
- request.setAttribute("sidebar.template", resource.path + ".sidebar.html");
- request.setAttribute("sidebar.template.options", "sling/usermgmt");
-
- //page body template
- request.setAttribute("body.template", resource.path + ".body.html");
- //request.setAttribute("body.template.options", "sling/userManager");
-
- //render the page using the default page template
- sling.include(resource.path + ".page.html", "sling/usermgmt");
-}
-%>
\ No newline at end of file
diff --git a/usermanager-ui/src/main/resources/libs/sling/userManager/searchresult.html.esp b/usermanager-ui/src/main/resources/libs/sling/userManager/searchresult.html.esp
deleted file mode 100644
index 69388be..0000000
--- a/usermanager-ui/src/main/resources/libs/sling/userManager/searchresult.html.esp
+++ /dev/null
@@ -1,124 +0,0 @@
-<%
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var isLoggedIn = request.getUserPrincipal() != null && !"anonymous".equals(request.getRemoteUser());
-if (!isLoggedIn) {
- //anonymous user can't do anything here, so don't show a page.
- response.sendError(404);
-} else {
-
-var rb = request.getResourceBundle("org.apache.sling.usermgr.Resources", null);
-var searchType = request.getAttribute("search.type");
-if (searchType == null) {
- searchType = 3; //all Authorizables should be searched
-}
-
-function format(key, args) {
- var value = rb.getString(key);
- return Packages.java.text.MessageFormat.format(value, args);
-}
-
-var qParam = request.getParameter("q");
-if (qParam != null && qParam.length() == 0) {
- qParam = "*"; //empty search == 'All'
-}
-
-var isPrefixQuery = false;
-var spParam = request.getParameter("sp");
-if (spParam != null && spParam.length() > 0) {
- isPrefixQuery = true;
- if (!spParam.equals("*")) {
- qParam = spParam + "*";
- }
-}
-
-var maxResults = 25; //rows per page
-var offset = 0;
-var oParam = request.getParameter("o"); //paging start row
-if (oParam != null && oParam.length() > 0) {
- offset = parseInt(oParam);
-}
-
-var searchResults = null;
-if (qParam != null) {
- var jcrSession = request.getResourceResolver().adaptTo(Packages.javax.jcr.Session);
- var userManager = Packages.org.apache.sling.jcr.base.util.AccessControlUtil.getUserManager(jcrSession);
-
- var query = new Packages.org.apache.sling.usermgr.FindPeopleQuery(searchType, qParam, isPrefixQuery, offset, maxResults);
- searchResults = userManager.findAuthorizables(query);
-}
-var readyToSearch = qParam == null;
-var noMatches = searchResults != null && !searchResults.hasNext();
-%>
-<div id="authorizables-results-body" >
-<% if (readyToSearch) { %>
- <div id="search-result-ready-to-search" class="search-empty-msg ui-corner-all ui-state-highlight"><%=rb.getString("msg.readyToSearch")%></div>
-<% } else if (noMatches) { %>
- <div id="search-result-no-matches" class="search-empty-msg ui-corner-all ui-state-highlight"><%=rb.getString("msg.noMatchesFound")%></div>
-<% } else { %>
- <table id="search-result" width="100%" class="ui-widget ui-widget-content ui-corner-all">
- <thead id="search-result-head" class="ui-widget-header">
- <tr>
- <th align="left" width="50%"><%=rb.getString("label.column.name")%></th>
- <th align="left" width="50%"><%=rb.getString("label.column.displayName")%></th>
- </tr>
- </thead>
- <tbody id="search-result-body">
- <% var count = 0;
- var resourceResolver = resource.getResourceResolver();
- while (count < maxResults && searchResults.hasNext()) {
- var a = searchResults.next();
- count++;
-
- var principalResource = resourceResolver.getResource("/system/userManager/" + (a.isGroup() ? "group/" : "user/") + a.getID());
- var valueMap = principalResource.adaptTo(Packages.org.apache.sling.api.resource.ValueMap);
- %>
- <tr <%= (count % 2 == 1) ? "" : "class='odd'" %>>
- <td><a href="<%=request.contextPath%><%=principalResource.path%>.html"><%=a.getID()%></a></td>
- <td><%=valueMap.get("displayName", "")%></td>
- </tr>
- <% } /*endwhile*/ %>
- </tbody>
- <%-- paging --%>
- <tfoot id="search-result-foot" class="ui-widget-header">
- <tr>
- <td id="search-result-paging" align="center" colspan="2">
- <form id="find-authorizables-paging-form" accept-charset="UTF-8"
- action="<%=request.contextPath%><%=resource.path%>.html"
- method="get">
- <input type="hidden" value="UTF-8" name="_charset_" />
- <input type="hidden" name="q" value="<%=qParam%>" />
- <% if (offset > maxResults) { %>
- <button id='first_page' title='<%=rb.getString("tooltip.paging.first.page") %>' type="submit" name="o" value="0"><%=rb.getString("label.paging.first.page")%></button>
- <% }
- if (offset > 1) { %>
- <button id='prev_page' title='<%=rb.getString("tooltip.paging.prev.page") %>' type="submit" name="o" value="<%=Math.max(0, offset - maxResults)%>"><%=rb.getString("label.paging.prev.page")%></button>
- <% }
- var currentPageMsg = format("paging.current.page", [offset + 1, offset + count]);
- %>
- <span id='current_page'><%=currentPageMsg%></span>
- <% if (searchResults.hasNext()) { %>
- <button id='next_page' title='<%=rb.getString("tooltip.paging.next.page") %>' type="submit" name="o" value="<%=offset + maxResults%>"><%=rb.getString("label.paging.next.page")%></button>
- <% } %>
- </form>
- </td>
- </tr>
- </tfoot>
- </table>
-<% } /*endelse*/ %>
-</div>
-<% } /*endelse (isLoggedIn) */ %>
\ No newline at end of file
diff --git a/usermanager-ui/src/main/resources/libs/sling/usermgmt/page.html.esp b/usermanager-ui/src/main/resources/libs/sling/usermgmt/page.html.esp
deleted file mode 100644
index 2b7228d..0000000
--- a/usermanager-ui/src/main/resources/libs/sling/usermgmt/page.html.esp
+++ /dev/null
@@ -1,117 +0,0 @@
-<%
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xml:lang="en" lang="en"
- xmlns="http://www.w3.org/1999/xhtml"
->
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8" />
- <%
- //allow the caller to override the title by
- // specifying request attributes.
- var title = request.getAttribute("page.title");
- if (title == null) {
- title = resource.path;
- }
-
- var userDisplayName = null;
- if (request.getUserPrincipal() != null && !"anonymous".equals(request.getRemoteUser())) {
- var userResource = request.getResourceResolver().getResource("/system/userManager/user/" + request.getRemoteUser());
- var valueMap = userResource.adaptTo(Packages.org.apache.sling.api.resource.ValueMap);
- userDisplayName = valueMap.get("displayName", request.getRemoteUser());
- }
-
- var currentPage = request.contextPath + resource.path + ".html";
- var logoutTarget = request.getAttribute("logout.target");
- if (logoutTarget == null) {
- logoutTarget = currentPage;
- }
- var rb = request.getResourceBundle("org.apache.sling.usermgr.Resources", null);
- %>
- <title><%= Packages.java.text.MessageFormat.format(rb.getString("page.template.title"), title) %></title>
-
- <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/themes/cupertino/jquery-ui.css" type="text/css"/>
- <link rel="stylesheet" href="<%= request.getContextPath() %>/css/usermanager/usermanager.min.css" type="text/css"/>
-</head>
-<%
-//flush the buffer early so the browser can start start fetching the stylesheets and scripts in parallel
-// while the rest of the page is being rendered below.
-response.flushBuffer();
-%>
-<body>
- <div id="menu_login" class="ui-widget ui-widget-content ui-corner-all">
- <% if (userDisplayName != null) { %>
- <strong id="menu_username"><%=userDisplayName%></strong> | <a href="<%=request.contextPath%>/system/sling/logout?resource=<%=logoutTarget%>" id="do_logout"><%=rb.getString("link.logout")%></a>
- <% } else { %>
- <a href="<%=request.contextPath%>/system/sling/selector/login?resource=<%=currentPage%>" id="do_login"><%=rb.getString("link.login")%></a>
- <% } %>
- </div>
-
- <div class="title">
- <div class="logo">
- <a href="http://sling.apache.org">
- <img alt='<%=rb.getString("logo.alt")%>' src="<%=request.getContextPath()%>/images/sling-logo.png"/>
- </a>
- </div>
- </div>
-
- <div class="menu">
- <%
- var template = request.getAttribute("sidebar.template");
- if (template != null) {
- var options = request.getAttribute("sidebar.template.options");
- if (options == null) {
- sling.include(template);
- } else {
- sling.include(template, options);
- }
- }
- %>
- </div>
-
- <div id="content" class="main">
- <noscript>
- <div class="ui-widget" style="margin-bottom: 10px;">
- <div style="padding: 0pt 0.7em;" class="ui-state-error ui-corner-all">
- <p><span style="float: left; margin-right: 0.3em;" class="ui-icon ui-icon-alert"></span>
- <%=rb.getString("msg.noscript")%></p>
- </div>
- </div>
- </noscript>
-
- <%
- var template = request.getAttribute("body.template");
- if (template != null) {
- var options = request.getAttribute("body.template.options");
- if (options == null) {
- sling.include(template);
- } else {
- sling.include(template, options);
- }
- }
- %>
- </div>
-
- <%-- scripts moved to the bottom to help the page load faster --%>
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.min.js"></script>
- <script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.8/jquery.validate.min.js"></script>
- <script type="text/javascript" src="<%= request.getContextPath() %>/js/usermanager/usermanager.min.js"></script>
- <script type="text/javascript">UserManager.contextPath = "<%=request.contextPath%>";</script>
-</body>
-</html>
\ No newline at end of file
diff --git a/usermanager-ui/src/main/resources/libs/sling/usermgmt/sidebar.html.esp b/usermanager-ui/src/main/resources/libs/sling/usermgmt/sidebar.html.esp
deleted file mode 100644
index 220c72f..0000000
--- a/usermanager-ui/src/main/resources/libs/sling/usermgmt/sidebar.html.esp
+++ /dev/null
@@ -1,60 +0,0 @@
-<%
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var privilegesInfo = sling.getService(Packages.org.apache.sling.jackrabbit.usermanager.AuthorizablePrivilegesInfo);
-var rb = request.getResourceBundle("org.apache.sling.usermgr.Resources", null);
-%>
-<ul id="sidebar-nav" class="ui-corner-br">
- <li>
- <a href="<%=request.contextPath%>/system/userManager.html"><%=rb.getString("menu.link.authorizables")%></a>
- </li>
- <li>
- <a style="margin-left: 15px;" href="<%=request.contextPath%>/system/userManager/user.html"><%=rb.getString("menu.link.users")%></a>
- </li>
- <li>
- <a style="margin-left: 15px;" href="<%=request.contextPath%>/system/userManager/group.html"><%=rb.getString("menu.link.groups")%></a>
- </li>
- <li> </li>
- <% if (privilegesInfo.canAddUser(currentSession)) { %>
- <li>
- <a href="<%=request.contextPath%>/system/userManager/user.create.html"><%=rb.getString("menu.link.createUser")%></a>
- </li>
- <% } %>
- <% if (privilegesInfo.canAddGroup(currentSession)) { %>
- <li>
- <a href="<%=request.contextPath%>/system/userManager/group.create.html"><%=rb.getString("menu.link.createGroup")%></a>
- </li>
- <% } %>
- <%
- var res = request.getResourceResolver().resolve(resource.path);
- var authorizable = resource.adaptTo(Packages.org.apache.jackrabbit.api.security.user.Authorizable);
- var canEdit = false;
- if (authorizable) {
- canEdit = privilegesInfo.canUpdateProperties(currentSession, authorizable.getID());
- }
- if (res.resourceType == "sling/user") { %>
- <li>
- <a href="<%=request.contextPath%><%=resource.path%>.html"><%=rb.getString(canEdit ? "menu.link.updateUser" : "menu.link.viewUser")%></a>
- </li>
- <% } %>
- <% if (res.resourceType == "sling/group") { %>
- <li>
- <a href="<%=request.contextPath%><%=resource.path%>.html"><%=rb.getString(canEdit ? "menu.link.updateGroup" : "menu.link.viewGroup")%></a>
- </li>
- <% } %>
-</ul>
\ No newline at end of file
diff --git a/usermanager-ui/src/main/resources/libs/sling/users/body.html.esp b/usermanager-ui/src/main/resources/libs/sling/users/body.html.esp
deleted file mode 100644
index 799f00b..0000000
--- a/usermanager-ui/src/main/resources/libs/sling/users/body.html.esp
+++ /dev/null
@@ -1,36 +0,0 @@
-<%
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var isLoggedIn = request.getUserPrincipal() != null && !"anonymous".equals(request.getRemoteUser());
-if (!isLoggedIn) {
- //anonymous user can't do anything here, so don't show a page.
- response.sendError(404);
-} else {
-
-var rb = request.getResourceBundle("org.apache.sling.usermgr.Resources", null);
-
-var searchType = 1; //search only users
-request.setAttribute("search.type", searchType);
-
-var title = rb.getString("page.title.find.users");
-request.setAttribute("page.title", title);
-
-//delegate the 'authorizables' script to render the page
-sling.include(resource.path + ".body.html", "sling/userManager");
-
-} /* endelse */
-%>
\ No newline at end of file
diff --git a/usermanager-ui/src/main/resources/libs/sling/users/create.html.esp b/usermanager-ui/src/main/resources/libs/sling/users/create.html.esp
deleted file mode 100644
index 9307c5f..0000000
--- a/usermanager-ui/src/main/resources/libs/sling/users/create.html.esp
+++ /dev/null
@@ -1,40 +0,0 @@
-<%
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var privilegesInfo = sling.getService(Packages.org.apache.sling.jackrabbit.usermanager.AuthorizablePrivilegesInfo);
-if (!privilegesInfo.canAddUser(currentSession)) {
- //user can't create users.
- response.sendError(403);
-} else {
- var rb = request.getResourceBundle("org.apache.sling.usermgr.Resources", null);
-
- //header options
- request.setAttribute("page.title", rb.getString("page.title.create.user"));
-
- //page sidebar template
- request.setAttribute("sidebar.template", resource.path + ".sidebar.html");
- request.setAttribute("sidebar.template.options", "sling/usermgmt");
-
- //page body template
- request.setAttribute("body.template", resource.path + ".create_body.html");
- request.setAttribute("body.template.options", null);
-
- //render the page using the default page template
- sling.include(resource.path + ".page.html", "sling/usermgmt");
-}
-%>
\ No newline at end of file
diff --git a/usermanager-ui/src/main/resources/libs/sling/users/create_body.html.esp b/usermanager-ui/src/main/resources/libs/sling/users/create_body.html.esp
deleted file mode 100644
index 9c99768..0000000
--- a/usermanager-ui/src/main/resources/libs/sling/users/create_body.html.esp
+++ /dev/null
@@ -1,77 +0,0 @@
-<%
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var privilegesInfo = sling.getService(Packages.org.apache.sling.jackrabbit.usermanager.AuthorizablePrivilegesInfo);
-if (!privilegesInfo.canAddUser(currentSession)) {
- //user can't create users.
- response.sendError(403);
-} else {
- var rb = request.getResourceBundle("org.apache.sling.usermgr.Resources", null);
-%>
-<div class="ui-widget ui-widget-content ui-corner-all usermgmt-body" id="create-user-body" >
- <h3 class="ui-widget-header ui-corner-all usermgmt-header"><%=rb.getString("page.title.create.user")%></h3>
-
- <div class="info-msg-block" style="display:none;">
- <div class="ui-state-highlight ui-corner-all">
- <p>
- <span class="ui-icon ui-icon-info"></span>
- <span class="info-msg-text"></span>
- </p>
- </div>
- </div>
-
- <form id="create-user-form" accept-charset="UTF-8"
- action="<%=request.contextPath%>/system/userManager/user.create.html"
- method="post">
- <fieldset>
- <input type="hidden" value="UTF-8" name="_charset_" />
- <input id="redirect" type="hidden" name=":redirect" value="<%=request.contextPath%>" />
-
- <div class="prop-line ui-helper-clearfix">
- <label for="userId" accesskey="u"><%=rb.getString("prop.label.userid")%>:</label>
- <input id="userId" type="text" name=":name" />
- </div>
-
- <div class="prop-line ui-helper-clearfix">
- <label for="displayName" accesskey="e"><%=rb.getString("prop.label.displayName")%>:</label>
- <input id="displayName" type="text" name="displayName" />
- </div>
-
- <div class="prop-line ui-helper-clearfix">
- <label for="email" accesskey="e"><%=rb.getString("prop.label.email")%>:</label>
- <input id="email" type="text" name="email" />
- </div>
-
- <div class="prop-line ui-helper-clearfix">
- <label for="pwd" accesskey="p"><%=rb.getString("prop.label.pwd")%>:</label>
- <input id="pwd" type="password" name="pwd" />
- </div>
-
- <div class="prop-line ui-helper-clearfix">
- <label for="pwdConfirm" accesskey="c"><%=rb.getString("prop.label.pwdConfirm")%>:</label>
- <input id="pwdConfirm" type="password" name="pwdConfirm" />
- </div>
-
- <div class="ui-helper-clearfix">
- <label> </label>
- <button accesskey="r" id="createUserBtn" type="submit"><%=rb.getString("button.create")%></button>
- </div>
- </fieldset>
- </form>
-</div>
-<% } /*endif (canAddUser) */ %>
\ No newline at end of file
diff --git a/usermanager-ui/src/main/resources/libs/sling/users/html.esp b/usermanager-ui/src/main/resources/libs/sling/users/html.esp
deleted file mode 100644
index 6ed252c..0000000
--- a/usermanager-ui/src/main/resources/libs/sling/users/html.esp
+++ /dev/null
@@ -1,41 +0,0 @@
-<%
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var isLoggedIn = request.getUserPrincipal() != null && !"anonymous".equals(request.getRemoteUser());
-if (!isLoggedIn) {
- //anonymous user can't do anything here, so don't show a page.
- response.sendError(404);
-} else {
-
-var rb = request.getResourceBundle("org.apache.sling.usermgr.Resources", null);
-
-//header options
-request.setAttribute("page.title", rb.getString("page.title.find.users"));
-
-//page sidebar template
-request.setAttribute("sidebar.template", resource.path + ".sidebar.html");
-request.setAttribute("sidebar.template.options", "sling/usermgmt");
-
-//page body template
-request.setAttribute("body.template", resource.path + ".body.html");
-//request.setAttribute("body.template.options", "sling/users");
-
-//render the page using the default page template
-sling.include(resource.path + ".page.html", "sling/usermgmt");
-
-} /* endelse */
-%>
\ No newline at end of file
diff --git a/usermanager-ui/src/main/resources/libs/sling/users/searchresult.html.esp b/usermanager-ui/src/main/resources/libs/sling/users/searchresult.html.esp
deleted file mode 100644
index 9ed2bad..0000000
--- a/usermanager-ui/src/main/resources/libs/sling/users/searchresult.html.esp
+++ /dev/null
@@ -1,31 +0,0 @@
-<%
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var isLoggedIn = request.getUserPrincipal() != null && !"anonymous".equals(request.getRemoteUser());
-if (!isLoggedIn) {
- //anonymous user can't do anything here, so don't show a page.
- response.sendError(404);
-} else {
-
-var searchType = 1; //search only users
-request.setAttribute("search.type", searchType);
-
-//delegate the 'authorizables' script to render the page
-sling.include(resource.path + ".searchresult.html", "sling/userManager");
-
-} /* endelse */
-%>
\ No newline at end of file