当前位置: 首页>>代码示例>>PHP>>正文


PHP TikiLib::generate_unique_sequence方法代码示例

本文整理汇总了PHP中TikiLib::generate_unique_sequence方法的典型用法代码示例。如果您正苦于以下问题:PHP TikiLib::generate_unique_sequence方法的具体用法?PHP TikiLib::generate_unique_sequence怎么用?PHP TikiLib::generate_unique_sequence使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TikiLib的用法示例。


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

示例1: isset

             * collisions. An extra cookie is set with an additional random value. When loading
             * the session, it makes sure the extra cookie matches the one in the session. Otherwise
             * it destroys the session and reloads the page for the user.
             *
             * Effectively, in the occurence of a collision, both users are kicked out.
             * This is an extremely rare occurence that is hard to reproduce by nature.
             */
            if (isset($_SESSION['extra_validation'])) {
                $cookie = isset($_COOKIE[$extra_cookie_name]) ? $_COOKIE[$extra_cookie_name] : null;
                if ($cookie !== $_SESSION['extra_validation']) {
                    Zend_Session::destroy();
                    header('Location: ' . $_SERVER['REQUEST_URI']);
                    exit;
                }
            } else {
                $sequence = $tikilib->generate_unique_sequence(16);
                $_SESSION['extra_validation'] = $sequence;
                setcookie($extra_cookie_name, $sequence, time() + 365 * 24 * 3600, ini_get('session.cookie_path'));
                unset($sequence);
            }
        } catch (Zend_Session_Exception $e) {
            // Ignore
        }
    }
}
// Moved here from tiki-setup.php because smarty use a copy of session
if (isset($prefs['feature_fullscreen']) && $prefs['feature_fullscreen'] == 'y') {
    require_once 'lib/setup/fullscreen.php';
}
// Retrieve Tiki addons
TikiAddons::refresh();
开发者ID:ameoba32,项目名称:tiki,代码行数:31,代码来源:tiki-setup_base.php


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