Code

Updated password field handling
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 29 Apr 2010 08:10:21 +0000 (08:10 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 29 Apr 2010 08:10:21 +0000 (08:10 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17922 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/ihtml/themes/default/login.tpl
gosa-core/include/smarty/plugins/function.factory.php
gosa-core/plugins/personal/generic/password.tpl [deleted file]
gosa-core/plugins/personal/myaccount/password.tpl [new file with mode: 0644]

index 795dd6d9fae5a5ea9cf239301270bb9ae25eb89f..049d835015d6b7776a081402d26e99482e675ede 100644 (file)
@@ -46,7 +46,7 @@
        <div class='login-element-container'>
         <div class='login-label'><label for='password'>{t}Password{/t}</label></div>
         <div class='login-input'>
-         {factory type='password' name='password' id='password' maxlength='40' onfocus="nextfield= 'login'"}
+         {factory type='password' name='password' id='password' onfocus="nextfield= 'login'"}
         </div>
         <div class="clear"></div>
        </div>
index 7156feb926ac07694a2e49c8f21d30ae2d07d359..42640241fadbb73a4c02c620cc95642f6786f1b2 100644 (file)
@@ -15,14 +15,17 @@ function smarty_function_factory($params, &$smarty)
     switch($type){
 
         // Generate a password input field, with CapsLock detection.
-        case 'password' : 
+        case 'password' :
+
+            // Maxlength has a default of 40 characters
+            $maxlengthReady = (empty($maxlength))?'maxlength="40"': $maxlengthReady; 
             $str .= "<input {$nameReady} {$idReady} {$valueReady} {$maxlengthReady}
             {$titleReady} {$onfocusReady} type='password'
             onkeypress=\"
                 if (capslock(event)){
-                    $('password').style.backgroundImage = 'url(images/caps.png)'
+                    $('{$id}').style.backgroundImage = 'url(images/caps.png)'
                 } else {
-                    $('password').style.backgroundImage= ''
+                    $('{$id}').style.backgroundImage= ''
                 }\">";
     }
     return($str);
diff --git a/gosa-core/plugins/personal/generic/password.tpl b/gosa-core/plugins/personal/generic/password.tpl
deleted file mode 100644 (file)
index 7ec4396..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-<p>
- {t}You have changed the method your password is stored in the ldap database. For that reason you've to enter your password at this point again. GOsa will then encode it with the selected method.{/t}
-</p>
-
-<table summary="{t}Password change dialog{/t}" cellpadding=4 border=0>
-  <tr>
-    <td><b><LABEL for="new_password">{t}New password{/t}</LABEL></b></td>
-    <td><input id="new_password" type="password" name="new_password" size="30" maxlength="40" onFocus="nextfield= 'repeated_password';"></td>
-  </tr>
-  <tr>
-    <td><b><LABEL for="repeated_password">{t}Repeat new password{/t}</LABEL></b></td>
-    <td><input id="repeated_password" type="password" name="repeated_password" size="30" maxlength="40" onFocus="nextfiled= 'password_finish'"></td>
-  </tr>
-</table>
-<br>
-
-<hr>
-<div class="plugin-actions">
-  <button type='submit' name='password_finish'>{t}Set password{/t}</button>
-  <button type='submit' name='password_cancel'>{msgPool type=cancelButton}</button>
-</div>
-
-<!-- Place cursor -->
-<script language="JavaScript" type="text/javascript">
-  <!-- // First input field on page
-       nextfield= "new_password";
-       focus_field('new_password');
-  -->
-</script>
diff --git a/gosa-core/plugins/personal/myaccount/password.tpl b/gosa-core/plugins/personal/myaccount/password.tpl
new file mode 100644 (file)
index 0000000..253e513
--- /dev/null
@@ -0,0 +1,32 @@
+<p>
+ {t}You have changed the method your password is stored in the ldap database. For that reason you've to enter your password at this point again. GOsa will then encode it with the selected method.{/t}
+</p>
+
+<table summary="{t}Password change dialog{/t}" cellpadding=4 border=0>
+  <tr>
+    <td><b><LABEL for="new_password">{t}New password{/t}</LABEL></b></td>
+    <td>
+        {factory type='password' id='new_password' name='new_password' onfocus="nextfield='repeated_password'"}
+  </tr>
+  <tr>
+    <td><b><LABEL for="repeated_password">{t}Repeat new password{/t}</LABEL></b></td>
+    <td>
+        {factory type='password' id='repeated_password' name='repeated_password' onfocus="nextfield='password_finish'"}
+    </td>
+  </tr>
+</table>
+<br>
+
+<hr>
+<div class="plugin-actions">
+  <button type='submit' id='password_finish'name='password_finish'>{t}Set password{/t}</button>
+  <button type='submit' id='password_cancel'name='password_cancel'>{msgPool type=cancelButton}</button>
+</div>
+
+<!-- Place cursor -->
+<script language="JavaScript" type="text/javascript">
+  <!-- // First input field on page
+       nextfield= "new_password";
+       focus_field('new_password');
+  -->
+</script>