예제 #1
0
 * Передаем в Smarty системные словари (для доступа из всех шаблонов)
 */
$smarty->assignByRef('arrSysDict', $arrSysDict);
/**
 * Передаем в Smarty дополнительные словари (для доступа из всех шаблонов)
 */
$smarty->assignByRef('arrAddDict', $arrAddDict);
if (isset($_GET['id_s']) && validate::checkNaturalNumber($_GET['id_s']) && ($result = ajax::getProfessions($_GET['id_s']))) {
    echo $result;
} elseif (isset($_GET['id_r']) && validate::checkNaturalNumber($_GET['id_r'])) {
    $response = array('success' => false, 'error' => ERROR_UNABLE_PERFORM_OPERATION);
    $regions = new regions();
    $region = $regions->retCategorysByIds($_GET['id_r']);
    if (!empty($region[$_GET['id_r']]) && is_array($region[$_GET['id_r']])) {
        if ('on' !== $region[$_GET['id_r']]['major']) {
            $result = ajax::getCitys($_GET['id_r']);
            if (!empty($result)) {
                if (!empty($region[$_GET['id_r']]['add_city_allowed'])) {
                    $result[0] = array('id' => '0', 'name' => FORM_INPUT_OTHER);
                }
                $response = array('success' => true, 'data' => &$result);
            } else {
                $response = array('success' => false, 'data' => false);
            }
        } else {
            $response = array('success' => true, 'data' => false);
        }
    }
    echo ajax::sdgJSONencode($response);
} elseif (!empty($_GET['q']) && defined(strtoupper($_GET['q']))) {
    echo constant($_GET['q']);
예제 #2
0
    echo 'Error: Administrator is not logged!';
    exit;
}
/**
 * Передаем в Smarty системные словари (для доступа из всех шаблонов)
 */
$smarty->assignByRef('arrSysDict', $arrSysDict);
/**
 * Передаем в Smarty дополнительные словари (для доступа из всех шаблонов)
 */
$smarty->assignByRef('arrAddDict', $arrAddDict);
// получаем список профессий
if (isset($_GET['id_s']) && (int) $_GET['id_s'] && 0 < $_GET['id_s']) {
    print ajax::getProfessions($_GET['id_s']);
} elseif (isset($_GET['id_r']) && (int) $_GET['id_r'] && 0 < $_GET['id_r']) {
    print ajax::getCitys($_GET['id_r']);
} elseif (!empty($_GET['q'])) {
    $_GET['q'] = strtoupper($_GET['q']);
    echo defined($_GET['q']) ? constant($_GET['q']) : $_GET['q'];
} elseif (isset($_GET['getIP'])) {
    echo !empty($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : 0;
} elseif (!empty($_GET['addAdmAccessIP'])) {
    // получаем в массив список адресов и проверяем новый адрес на дублирование
    if (false === array_search($_GET['addAdmAccessIP'], $arrIpList = explode(';', SECURE_ADMIN_ACCESS_IP_LIST))) {
        $newIpList = array();
        foreach ($arrIpList as &$ipValue) {
            !empty($ipValue) ? $newIpList[] = $ipValue : null;
        }
        $newIpList[] = $_GET['addAdmAccessIP'];
        $data = "<?php\n\n" . "(!defined('SDG')) ? die ('Triple protection!') : null;\n\n" . 'define("SECURE_CAPTCHA", "' . SECURE_CAPTCHA . '");' . "\n\n" . 'define("SECURE_SQLERR_LOG", "' . SECURE_SQLERR_LOG . '");' . "\n\n" . 'define("SECURE_SQLERR_PRINT", "' . SECURE_SQLERR_PRINT . '");' . "\n\n" . 'define("SECURE_SQLERR_SEND_MESS", "' . SECURE_SQLERR_SEND_MESS . '");' . "\n\n" . 'define("SECURE_SQLERR_EMAIL", "' . SECURE_SQLERR_EMAIL . '");' . "\n\n" . 'define("SECURE_SQLERR_HEADERS", "' . implode('\\r\\n', explode("\r\n", SECURE_SQLERR_HEADERS)) . '");' . "\n\n" . 'define("SECURE_ADMIN_ACCESS_IP_LIST", "' . implode(';', $newIpList) . '");' . "\n";
        echo !tools::saveConfig('core/conf/const.config.secure.php', $data, false) ? 'errSaveConfIpList' : 'success';