summaryrefslogtreecommitdiffstats
path: root/ipa-server/ipa-gui/ipagui/templates/usereditform.kid
diff options
context:
space:
mode:
authorKevin McCarthy <kmccarth@redhat.com>2007-08-14 09:40:13 -0700
committerKevin McCarthy <kmccarth@redhat.com>2007-08-14 09:40:13 -0700
commit2ef4792fd12efc84237e005add0ed0081425d599 (patch)
treec15c5c4c6dc107ff0e5c373ea2a5cfef549bfea0 /ipa-server/ipa-gui/ipagui/templates/usereditform.kid
parent10cbfe87876f536a51f3420945429cd82b7716b6 (diff)
downloadfreeipa-2ef4792fd12efc84237e005add0ed0081425d599.tar.gz
freeipa-2ef4792fd12efc84237e005add0ed0081425d599.tar.xz
freeipa-2ef4792fd12efc84237e005add0ed0081425d599.zip
- Add password generator method to controller.
This uses the random.SystemRandom() method to generate an 8-digit alphanumeric password. - Add ajax call to usernew and useredit forms to generate a new password - Add the prototype javascript library: http://www.prototypejs.org/ prototype is distributed with the MIT license. - Add a checkbox to toggle editing (and displaying) the password. - Change usershow template to use same field labels as the edit and new forms.
Diffstat (limited to 'ipa-server/ipa-gui/ipagui/templates/usereditform.kid')
-rw-r--r--ipa-server/ipa-gui/ipagui/templates/usereditform.kid41
1 files changed, 37 insertions, 4 deletions
diff --git a/ipa-server/ipa-gui/ipagui/templates/usereditform.kid b/ipa-server/ipa-gui/ipagui/templates/usereditform.kid
index 499f7ab42..02497d852 100644
--- a/ipa-server/ipa-gui/ipagui/templates/usereditform.kid
+++ b/ipa-server/ipa-gui/ipagui/templates/usereditform.kid
@@ -19,17 +19,50 @@
</td>
</tr>
-<!-- <tr>
- <th>
+ <tr>
+ <th valign="top">
<label class="fieldlabel" for="${user.userPassword.field_id}"
py:content="user.userPassword.label" />
</th>
- <td>
+ <td valign="top">
<span py:replace="user.userPassword.display(value_for(user.userPassword))" />
<span py:if="tg.errors.get('userPassword')" class="fielderror"
py:content="tg.errors.get('userPassword')" />
+ <span id="password_text">********</span>
+
+ <input id="genpassword_button" type="button" value="Generate Password"
+ disabled="true"
+ onclick="new Ajax.Request('${tg.url('/generate_password')}',
+ {
+ method: 'get',
+ onSuccess: function(transport) {
+ document.getElementById('form_userPassword').value =
+ transport.responseText;
+ }
+ });" />
+ <br />
+ <input type="checkbox"
+ onclick="togglePassword(this);"><span class="small">edit</span></input>
+ <script type="text/javascript">
+ document.getElementById('form_userPassword').style.display='none';
+
+ function togglePassword(checkbox) {
+ passwordField = document.getElementById('form_userPassword');
+ passwordText = document.getElementById('password_text');
+ passwordButton = document.getElementById('genpassword_button');
+ if (checkbox.checked) {
+ passwordField.style.display='inline';
+ passwordText.style.display='none';
+ passwordButton.disabled=false;
+ } else {
+ passwordField.style.display='none';
+ passwordText.style.display='inline';
+ passwordButton.disabled=true;
+ }
+ }
+ </script>
</td>
- </tr> -->
+ </tr>
<tr>
<th>