Author: simoneg
Date: Wed Apr 14 22:05:36 2010
New Revision: 934215
URL: http://svn.apache.org/viewvc?rev=934215&view=rev
Log:
Modify passwords from admin
Added:
labs/magma/trunk/fragment-user-web/src/main/resources/org/apache/magma/web/user/passwordMismatch.vm
Modified:
labs/magma/trunk/fragment-user-web/src/main/java/org/apache/magma/web/user/UserCrud.java
Modified:
labs/magma/trunk/fragment-user-web/src/main/java/org/apache/magma/web/user/UserCrud.java
URL:
http://svn.apache.org/viewvc/labs/magma/trunk/fragment-user-web/src/main/java/org/apache/magma/web/user/UserCrud.java?rev=934215&r1=934214&r2=934215&view=diff
==============================================================================
---
labs/magma/trunk/fragment-user-web/src/main/java/org/apache/magma/web/user/UserCrud.java
(original)
+++
labs/magma/trunk/fragment-user-web/src/main/java/org/apache/magma/web/user/UserCrud.java
Wed Apr 14 22:05:36 2010
@@ -20,6 +20,7 @@ import org.apache.magma.view.MagDefaultL
import org.apache.magma.website.HtmlProducer;
import org.apache.magma.website.admin.CompleteCrudHandler;
import org.apache.magma.website.beansview.SmartForm;
+import org.apache.magma.website.producers.TemplatingProducer;
import org.apache.magma.domain.user.User;
public class UserCrud extends CompleteCrudHandler<User> {
@@ -34,5 +35,16 @@ public class UserCrud extends CompleteCr
super.editLayers = new String[] { MagDefaultLayers.ALL };
return super.handleNew();
}
+
+ public SmartForm handleChangePassword(User u) {
+ return new SmartForm(u,
"hiddenChangePassword").setLayers(User.LAYER_SECRET);
+ }
+
+ public HtmlProducer hiddenChangePassword(User u) {
+ if (!u.getPassword().equals(u.getConfirmPassword())) {
+ return new TemplatingProducer("passwordMismatch");
+ }
+ return doShow(u);
+ }
}
Added:
labs/magma/trunk/fragment-user-web/src/main/resources/org/apache/magma/web/user/passwordMismatch.vm
URL:
http://svn.apache.org/viewvc/labs/magma/trunk/fragment-user-web/src/main/resources/org/apache/magma/web/user/passwordMismatch.vm?rev=934215&view=auto
==============================================================================
---
labs/magma/trunk/fragment-user-web/src/main/resources/org/apache/magma/web/user/passwordMismatch.vm
(added)
+++
labs/magma/trunk/fragment-user-web/src/main/resources/org/apache/magma/web/user/passwordMismatch.vm
Wed Apr 14 22:05:36 2010
@@ -0,0 +1,20 @@
+## 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.
+<h1 >
+ $i18n.tr("Passwords does not match")
+</h1>
+ <p >
+ $i18n.tr("The passwords you entered does not match one with the
other, please try again.")
+ </p>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]