Commit a114af4c authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Hide institution authplugin dropdown for institutional admins; print warning...

Hide institution authplugin dropdown for institutional admins; print warning when no auth plugin is configured
parent d9f4b926
......@@ -196,7 +196,10 @@ if ($institution || $add) {
),
'help' => true,
),
'authplugin' => array(
);
if ($USER->get('admin')) {
$elements['authplugin'] = array(
'type' => 'authlist',
'title' => get_string('authplugin', 'admin'),
'options' => $authinstances,
......@@ -206,14 +209,24 @@ if ($institution || $add) {
'institution' => $institution,
'help' => true,
'ignore' => count($authtypes) == 0 || $institution == ''
),
'registerallowed' => array(
'type' => 'checkbox',
'title' => get_string('registrationallowed', 'admin'),
'description' => get_string('registrationalloweddescription', 'admin'),
'defaultvalue' => $data->registerallowed,
'help' => true,
),
);
}
if (!$add && empty($inuse)) {
if ($USER->get('admin')) {
$smarty->assign('noauthmessage', get_string('adminnoauthpluginforinstitution', 'admin'));
}
else {
$smarty->assign('noauthmessage', get_string('noauthpluginforinstitution', 'admin'));
}
}
$elements['registerallowed'] = array(
'type' => 'checkbox',
'title' => get_string('registrationallowed', 'admin'),
'description' => get_string('registrationalloweddescription', 'admin'),
'defaultvalue' => $data->registerallowed,
'help' => true,
);
if (empty($data->name) || $data->name != 'mahara') {
......
......@@ -330,6 +330,8 @@ $string['deleteinstitution'] = 'Delete Institution';
$string['deleteinstitutionconfirm'] = 'Are you really sure you wish to delete this institution?';
$string['institutionaddedsuccessfully'] = 'Institution added successfully. Please configure an authentication plugin for this institution.';
$string['institutiondeletedsuccessfully'] = 'Institution deleted successfully';
$string['noauthpluginforinstitution'] = 'Your site administrator has not configured an authentication plugin for this institution.';
$string['adminnoauthpluginforinstitution'] = 'Please configure an authentication plugin for this institution.';
$string['institutionname'] = 'Institution name';
$string['institutionnamealreadytaken'] = 'This institution name is already taken';
$string['institutiondisplayname'] = 'Institution display name';
......
......@@ -10,6 +10,8 @@
{if $institution_form}
{if $add}
<h3>{str tag="addinstitution" section="admin"}</h3>
{elseif ($noauthmessage)}
<div class="error">{$noauthmessage}</div>
{/if}
{$institution_form}
{else}
......
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