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


PHP Security::init方法代码示例

本文整理汇总了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'));
 }
开发者ID:aaronleslie,项目名称:aaronunix,代码行数:8,代码来源:CMSSecurity.php

示例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');
 }
开发者ID:axyr,项目名称:silverstripe-adminlogin,代码行数:17,代码来源:AdminSecurity.php

示例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');
 }
开发者ID:sheadawson,项目名称:silverstripe-adminlogin,代码行数:17,代码来源:AdminLogin.php

示例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');
 }
开发者ID:helpfulrobot,项目名称:axyr-silverstripe-adminlogin,代码行数:20,代码来源:AdminLogin.php

示例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)];
开发者ID:jcsilkey,项目名称:CodeReviewSecurityRepo,代码行数:31,代码来源:Security.php


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