예제 #1
0
 function __construct($w = 200, $h = 80)
 {
     /* create session to set word for verification */
     startCMSSession();
     $this->set_veriword();
     $this->dir_font = dirname(__FILE__) . '/' . $this->dir_font;
     $this->im_width = $w;
     $this->im_height = $h;
 }
예제 #2
0
}
// include the database configuration file
include_once "config.inc.php";
// initiate the content manager class
include_once "document.parser.class.inc.php";
$modx = new DocumentParser();
$modx->loadExtension("ManagerAPI");
$modx->getSettings();
$etomite =& $modx;
// for backward compatibility
$modx->tstart = $tstart;
$modx->mstart = $mstart;
// connect to the database
$modx->db->connect();
// start session
startCMSSession();
// get the settings from the database
include_once "settings.inc.php";
// get the user settings from the database
include_once "user_settings.inc.php";
// include_once the language file
if (!isset($manager_language) || !file_exists(MODX_MANAGER_PATH . "includes/lang/" . $manager_language . ".inc.php")) {
    $manager_language = "english";
    // if not set, get the english language file.
}
$_lang = array();
include_once "lang/english.inc.php";
$length_eng_lang = count($_lang);
if ($manager_language != "english" && file_exists(MODX_MANAGER_PATH . "includes/lang/" . $manager_language . ".inc.php")) {
    include_once "lang/" . $manager_language . ".inc.php";
}
예제 #3
0
 function startSession()
 {
     startCMSSession();
 }
예제 #4
0
function modxWebLogout()
{
    global $modx;
    $dbase = $modx->dbConfig['dbase'];
    $table_prefix = $modx->dbConfig['table_prefix'];
    $internalKey = $_SESSION['webInternalKey'];
    $username = $_SESSION['webShortname'];
    // invoke OnBeforeWebLogout event
    $modx->invokeEvent("OnBeforeWebLogout", array("userid" => $internalKey, "username" => $username));
    // if we were launched from the manager
    // do NOT destroy session
    if (isset($_SESSION['mgrValidated'])) {
        unset($_SESSION['webShortname']);
        unset($_SESSION['webFullname']);
        unset($_SESSION['webEmail']);
        unset($_SESSION['webValidated']);
        unset($_SESSION['webInternalKey']);
        unset($_SESSION['webValid']);
        unset($_SESSION['webUser']);
        unset($_SESSION['webFailedlogins']);
        unset($_SESSION['webLastlogin']);
        unset($_SESSION['webnrlogins']);
        unset($_SESSION['webUsrConfigSet']);
        unset($_SESSION['webUserGroupNames']);
        unset($_SESSION['webDocgroups']);
    } else {
        // Unset all of the session variables.
        $_SESSION = array();
        // destroy session cookie
        if (isset($_COOKIE[session_name()])) {
            setcookie(session_name(), '', time() - 42000, '/');
        }
        session_destroy();
        $sessionID = md5(date('d-m-Y H:i:s'));
        session_id($sessionID);
        startCMSSession();
        session_destroy();
    }
    // invoke OnWebLogout event
    $modx->invokeEvent("OnWebLogout", array("userid" => $internalKey, "username" => $username));
    return;
}