diff options
author | Rob Crittenden <rcritten@redhat.com> | 2007-11-13 15:36:52 -0500 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2007-11-13 15:36:52 -0500 |
commit | bd78fe06877e80b19bd0358f525bed73efe17004 (patch) | |
tree | 9acd28eb5f3619d65a9eb453a0499f55556dd363 /ipa-server | |
parent | 83dd26c6e351c020ddde21bba310b8076360f890 (diff) | |
download | freeipa-bd78fe06877e80b19bd0358f525bed73efe17004.tar.gz freeipa-bd78fe06877e80b19bd0358f525bed73efe17004.tar.xz freeipa-bd78fe06877e80b19bd0358f525bed73efe17004.zip |
Add more fields to the IPA Policy form
Diffstat (limited to 'ipa-server')
4 files changed, 68 insertions, 1 deletions
diff --git a/ipa-server/ipa-gui/ipagui/forms/ipapolicy.py b/ipa-server/ipa-gui/ipagui/forms/ipapolicy.py index 63eebbe9e..660a34b68 100644 --- a/ipa-server/ipa-gui/ipagui/forms/ipapolicy.py +++ b/ipa-server/ipa-gui/ipagui/forms/ipapolicy.py @@ -2,14 +2,20 @@ import turbogears from turbogears import validators, widgets class IPAPolicyFields(): - searchlimit = widgets.TextField(name="searchlimit", label="Search Time Limit", attrs=dict(size=6,maxlength=6)) + searchlimit = widgets.TextField(name="searchlimit", label="Search Time Limit (sec.)", attrs=dict(size=6,maxlength=6)) maxuidlength = widgets.TextField(name="maxuidlength", label="Max. UID Length", attrs=dict(size=3,maxlength=3)) passwordnotif = widgets.TextField(name="passwordnotif", label="Password Expiration Notification (days)", attrs=dict(size=3,maxlength=3)) + homedir = widgets.TextField(name="homedir", label="Root for Home Directories") + defaultshell = widgets.TextField(name="defaultshell", label="Default shell") + defaultgroup = widgets.TextField(name="defaultgroup", label="Default Users group") class IPAPolicyValidator(validators.Schema): searchlimit = validators.Number(not_empty=True) maxuidlength = validators.Number(not_empty=True) passwordnotif = validators.Number(not_empty=True) + homedir = validators.String(not_empty=True) + defaultshell = validators.String(not_empty=True) + defaultgroup = validators.String(not_empty=True) class IPAPolicyForm(widgets.Form): params = ['ipapolicy_fields'] diff --git a/ipa-server/ipa-gui/ipagui/subcontrollers/ipapolicy.py b/ipa-server/ipa-gui/ipagui/subcontrollers/ipapolicy.py index bbef94582..a1c1a9f03 100644 --- a/ipa-server/ipa-gui/ipagui/subcontrollers/ipapolicy.py +++ b/ipa-server/ipa-gui/ipagui/subcontrollers/ipapolicy.py @@ -39,6 +39,9 @@ class IPAPolicyController(IPAController): ipapolicy['searchlimit'] = 2 ipapolicy['maxuidlength'] = 3 ipapolicy['passwordnotif'] = 4 + ipapolicy['homedir'] = "/home" + ipapolicy['defaultgroup'] = "ipausers" + ipapolicy['defaultshell'] = "/bin/bash" return dict(ipapolicy=ipapolicy,fields=ipagui.forms.ipapolicy.IPAPolicyFields()) @expose("ipagui.templates.ipapolicyedit") @@ -55,6 +58,9 @@ class IPAPolicyController(IPAController): ipapolicy_dict['searchlimit'] = 2 ipapolicy_dict['maxuidlength'] = 3 ipapolicy_dict['passwordnotif'] = 4 + ipapolicy_dict['homedir'] = "/home" + ipapolicy_dict['defaultgroup'] = "ipausers" + ipapolicy_dict['defaultshell'] = "/bin/bash" return dict(form=ipapolicy_edit_form, ipapolicy=ipapolicy_dict) except ipaerror.IPAError, e: turbogears.flash("IPA Policy edit failed: " + str(e) + "<br/>" + str(e.detail)) diff --git a/ipa-server/ipa-gui/ipagui/templates/ipapolicyeditform.kid b/ipa-server/ipa-gui/ipagui/templates/ipapolicyeditform.kid index 2ba5e123b..bcdef8c27 100644 --- a/ipa-server/ipa-gui/ipagui/templates/ipapolicyeditform.kid +++ b/ipa-server/ipa-gui/ipagui/templates/ipapolicyeditform.kid @@ -46,6 +46,10 @@ from ipagui.helpers import ipahelper py:content="tg.errors.get('passwordnotif')" /> </td> </tr> + </table> + + <h2 class="formsection">Password Policy</h2> + <table class="formtable" cellpadding="2" cellspacing="0" border="0"> <tr> <th> <label class="fieldlabel" py:content="ipapolicy_fields.maxuidlength.label" />: @@ -56,6 +60,36 @@ from ipagui.helpers import ipahelper py:content="tg.errors.get('maxuidlength')" /> </td> </tr> + <tr> + <th> + <label class="fieldlabel" py:content="ipapolicy_fields.homedir.label" />: + </th> + <td> + <span py:replace="ipapolicy_fields.homedir.display(value_for(ipapolicy_fields.homedir))" /> + <span py:if="tg.errors.get('homedir')" class="fielderror" + py:content="tg.errors.get('homedir')" /> + </td> + </tr> + <tr> + <th> + <label class="fieldlabel" py:content="ipapolicy_fields.defaultshell.label" />: + </th> + <td> + <span py:replace="ipapolicy_fields.defaultshell.display(value_for(ipapolicy_fields.defaultshell))" /> + <span py:if="tg.errors.get('defaultshell')" class="fielderror" + py:content="tg.errors.get('defaultshell')" /> + </td> + </tr> + <tr> + <th> + <label class="fieldlabel" py:content="ipapolicy_fields.defaultgroup.label" />: + </th> + <td> + <span py:replace="ipapolicy_fields.defaultgroup.display(value_for(ipapolicy_fields.defaultgroup))" /> + <span py:if="tg.errors.get('defaultgroup')" class="fielderror" + py:content="tg.errors.get('defaultgroup')" /> + </td> + </tr> </table> </form> diff --git a/ipa-server/ipa-gui/ipagui/templates/ipapolicyshow.kid b/ipa-server/ipa-gui/ipagui/templates/ipapolicyshow.kid index f47dfc27f..e14485f2a 100644 --- a/ipa-server/ipa-gui/ipagui/templates/ipapolicyshow.kid +++ b/ipa-server/ipa-gui/ipagui/templates/ipapolicyshow.kid @@ -34,12 +34,33 @@ edit_url = tg.url('/ipapolicy/edit') </th> <td>${ipapolicy.get("passwordnotif")}</td> </tr> + </table> + <h2 class="formsection">User Settings</h2> + <table class="formtable" cellpadding="2" cellspacing="0" border="0"> <tr> <th> <label class="fieldlabel" py:content="fields.maxuidlength.label" />: </th> <td>${ipapolicy.get("maxuidlength")}</td> </tr> + <tr> + <th> + <label class="fieldlabel" py:content="fields.homedir.label" />: + </th> + <td>${ipapolicy.get("homedir")}</td> + </tr> + <tr> + <th> + <label class="fieldlabel" py:content="fields.defaultshell.label" />: + </th> + <td>${ipapolicy.get("defaultshell")}</td> + </tr> + <tr> + <th> + <label class="fieldlabel" py:content="fields.defaultgroup.label" />: + </th> + <td>${ipapolicy.get("defaultgroup")}</td> + </tr> </table> <hr /> <input class="submitbutton" type="button" |