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


PHP General::CheckPostMasterPassword方法代码示例

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


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

示例1: createNewSession

 /**
  * Creates a new Session-object, if password is correct
  */
 static function createNewSession($password, $project_id = null)
 {
     if (!$project_id) {
         $project_id = Config::$default_project_id;
     }
     // Delete old Session object from php_session cache
     // and create new session_id to prevent session fixation:
     self::destroySession();
     $session = self::getInstance();
     if ($password) {
         // some password has to be entered
         //Allow login via Master Password
         if (Config::$allow_project_login_with_master_password && General::CheckPostMasterPassword($password)) {
             $password = '';
         }
         try {
             $session->project = new Project($project_id, $password);
         } catch (PasswordException $e) {
             $session->project = null;
         }
     } else {
         $session->project = null;
     }
     return $session;
 }
开发者ID:BackupTheBerlios,项目名称:reson-svn,代码行数:28,代码来源:Session.php

示例2: processForm

 function processForm()
 {
     if (!$_POST['name']) {
         return Messages::getString('CreateProjectPage.ProjectNameNotEmpty');
     }
     if (!$_POST['pwd']) {
         return Messages::getString('CreateProjectPage.PasswordNotEmpty');
     }
     if ($_POST['pwd'] != $_POST['pwd2']) {
         return Messages::getString('CreateProjectPage.PasswordsNotEqual');
     }
     if (!General::CheckPostMasterPassword()) {
         return Messages::getString('CreateProjectPage.MasterPasswordWrong');
     }
     try {
         $db = Database::getInstance();
         $project_info = array('name' => stripslashes($_POST['name']), 'pwd' => stripslashes($_POST['pwd']), 'info' => Config::$default_project_info['info'], 'access' => Config::$default_project_info['access'], 'introduction' => Config::$default_project_info['introduction'], 'hint' => Config::$default_project_info['hint']);
         if (!($this->new_project_id = $db->insertProject($project_info))) {
             return sprintf("%s: %s", Messages::getString('General.dbError'), $db->lastError());
         }
     } catch (Exception $exception) {
         // in this case, render exception as error.
         return $exception;
     }
     return '';
 }
开发者ID:BackupTheBerlios,项目名称:reson-svn,代码行数:26,代码来源:CreateProjectPage.php

示例3: __construct

 function __construct()
 {
     parent::__construct();
     $this->setTitle(Messages::getString('SetupPage.Title'));
     $this->menu = array(Messages::getString('General.Admin') => "admin.php") + $this->menu;
     $this->menu = array(Messages::getString('General.Home') => "index.php") + $this->menu;
     $this->menu = array(Messages::getString('CreateProjectPage.NewProject') => "create_project.php") + $this->menu;
     //Set absolute basedir
     $this->BASEDIR = dirname(dirname(__FILE__));
     // Check, if transmitted master password is correct
     if (Config::$master_password) {
         $check = General::CheckPostMasterPassword();
         if ($check !== null && $check === false) {
             $this->error = Messages::getString('CreateProjectPage.MasterPasswordWrong');
         }
         $this->master_password_correct = $check;
     }
     // process transmitted form
     if ((!Config::$master_password || General::CheckPostMasterPassword()) && isset($_POST['setup'])) {
         $this->error = $this->processForm();
         if (!$this->error) {
             header("Location: " . $this->SUCCESS_REDIRECT_PAGE);
             //Redirect to create_project, if succeeded
         }
     }
 }
开发者ID:BackupTheBerlios,项目名称:reson-svn,代码行数:26,代码来源:SetupPage.php


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