• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP formhash函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中formhash函数的典型用法代码示例。如果您正苦于以下问题:PHP formhash函数的具体用法?PHP formhash怎么用?PHP formhash使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了formhash函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: submitcheck

 public static function submitcheck($var, $allowget = 0, $seccodecheck = 0, $secqaacheck = 0)
 {
     if (!getgpc($var)) {
         return FALSE;
     } else {
         global $_G;
         if ($allowget || $_SERVER['REQUEST_METHOD'] == 'POST' && !empty($_GET['formhash']) && $_GET['formhash'] == formhash() && empty($_SERVER['HTTP_X_FLASH_VERSION']) && (empty($_SERVER['HTTP_REFERER']) || preg_replace("/https?:\\/\\/([^\\:\\/]+).*/i", "\\1", $_SERVER['HTTP_REFERER']) == preg_replace("/([^\\:]+).*/", "\\1", $_SERVER['HTTP_HOST']))) {
             if (empty($_GET['phone_reg'])) {
                 if (checkperm('seccode')) {
                     if ($secqaacheck && !check_secqaa($_GET['secanswer'], $_GET['sechash'])) {
                         showmessage('submit_secqaa_invalid');
                     }
                     if ($seccodecheck && !check_seccode($_GET['seccodeverify'], $_GET['sechash'])) {
                         showmessage('submit_seccode_invalid');
                     }
                 }
             }
             return TRUE;
             // For ios reg modify by heavenK
         } elseif ($_SERVER['REQUEST_METHOD'] == 'POST' && !empty($_GET['formhash']) && !empty($_GET['phone_reg']) && empty($_SERVER['HTTP_X_FLASH_VERSION']) && empty($_SERVER['HTTP_REFERER'])) {
             return TRUE;
         } else {
             //add by zh
             if ($_GET['mod'] == 'sms' && $_GET['flag'] == 1) {
                 exit(lang('message', 'submit_invalid'));
             } else {
                 showmessage('submit_invalid');
             }
         }
     }
 }
开发者ID:Jaedeok-seol,项目名称:discuz_template,代码行数:31,代码来源:helper_form.php


示例2: index

 function index()
 {
     global $viewhelper;
     $viewhelper->setPosition(L("apply_friendlink", "tpl"));
     formhash();
     render("friendlink");
 }
开发者ID:reboxhost,项目名称:phpb2b,代码行数:7,代码来源:friendlink_controller.php


示例3: _init_env

 function _init_env()
 {
     error_reporting(E_ERROR);
     if (phpversion() < '5.3.0') {
         set_magic_quotes_runtime(0);
     }
     define('MAGIC_QUOTES_GPC', function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc());
     define('ICONV_ENABLE', function_exists('iconv'));
     define('MB_ENABLE', function_exists('mb_convert_encoding'));
     define('FORMHASH', formhash());
     define('TIMESTAMP', time());
     $_SERVER['HTTP_USER_AGENT'] = empty($_SERVER['HTTP_USER_AGENT']) ? '' : $_SERVER['HTTP_USER_AGENT'];
     foreach ($GLOBALS as $key => $value) {
         if (!isset($this->superglobal[$key])) {
             $GLOBALS[$key] = null;
             unset($GLOBALS[$key]);
         }
     }
     global $_G;
     $_G = array('uid' => 0, 'username' => 'Guest', 'formhash' => '', 'timestamp' => TIMESTAMP, 'starttime' => array_sum(explode(' ', microtime())), 'clientip' => $this->_get_client_ip(), 'referer' => '', 'charset' => '', 'timenow' => array(), 'cookiepre' => '', 'PHP_SELF' => '', 'siteurl' => '', 'siteroot' => '', 'authkey' => '', 'config' => array(), 'setting' => array('sitetheme' => 'default'), 'member' => array(), 'cookie' => array(), 'style' => array(), 'cache' => array());
     $_G['PHP_SELF'] = htmlspecialchars($_SERVER['SCRIPT_NAME'] ? $_SERVER['SCRIPT_NAME'] : $_SERVER['PHP_SELF']);
     $_G['basescript'] = CURSCRIPT;
     $_G['basefilename'] = basename($_G['PHP_SELF']);
     $_G['siteurl'] = htmlspecialchars('http://' . $_SERVER['HTTP_HOST'] . preg_replace("/\\/+(api)?\\/*\$/i", '', substr($_G['PHP_SELF'], 0, strrpos($_G['PHP_SELF'], '/'))) . '/');
     $_G['siteroot'] = substr($_G['PHP_SELF'], 0, -strlen($_G['basefilename']));
 }
开发者ID:pan289091315,项目名称:Discuz,代码行数:26,代码来源:brand.class.php


示例4: uploadfile

 public function uploadfile()
 {
     if ($_GET['from'] == 'swfupload') {
         $uid = intval($_GET['uid']);
         $username = trim($_GET['username']);
         $token = sha1($uid . $username . formhash());
         if (!$uid || !$username || $token != $_GET['token']) {
             echo json_encode(array('state' => 0, 'info' => 'nologin'));
             exit;
         }
     } else {
         $this->_checkuser();
         $uid = $this->uid;
     }
     $config = $GLOBALS['G']['config']['output'];
     $upload = new Upload();
     $attachment = 'attach/' . date('Y') . '/' . date('m') . '/' . $upload->setfilename();
     if ($upload->save(ROOT_PATH . '/' . $config['attachdir'] . '/' . $attachment)) {
         $attachdata = array('uid' => $uid, 'attachname' => $upload->oriname(), 'attachment' => $attachment, 'attachsize' => $upload->size(), 'attachtype' => $upload->type(), 'attachtime' => time());
         $attachdata['attachid'] = $this->t('attachment')->insert($attachdata, true);
         echo json_encode(array('state' => 1, 'data' => $attachdata));
         exit;
     } else {
         echo json_encode(array('state' => 0, 'info' => 'Upload Failed(' . $upload->error . ')'));
         exit;
     }
 }
开发者ID:xy113,项目名称:XiangBaLaoServer,代码行数:27,代码来源:class.MiscController.php


示例5: global_footer

    public function global_footer()
    {
        global $_G, $_GET;
        if (self::$securityStatus != TRUE) {
            return false;
        }
        $formhash = formhash();
        if ($_G['adminid']) {
            $processName = 'securityOperate';
            if (self::$isAdminGroup && !discuz_process::islocked($processName, 30)) {
                $ajaxReportScript = <<<EOF
\t\t\t\t\t<script type='text/javascript'>
\t\t\t\t\tvar url = SITEURL + '/plugin.php?id=security:sitemaster';
\t\t\t\t\tvar x = new Ajax();
\t\t\t\t\tx.post(url, 'formhash={$formhash}', function(s){});
\t\t\t\t\t</script>
EOF;
            }
        }
        $processName = 'securityRetry';
        $time = 10;
        if (!discuz_process::islocked($processName, $time)) {
            if (C::t('#security#security_failedlog')->count()) {
                $ajaxRetryScript = <<<EOF
\t\t\t\t\t<script type='text/javascript'>
\t\t\t\t\tvar urlRetry = SITEURL + '/plugin.php?id=security:job';
\t\t\t\t\tvar ajaxRetry = new Ajax();
\t\t\t\t\tajaxRetry.post(urlRetry, 'formhash={$formhash}', function(s){});
\t\t\t\t\t</script>
EOF;
            }
        }
        return $ajaxReportScript . $ajaxRetryScript;
    }
开发者ID:softhui,项目名称:discuz,代码行数:34,代码来源:security.class.php


示例6: setloginstatus

function setloginstatus($member, $cookietime)
{
    global $_G;
    $_G['uid'] = intval($member['uid']);
    $_G['username'] = $member['username'];
    $_G['adminid'] = $member['adminid'];
    $_G['groupid'] = $member['groupid'];
    $_G['formhash'] = formhash();
    $_G['session']['invisible'] = getuserprofile('invisible');
    $_G['member'] = $member;
    loadcache('usergroup_' . $_G['groupid']);
    C::app()->session->isnew = true;
    C::app()->session->updatesession();
    dsetcookie('auth', authcode("{$member['password']}\t{$member['uid']}", 'ENCODE'), $cookietime, 1, true);
    dsetcookie('loginuser');
    dsetcookie('activationauth');
    dsetcookie('pmnum');
    include_once libfile('function/stat');
    updatestat('login', 1);
    if (defined('IN_MOBILE')) {
        updatestat('mobilelogin', 1);
    }
    if ($_G['setting']['connect']['allow'] && $_G['member']['conisbind']) {
        updatestat('connectlogin', 1);
    }
    $rule = updatecreditbyaction('daylogin', $_G['uid']);
    if (!$rule['updatecredit']) {
        checkusergroup($_G['uid']);
    }
}
开发者ID:tang86,项目名称:discuz-utf8,代码行数:30,代码来源:function_member.php


示例7: global_footer

    function global_footer()
    {
        global $_G;
        if (!$this->_secStatus) {
            return false;
        }
        $formhash = formhash();
        $ajaxReportScript = '';
        $processName = 'securitOperate';
        if ($this->isAdminGroup && !discuz_process::islocked($processName, 10)) {
            $ajaxReportScript = <<<EOF
\t\t\t<script type='text/javascript'>
\t\t\tvar url = SITEURL + '/plugin.php?id=security:sitemaster';
\t\t\tvar x = new Ajax();
\t\t\tx.post(url, 'formhash={$formhash}', function(s){});
\t\t\t</script>
EOF;
        }
        $processName = 'securitRetry';
        $time = 5;
        if ($_G['gp_d']) {
            $time = 1;
        }
        if (!discuz_process::islocked($processName, $time)) {
            $ajaxRetryScript = <<<EOF
\t\t\t<script type='text/javascript'>
\t\t\tvar urlRetry = SITEURL + '/plugin.php?id=security:job';
\t\t\tvar ajaxRetry = new Ajax();
\t\t\tajaxRetry.post(urlRetry, 'formhash={$formhash}', function(s){});
\t\t\t</script>
EOF;
        }
        return $ajaxReportScript . $ajaxRetryScript;
    }
开发者ID:v998,项目名称:discuzx-en,代码行数:34,代码来源:security.class.php


示例8: onUsersGetFormHash

 public function onUsersGetFormHash($uId, $userAgent)
 {
     global $_G;
     $uId = intval($uId);
     if (!$uId) {
         return false;
     }
     $member = getuserbyuid($uId, 1);
     $_G['username'] = $member['username'];
     $_G['uid'] = $member['uid'];
     $_G['authkey'] = md5($_G['config']['security']['authkey'] . $userAgent);
     return formhash();
 }
开发者ID:softhui,项目名称:discuz,代码行数:13,代码来源:Users.php


示例9: submitcheck

function submitcheck($var)
{
    $CI =& get_instance();
    if ($CI->input->post($var) && $_SERVER['REQUEST_METHOD'] == 'POST') {
        if ((empty($_SERVER['HTTP_REFERER']) || preg_replace("/https?:\\/\\/([^\\:\\/]+).*/i", "\\1", $_SERVER['HTTP_REFERER']) == preg_replace("/([^\\:]+).*/", "\\1", $_SERVER['HTTP_HOST'])) && $CI->input->userdata('formhash') == formhash()) {
            return true;
        } else {
            showmessage('submit_invalid');
        }
    } else {
        return false;
    }
}
开发者ID:sdgdsffdsfff,项目名称:hiveAdmin,代码行数:13,代码来源:functions_helper.php


示例10: common_base

 function common_base()
 {
     global $_G;
     if (!isset($_G['connect'])) {
         $_G['connect']['url'] = 'http://connect.discuz.qq.com';
         $_G['connect']['api_url'] = 'http://api.discuz.qq.com';
         $_G['connect']['avatar_url'] = 'http://avatar.connect.discuz.qq.com';
         // QZone公共分享页面URL
         $_G['connect']['qzone_public_share_url'] = 'http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey';
         $_G['connect']['referer'] = !$_G['inajax'] && CURSCRIPT != 'member' ? $_G['basefilename'] . ($_SERVER['QUERY_STRING'] ? '?' . $_SERVER['QUERY_STRING'] : '') : dreferer();
         // 微薄公共分享Appkey
         $_G['connect']['weibo_public_appkey'] = 'ce7fb946290e4109bdc9175108b6db3a';
         // 新版Connect登录本地代理页
         $_G['connect']['login_url'] = $_G['siteurl'] . 'connect.php?mod=login&op=init&referer=' . urlencode($_G['connect']['referer'] ? $_G['connect']['referer'] : 'index.php');
         // 新版Connect本地Callback代理页
         $_G['connect']['callback_url'] = $_G['siteurl'] . 'connect.php?mod=login&op=callback';
         // 发feed js通知本地代理页
         $_G['connect']['discuz_new_feed_url'] = $_G['siteurl'] . 'connect.php?mod=feed&op=new&formhash=' . formhash();
         $_G['connect']['discuz_new_post_feed_url'] = $_G['siteurl'] . 'connect.php?mod=feed&op=new&action=post&formhash=' . formhash();
         // 发分享js通知本地代理页
         //$_G['connect']['discuz_new_share_url'] = $_G['siteurl'].'connect.php?mod=share&op=new';
         $_G['connect']['discuz_new_share_url'] = $_G['siteurl'] . 'home.php?mod=spacecp&ac=plugin&id=qqconnect:spacecp&pluginop=new';
         // 分享到微博后的回流处理地址
         $_G['connect']['discuz_sync_tthread_url'] = $_G['siteurl'] . 'home.php?mod=spacecp&ac=plugin&id=qqconnect:spacecp&pluginop=sync_tthread&formhash=' . formhash();
         // 更换QQ号登录本地代理页
         $_G['connect']['discuz_change_qq_url'] = $_G['siteurl'] . 'connect.php?mod=login&op=change';
         // QC授权项对应关系
         $_G['connect']['auth_fields'] = array('is_user_info' => 1, 'is_feed' => 2);
         if ($_G['uid']) {
             dsetcookie('connect_is_bind', $_G['member']['conisbind'], 31536000);
             if (!$_G['member']['conisbind'] && $_G['cookie']['connect_login']) {
                 $_G['cookie']['connect_login'] = 0;
                 dsetcookie('connect_login');
             }
         }
         // QQ互联游客更换用户名为QQ昵称
         if (!$_G['uid'] && $_G['connectguest']) {
             if ($_G['cookie']['connect_qq_nick']) {
                 $_G['member']['username'] = $_G['cookie']['connect_qq_nick'];
             } else {
                 $connectGuest = C::t('#qqconnect#common_connect_guest')->fetch($conopenid);
                 if ($connectGuest['conqqnick']) {
                     $_G['member']['username'] = $connectGuest['conqqnick'];
                 }
             }
         }
         if ($this->allow && !$_G['uid'] && !defined('IN_MOBILE')) {
             $_G['setting']['pluginhooks']['global_login_text'] = tpl_login_bar();
         }
     }
 }
开发者ID:dalinhuang,项目名称:healthshop,代码行数:51,代码来源:connect.class.php


示例11: setloginstatus

function setloginstatus($member, $cookietime)
{
    global $_G;
    $_G['uid'] = $member['uid'];
    $_G['username'] = $member['username'];
    $_G['adminid'] = $member['adminid'];
    $_G['groupid'] = $member['groupid'];
    $_G['formhash'] = formhash();
    $_G['session']['invisible'] = getuserprofile('invisible');
    $_G['member'] = $member;
    $_G['core']->session->isnew = 1;
    dsetcookie('auth', authcode("{$member['password']}\t{$member['uid']}", 'ENCODE'), $cookietime, 1, true);
    dsetcookie('loginuser');
    dsetcookie('activationauth');
    dsetcookie('pmnum');
}
开发者ID:Kingson4Wu,项目名称:php_demo,代码行数:16,代码来源:function_login.php


示例12: setloginstatus

function setloginstatus($member, $cookietime)
{
    global $_G;
    foreach ($_G['cookie'] as $k => $v) {
        dsetcookie($k);
    }
    $_G['uid'] = $member['uid'];
    $_G['username'] = addslashes($member['username']);
    $_G['adminid'] = $member['adminid'];
    $_G['groupid'] = $member['groupid'];
    $_G['formhash'] = formhash();
    $_G['session']['invisible'] = getuserprofile('invisible');
    $_G['member'] = $member;
    $discuz =& discuz_core::instance();
    $discuz->session->isnew = true;
    dsetcookie('auth', authcode("{$member['password']}\t{$member['uid']}", 'ENCODE'), $cookietime, 1, true);
    dsetcookie('loginuser');
    dsetcookie('activationauth');
    dsetcookie('pmnum');
}
开发者ID:v998,项目名称:discuzx-en,代码行数:20,代码来源:function_member.php


示例13: submitcheck

 public static function submitcheck($var, $allowget = 0, $seccodecheck = 0, $secqaacheck = 0)
 {
     if (!getgpc($var)) {
         return FALSE;
     } else {
         global $_G;
         if ($allowget || $_SERVER['REQUEST_METHOD'] == 'POST' && !empty($_GET['formhash']) && $_GET['formhash'] == formhash() && empty($_SERVER['HTTP_X_FLASH_VERSION']) && (empty($_SERVER['HTTP_REFERER']) || strncmp($_SERVER['HTTP_REFERER'], 'http://wsq.discuz.qq.com', 24) === 0 || strncmp($_SERVER['HTTP_REFERER'], 'http://m.wsq.qq.com', 19) === 0 || preg_replace("/https?:\\/\\/([^\\:\\/]+).*/i", "\\1", $_SERVER['HTTP_REFERER']) == preg_replace("/([^\\:]+).*/", "\\1", $_SERVER['HTTP_HOST']))) {
             if (checkperm('seccode')) {
                 if ($secqaacheck && !check_secqaa($_GET['secanswer'], $_GET['secqaahash'])) {
                     showmessage('submit_secqaa_invalid');
                 }
                 if ($seccodecheck && !check_seccode($_GET['seccodeverify'], $_GET['seccodehash'], 0, $_GET['seccodemodid'])) {
                     showmessage('submit_seccode_invalid');
                 }
             }
             return TRUE;
         } else {
             showmessage('submit_invalid');
         }
     }
 }
开发者ID:MCHacker,项目名称:discuz-docker,代码行数:21,代码来源:helper_form.php


示例14: output

 function output()
 {
     global $_G;
     parse_str($_G['messageparam'][1], $p);
     $variable = array('auth' => $p['auth']);
     if ($_G['uid']) {
         require_once DISCUZ_ROOT . './source/plugin/wechat/wsq.class.php';
         if (method_exists('wsq', 'userloginUrl')) {
             $_source = isset($_GET['_source']) ? $_GET['_source'] : '';
             if (!$_source && !empty($_GET['openid']) && !empty($_GET['openidsign'])) {
                 $variable['loginUrl'] = wsq::userloginUrl($_G['uid'], $_GET['openid'], $_GET['openidsign']);
                 if (!C::t('#wechat#common_member_wechatmp')->fetch($_G['uid'])) {
                     C::t('#wechat#common_member_wechatmp')->insert(array('uid' => $_G['uid'], 'openid' => $_GET['openid'], 'status' => 1), false, true);
                 }
             } else {
                 $variable['loginUrl'] = wsq::userloginUrl2($_G['uid']);
             }
         }
     }
     $variable['formhash'] = formhash();
     mobile_core::result(mobile_core::variable($variable));
 }
开发者ID:lemonstory,项目名称:bbs,代码行数:22,代码来源:login.php


示例15: formhash

">友情链接</a> | 
<a href="<?php 
    echo S_URL;
    ?>
/html/49/n-17649.html">版权声明</a> | 
<a href="<?php 
    echo S_URL;
    ?>
/html/48/n-17648.html">联系我们</a>
</p>
<form action="<?php 
    echo S_URL;
    ?>
/batch.search.php" method="post">
<input type="hidden" name="formhash" value="<?php 
    echo formhash();
    ?>
" />
<input type="hidden" name="searchname" id="searchname" value="subject" />
<p class="footer_search">
<select name="searchtxt" id="searchtxt" onchange="changetype();">
<option value="标题">标题</option>
<option value="内容">内容</option>
<option value="作者">作者</option>
</select>
<input class="input_tx" type="text" value="" name="searchkey" size="30"/>
<input class="input_search" type="submit" value="搜索" name="searchbtn"/>
</p>
</form>
</div>
<div class="copyright">
开发者ID:hongz1125,项目名称:devil,代码行数:31,代码来源:tpl_tobo20130125_o_footer.php


示例16: showmessage

                    showmessage('forum_usertag_set_continue', '', array('limit' => $limit, 'next' => min($limit + $per, $count), 'count' => $count), array('alert' => 'right'));
                }
                showmessage('forum_usertag_succeed', '', array(), array('alert' => 'right'));
            } else {
                showmessage('parameters_error', '', array('haserror' => 1));
            }
        }
    } else {
        showmessage('parameters_error', '', array('haserror' => 1));
    }
    include_once template("forum/usertag");
} elseif ($_GET['action'] == 'postreview') {
    if (!$_G['setting']['repliesrank'] || empty($_G['uid'])) {
        showmessage('to_login', null, array(), array('showmsg' => true, 'login' => 1));
    }
    if (empty($_GET['hash']) || $_GET['hash'] != formhash()) {
        showmessage('submit_invalid');
    }
    $doArray = array('support', 'against');
    $post = C::t('forum_post')->fetch('tid:' . $_GET['tid'], $_GET['pid'], false);
    if (!in_array($_GET['do'], $doArray) || empty($post) || $post['first'] == 1 || $_G['setting']['threadfilternum'] && $_G['setting']['filterednovote'] && getstatus($post['status'], 11)) {
        showmessage('undefined_action', NULL);
    }
    $hotreply = C::t('forum_hotreply_number')->fetch_by_pid($post['pid']);
    if ($_G['uid'] == $post['authorid']) {
        showmessage('noreply_yourself_error', '', array(), array('msgtype' => 3));
    }
    if (empty($hotreply)) {
        $hotreply['pid'] = C::t('forum_hotreply_number')->insert(array('pid' => $post['pid'], 'tid' => $post['tid'], 'support' => 0, 'against' => 0, 'total' => 0), true);
    } else {
        if (C::t('forum_hotreply_member')->fetch($post['pid'], $_G['uid'])) {
开发者ID:443952248,项目名称:jiazhichao,代码行数:31,代码来源:forum_misc.php


示例17: header

    echo '&nbsp;<a href="/">返回首页</a>';
    exit;
}
*/
if ($cur_user) {
    header('location: /');
    exit;
} else {
    if ($options['close_register']) {
        header('location: /login');
        exit;
    }
}
$errors = array();
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    if (empty($_SERVER['HTTP_REFERER']) || $_POST['formhash'] != formhash() || preg_replace("/https?:\\/\\/([^\\:\\/]+).*/i", "\\1", $_SERVER['HTTP_REFERER']) !== preg_replace("/([^\\:]+).*/", "\\1", $_SERVER['HTTP_HOST'])) {
        exit('403: unknown referer.');
    }
    $name = addslashes(strtolower(trim($_POST["name"])));
    $pw = addslashes(trim($_POST["pw"]));
    $pw2 = addslashes(trim($_POST["pw2"]));
    $seccode = intval(trim($_POST["seccode"]));
    if ($name && $pw && $pw2 && $seccode) {
        if ($pw === $pw2) {
            if (strlen($name) < 21 && strlen($pw) < 32) {
                //检测字符
                if (preg_match('/^[a-zA-Z0-9\\x80-\\xff]{4,20}$/i', $name)) {
                    if (preg_match('/^[0-9]{4,20}$/', $name)) {
                        $errors[] = '名字不能全为数字';
                    } else {
                        error_reporting(0);
开发者ID:zhangwenhua029,项目名称:YouBBS-EOEN,代码行数:31,代码来源:sigin.php


示例18: exit

<?php

/**
 *		[Discuz!] (C)2001-2099 Comsenz Inc.
 *		This is NOT a freeware, use is subject to license terms
 *
 *		$Id: evilnotice.inc.php 33944 2013-09-04 07:33:32Z nemohou $
 */
if (!defined('IN_DISCUZ')) {
    exit('Access Denied');
}
if ($_G['adminid'] <= 0) {
    exit('Access Denied');
}
if ($_GET['formhash'] != formhash()) {
    exit('Access Denied');
}
$count = empty($_G['cookie']['evilnotice']) ? C::t('#security#security_eviluser')->count_by_day() : 0;
include template('common/header_ajax');
if ($count) {
    echo '<div class="bm"><div class="bm_h cl"><a href="javascript:;" onclick="$(\'evil_notice\').style.display=\'none\';setcookie(\'evilnotice\', 1, 86400)" class="y" title="' . lang('plugin/security', 'notice_close') . '">' . lang('plugin/security', 'notice_close') . '</a>';
    echo '<h2 class="i">' . lang('plugin/security', 'notice_title') . '</h2></div><div class="bm_c">';
    echo '<div class="cl bbda pbm">' . lang('plugin/security', 'notice_memo', array('count' => $count)) . '</div>';
    echo '<div class="ptn cl"><a href="admin.php?action=cloud&operation=security&anchor=member" class="xi2 y">' . lang('plugin/security', 'notice_link') . ' &raquo;</a></div>';
    echo '</div></div>';
}
include template('common/footer_ajax');
开发者ID:MCHacker,项目名称:discuz-docker,代码行数:27,代码来源:evilnotice.inc.php


示例19: submitcheck

function submitcheck($var, $allowget = 0, $seccodecheck = 0, $secqaacheck = 0)
{
    if (empty($GLOBALS[$var])) {
        return FALSE;
    } else {
        global $_SERVER, $seclevel, $seccode, $seccodedata, $seccodeverify, $secanswer, $_DCACHE, $_DCOOKIE, $timestamp, $discuz_uid;
        if ($allowget || $_SERVER['REQUEST_METHOD'] == 'POST' && $GLOBALS['formhash'] == formhash() && empty($_SERVER['HTTP_X_FLASH_VERSION']) && (empty($_SERVER['HTTP_REFERER']) || preg_replace("/https?:\\/\\/([^\\:\\/]+).*/i", "\\1", $_SERVER['HTTP_REFERER']) == preg_replace("/([^\\:]+).*/", "\\1", $_SERVER['HTTP_HOST']))) {
            if ($seccodecheck) {
                if (!$seclevel) {
                    $key = $seccodedata['type'] != 3 ? '' : $_DCACHE['settings']['authkey'] . date('Ymd');
                    list($seccode, $expiration, $seccodeuid) = explode("\t", authcode($_DCOOKIE['secc'], 'DECODE', $key));
                    if ($seccodeuid != $discuz_uid || $timestamp - $expiration > 600) {
                        showmessage('submit_seccode_invalid');
                    }
                    dsetcookie('secc', '');
                } else {
                    $tmp = substr($seccode, 0, 1);
                }
                seccodeconvert($seccode);
                if (strtoupper($seccodeverify) != $seccode) {
                    showmessage('submit_seccode_invalid');
                }
                $seclevel && ($seccode = random(6, 1) + $tmp * 1000000);
            }
            if ($secqaacheck) {
                if (!$seclevel) {
                    list($seccode, $expiration, $seccodeuid) = explode("\t", authcode($_DCOOKIE['secq'], 'DECODE'));
                    if ($seccodeuid != $discuz_uid || $timestamp - $expiration > 600) {
                        showmessage('submit_secqaa_invalid');
                    }
                    dsetcookie('secq', '');
                }
                require_once DISCUZ_ROOT . './forumdata/cache/cache_secqaa.php';
                if (md5($secanswer) != $_DCACHE['secqaa'][substr($seccode, 0, 1)]['answer']) {
                    showmessage('submit_secqaa_invalid');
                }
                $seclevel && ($seccode = random(1, 1) * 1000000 + substr($seccode, -6));
            }
            return TRUE;
        } else {
            showmessage('submit_invalid');
        }
    }
}
开发者ID:xiaoxiaoleo,项目名称:ngintek,代码行数:44,代码来源:global.func.php


示例20: exit

<?php

/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: misc_initsys.php 27433 2012-01-31 08:16:01Z monkey $
 */
if (!defined('IN_DISCUZ')) {
    exit('Access Denied');
}
if (!($_G['adminid'] == 1 && $_GET['formhash'] == formhash()) && $_G['setting']) {
    exit('Access Denied');
}
require_once libfile('function/cache');
updatecache();
require_once libfile('function/block');
blockclass_cache();
if ($_G['config']['output']['tplrefresh']) {
    cleartemplatecache();
}
$plugins = array('qqconnect', 'cloudstat', 'soso_smilies', 'cloudsearch', 'qqgroup', 'security', 'xf_storage', 'mobile');
$opens = array('mobile');
require_once libfile('function/plugin');
require_once libfile('function/admincp');
foreach ($plugins as $pluginid) {
    $importfile = DISCUZ_ROOT . './source/plugin/' . $pluginid . '/discuz_plugin_' . $pluginid . '.xml';
    if (!file_exists($importfile)) {
        continue;
    }
    $importtxt = @implode('', file($importfile));
开发者ID:softhui,项目名称:discuz,代码行数:31,代码来源:misc_initsys.php



注:本文中的formhash函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP formthrottle_too_many_submissions函数代码示例发布时间:2022-05-15
下一篇:
PHP formdata_validate函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap