Commit c727285d authored by Son Nguyen's avatar Son Nguyen
Browse files

Fix the licendefault's value when creating a new account (Bug 1251098)



see also bug 1296915

Change-Id: I8a72beb37a23584f93e0e654df7e95c0f9e6311c
Signed-off-by: default avatarSon Nguyen <son.nguyen@catalyst.net.nz>
parent 274bc0eb
......@@ -2159,14 +2159,16 @@ function create_user($user, $profile=array(), $institution=null, $remoteauth=nul
set_profile_field($user->id, $k, $v);
}
if (!empty($institution) && $institution != 'mahara') {
if (is_string($institution)) {
if (!empty($institution)) {
if (is_string($institution) && $institution != 'mahara') {
$institution = new Institution($institution);
}
if ($institution->name != 'mahara') {
$institution->addUserAsMember($user); // uses $user->newuser
if (empty($accountprefs['licensedefault'])) {
$accountprefs['licensedefault'] = LICENSE_INSTITUTION_DEFAULT;
}
}
$accountprefs['licensedefault'] = LICENSE_INSTITUTION_DEFAULT;
}
$authobj = get_record('auth_instance', 'id', $user->authinstance);
$authinstance = AuthFactory::create($authobj->id);
......
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