本文整理汇总了PHP中Security::init方法的典型用法代码示例。如果您正苦于以下问题:PHP Security::init方法的具体用法?PHP Security::init怎么用?PHP Security::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Security
的用法示例。
在下文中一共展示了Security::init方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
parent::init();
// Include CMS styles and js
Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css');
Requirements::css(FRAMEWORK_ADMIN_DIR . '/css/screen.css');
Requirements::combine_files('cmssecurity.js', array(THIRDPARTY_DIR . '/jquery/jquery.js', THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js', THIRDPARTY_DIR . '/jquery-entwine/dist/jquery.entwine-dist.js', FRAMEWORK_ADMIN_DIR . '/javascript/lib.js', FRAMEWORK_ADMIN_DIR . '/javascript/CMSSecurity.js'));
}
示例2: init
/**
* @return void
*/
public function init()
{
parent::init();
$access = new IpAccess($this->getRequest()->getIP());
if (!$access->hasAccess()) {
$access->respondNoAccess($this);
}
if (Config::inst()->get('AdminLogin', 'UseTheme') !== true) {
// this prevents loading frontend css and javscript files
Object::useCustomClass('Page_Controller', 'AdminLoginPage_Controller');
Requirements::css('adminlogin/css/style.css');
}
Object::useCustomClass('MemberLoginForm', 'AdminLoginForm');
}
示例3: init
public function init()
{
parent::init();
if (Config::inst()->get('IpAccess', 'enabled')) {
$ipAccess = new IpAccess($this->owner->getRequest()->getIP(), Config::inst()->get('IpAccess', 'allowed_ips'));
if (!$ipAccess->hasAccess()) {
$reponse = '';
if (class_exists('ErrorPage', true)) {
$response = ErrorPage::response_for(404);
}
return $this->owner->httpError(404, $response ? $response : 'The requested page could not be found.');
}
}
// this prevents loading frontend css and javscript files
Requirements::clear();
Requirements::css('adminlogin/css/style.css');
}
示例4: init
public function init()
{
parent::init();
if (Config::inst()->get('IpAccess', 'enabled')) {
$ipAccess = new IpAccess($this->owner->getRequest()->getIP(), Config::inst()->get('IpAccess', 'allowed_ips'));
if (!$ipAccess->hasAccess()) {
$reponse = '';
if (class_exists('ErrorPage', true)) {
$response = ErrorPage::response_for(404);
}
return $this->owner->httpError(404, $response ? $response : 'The requested page could not be found.');
}
}
if (Config::inst()->get('AdminLogin', 'UseTheme') !== true) {
// this prevents loading frontend css and javscript files
Object::useCustomClass('Page_Controller', 'AdminLoginPage_Controller');
Requirements::css('adminlogin/css/style.css');
}
Object::useCustomClass('MemberLoginForm', 'AdminLoginForm');
}
示例5: init
* DISCLAIMER: This application is for education use only. Installing it on a
* public facing server will expose the server to several security vulnerabilities
* The author takes absolutely no resposibility for any damage that may occur
* from the use or misuse of any of this code.
*
* PHP version 5.3
*
* @category XssBadWebApp
* @package Utilities
* @author Anthony Ferrara <ircmaxell@ircmaxell.com>
* @copyright 2011 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
*/
namespace XssBadWebApp\Utilities;
Security::init();
class Security
{
protected static $seed = 'abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789-?/.,)(*^%$#@!~';
public static function init()
{
static::$seed = preg_replace('/\\s/', '', static::$seed);
}
public static function makeRandomString($length = 64)
{
$result = '';
$seedLength = strlen(static::$seed);
for ($i = 0; $i < $length; $i++) {
$result .= static::$seed[mt_rand(0, $seedLength - 1)];