當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。