Commit 00475c2a 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: default avatarRobert Lyon <robertl@catalyst.net.nz>
(cherry picked from commit 254103d6)
(cherry picked from commit f2da0c00)
parent 8afe2070
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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);
+6 −3
Original line number Diff line number Diff line
@@ -2041,11 +2041,14 @@ function set_cookie($name, $value='', $expires=0, $access=false) {
    if (!$domain = get_config('cookiedomain')) {
        $domain = $url['host'];
    }
    // 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;
        }
    }
}

/**
 * Returns an assoc array of countrys suitable for use with the "select" form