Commit 254103d6 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>
parent 05d7f628
...@@ -974,7 +974,7 @@ class AuthLdap extends Auth { ...@@ -974,7 +974,7 @@ class AuthLdap extends Auth {
$todb->$dbfield = $ldaprec[$ldapfield][0]; $todb->$dbfield = $ldaprec[$ldapfield][0];
} }
else { 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);
} }
} }
...@@ -1105,7 +1105,7 @@ class AuthLdap extends Auth { ...@@ -1105,7 +1105,7 @@ class AuthLdap extends Auth {
// Create a temp table to store the users, for better performance // Create a temp table to store the users, for better performance
$temptable = new XMLDBTable('auth_ldap_extusers_temp'); $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('firstname', XMLDB_TYPE_TEXT);
$temptable->addFieldInfo('lastname', XMLDB_TYPE_TEXT); $temptable->addFieldInfo('lastname', XMLDB_TYPE_TEXT);
$temptable->addFieldInfo('email', XMLDB_TYPE_CHAR, 255); $temptable->addFieldInfo('email', XMLDB_TYPE_CHAR, 255);
......
...@@ -2141,9 +2141,12 @@ function set_cookie($name, $value='', $expires=0, $access=false) { ...@@ -2141,9 +2141,12 @@ function set_cookie($name, $value='', $expires=0, $access=false) {
if (!$domain = get_config('cookiedomain')) { if (!$domain = get_config('cookiedomain')) {
$domain = $url['host']; $domain = $url['host'];
} }
setcookie($name, $value, $expires, $url['path'], $domain, is_https(), true); // If no headers are sent - to avoid CLI scripts calling logout() problems
if ($access) { // View access cookies may be needed on this request if (!headers_sent()) {
$_COOKIE[$name] = $value; 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