Commit 320bdce4 authored by Andrew Robert Nicols's avatar Andrew Robert Nicols Committed by Richard Mansfield
Browse files

institution admin page was throwing errors when changing the 'mahara' institution



An attempt was made to set the 'expiry' field for No Institution (mahara).
Moved the setter into an existing check for $institution != 'mahara' to fix
this.
Signed-off-by: default avatarAndrew Robert Nicols <andrew.nicols@luns.net.uk>
parent e5c96d75
......@@ -400,7 +400,6 @@ function institution_submit(Pieform $form, $values) {
}
$newinstitution->displayname = $values['displayname'];
$newinstitution->expiry = db_format_timestamp($values['expiry']);
$newinstitution->authplugin = empty($values['authplugin']) ? null : $values['authplugin'];
if (get_config('usersuniquebyusername')) {
// Registering absolutely not allowed when this setting is on, it's a
......@@ -413,6 +412,7 @@ function institution_submit(Pieform $form, $values) {
}
$newinstitution->theme = (empty($values['theme']) || $values['theme'] == 'sitedefault') ? null : $values['theme'];
if ($institution != 'mahara') {
$newinstitution->expiry = db_format_timestamp($values['expiry']);
$newinstitution->defaultmembershipperiod = ($values['defaultmembershipperiod']) ? intval($values['defaultmembershipperiod']) : null;
if ($USER->get('admin')) {
$newinstitution->maxuseraccounts = ($values['maxuseraccounts']) ? intval($values['maxuseraccounts']) : null;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment