<?php include_once "../../cache/siteManager.php"; require_once '../../../' . MGR_DIR . '/includes/protect.inc.php'; include_once '../../../' . MGR_DIR . '/includes/config.inc.php'; include_once MODX_MANAGER_PATH . 'includes/document.parser.class.inc.php'; $modx = new DocumentParser(); $modx->loadExtension("ManagerAPI"); $modx->getSettings(); // start session startCMSSession(); $LoginUserID = $modx->getLoginUserID(); if (isset($_SESSION['mgrValidated']) or $LoginUserID !== NULL) { include_once $modx->config['base_path'] . 'assets/modules/easy_board/easy_board.config.php'; include_once $modx->config['base_path'] . 'assets/modules/easy_board/easy_board.inc.php'; $masterID = $modx->db->getValue($modx->db->select('createdby', $mod_table, "id=" . (int) $_GET[item_id])); // Формирование ответа для ajax запросов if (isset($_GET[act]) and ($masterID == $LoginUserID or isset($_SESSION['mgrValidated']))) { if ($_GET[act] == "delpic" and isset($_GET[item_id])) { delImage((int) $_GET[item_id], $mod_table); $fields = array('image' => ""); $query = $modx->db->update($fields, $mod_table, "id = " . (int) $_GET[item_id]); die("<input name=\"image\" type=\"file\" />"); } if ($_GET[act] == "unpub" and isset($_GET[item_id])) { $item_id = (int) $_GET[item_id]; $fields = array('published' => 0); $query = $modx->db->update($fields, $mod_table, "id = {$item_id}"); die(''); } }
// 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/'; if ($_POST['ajax'] == 1) {