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


PHP StringHelper::decrypt方法代码示例

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


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

示例1: init

 public function init()
 {
     parent::init();
     if (!in_array($this->_request->getActionName(), array('login', 'logout'))) {
         $authString = $this->_getParam(Model_Employee::COOKIE_NAME, '');
         $data = StringHelper::decrypt($authString);
         if (is_array($data)) {
             $id = $data['id'];
             $password = $data['password'];
             $employee = new Model_Employee($id);
             if ($employee->exists() && $employee->get('password') == $password) {
                 $this->view->employee = $this->employee = $employee;
                 $this->_request->setUserParam('EMPLOYEE_ID', $employee->get('id'));
             }
         }
         $this->checkAuth();
     }
 }
开发者ID:RobertCar,项目名称:RobertCarrential,代码行数:18,代码来源:AdminControllerAbstract.php

示例2: init

 public function init()
 {
     parent::init();
     $loggedIn = false;
     if (!in_array($this->_request->getActionName(), array('index', 'logout'))) {
         $authString = $this->_getParam(self::AUTH_COOKIE_NAME, '');
         $data = StringHelper::decrypt($authString);
         if (is_array($data)) {
             $name = $data['name'];
             $password = $data['password'];
             if (array_key_exists($name, $this->admins) && $password == $this->admins[$name]) {
                 $loggedIn = true;
             }
         }
         if (!$loggedIn) {
             setcookie(self::AUTH_COOKIE_NAME, '', null, '/');
             $this->error('Authentication failed. <a href="/private-car-management/">Login</a>');
         }
     }
 }
开发者ID:RobertCar,项目名称:RobertCarrential,代码行数:20,代码来源:PrivateCarManagementController.php

示例3: init

 public function init()
 {
     parent::init();
     if (!in_array($this->_request->getActionName(), array('signUp', 'signIn', 'signOut'))) {
         $authString = $this->_getParam(self::AUTH_COOKIE_NAME, '');
         $data = StringHelper::decrypt($authString);
         if (is_array($data)) {
             $email = $data['email'];
             $password = $data['password'];
             $user = new Model_User($email);
             if ($user->exists() && $user->get('password') == $password) {
                 $this->view->user = $this->user = $user;
                 $this->_request->setUserParam('EMAIL', $user->get('email'));
             }
         }
         if ($this->_request->getActionName() != 'index' && empty($this->user)) {
             setcookie(self::AUTH_COOKIE_NAME, '', null, '/');
             $this->error('Authentication failed. Please <a href="/private-car/">sign in</a>');
         }
     }
 }
开发者ID:RobertCar,项目名称:RobertCarrential,代码行数:21,代码来源:PrivateCarController.php

示例4: findAndDecrypt

 public static function findAndDecrypt($id)
 {
     $account = CloudAccount::where('user_id', Auth::id())->findOrFail($id);
     $account->credentials = StringHelper::decrypt($account->credentials, md5(Auth::user()->username));
     return $account;
 }
开发者ID:XDocker,项目名称:app,代码行数:6,代码来源:CloudAccountHelper.php

示例5: getDownloadKey

 public function getDownloadKey($id)
 {
     $this->check(true);
     $instanceID = Input::get('instanceID');
     $deployment = Deployment::where('user_id', Auth::id())->find($id);
     $account = CloudAccount::where('user_id', Auth::id())->findOrFail($deployment->cloudAccountId);
     $arr = $this->executeAction('downloadKey', $account, $deployment, $instanceID);
     if ($arr['status'] == 'OK') {
         $key = StringHelper::decrypt($arr['key'], md5(Auth::user()->username));
         header('Content-Description: File Transfer');
         header('Content-Type: ' . 'application/x-pem-file');
         header('Content-Disposition: attachment; filename=' . $arr['keyName'] . '.pem');
         header('Content-Transfer-Encoding: binary');
         header('Expires: 0');
         header('Cache-Control: must-revalidate');
         header('Pragma: public');
         header('Content-Length: ' . strlen($key));
         print $key;
     }
 }
开发者ID:XDocker,项目名称:app,代码行数:20,代码来源:DeploymentController.php


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