Added migration which starts executing in Page.php:displayHome(), ie. when a user just logged in. This is to migrate old users to LDAP for SingleSignOn across our systems. Missing: migrate on user registration. + Some membercard sticker stuff from oyvinbak.
This commit is contained in:
1 parent
9840114bae
commit
28b177add9
31 files changed
+2106
-25
No files matched your search
@@ -1554,4 +1554,26 @@ function strip_nl($string) {
|
||||
$string = str_replace("\r", "", $string);
|
||||
return $string;
|
||||
}
|
||||
|
||||
|
||||
function getStickerPeriod($time)
|
||||
{
|
||||
$start = date('Y', strtotime($time));
|
||||
return $start . '/' . (substr($start,2,2) + 1);
|
||||
}
|
||||
// Migration (nikolark)
|
||||
function is_migrated() {
|
||||
$conn = db_connect();
|
||||
$uid = getCurrentUser();
|
||||
|
||||
$sql = sprintf("SELECT migrated FROM din_user WHERE id=%s AND migrated IS NOT NULL", $uid);
|
||||
$result = $conn->query($sql);
|
||||
|
||||
if (DB :: isError($result) == true) {
|
||||
error("is_migrated: " . $result->toString());
|
||||
return false;
|
||||
}
|
||||
return $result->numRows() > 0;
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in new issue
Block a user