function logDocumentChange($action)
 {
     include_once MODX_MANAGER_PATH . 'includes/log.class.inc.php';
     $log = new logHandler();
     switch ($action) {
         case 'template':
             $log->initAndWriteLog($this->dm->lang['DM_log_template']);
             break;
         case 'templatevariables':
             $log->initAndWriteLog($this->dm->lang['DM_log_templatevariables']);
             break;
         case 'docpermissions':
             $log->initAndWriteLog($this->dm->lang['DM_log_docpermissions']);
             break;
         case 'sortmenu':
             $log->initAndWriteLog($this->dm->lang['DM_log_sortmenu']);
             break;
         case 'publish':
             $log->initAndWriteLog($this->dm->lang['DM_log_publish']);
             break;
         case 'hidemenu':
             $log->initAndWriteLog($this->dm->lang['DM_log_hidemenu']);
             break;
         case 'search':
             $log->initAndWriteLog($this->dm->lang['DM_log_search']);
             break;
         case 'cache':
             $log->initAndWriteLog($this->dm->lang['DM_log_cache']);
             break;
         case 'richtext':
             $log->initAndWriteLog($this->dm->lang['DM_log_richtext']);
             break;
         case 'delete':
             $log->initAndWriteLog($this->dm->lang['DM_log_delete']);
             break;
         case 'dates':
             $log->initAndWriteLog($this->dm->lang['DM_log_richtext']);
             break;
         case 'authors':
             $log->initAndWriteLog($this->dm->lang['DM_log_authors']);
             break;
     }
 }
$_SESSION['webLastlogin'] = $lastlogin;
$_SESSION['webnrlogins'] = $nrlogins;
$_SESSION['webUserGroupNames'] = '';
// reset user group names
// get user's document groups
$ds = $modx->db->select('uga.documentgroup', $modx->getFullTableName('web_groups') . " AS ug INNER JOIN " . $modx->getFullTableName('webgroup_access') . " AS uga ON uga.webgroup=ug.webgroup", "webuser='******'");
$_SESSION['webDocgroups'] = $modx->db->getColumn('documentgroup', $ds);
$ds = $modx->db->select('wgn.name', $modx->getFullTableName('webgroup_names') . " AS wgn INNER JOIN " . $modx->getFullTableName('web_groups') . " AS wg ON wg.webgroup=wgn.id AND wg.webuser='******'");
$grpNames = $this->db->getColumn("name", $ds);
$_SESSION['webUserGroupNames'] = $grpNames;
if ($rememberme) {
    $_SESSION['modx.web.session.cookie.lifetime'] = intval($modx->config['session.cookie.lifetime']);
} else {
    $_SESSION['modx.web.session.cookie.lifetime'] = 0;
}
$log = new logHandler();
$log->initAndWriteLog("Logged in", $_SESSION['webInternalKey'], $_SESSION['webShortname'], "58", "-", "WebLogin");
// get login home page
$ok = false;
if (isset($modx->config['login_home']) && ($id = $modx->config['login_home'])) {
    if ($modx->getPageInfo($id)) {
        $ok = true;
    }
}
if (!$ok) {
    // check if a login home id page was set
    foreach ($liHomeId as $id) {
        $id = trim($id);
        if ($modx->getPageInfo($id)) {
            $ok = true;
            break;
示例#3
0
        // get the event log delete processor
        include_once "processors/delete_eventlog.processor.php";
        break;
    case 501:
        //delete category
        include_once "processors/delete_category.processor.php";
        break;
        /********************************************************************/
        /* default action: show not implemented message                     */
        /********************************************************************/
    /********************************************************************/
    /* default action: show not implemented message                     */
    /********************************************************************/
    default:
        // say that what was requested doesn't do anything yet
        include_once "header.inc.php";
        echo "\n            <div class='sectionHeader'>" . $_lang['functionnotimpl'] . "</div>\n\t\t\t<div class='sectionBody'>\n                <p>" . $_lang['functionnotimpl_message'] . "</p>\n            </div>\n        ";
        include_once "footer.inc.php";
}
/********************************************************************/
// log action, unless it's a frame request
if ($action != 1 && $action != 7 && $action != 2) {
    include_once "log.class.inc.php";
    $log = new logHandler();
    $log->initAndWriteLog();
}
/********************************************************************/
// show debug
unset($_SESSION['itemname']);
// clear this, because it's only set for logging purposes
include_once "debug.inc.php";
示例#4
0
function logFileChange($type, $filename)
{
    //global $_lang;
    include_once 'log.class.inc.php';
    $log = new logHandler();
    switch ($type) {
        case 'upload':
            $string = 'Uploaded File';
            break;
        case 'delete':
            $string = 'Deleted File';
            break;
        case 'modify':
            $string = 'Modified File';
            break;
        default:
            $string = 'Viewing File';
            break;
    }
    $string = sprintf($string, $filename);
    $log->initAndWriteLog($string, '', '', '', $type, $filename);
    // HACK: change the global action to prevent double logging
    // @see manager/index.php @ 915
    global $action;
    $action = 1;
}
示例#5
0
$_SESSION['role'] = $role;
$_SESSION['lastlogin'] = $lastlogin;
$_SESSION['nrlogins'] = $nrlogins;
$sql = "SELECT * FROM {$dbase}." . $table_prefix . "user_roles where id=" . $role . ";";
$rs = mysql_query($sql);
$row = mysql_fetch_assoc($rs);
$_SESSION['permissions'] = $row;
if ($_SESSION['permissions']['frames'] != 1) {
    // $location = "../index.php?a=8";
    $location = "../../";
    header("Location: " . $location);
}
$cookieName = $site_id;
$_POST['rememberme'] = 1;
if ($_POST['rememberme'] == 1) {
    $rc4 = new rc4crypt();
    $username = $_POST['username'];
    $keyPhrase = "cryptocipher";
    $thestring = $rc4->endecrypt($keyPhrase, $username);
    setcookie($cookieName, $thestring, time() + 604800, "/", "", 0);
} else {
    setcookie($cookieName, "", time() - 604800, "/", "", 0);
}
// include the logger and add an audit trail entry unless logging is disabled
if ($use_mgr_logging != 0) {
    include_once "../includes/log.class.inc.php";
    $log = new logHandler();
    $log->initAndWriteLog("Logged in", $_SESSION['internalKey'], $_SESSION['shortname'], "58", "-", "Etomite");
}
$location = $_POST['location'] != "" ? $_POST['location'] : "../index.php";
header("Location: " . $location);
示例#6
0
    $_SESSION['modx.mgr.session.cookie.lifetime'] = intval($modx->config['session.cookie.lifetime']);
    // Set a cookie separate from the session cookie with the username in it.
    // Are we using secure connection? If so, make sure the cookie is secure
    global $https_port;
    $secure = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' || $_SERVER['SERVER_PORT'] == $https_port;
    if (version_compare(PHP_VERSION, '5.2', '<')) {
        setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, '; HttpOnly', $secure);
    } else {
        setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, NULL, $secure, true);
    }
} else {
    $_SESSION['modx.mgr.session.cookie.lifetime'] = 0;
    // Remove the Remember Me cookie
    setcookie('modx_remember_manager', "", time() - 3600, MODX_BASE_URL);
}
$log = new logHandler();
$log->initAndWriteLog("Logged in", $modx->getLoginUserID(), $_SESSION['mgrShortname'], "58", "-", "MODx");
// invoke OnManagerLogin event
$modx->invokeEvent("OnManagerLogin", array("userid" => $internalKey, "username" => $username, "userpassword" => $givenPassword, "rememberme" => $rememberme));
// check if we should redirect user to a web page
$tbl = $modx->getFullTableName("user_settings");
$id = $modx->db->getValue("SELECT setting_value FROM {$tbl} WHERE user='******' AND setting_name='manager_login_startup'");
if (isset($id) && $id > 0) {
    $header = 'Location: ' . $modx->makeUrl($id, '', '', 'full');
    if ($_POST['ajax'] == 1) {
        echo $header;
    } else {
        header($header);
    }
} else {
    $header = 'Location: ' . $modx->config['site_url'] . 'manager/';