Commit 9d657b76 authored by Son Nguyen's avatar Son Nguyen
Browse files

Fix the authentication warning for registration (bug #1043015)



When all institutions in the site have only Internal auth method,
values['authtype'] is not set.

Change-Id: I247e6033f69b40b2016ebd4a2ccac04603e7c020
Signed-off-by: default avatarSon Nguyen <son.nguyen@catalyst.net.nz>
parent 9f75f9d8
...@@ -2144,7 +2144,7 @@ function auth_register_submit(Pieform $form, $values) { ...@@ -2144,7 +2144,7 @@ function auth_register_submit(Pieform $form, $values) {
// If the institution requires approval, mark the record as pending // If the institution requires approval, mark the record as pending
// @todo the expiry date should be configurable // @todo the expiry date should be configurable
if ($confirm = get_field('institution', 'registerconfirm', 'name', $values['institution'])) { if ($confirm = get_field('institution', 'registerconfirm', 'name', $values['institution'])) {
if ($values['authtype'] && $values['authtype'] != 'internal') { if (isset($values['authtype']) && $values['authtype'] != 'internal') {
$authinstance = get_record('auth_instance', 'institution', $values['institution'], 'authname', $values['authtype'] ? $values['authtype'] : 'internal'); $authinstance = get_record('auth_instance', 'institution', $values['institution'], 'authname', $values['authtype'] ? $values['authtype'] : 'internal');
$auth = AuthFactory::create($authinstance->id); $auth = AuthFactory::create($authinstance->id);
$confirm = !$auth->weautocreateusers; $confirm = !$auth->weautocreateusers;
...@@ -2216,7 +2216,7 @@ function auth_register_submit(Pieform $form, $values) { ...@@ -2216,7 +2216,7 @@ function auth_register_submit(Pieform $form, $values) {
$_SESSION['registeredokawaiting'] = true; $_SESSION['registeredokawaiting'] = true;
} }
else { else {
if ($values['authtype'] == 'browserid') { if (isset($values['authtype']) && $values['authtype'] == 'browserid') {
redirect('/register.php?key='.$values['key']); redirect('/register.php?key='.$values['key']);
} }
else { 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