本文整理汇总了PHP中kleeja_check_form_key函数的典型用法代码示例。如果您正苦于以下问题:PHP kleeja_check_form_key函数的具体用法?PHP kleeja_check_form_key怎么用?PHP kleeja_check_form_key使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了kleeja_check_form_key函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: preg_replace
}
//english as default
if (!isset($_REQUEST['lang'])) {
$_REQUEST['lang'] = 'en';
}
$lang_id = preg_replace('![^a-z]!', '', $_REQUEST['lang']);
//for style ..
$stylee = "admin_langs";
$action = basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&page=' . (isset($_GET['page']) ? intval($_GET['page']) : 1) . '&lang=' . $lang_id;
$action2 = basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php');
$H_FORM_KEYS = kleeja_add_form_key('adm_langs');
//
// Check form key
//
if (isset($_POST['submit'])) {
if (!kleeja_check_form_key('adm_langs')) {
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 3);
}
}
//get languages
$lngfiles = '';
if ($dh = @opendir(PATH . 'lang')) {
while (($file = readdir($dh)) !== false) {
if (strpos($file, '.') === false && $file != '..' && $file != '.') {
$lngfiles .= '<option ' . ($lang_id == $file ? 'selected="selected"' : '') . ' value="' . $file . '">' . $file . '</option>' . "\n";
}
}
closedir($dh);
}
$query = array('SELECT' => '*', 'FROM' => "{$dbprefix}lang", 'WHERE' => "lang_id='" . $lang_id . "'", 'ORDER BY' => 'word DESC');
$result = $SQL->build($query);
示例2: isset
*
*/
// not for directly open
if (!defined('IN_ADMIN')) {
exit;
}
//for style ..
$current_template = 'extra.php';
$current_smt = isset($_GET['smt']) ? preg_match('![a-z0-9_]!i', trim($_GET['smt'])) ? trim($_GET['smt']) : 'he' : 'he';
$action = ADMIN_PATH . '?cp=extra&smt=' . $current_smt;
$H_FORM_KEYS = kleeja_add_form_key('adm_extra');
//
// Check form key
//
if (isset($_POST['submit'])) {
if (!kleeja_check_form_key('adm_extra')) {
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
}
}
$query = array('SELECT' => 'ex_header,ex_footer', 'FROM' => "{$dbprefix}stats");
$result = $SQL->build($query);
//is there any change !
$affected = false;
while ($row = $SQL->fetch($result)) {
$ex_header = isset($_POST['ex_header']) ? $_POST['ex_header'] : $row['ex_header'];
$ex_footer = isset($_POST['ex_footer']) ? $_POST['ex_footer'] : $row['ex_footer'];
//when submit !!
if (isset($_POST['submit'])) {
$ex_header = htmlspecialchars_decode($ex_header);
$ex_footer = htmlspecialchars_decode($ex_footer);
//update
示例3: basename
*
*/
// not for directly open
if (!defined('IN_ADMIN')) {
exit;
}
//for style ..
$stylee = "admin_rules";
$action = basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php');
$affected = false;
$H_FORM_KEYS = kleeja_add_form_key('adm_rules');
//
// Check form key
//
if (isset($_POST['submit'])) {
if (!kleeja_check_form_key('adm_rules')) {
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
}
}
$query = array('SELECT' => 'rules', 'FROM' => "{$dbprefix}stats");
$result = $SQL->build($query);
while ($row = $SQL->fetch_array($result)) {
$rulesw = isset($_POST['rules_text']) ? $_POST['rules_text'] : $row['rules'];
$rules = htmlspecialchars($rulesw);
//when submit
if (isset($_POST['submit'])) {
//update
$update_query = array('UPDATE' => "{$dbprefix}stats", 'SET' => "rules = '" . $SQL->real_escape($rulesw) . "'");
$SQL->build($update_query);
if ($SQL->affected()) {
$affected = true;
示例4: get_lang
//get languge of admin
get_lang('acp');
//
//need to login again
//
if (empty($_SESSION['ADMINLOGIN']) || $_SESSION['ADMINLOGIN'] != md5(sha1($config['h_key']) . $usrcp->name() . $config['siteurl']) || (empty($_SESSION['USER_SESS']) || $_SESSION['USER_SESS'] != session_id()) || (empty($_SESSION['ADMINLOGIN_T']) || $_SESSION['ADMINLOGIN_T'] < time())) {
if (isset($_GET['go']) && $_GET['go'] == 'login') {
if (isset($_POST['submit'])) {
//login
$ERRORS = array();
$pass_field = 'lpass_' . preg_replace('/[^0-9]/', '', sha1($klj_session . sha1($config['h_key']) . $_POST['kid']));
if (empty($_POST['lname']) || empty($_POST[$pass_field])) {
$ERRORS[] = $lang['EMPTY_FIELDS'];
} elseif (!user_can('enter_acp')) {
$ERRORS[] = $lang['U_NOT_ADMIN'];
} elseif (!kleeja_check_form_key('admin_login')) {
$ERRORS[] = $lang['INVALID_FORM_KEY'];
}
if (!sizeof($ERRORS)) {
if ($f = $usrcp->data($_POST['lname'], $_POST[$pass_field], false, $adm_time, true)) {
$_SESSION['USER_SESS'] = session_id();
$_SESSION['ADMINLOGIN'] = md5(sha1($config['h_key']) . $usrcp->name() . $config['siteurl']);
//to make sure, sometime setting time from fucntions doesnt work
$_SESSION['ADMINLOGIN_T'] = time() + $adm_time;
redirect('./' . basename(ADMIN_PATH) . '?cp=' . $go_to);
$SQL->close();
exit;
} else {
//Wrong entries
$ERRORS[] = $lang['LOGIN_ERROR'];
}
示例5: basename
}
$tpl_content = '';
if ($filename = @fopen($tpl_path, 'w')) {
@fwrite($filename, $tpl_content);
@fclose($filename);
}
$link = basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&style_choose=' . $style_id . '&method=1';
$text = $lang['TPL_CREATED'] . '<br /> <a href="' . $link . '">' . $lang['GO_BACK_BROWSER'] . '</a><meta HTTP-EQUIV="REFRESH" content="1; url=' . $link . '">' . "\n";
$stylee = "admin_info";
}
//return bakup template
if (isset($_POST['submit_bk_tpl'])) {
//
// Check form key
//
if (!kleeja_check_form_key('adm_style_order_bkup')) {
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $redirect_to, 1);
}
//style id
$style_id = str_replace('..', '', $SQL->escape($_POST['style_id']));
$tpl_name = str_replace('..', '', $SQL->escape($_POST['tpl_choose']));
include_once PATH . 'includes/bk_templates.php';
if (!isset($bkup_templates[$tpl_name])) {
redirect(basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&style_choose=' . $style_id . '&method=1');
exit;
}
$tpl_path = PATH . 'styles/' . $style_id . '/' . $tpl_name;
if (is_writable($tpl_path)) {
if ($filename = @fopen($tpl_path, 'w')) {
@fwrite($filename, kleeja_base64_decode($bkup_templates[$tpl_name]));
@fclose($filename);
示例6: setTimeout
$text .= '<script type="text/javascript"> setTimeout("get_kleeja_link(\'' . $link . '\');", 2000);</script>' . "\n";
$current_template = 'info.php';
} else {
$text = sprintf($lang['T_ISNT_WRITEABLE'], $tpl_name);
$text .= '<script type="text/javascript"> setTimeout("get_kleeja_link(\'' . $link . '\');", 2000);</script>' . "\n";
$current_template = 'err.php';
//kleeja_admin_err(, true,'', true, $link, 5);
}
//kleeja_admin_info(, true,'', true, $link, 5);
}
//new template file
if (isset($_POST['submit_new_tpl'])) {
//
// Check form key
//
if (!kleeja_check_form_key('adm_style_order_add')) {
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $redirect_to, 1);
}
//style id
$style_id = str_replace('..', '', $SQL->escape($_POST['style_id']));
//tpl name
$tpl_name = str_replace(array('..', '.html', '.php'), '', $_POST['new_tpl']);
$tpl_path = PATH . 'styles/' . $style_id . '/' . $tpl_name . '.html';
//same name, exists before, let's edit it
if (file_exists($tpl_path)) {
$tpl_path = PATH . 'styles/' . $style_id . '/' . str_replace('.html', substr(uniqid('_'), 0, 5) . '.html', $tpl_name);
}
$tpl_content = '';
if ($filename = @fopen($tpl_path, 'w')) {
@fwrite($filename, $tpl_content);
@fclose($filename);
示例7: basename
//for style ..
$stylee = "admin_exts";
$action = basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&page=' . (isset($_GET['page']) ? intval($_GET['page']) : 1);
$action_new_ext = basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&add_new_ext=1';
$H_FORM_KEYS = kleeja_add_form_key('adm_exts');
$H_FORM_KEYS2 = kleeja_add_form_key('adm_exts_new_ext');
//
// Check form key
//
if (isset($_POST['submit'])) {
if (!kleeja_check_form_key('adm_exts')) {
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
}
}
if (isset($_GET['add_new_ext'])) {
if (!kleeja_check_form_key('adm_exts_new_ext')) {
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
}
}
//show exts
$query = array('SELECT' => '*', 'FROM' => "{$dbprefix}exts");
$result_p = $SQL->build($query);
//pager
$nums_rows = $SQL->num_rows($result_p);
$currentPage = isset($_GET['page']) ? intval($_GET['page']) : 1;
$Pager = new SimplePager($perpage, $nums_rows, $currentPage);
$start = $Pager->getStartRow();
$no_results = false;
if ($nums_rows > 0) {
$query['LIMIT'] = "{$start}, {$perpage}";
$result = $SQL->build($query);
示例8: basename
*
*/
// not for directly open
if (!defined('IN_ADMIN')) {
exit;
}
//for style ..
$stylee = "admin_ban";
$action = basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php');
$affected = false;
$H_FORM_KEYS = kleeja_add_form_key('adm_ban');
//
// Check form key
//
if (isset($_POST['submit'])) {
if (!kleeja_check_form_key('adm_ban')) {
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
}
}
$query = array('SELECT' => 'ban', 'FROM' => "{$dbprefix}stats");
$result = $SQL->build($query);
while ($row = $SQL->fetch_array($result)) {
$ban = isset($_POST["ban_text"]) ? htmlspecialchars($_POST['ban_text']) : $row['ban'];
//when submit
if (isset($_POST['submit'])) {
//update
$update_query = array('UPDATE' => "{$dbprefix}stats", 'SET' => "ban='" . $SQL->escape($ban) . "'");
$SQL->build($update_query);
if ($SQL->affected()) {
$affected = true;
delete_cache('data_ban');
示例9: eval
($hook = $plugin->run_hook('get_pass_logon_before')) ? eval($hook) : null;
//run hook
kleeja_info($lang['LOGINED_BEFORE']);
}
#set variables
$t_rmail = p('rmail', 'mail', false);
#no submit yet
if (!ip('submit')) {
($hook = $plugin->run_hook('no_submit_get_pass')) ? eval($hook) : null;
//run hook
} else {
$ERRORS = array();
($hook = $plugin->run_hook('submit_get_pass')) ? eval($hook) : null;
//run hook
//check for form key
if (!kleeja_check_form_key('get_pass')) {
$ERRORS['form_key'] = $lang['INVALID_FORM_KEY'];
}
if (!kleeja_check_captcha()) {
$ERRORS['captcha'] = $lang['WRONG_VERTY_CODE'];
}
if (!$t_rmail) {
$ERRORS['rmail'] = $lang['WRONG_EMAIL'];
} else {
#if email not exists
$query_chk = array('SELECT' => 'u.mail', 'FROM' => "{$dbprefix}users u", 'WHERE' => "u.mail='" . strtolower($SQL->escape($t_rmail)) . "'");
($hook = $plugin->run_hook('get_pass_query_chk')) ? eval($hook) : null;
//run hook
$result_chk = $SQL->build($query_chk);
if (!$SQL->num($result_chk)) {
$ERRORS['no_rmail'] = $lang['WRONG_DB_EMAIL'];
示例10: basename
$page_action = basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . $url_pg . $url_or . $url_sea . $url_lst;
$ord_action = basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . $url_pg . $url_sea . $url_lst;
$page2_action = basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . $url_or2 . $url_sea . $url_lst;
$action = $page_action;
$is_search = $affected = false;
$H_FORM_KEYS = kleeja_add_form_key('adm_files');
//
// Check form key
//
if (isset($_POST['submit'])) {
if (!kleeja_check_form_key('adm_files')) {
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
}
}
if (isset($_POST['search_file'])) {
if (!kleeja_check_form_key('adm_files_search')) {
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, basename(ADMIN_PATH) . '?cp=h_search', 1);
}
}
//
//Delete all user files [only one user]
//
if (isset($_GET['deletefiles'])) {
$query = array('SELECT' => 'id,size,name,folder', 'FROM' => "{$dbprefix}files AS f");
$search = kleeja_base64_decode($_GET['deletefiles']);
$search = unserialize($search);
$search['filename'] = !isset($search['filename']) ? '' : $search['filename'];
$search['username'] = !isset($search['username']) ? '' : $search['username'];
$search['than'] = !isset($search['than']) ? 1 : $search['than'];
$search['size'] = !isset($search['size']) ? '' : $search['size'];
$search['ups'] = !isset($search['ups']) ? '' : $search['ups'];
示例11: isset
if (!defined('IN_ADMIN')) {
exit;
}
//for style ..
$current_template = 'messages.php';
$current_smt = isset($_GET['smt']) ? preg_match('![a-z0-9_]!i', trim($_GET['smt'])) ? trim($_GET['smt']) : 'general' : 'general';
$action = ADMIN_PATH . '?cp=messages&page=' . (isset($_GET['page']) ? intval($_GET['page']) : 1) . '&smt=' . $current_smt;
$msg_sent = isset($_GET['sent']) ? intval($_GET['sent']) : false;
$H_FORM_KEYS = kleeja_add_form_key('adm_messages');
$there_queue = preg_match('!:del_[a-z0-9]{0,3}messages:!i', $config['queue']);
print_r($_POST);
//
// Check form key
//
if (isset($_POST['submit'])) {
if (!kleeja_check_form_key('adm_messages')) {
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
}
}
#add delete process to the queue
if ($current_smt == 'del_d30' || $current_smt == 'del_all') {
if (strpos($config['queue'], ':' . $current_smt . 'messages:') !== false) {
kleeja_admin_err($lang['DELETE_PROCESS_IN_WORK'], true, $lang['ERROR'], true, ADMIN_PATH . '?cp=messages', 1);
} else {
update_config('queue', $config['queue'] . ':' . $current_smt . 'messages:');
kleeja_admin_info($lang['DELETE_PROCESS_QUEUED'], true, '', true, ADMIN_PATH . '?cp=messages');
}
}
$query = array('SELECT' => 'c.*', 'FROM' => "`{$dbprefix}messages` c", 'ORDER BY' => 'c.id DESC');
if ($current_smt == 'show_h24') {
$query['WHERE'] = 'c.time > ' . intval(time() - 3600 * 24);
示例12: basename
exit;
}
//for style ..
$stylee = "admin_configs";
//words
$action = basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php');
$n_submit = $lang['UPDATE_CONFIG'];
$options = '';
$SHOW_CH_STAGE = isset($_GET['type']) ? false : true;
$CONFIGEXTEND = false;
$H_FORM_KEYS = kleeja_add_form_key('adm_configs');
//
// Check form key
//
if (isset($_POST['submit'])) {
if (!kleeja_check_form_key('adm_configs')) {
$redirect_url = $action . (isset($_GET['type']) ? '&type=' . htmlspecialchars($_GET['type']) : '');
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $redirect_url, 1);
}
}
switch ($SHOW_CH_STAGE) {
//
//box of config types
//
case true:
$query = array('SELECT' => 'DISTINCT(type)', 'FROM' => "{$dbprefix}config", 'WHERE' => '`option` != \'\'', 'ORDER BY' => 'display_order');
$result = $SQL->build($query);
$icons_path = $STYLE_PATH_ADMIN . 'images/config_icons/';
$default_icon = $icons_path . 'default.png';
$typesnavi = array();
while ($row = $SQL->fetch_array($result)) {
示例13: explode
$siteurl_parts = explode('/', $ftp_info['host']);
$ftp_info['host'] = $siteurl_parts[0];
}
}
switch ($current_step) {
default:
//general
$not_writable = false;
//check if not writable then we need ftp
if (!is_writable(PATH)) {
$not_writable = true;
//kleeja_admin_info($lang['KLJ_DIR_NOT_WR']);
}
//save ftp info in database
if (isset($_POST['_fmethod']) && $_POST['_fmethod'] == 'kftp') {
if (!kleeja_check_form_key('adm_aupdate', 3600)) {
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
}
$ups->save_f_method('kftp');
$ups->f_method = 'kftp';
if (empty($_POST['ftp_host']) || empty($_POST['ftp_port']) || empty($_POST['ftp_user']) || empty($_POST['ftp_pass'])) {
kleeja_admin_err($lang['EMPTY_FIELDS'], true, '', true, basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php'));
} else {
$ups->info = $ftpinfo = array('host' => $_POST['ftp_host'], 'port' => $_POST['ftp_port'], 'user' => $_POST['ftp_user'], 'pass' => $_POST['ftp_pass'], 'path' => $_POST['ftp_path']);
$ftpinfo['pass'] = '';
update_config('ftp_info', serialize($ftpinfo), false);
if (!$ups->check_connect()) {
kleeja_admin_err($lang['LOGIN_ERROR'], true, '', true, basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '?#!cp=' . basename(__FILE__, '.php'));
} else {
//. '&' . $GET_FORM_KEY
$ups->atend();
示例14: kleeja_admin_err
if (!kleeja_check_form_key('adm_users_newgroup')) {
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
}
}
if (isset($_POST['editacl'])) {
if (!kleeja_check_form_key('adm_users_editacl')) {
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
}
}
if (isset($_POST['editdata'])) {
if (!kleeja_check_form_key('adm_users_editdata')) {
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
}
}
if (isset($_POST['newext']) or isset($_POST['editexts'])) {
if (!kleeja_check_form_key('adm_users_editexts')) {
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
}
}
//
//delete all user files [only one user]
//
if (isset($_GET['deleteuserfile'])) {
//check _GET Csrf token
if (!kleeja_check_form_key_get('adm_users')) {
kleeja_admin_err($lang['INVALID_GET_KEY'], true, $lang['ERROR'], true, $action_all, 2);
}
//is exists ?
if (!$SQL->num($SQL->query("SELECT * FROM {$dbprefix}users WHERE id=" . intval($_GET['deleteuserfile'])))) {
redirect($action_all);
}
示例15: elseif
$cache->clean('__changes_files__');
//redirect(basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php'));
//show first page of plugins
} elseif (!isset($_GET['do_plg'])) {
//for style ..
$stylee = "admin_plugins";
$current_smt = isset($_GET['smt']) ? preg_match('![a-z0-9_]!i', trim($_GET['smt'])) ? trim($_GET['smt']) : 'general' : 'general';
$action = basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&smt=' . $current_smt;
$no_plugins = false;
//kleeja depend on its users .. and kleeja love them .. so let's tell them about that ..
$klj_d_s = $lang['KLJ_MORE_PLUGINS'][rand(0, sizeof($lang['KLJ_MORE_PLUGINS']) - 1)];
//
// Check form key
//
if (isset($_POST['submit_new_plg'])) {
if (!kleeja_check_form_key('adm_plugins', 3600)) {
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
}
}
//empty array of icons
$plugins_icons = array();
//get plugins
$query = array('SELECT' => 'p.plg_id, p.plg_name, plg_icon, p.plg_disabled, p.plg_ver, p.plg_ver, p.plg_author, p.plg_dsc, p.plg_instructions', 'FROM' => "{$dbprefix}plugins p");
$result = $SQL->build($query);
if ($SQL->num_rows($result) > 0) {
$arr = array();
$i = 1;
while ($row = $SQL->fetch_array($result)) {
$desc = unserialize(kleeja_base64_decode($row['plg_dsc']));
$arr[] = array('i' => $i % 3 == 0, 'plg_id' => $row['plg_id'], 'plg_name' => str_replace('-', ' ', $row['plg_name']) . ($row['plg_disabled'] == 1 ? ' [ x ]' : ''), 'plg_disabled' => (int) $row['plg_disabled'] == 1 ? true : false, 'plg_ver' => $row['plg_ver'], 'plg_author' => $row['plg_author'], 'plg_dsc' => isset($desc[$config['language']]) ? $desc[$config['language']] : $desc['en'], 'plg_instructions' => trim($row['plg_instructions']) == '' ? false : true, 'plg_icon_url' => basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&iconp=' . $row['plg_id']);
$i++;