Esempio n. 1
0
 static function loginAndCheckExpired()
 {
     global $ui, $config, $plist, $message, $smarty;
     /* Remove all locks of this user */
     del_user_locks($ui->dn);
     /* Save userinfo and plugin structure */
     session::global_set('ui', $ui);
     /* User might have its own language, re-run initLanguage */
     initLanguage();
     /* Save config to session. */
     session::global_set('config', $config);
     /* We need a fully loaded plist and config to test account expiration */
     session::global_un_set('plist');
     $plist = load_plist();
     /* Check account expiration */
     if ($config->get_cfg_value('handleExpiredAccounts') == 'TRUE') {
         $expired = $ui->expired_status();
         if ($expired == POSIX_ACCOUNT_EXPIRED) {
             new log('security', 'login', '', array(), 'Account for user "' . self::$username . '" has expired');
             $message = _('Account locked. Please contact your system administrator!');
             $smarty->assign('nextfield', 'password');
             return FALSE;
         }
     }
     return TRUE;
 }
Esempio n. 2
0
        new log('security', 'login', '', array(), 'main.php called with expired session - logging out');
        header('Location: index.php?signout=1&message=expired');
        exit;
    }
}
session::global_set('_LAST_PAGE_REQUEST', time());
@DEBUG(DEBUG_CONFIG, __LINE__, __FUNCTION__, __FILE__, $config->data, "config");
/* Set template compile directory */
$smarty->compile_dir = $config->get_cfg_value("templateCompileDirectory", SPOOL_DIR);
/* Preset current main base */
if (!session::global_is_set('CurrentMainBase')) {
    session::global_set('CurrentMainBase', get_base_from_people($ui->dn));
}
initLanguage();
/* Prepare plugin list */
$plist = load_plist();
/* Check for register globals */
if (isset($global_check) && $config->get_cfg_value("forceglobals") == "TRUE") {
    msg_dialog::display(_("PHP configuration"), _("Fatal error: Register globals is on. FusionDirectory will refuse to login unless this is fixed by an administrator."), FATAL_ERROR_DIALOG);
    new log("security", "login", "", array(), "Register globals is on. For security reasons, this should be turned off.");
    session::destroy();
    exit;
}
/* Check Plugin variable */
if (session::global_is_set('plugin_dir')) {
    $old_plugin_dir = session::global_get('plugin_dir');
} else {
    $old_plugin_dir = "";
}
$plist->gen_menu();
/* check if we are using account expiration */