Commit 220f29cd authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1792638: Problem with ldap sync temp table



And also with calling $USER->logout();

And also with showing missing ldap server info for a user

behatnotneeded

Change-Id: I03656d286bbf2e56416151a52b2051235f9364df
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
(cherry picked from commit 254103d6)
(cherry picked from commit f2da0c00)
parent a6e021a2
......@@ -963,7 +963,7 @@ class AuthLdap extends Auth {
$todb->$dbfield = $ldaprec[$ldapfield][0];
}
else {
log_warn("Ldap record contained no {$ldapfield} field to map to DB {$dbfield}");
log_warn("Ldap record for {$todb->$columnname} contained no {$ldapfield} field to map to DB {$dbfield}", true, false);
}
}
......@@ -1094,7 +1094,7 @@ class AuthLdap extends Auth {
// Create a temp table to store the users, for better performance
$temptable = new XMLDBTable('auth_ldap_extusers_temp');
$temptable->addFieldInfo('extusername', XMLDB_TYPE_CHAR, 64, null, false);
$temptable->addFieldInfo('extusername', XMLDB_TYPE_CHAR, 64, null, XMLDB_NOTNULL);
$temptable->addFieldInfo('firstname', XMLDB_TYPE_TEXT);
$temptable->addFieldInfo('lastname', XMLDB_TYPE_TEXT);
$temptable->addFieldInfo('email', XMLDB_TYPE_CHAR, 255);
......
......@@ -2091,9 +2091,12 @@ function set_cookie($name, $value='', $expires=0, $access=false) {
if (!$domain = get_config('cookiedomain')) {
$domain = $url['host'];
}
setcookie($name, $value, $expires, $url['path'], $domain, is_https(), true);
if ($access) { // View access cookies may be needed on this request
$_COOKIE[$name] = $value;
// If no headers are sent - to avoid CLI scripts calling logout() problems
if (!headers_sent()) {
setcookie($name, $value, $expires, $url['path'], $domain, is_https(), true);
if ($access) { // View access cookies may be needed on this request
$_COOKIE[$name] = $value;
}
}
}
......
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