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


PHP VBX_User::salt_encrypt方法代码示例

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


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

示例1: validate_returning_user

 /**
  * Validate the user's signature & state
  * State is generated in the welcome controller and passed through the oauth process
  * 
  * @todo process $state passed back through the oauth process
  *
  * @param int $user_id 
  * @return mixed VBX_User or false
  */
 protected function validate_returning_user($user_id)
 {
     // jump through hoops to get around the Tenantization
     $userdata = $this->db->get_where('users', array('id' => $user_id))->result();
     if (!empty($userdata[0])) {
         $user = new VBX_User($userdata[0]);
         $list = implode(',', array($user->id, $user->password, $user->tenant_id, $user->is_admin));
         $expected_signature = VBX_User::salt_encrypt($list);
         $actual_signature = $this->session->userdata('signature');
         if ($expected_signature == $actual_signature) {
             return $user;
         } else {
             return false;
         }
     }
 }
开发者ID:ryanlarrabure,项目名称:OpenVBX,代码行数:25,代码来源:connect.php

示例2: setup_user

 private function setup_user($user)
 {
     $this->load->database();
     $this->config->load('openvbx');
     $this->load->model('vbx_user');
     $admin = new VBX_User();
     $admin->email = $user['email'];
     $admin->password = VBX_User::salt_encrypt($user['password']);
     $admin->first_name = $user['firstname'];
     $admin->last_name = $user['lastname'];
     $admin->tenant_id = $user['tenant_id'];
     $admin->is_admin = true;
     $admin->voicemail = 'Please leave a message after the beep.';
     try {
         $admin->save();
     } catch (Exception $e) {
         throw new InstallException($e->getMessage(), 4);
     }
 }
开发者ID:joshgomez,项目名称:OpenVBX,代码行数:19,代码来源:install.php

示例3: password

 public function password()
 {
     if (!$this->session->userdata('loggedin')) {
         redirect('auth/login');
     }
     $user = VBX_user::get(array('id' => $this->user_id));
     $old_pw = $this->input->post('old_pw');
     $new_pw = $this->input->post('new_pw1');
     $new_pw2 = $this->input->post('new_pw2');
     $this->data['error'] = false;
     $message = '';
     if ($user->password != VBX_User::salt_encrypt($old_pw)) {
         $this->data['error'] = true;
         $message = 'Password incorrect';
     } else {
         if ($new_pw != $new_pw2) {
             $this->data['error'] = true;
             $message = 'Password mismatch';
         } else {
             $user->password = VBX_User::salt_encrypt($new_pw);
             try {
                 $user->save();
                 $message = 'Password changed';
                 $this->session->set_userdata('signature', VBX_User::signature($user->id));
             } catch (VBX_UserException $e) {
                 $this->data['error'] = true;
                 $message = 'Unable to set password, please try again later.';
                 error_log($e->getMessage());
             }
         }
     }
     $this->data['message'] = $message;
     echo json_encode($this->data);
 }
开发者ID:howethomas,项目名称:OpenVBX,代码行数:34,代码来源:account.php


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