Code

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

gosa-core/include/smarty/plugins/function.factory.php
gosa-core/plugins/admin/users/password.tpl
gosa-core/plugins/personal/password/password.tpl

index 42640241fadbb73a4c02c620cc95642f6786f1b2..7de9c138a442aa97a213ce09517e19fe3c2054ba 100644 (file)
@@ -5,7 +5,7 @@ function smarty_function_factory($params, &$smarty)
 
     // Capture params
     foreach(array('type','id','name','title','value','maxlength',
-                'onfocus','onclick') as $var){
+                'onfocus','onclick','onkeyup') as $var){
         $$var = (isset($params[$var]))? $params[$var] : "";
         $tmp  = "{$var}Ready";
         $$tmp = (isset($params[$var]))? "{$var}=\"{$params[$var]}\"" : "";
@@ -20,10 +20,10 @@ function smarty_function_factory($params, &$smarty)
             // Maxlength has a default of 40 characters
             $maxlengthReady = (empty($maxlength))?'maxlength="40"': $maxlengthReady; 
             $str .= "<input {$nameReady} {$idReady} {$valueReady} {$maxlengthReady}
-            {$titleReady} {$onfocusReady} type='password'
+            {$titleReady} {$onfocusReady} {$onkeyupReady} type='password'
             onkeypress=\"
                 if (capslock(event)){
-                    $('{$id}').style.backgroundImage = 'url(images/caps.png)'
+                    $('{$id}').style.backgroundImage='url(images/caps.png)'
                 } else {
                     $('{$id}').style.backgroundImage= ''
                 }\">";
index 2186bfc3aebe1fed79878356218c2faf6b7fb6c6..0a36fbc1d88944cca50461b320b33befb3e37daa 100644 (file)
 <table summary="{t}Password input dialog{/t}" cellpadding=4 border=0>
   <tr>
     <td><b><LABEL for="new_password">{t}New password{/t}</LABEL></b></td>
-    <td><input type="password" id="new_password" name="new_password" size="30" maxlength="40" onFocus="nextfield= 'repeated_password';" onkeyup="testPasswordCss(document.getElementById('new_password').value);"></td>
+    <td>
+        {factory type='password' id='new_password' name='new_password' 
+            onfocus="nextfield='repeated_password';" onkeyup="testPasswordCss(\$('new_password').value);"}
+    </td>
   </tr>
   <tr>
     <td><b><LABEL for="repeated_password">{t}Repeat new password{/t}</LABEL></b></td>
-    <td><input type="password" id="repeated_password" name="repeated_password" size="30" maxlength="40" onFocus="nextfiled= 'password_finish'"></td>
+    <td>
+        {factory type='password' id='repeated_password' name='repeated_password'
+            onfocus="nextfield='password_finish';"}
+    </td>
   </tr>
   <tr>
     <td><b>{t}Strength{/t}</b></td>
 
 <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>
-
+  <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>
 
 <input type='hidden' id='formSubmit'>
index 61562fe6910d1145a7ddac65371aafe0f5402f45..f83beca189c30b6f544eafdf97232d12674da1d4 100644 (file)
 <table cellpadding=4 border=0 summary="{t}Password change dialog{/t}">
   <tr>
     <td><b><LABEL for="current_password">{t}Current password{/t}</LABEL></b></td>
-    <td><input id="current_password" type="password" name="current_password" size="30" maxlength="40"
-               onFocus="nextfield= 'new_password';"></td>
+    <td>
+        {factory type='password' name='current_password' id='current_password' onfocus="nextfield= 'new_password';"}
+    </td>
   </tr>
   <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';" onkeyup="testPasswordCss(document.getElementById('new_password').value);"></td>
+    <td>
+        {factory type='password' name='new_password' id='new_password' onkeyup="testPasswordCss(\$('new_password').value)"}
+    </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="nextfield= 'password_finish';"></td>
+    <td>
+        {factory type='password' name='repeated_password' id='repeated_password' onfocus="nextfield= 'password_finish';"}
+    </td>
   </tr>
   <tr>
     <td><b>{t}Password strength{/t}</b></td>