本文整理汇总了PHP中secure类的典型用法代码示例。如果您正苦于以下问题:PHP secure类的具体用法?PHP secure怎么用?PHP secure使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了secure类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: clear
static function clear($key = null, $is_secret_key = false)
{
$is_secret_key and $key = secure::token($key);
if (is_null($key)) {
session_unset();
} elseif (is_array($key)) {
foreach ($key as $k) {
unset($_SESSION[$k]);
}
} else {
unset($_SESSION[$key]);
}
return true;
}
开发者ID:mjiong,项目名称:framework,代码行数:14,代码来源:session.php
示例2: csrf
static function csrf($mode, $csrf = '')
{
$key = config('secure.csrf_name', 'secure');
if ($mode === 'get') {
return session::get($key);
}
if ($mode === 'check') {
//Notice 是否只用一次并清掉cookie
// input::cookie($key,$value,1);
return $csrf && $csrf === session::get($key);
}
if ($mode === 'set') {
$value = substr(secure::token(time()), 5, 8);
session::set($key, $value);
input::cookie($key, $value, 7200);
}
return true;
}
开发者ID:jiokss,项目名称:framework,代码行数:18,代码来源:secure.php
示例3: changeAdminPassword
/**
* функция проверки авторизации админа
* Берет логин и пароль админа из сесси и сверяет их с данными в БД
*
* @param (string) $login - новый логин (может быть false)
* @param (string) $password - новый пароль (может быть false)
*
* @return bool (сообщение перезагружающее страницу)
*/
static function changeAdminPassword($login, $password)
{
$link = isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING']) ? '?' . $_SERVER['QUERY_STRING'] : '';
if ($login && $password) {
$change = "login='" . md5($login) . "', password='" . md5($password) . "'";
$arrSession = array('administrator_login' => md5($login), 'administrator_password' => md5($password));
} elseif (!$login && $password) {
$change = "password='" . md5($password) . "'";
$arrSession = array('administrator_password' => md5($password));
} elseif ($login && !$password) {
$change = "login='" . md5($login) . "'";
$arrSession = array('administrator_login' => md5($login));
} else {
$change = false;
}
$strQuery = "UPDATE " . USR_PREFIX . "admin SET " . $change . " WHERE login IN (" . secure::escQuoteData($_SESSION['administrator_login']) . ") AND password IN (" . secure::escQuoteData($_SESSION['administrator_password']) . ")";
if (!empty($change) && db::dbQuery($strQuery)) {
// обновляем пароль в сессии
tools::updateSessionData($_SESSION, $arrSession);
messages::messageChangeSaved(MESSAGE_DATA_HAS_BEEN_CHANGED, false, CONF_ADMIN_FILE . $link);
} else {
messages::messageChangeSaved(MESSAGE_DATA_HAS_NOT_BEEN_CHANGED, false, CONF_ADMIN_FILE . $link);
}
}
开发者ID:innova-market,项目名称:JobExpert,代码行数:33,代码来源:admin.class.php
示例4: spl_autoload_register
############################### INIT ###############################
####################################################################
/********** Автозагрузчик классов **********/
spl_autoload_register('expert__autoload');
function expert__autoload($className)
{
/********** Библиотека статических классов **********/
if (file_exists(SD_ROOT_DIR . 'core/classes/lib/' . $className . '.class.php')) {
require_once SD_ROOT_DIR . 'core/classes/lib/' . $className . '.class.php';
} else {
// Файл класса ненайден печатаем сообщение об ошибке
spl_autoload_register('smartyAutoload');
}
}
/********** Очистка полученных данных **********/
secure::clearRequestData();
/********** Языковые файлы **********/
if (!empty($_COOKIE['instLang']) && is_dir(SD_ROOT_DIR . 'install/lang/' . $_COOKIE['instLang'] . '/')) {
$currLang = $_COOKIE['instLang'];
} else {
$currLang = SDG_DEFAULT_LANGUAGE;
}
foreach (filesys::getFilesInDir(SD_ROOT_DIR . 'install/lang/' . $currLang . '/') as $fileLang) {
require_once SD_ROOT_DIR . 'install/lang/' . $currLang . '/' . $fileLang;
}
/********** Инициализация Smarty **********/
define('SMARTY_SPL_AUTOLOAD', 1);
require_once SD_ROOT_DIR . 'install/Smarty/Smarty.class.php';
$smarty = new Smarty();
//core smarty object
$smarty->error_reporting = E_ALL & ~E_NOTICE;
开发者ID:innova-market,项目名称:JobExpert,代码行数:31,代码来源:index.php
示例5: sendUserDeletedArticle
/**
* Функция отправляет пользователю сообщение о том, что его статья удалена
*
* @param (array) $arrData - массив данных статьи
*
* @return void
*/
public function sendUserDeletedArticle(&$arrData)
{
/** Получаем данные пользователя **/
$user = new user();
if ($uData = $user->getUser("id IN (" . secure::escQuoteData($arrData['id']) . ")")) {
$mailer = new mailer();
// массив для замены в шаблоне
$mailer->setAddReplace(array('%ARTICLE_TITLE%' => $arrData['title'], '%COMMENTS%' => CONF_MAIL_FORMAT_HTML ? nl2br($arrData['comments']) : $arrData['comments']));
// отправляем письмо администратору
$mailer->sendEmail(CONF_MAIL_ADMIN_EMAIL, CONF_SITE_NAME, false, $uData['email'], $uData['first_name'], MAIL_MODERATE_ARTICLES_DELETED . ': ' . $arrData['title'], 'user.article.deleted.txt');
unset($mailer);
// уничтожаем объект
}
unset($user);
// уничтожаем объект
}
开发者ID:innova-market,项目名称:JobExpert,代码行数:23,代码来源:articles.class.php
示例6: array_filter
$arrID = array_filter(explode('-', $retFields['id_user']), 'strings::ifInt');
!empty($arrID[0]) && !empty($arrID[1]) ? $strWhere .= " AND id_user>=" . $arrID[0] . " AND id_user<=" . $arrID[1] : null;
} elseif ((int) $retFields['id_user']) {
$strWhere .= " AND id_user IN (" . secure::escQuoteData((int) abs($retFields['id_user'])) . ")";
}
}
/** Автор **/
!empty($retFields['author']) ? $strWhere .= " AND author LIKE " . secure::escQuoteData($retFields['author']) : null;
/** Заголовок **/
!empty($retFields['title']) ? $strWhere .= " AND title LIKE " . secure::escQuoteData($retFields['title']) : null;
/** Раздел **/
!empty($retFields['id_section']) ? $strWhere .= " AND id_section IN (" . secure::escQuoteData($retFields['id_section']) . ")" : null;
// проверяем поле "Дата от" и создаем условие для запроса
!empty($retFields['sDate']) ? !validate::validateMySqlDate($retFields['sDate']) ? $arrErrors[] = ERROR_DATE_FORMAT : ($strWhere .= " AND datetime>=" . secure::escQuoteData($retFields['sDate'])) : null;
// проверяем поле "Дата до" и создаем условие для запроса
!empty($retFields['eDate']) ? !validate::validateMySqlDate($retFields['eDate']) ? $arrErrors[] = ERROR_DATE_FORMAT : ($strWhere .= " AND datetime<=" . secure::escQuoteData($retFields['eDate'])) : null;
///////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////
$smarty->assignByRef('retFields', $retFields);
/** текущий обработанный URL **/
$path .= 'do=filter&id=' . $retFields['id'] . '&id_user=' . $retFields['id_user'] . '&author=' . $retFields['author'] . '&title=' . $retFields['title'] . '&id_section=' . $retFields['id_section'] . '&sDate=' . $retFields['sDate'] . '&eDate=' . $retFields['eDate'] . '&records=' . $retFields['records'] . '&';
}
/** смещение, всегда 0 (затем берется из $_GET) **/
$offset = !empty($_GET['offset']) && strings::ifInt($_GET['offset']) && (int) $_GET['offset'] > 0 ? (int) abs($_GET['offset']) : 0;
$strLimit = array('strLimit' => $offset . ',' . $retFields['records'], 'calcRows' => true);
$arrFields = array('id', 'title', 'id_section', 'id_user', 'author', 'datetime');
$smarty->assign('arrArticles', $articles->getArticles($strWhere, false, $strLimit, $arrFields));
// массив всех статей
/** формируем страницы **/
$allRecords = $articles->cntArticles();
// получаем общее количество статей
开发者ID:innova-market,项目名称:JobExpert,代码行数:31,代码来源:adm.manager.articles.php
示例7: elseif
// массив всех новостей
$smarty->assignByRef('news', $arrNews);
// для блока боковой части
$currMonth = terms::currentDateTime('n');
$smarty->assignByRef('currMonth', $currMonth);
//$smarty->assignByRef('arrMonth', $arrAddDict['Month']['values']);
} elseif (isset($_GET['month'])) {
messages::error404();
} elseif (!empty($_GET['year']) && ($year = chpu::getId_out_tId($_GET['year'])) && 4 == strlen($year)) {
$arrNamePage[] = array('name' => MENU_ACTION_ARCHIVED, 'link' => chpu::createChpuUrl(CONF_SCRIPT_URL . 'index.php?do=news&action=archive'));
$arrNamePage[] = array('name' => $year, 'link' => false);
//смещение, всегда 0 (затем берется из $_GET)
$offset = !empty($_GET['offset']) && validate::checkNaturalNumber($_GET['offset']) ? validate::checkNaturalNumber($_GET['offset']) : 0;
//получаем массив, содержащий текущий обработанный URL
$path = CONF_SCRIPT_URL . 'index.php?do=news&action=archive&year=' . $year . '&page=offset&';
$strWhere = "token IN ('archived') AND YEAR(`datetime`)=" . secure::escQuoteData($year);
$arrOrderBy = array('datetime' => 'DESC');
$arrLimit = array('strLimit' => $offset . ',' . CONF_NEWS_PERPAGE, 'calcRows' => true);
$arrNews = $news->getNewses($strWhere, $arrOrderBy, $arrLimit, false);
// формируем страницы
// получаем общее количество новостей
$allRecords = $news->cntNews();
// формируем странциы
$strPages = strings::generatePage($allRecords, $offset, CONF_NEWS_PERPAGE, $path);
//передаем в шаблон строку сформированных страниц
$smarty->assignByRef('string_page', $strPages);
// массив всех новостей
$smarty->assignByRef('news', $arrNews);
// для блока боковой части
$currMonth = terms::currentDateTime('n');
$smarty->assignByRef('currMonth', $currMonth);
开发者ID:innova-market,项目名称:JobExpert,代码行数:31,代码来源:news.php
示例8: IN
if (!empty($_POST['action'])) {
// удаление
if ('delete' === $_POST['action'] && !empty($_SESSION['sd_' . DB_PREFIX . 'codex']['rights']['del_articles']) && !empty($_POST['articles'])) {
$strWhere = "id_user IN (" . secure::escQuoteData($arrUser['id']) . ")";
!$articles->deleteArticles(array_keys($_POST['articles']), $strWhere) ? $arrErrors[] = db::$message_error : messages::messageChangeSaved(MESSAGE_CHANGE_SAVED, false, chpu::createChpuUrl(CONF_SCRIPT_URL . 'index.php?ut=' . $_SESSION['sd_user'][DB_PREFIX . 'conf']['user_type'] . '&do=user.articles&action=active'));
}
// архивация
if ('archive' === $_POST['action'] && !empty($_SESSION['sd_' . DB_PREFIX . 'codex']['rights']['arc_articles']) && !empty($_POST['articles'])) {
$arrData = array('token' => 'archived');
$strWhere = "id_user IN (" . secure::escQuoteData($arrUser['id']) . ")";
!$articles->updateArticles($arrData, array_keys($_POST['articles']), $strWhere) ? $arrErrors[] = db::$message_error : messages::messageChangeSaved(MESSAGE_CHANGE_SAVED, false, chpu::createChpuUrl(CONF_SCRIPT_URL . 'index.php?ut=' . $_SESSION['sd_user'][DB_PREFIX . 'conf']['user_type'] . '&do=user.articles&action=active'));
}
}
// инициируем "Наименование страницы" отображаемое в заголовке формы
$arrNamePage[] = array('name' => constant('MENU_ACTION_ACTIVE'), 'link' => false);
$strWhere = "id_user IN (" . secure::escQuoteData($arrUser['id']) . ") AND token IN ('active')";
if ($arrArticles = $articles->getArticles($strWhere, false, false, false)) {
// если есть статьи, устанавливаем признак публикации
foreach ($arrArticles as $key => &$value) {
$value['link'] = strtotime($value['datetime']) > time() ? false : true;
$arrArticles[$key] = $value;
}
}
$smarty->assignByRef('arrArticles', $arrArticles);
} else {
messages::error404();
}
$smarty->assignByRef('retFields', $retFields);
$smarty->assignByRef('arrUser', $arrUser);
$smarty->assignByRef('errors', $arrErrors);
$smarty->assignByRef('warnings', $arrWarnings);
开发者ID:innova-market,项目名称:JobExpert,代码行数:31,代码来源:user.articles.php
示例9: pDeleteSections
/**
* protected функция помечает разделы и сатьи этих разделов как удаленные
*
* @param (array) $arrSections - массив, содержащий id разделов для удаления
*
* @return bool
*/
protected function pDeleteSections(&$arrSections)
{
// помечаем статьи разделов как удаленные
foreach ($arrSections as &$value) {
$articles = new articles();
$articles->deleteArticlesBySection($value);
}
$strWhere = 'id IN (' . implode(',', secure::escQuoteData($arrSections)) . ')';
caching::clearCache($this->retTableName());
return $this->delEntrys($strWhere);
}
开发者ID:innova-market,项目名称:JobExpert,代码行数:18,代码来源:bartsections.class.php
示例10: md5
$new_password = md5($_POST['new_password']);
if (md5($_POST['password']) !== $_SESSION['sd_user']['data']['password']) {
$arrErrors[] = ERROR_PASSWORD;
}
if (strlen($_POST['new_password']) < CONF_REGISTER_USER_PASSWORD) {
$arrErrors[] = ERROR_PASSWORD_SHORT;
}
if (md5($_POST['password']) === md5($_POST['new_password'])) {
$arrErrors[] = ERROR_PASSWORD_NOT_NEW_PASSWORD;
}
if ($_POST['new_password'] !== $_POST['confirm_password']) {
$arrErrors[] = ERROR_PASSWORD_NOT_CONFIRM_PASSWORD;
}
} else {
$arrErrors[] = ERROR_EMPTY_FIELDS;
}
if (!$arrErrors) {
$user->updateUser(array('password' => md5($_POST['new_password'])), "id IN (" . secure::escQuoteData($_SESSION['sd_user']['data']['id']) . ")");
// обновляем пароль в сессии
tools::updateSessionData($_SESSION['sd_user']['data'], array('password' => md5($_POST['new_password'])));
messages::messageChangeSaved(MESSAGE_PASSWORD_HAS_BEEEN_CHANGED, false, chpu::createChpuUrl(CONF_SCRIPT_URL . 'index.php?ut=' . $_SESSION['sd_user'][DB_PREFIX . 'conf']['user_type'] . '&do=user.data'));
} else {
$smarty->assignByRef('errors', $arrErrors);
}
}
} else {
messages::error404();
}
} else {
messages::error404();
}
开发者ID:innova-market,项目名称:JobExpert,代码行数:31,代码来源:change.password.php
示例11: array_merge
$arrUser = array_merge($_SESSION['sd_user']['data'], $_SESSION['sd_user'][DB_PREFIX . 'conf']);
// объединяем данные пользователя
/**
* Действия
*/
if (isset($_GET['action'])) {
/**
* Редактирование личных данных
*/
if ('edit' === $_GET['action']) {
/**
* Сохранение личных данных пользователя
*/
if (isset($_POST['save'])) {
if (!empty($_POST['alias'])) {
if ($user->issetUser("id NOT IN (" . secure::escQuoteData($_SESSION['sd_user']['data']['id']) . ") AND alias IN (" . secure::escQuoteData($_POST['alias']) . ") AND token IN ('active','archived','moderate','new')")) {
$arrErrors[] = ERROR_USER_ALIAS_EXISTS;
}
} else {
$arrErrors[] = ERROR_EMPTY_BIND_FIELDS;
}
// массив основных данных пользователя
$arrData = array('alias' => $_POST['alias'], 'middle_name' => !empty($_POST['middle_name']) ? $_POST['middle_name'] : '');
// Разрешаем пользователю изменять имя и фамилиию только если включена соотв. настройка
if (CONF_USER_CHANGE_NAME) {
if (!empty($_POST['first_name']) && !empty($_POST['last_name'])) {
$arrData['first_name'] = $_POST['first_name'];
$arrData['last_name'] = $_POST['last_name'];
} else {
$arrErrors[] = ERROR_EMPTY_NAME_OR_SURNAME;
}
开发者ID:innova-market,项目名称:JobExpert,代码行数:31,代码来源:user.data.php
示例12: Group
JobExpert v1.0
powered by Script Developers Group (SD-Group)
email: [email protected]
url: http://sd-group.org.ua/
Copyright 2010-2015 (c) SD-Group
All rights reserved
=========================================================
Дополнительные страницы
********************************************************/
/**
* @package
* @todo
*/
!defined('SDG') ? die('Triple protection!') : null;
if (!empty($_GET['action']) && 'view' === $_GET['action'] && !empty($_GET['id'])) {
$strWhere = "id IN (" . secure::escQuoteData($_GET['id']) . ") AND token IN ('active')";
$fields = array('title', 'text', 'meta_keywords', 'meta_description');
if ($arrData = $pages->getPage($strWhere, $fields)) {
$arrNamePage[] = array('name' => $arrData['title'], 'link' => false);
$smarty->assignByRef('menu', $_GET['id']);
// выбранный пункт меню
// HEAD страницы
$smarty->assignByRef('meta_keywords', $arrData['meta_keywords']);
$smarty->assignByRef('meta_description', $arrData['meta_description']);
$smarty->assignByRef('arrPage', $arrData);
// параметры выбранной страницы
} else {
messages::error404();
}
} else {
messages::error404();
开发者ID:innova-market,项目名称:JobExpert,代码行数:31,代码来源:pages.php
示例13: actionRegions
/**
* public функция выполняет действия над группой регионов
*
* @param string $action
* @param array $arrFields
*
* @return bool
*/
public function actionRegions($action, $arrFields, $silentMode = false)
{
if ('edit' === $action || 'sort' === $action || 'del' === $action || 'setRegionMajor' === $action || 'resetRegionMajor' === $action || 'setAddCityAllowed' === $action || 'resetAddCityAllowed' === $action) {
if ('del' === $action) {
global $citys;
$citys->delCategorys('parent_id IN (' . implode(',', secure::escQuoteData($arrFields)) . ')');
}
if (!$this->actionCategorys($action, $arrFields)) {
if ($silentMode) {
return false;
} else {
messages::messageChangeSaved(ERROR_NOT_SAVE_CHANGE, false, CONF_ADMIN_FILE . '?m=dictionary&s=regions');
}
} else {
if ($silentMode) {
return true;
} else {
messages::messageChangeSaved(MESSAGE_CHANGE_SAVED, false, CONF_ADMIN_FILE . '?m=dictionary&s=regions');
}
}
} else {
if ($silentMode) {
return false;
} else {
messages::messageChangeSaved(MESSAGE_WARNING_UNKNOWN_ACTION, false, CONF_ADMIN_FILE . '?m=dictionary&s=regions');
}
}
}
开发者ID:innova-market,项目名称:JobExpert,代码行数:36,代码来源:regions.class.php
示例14: secure
<?php
$secure = new secure();
$payflow = new payflow();
$module_name = $args[2];
$module_id = $args[3];
$selected_option = $args[0];
$chart_assign_id = $args[1];
$result = $this->db->query("SELECT * FROM payments WHERE chart_assign_id = '{$chart_assign_id}'");
$tmp1 = $this->db->fetch_assoc($this->db->query("SELECT grant_total FROM erp_order WHERE order_id = {$module_id}"));
$full_amount = $tmp1["grant_total"];
$bill_amount = $full_amount / 2;
$total_arr = $this->db->fetch_assoc($this->db->query("SELECT SUM( amount ) total FROM `payments` WHERE for_module_name = 'order' AND for_module_id = '{$module_id}' AND refund='no'"));
$already_payed = $total_arr["total"];
// $return["javascript"] = "alert('ba: $bill_amount|ap: $already_payed');";
//$return["javascript"] = "alert('" . $this->db->num_rows($result) . "| $already_payed | $bill_amount" . "');";
if ($this->db->num_rows($result) == 0 && $already_payed < $bill_amount) {
$return["stop"] = "YES";
$bill = $bill_amount - $already_payed;
$contacts = $this->get_contact_by_module($module_id, $module_name);
$credit_cards = $secure->get_creditcards("contacts", $contacts[0]);
$tmp1 = $this->db->fetch_assoc($this->db->query("SELECT ccid FROM erp_order WHERE order_id = {$module_id}"));
$ccid = $tmp1["ccid"];
if (array_key_exists($ccid, $credit_cards) == false && $ccid != '0') {
$cc2 = $secure->get_creditcard($ccid);
$credit_cards[$ccid] = $cc2[$ccid];
}
$ccoptions = '<option value="">--SELECT ONE--</option>';
foreach ($credit_cards as $num => $card) {
if ($num = $ccid) {
$select = " SELECTED ";
开发者ID:name256,项目名称:crm42,代码行数:31,代码来源:systemtask.down_payment.php
示例15: actionCategorys
/**
* protected функция выполняет действия над группой строк в таблице БД
*
* @param string $action
* @param array $arrFields
*
* @return bool
*/
protected function actionCategorys($action, $arrFields, $silentMode = false)
{
switch ($action) {
case 'edit':
foreach ($arrFields as $key => $value) {
$arrData = isset($value['arrNoBindFields']) ? $value['arrBindFields'] + $value['arrNoBindFields'] : $value['arrBindFields'];
$result = $this->editEntrys(secure::escQuoteData($arrData), "id IN (" . secure::escQuoteData($key) . ")");
}
break;
case 'sort':
foreach ($arrFields as $key => $value) {
$arrSort[$value][] = $key;
}
foreach ($arrSort as $key => $value) {
$result = $this->editEntrys(array('sort' => "'{$key}'"), "id IN (" . implode(',', secure::escQuoteData($value)) . ")");
}
break;
case 'del':
$table = $this->retTableName();
$strFields = implode(',', secure::escQuoteData($arrFields));
$vacancy = new vacancy();
$result = $vacancy->delAnnounces('id_' . $table . ' IN (' . $strFields . ')');
$resume = new resume();
$result = $resume->delAnnounces('id_' . $table . ' IN (' . $strFields . ')');
$subscription = new subscription();
$strWhere = 'profession' !== $table ? 'id_' . $table . ' IN (' . $strFields . ')' : 'id_' . $table . ' IN (' . $strFields . ') OR id_' . $table . '_1 IN (' . $strFields . ') OR id_' . $table . '_2 IN (' . $strFields . ')';
$result = $subscription->delSubscriptions($strWhere);
$result = $this->delCategorys('id IN (' . $strFields . ')');
break;
case 'setcapital':
$result = $this->editEntrys(array('capital' => "'on'"), "id IN (" . implode(',', secure::escQuoteData($arrFields)) . ") AND capital IN ('0')");
break;
case 'resetcapital':
$result = $this->editEntrys(array('capital' => "'0'"), "parent_id IN (" . implode(',', secure::escQuoteData($arrFields)) . ") AND capital IN ('on')");
break;
case 'setRegionMajor':
$result = $this->editEntrys(array('major' => "'on'"), "id IN (" . implode(',', secure::escQuoteData($arrFields)) . ") AND major IN ('0')");
break;
case 'resetRegionMajor':
$result = $this->editEntrys(array('major' => "'0'"), "id IN (" . implode(',', secure::escQuoteData($arrFields)) . ") AND major IN ('on')");
break;
case 'setAddCityAllowed':
$result = $this->editEntrys(array('add_city_allowed' => "'on'"), "id IN (" . implode(',', secure::escQuoteData($arrFields)) . ") AND add_city_allowed IN ('0')");
break;
case 'resetAddCityAllowed':
$result = $this->editEntrys(array('add_city_allowed' => "'0'"), "id IN (" . implode(',', secure::escQuoteData($arrFields)) . ") AND add_city_allowed IN ('on')");
break;
default:
if ($silentMode) {
$result = false;
} else {
messages::messageChangeSaved(MESSAGE_WARNING_UNKNOWN_ACTION, false, CONF_ADMIN_FILE);
}
}
return $result;
}
开发者ID:innova-market,项目名称:JobExpert,代码行数:64,代码来源:categorys.class.php
示例16: dbGetTableFreeId
/**
* функция получает стоки помеченные на удаления в таблице БД
* производит проверку на совпадение значений уникальных полей и резервирует строку для обновления данных
* если такая строка не найдена - возвращает: false
*
* @param (string) $table - имя таблицы БД
* @param (array) $arrUniFields - массив уникальных полей таблицы БД
*
* @return int id-строки or false
*/
static function dbGetTableFreeId($table, $arrUniFields)
{
if (!is_array($arrUniFields)) {
db::$dbTypeSelect = 'single';
$arrLimit = array('strLimit' => '0, 1', 'calcRows' => false);
$resultQuery = self::dbSelectTable(array('id'), $table, "token IN ('deleted')", false, $arrLimit, false, true);
if (!empty($resultQuery)) {
$id = $resultQuery['id'];
$set = secure::escQuoteData(array('token' => 'reserved'));
return !self::dbUpdateTable($table, $set, "id IN ('{$id}')") ? false : $id;
} else {
return false;
}
} else {
$fields = array_keys($arrUniFields);
!in_array('id', $fields) ? $fields[] = 'id' : null;
db::$dbTypeSelect = 'multi';
$resultQuery = self::dbSelectTable($fields, $table, "token IN ('deleted')", false, false, true);
if (!empty($resultQuery)) {
foreach ($resultQuery as $key => &$value) {
foreach ($arrUniFields as &$needle) {
if (in_array($needle, $value)) {
$id =& $resultQuery[$key]['id'];
break 2;
}
}
}
if (empty($id)) {
$resultQuery = reset($resultQuery);
$id =& $resultQuery['id'];
}
$set = secure::escQuoteData(array('token' => 'reserved'));
return !self::dbUpdateTable($table, $set, "id IN ('{$id}')") ? false : $id;
} else {
return false;
}
}
}
开发者ID:innova-market,项目名称:JobExpert,代码行数:48,代码来源:db.class.php
示例17: time
!empty($arrConf['robot_running_firsttime']) && $arrConf['robot_running_firsttime'] < time() ? $arrConf['robot_running_firsttime'] += 86400 : null;
$data = "<?php\n\n" . "(!defined('SDG')) ? die ('Triple protection!') : null;\n\n" . '$arrRobotConf = array(' . "\n\t\t\t\t\t\t'configs' => array(\n";
foreach ($arrConf as $confKey => $confVal) {
$arrConfData[] = "\t\t\t\t\t\t\t\t\t\t\t\t'{$confKey}' => {$confVal}";
}
$data .= implode(",\n", $arrConfData) . "\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t'actions' => array(\n";
foreach ($arrRobotConf['actions'] as $actionKey => $actionVal) {
$actionVal = false === $actionVal ? 'false' : (true === $actionVal ? 'true' : "'{$actionVal}'");
$arrActData[] = "\t\t\t\t\t\t\t\t\t\t\t\t'{$actionKey}' => {$actionVal}";
}
$data .= implode(",\n", $arrActData) . "\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t );\n";
if (!tools::saveConfig($fileName, $data, CONF_ADMIN_FILE . '?m=service&s=robot&action=config')) {
$arrErrors[] = ERROR_FILES_MISSING_FILE;
}
} elseif (isset($_POST['ctrl_save'])) {
$arrCtrl = array('updateCounters' => isset($_POST['arrCtrl']['updateCounters']) ? 'true' : 'false', 'delNonverifyUsers' => isset($_POST['arrCtrl']['delNonverifyUsers']) ? 'true' : 'false', 'delNontypeUsers' => isset($_POST['arrCtrl']['delNontypeUsers']) ? 'true' : 'false', 'delUnpaidUsers' => isset($_POST['arrCtrl']['delUnpaidUsers']) ? 'true' : 'false', 'delUnpaidSubscr' => isset($_POST['arrCtrl']['delUnpaidSubscr']) ? 'true' : 'false', 'vacActionSlo' => isset($_POST['arrCtrl']['vacActionSlo']) && ('deleted' === $_POST['arrCtrl']['vacActionSlo'] || 'archived' === $_POST['arrCtrl']['vacActionSlo']) ? secure::escQuoteData($_POST['arrCtrl']['vacActionSlo']) : 'false', 'resActionSlo' => isset($_POST['arrCtrl']['resActionSlo']) && ('deleted' === $_POST['arrCtrl']['resActionSlo'] || 'archived' === $_POST['arrCtrl']['resActionSlo']) ? secure::escQuoteData($_POST['arrCtrl']['resActionSlo']) : 'false', 'vacDelNonverify' => isset($_POST['arrCtrl']['vacDelNonverify']) ? 'true' : 'false', 'resDelNonverify' => isset($_POST['arrCtrl']['resDelNonverify']) ? 'true' : 'false', 'vacDelUnpaid' => isset($_POST['arrCtrl']['vacDelUnpaid']) ? 'true' : 'false', 'resDelUnpaid' => isset($_POST['arrCtrl']['resDelUnpaid']) ? 'true' : 'false', 'vacVipResetSlo' => isset($_POST['arrCtrl']['vacVipResetSlo']) ? 'true' : 'false', 'resVipResetSlo' => isset($_POST['arrCtrl']['resVipResetSlo']) ? 'true' : 'false', 'vacHotResetSlo' => isset($_POST['arrCtrl']['vacHotResetSlo']) ? 'true' : 'false', 'resHotResetSlo' => isset($_POST['arrCtrl']['resHotResetSlo']) ? 'true' : 'false');
$data = "<?php\n\n" . "(!defined('SDG')) ? die ('Triple protection!') : null;\n\n" . '$arrRobotConf = array(' . "\n\t'configs' => array(\n";
foreach ($arrRobotConf['configs'] as $configKey => $configVal) {
$configVal = false === $configVal ? 'false' : (true === $configVal ? 'true' : $configVal);
$arrConfData[] = "\t\t'{$configKey}' => {$configVal}";
}
$data .= implode(",\n", $arrConfData) . "\n\t),\n\n\t'actions' => array(\n";
foreach ($arrCtrl as $ctrlKey => $ctrlVal) {
$arrActData[] = "\t\t'{$ctrlKey}' => {$ctrlVal}";
}
$data .= implode(",\n", $arrActData) . "\n\t)\n);\n";
if (!tools::saveConfig($fileName, $data, CONF_ADMIN_FILE . '?m=service&s=robot&action=config')) {
$arrErrors[] = ERROR_FILES_MISSING_FILE;
}
}
} else {
开发者ID:innova-market,项目名称:JobExpert,代码行数:31,代码来源:adm.service.robot.php
示例18: isset
} else {
/**
* действия с объявлениями
*/
isset($_POST['arrVacData']['action']) ? !$vacancy->actionAnnounces($_POST['arrVacData']) ? messages::messageChangeSaved(ERROR_NOT_SAVE_CHANGE, false, CONF_ADMIN_FILE . '?m=announces&s=vacancys') : messages::messageChangeSaved(MESSAGE_CHANGE_SAVED, false, CONF_ADMIN_FILE . '?m=announces&s=vacancys') : null;
// инициируем "Наименование страницы" отображаемое в форме
$arrNamePage[] = array('name' => MENU_ANNOUNCES_VACANCYS, 'link' => false);
/**
* передаем данные в шаблон
*/
$smarty->assign('professions', $professions->retCategorys());
$smarty->assign('citys', $citys->retCategorys());
/**
* Проверяем фильтр
*/
$strWhere = isset($_GET['filter']) && ('company_name' === $_GET['filter'] || 'email' === $_GET['filter'] || 'user_type' === $_GET['filter'] || 'id_region' === $_GET['filter'] || 'id_city' === $_GET['filter'] || 'id_section' === $_GET['filter'] || 'id_profession' === $_GET['filter']) && isset($_GET['in']) && !empty($_GET['in']) ? $_GET['filter'] . " IN (" . secure::escQuoteData($_GET['in']) . ")" : false;
/**
* Проверяем сортировку
*/
$arrOrderBy = array();
isset($_GET['order']) && ('act_datetime' === $_GET['order'] || 'token_datetime' === $_GET['order']) && isset($_GET['by']) && ('ASC' === $_GET['by'] || 'DESC' === $_GET['by']) ? $arrOrderBy[$_GET['order']] = $_GET['by'] : ($arrOrderBy = false);
/**
* Формируем страницы и передаем полученные данные в шаблон
*/
$offset = isset($_GET['offset']) ? (int) abs($_GET['offset']) : 0;
//смещение, всегда 0 (затем берется из $_GET)
$arrLimit = array('strLimit' => $offset . ',' . CONF_ANNOUNCE_PERPAGE_ADMIN_PANEL, 'calcRows' => true);
$smarty->assign('return_data', $vacancy->getAnnouncesByToken('active', $strWhere, $arrLimit, $arrOrderBy));
$allRecords = $vacancy->cntAnnounces();
// получаем общее количество объявлений
$smarty->assignByRef('allRecords', $allRecords);
开发者ID:innova-market,项目名称:JobExpert,代码行数:31,代码来源:adm.announces.vacancys.php
示例19: array
/**
* иницализация массива подключаемых шаблонов: по умолчанию все значения - false
* для подключения шаблона, необходимо установить значение - true
* шаблоны подключаются в порядке установленном в файле головного шаблона
*/
$arrActions = array('payments' => false, 'config' => false, 'mt' => false, 'lt' => false);
// определяем шаблон для отображения
isset($_GET['action']) && isset($arrActions[$_GET['action']]) ? $arrActions[$_GET['action']] = true : null;
$payments = new payments();
$modMenu = array();
// инициируем "Наименование страницы" отображаемое в форме
$arrNamePage[] = array('name' => MENU_MODS_PAYMENTS, 'link' => CONF_ADMIN_FILE . '?m=mods&s=payments');
/**
* Действия
*/
$issetMod = !empty($_GET['id']) ? $payments->issetMod("id IN (" . secure::escQuoteData($_GET['id']) . ") AND token IN ('active', 'disabled')") : false;
/**
* Настройки модов
*/
if ($arrActions['config'] && !empty($_GET['id']) && $issetMod) {
// инициируем "Наименование страницы" отображаемое в форме
$arrNamePage[] = array('name' => strtoupper($_GET['id']), 'link' => false);
$arrNamePage[] = array('name' => MENU_CONFIG, 'link' => false);
include_once 'core/mods/payments/' . $_GET['id'] . '/admin.php';
include_once 'core/mods/payments/' . $_GET['id'] . '/conf/' . $_GET['id'] . '.conf.php';
include_once 'core/mods/payments/' . $_GET['id'] . '/conf/' . $_GET['id'] . '.tariffs.php';
$smarty->assign('config_template', SD_ROOT_DIR . 'core/mods/payments/' . $_GET['id'] . '/templates/' . $_GET['id'] . '.conf.tpl');
$smarty->assign('tariffs_template', SD_ROOT_DIR . 'core/mods/payments/' . $_GET['id'] . '/templates/' . $_GET['id'] . '.tariffs.tpl');
/**
* Сохраняем настройки самого мода
*/
开发者ID:innova-market,项目名称:JobExpert,代码行数:31,代码来源:adm.mods.payments.php
示例20: IN
*/
if (!empty($_POST['action'])) {
// отображение на главной
if ('show' === $_POST['action'] && !empty($_POST['compan
|
请发表评论