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

PHP wfCheckEntropy函数代码示例

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

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



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

示例1: wfResetSessionID

/**
 * Reset the session_id
 *
 * @since 1.22
 */
function wfResetSessionID()
{
    global $wgCookieSecure;
    $oldSessionId = session_id();
    $cookieParams = session_get_cookie_params();
    if (wfCheckEntropy() && $wgCookieSecure == $cookieParams['secure']) {
        session_regenerate_id(false);
    } else {
        $tmp = $_SESSION;
        session_destroy();
        wfSetupSession(MWCryptRand::generateHex(32));
        $_SESSION = $tmp;
    }
    $newSessionId = session_id();
    Hooks::run('ResetSessionID', array($oldSessionId, $newSessionId));
}
开发者ID:D66Ha,项目名称:mediawiki,代码行数:21,代码来源:GlobalFunctions.php


示例2: renewSessionId

 /**
  * Renew the user's session id, using strong entropy
  */
 private function renewSessionId()
 {
     global $wgSecureLogin, $wgCookieSecure;
     if ($wgSecureLogin && !$this->mStickHTTPS) {
         $wgCookieSecure = false;
     }
     // If either we don't trust PHP's entropy, or if we need
     // to change cookie settings when logging in because of
     // wpStickHTTPS, then change the session ID manually.
     $cookieParams = session_get_cookie_params();
     if (wfCheckEntropy() && $wgCookieSecure == $cookieParams['secure']) {
         session_regenerate_id(false);
     } else {
         $tmp = $_SESSION;
         session_destroy();
         wfSetupSession(MWCryptRand::generateHex(32));
         $_SESSION = $tmp;
     }
 }
开发者ID:mangowi,项目名称:mediawiki,代码行数:22,代码来源:SpecialUserlogin.php


示例3: wfFixSessionID

/**
 * Override session_id before session startup if php's built-in
 * session generation code is not secure.
 */
function wfFixSessionID()
{
    // If the cookie or session id is already set we already have a session and should abort
    if (isset($_COOKIE[session_name()]) || session_id()) {
        return;
    }
    // PHP's built-in session entropy is enabled if:
    // - entropy_file is set or you're on Windows with php 5.3.3+
    // - AND entropy_length is > 0
    // We treat it as disabled if it doesn't have an entropy length of at least 32
    $entropyEnabled = wfCheckEntropy();
    // If built-in entropy is not enabled or not sufficient override php's built in session id generation code
    if (!$entropyEnabled) {
        wfDebug(__METHOD__ . ": PHP's built in entropy is disabled or not sufficient, overriding session id generation using our cryptrand source.\n");
        session_id(MWCryptRand::generateHex(32));
    }
}
开发者ID:mangowi,项目名称:mediawiki,代码行数:21,代码来源:GlobalFunctions.php


示例4: renewSessionId

 /**
  * Renew the user's session id, using strong entropy
  */
 private function renewSessionId()
 {
     if (wfCheckEntropy()) {
         session_regenerate_id(false);
     } else {
         //If we don't trust PHP's entropy, we have to replace the session manually
         $tmp = $_SESSION;
         session_unset();
         session_write_close();
         session_id(MWCryptRand::generateHex(32));
         session_start();
         $_SESSION = $tmp;
     }
 }
开发者ID:slackfaith,项目名称:deadbrain_site,代码行数:17,代码来源:SpecialUserlogin.php


示例5: wfResetSessionID

/**
 * Reset the session_id
 *
 * Backported from MW 1.22
 */
function wfResetSessionID()
{
    global $wgCookieSecure;
    $oldSessionId = session_id();
    $cookieParams = session_get_cookie_params();
    if (wfCheckEntropy() && $wgCookieSecure == $cookieParams['secure']) {
        session_regenerate_id(true);
        // Wikia - $delete_old_session = true
    } else {
        $tmp = $_SESSION;
        session_destroy();
        wfSetupSession(MWCryptRand::generateHex(32));
        $_SESSION = $tmp;
    }
    $newSessionId = session_id();
    Hooks::run('ResetSessionID', array($oldSessionId, $newSessionId));
    wfDebug(sprintf("%s: new ID is '%s'\n", __METHOD__, $newSessionId));
}
开发者ID:Tjorriemorrie,项目名称:app,代码行数:23,代码来源:GlobalFunctions.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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