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


PHP Acl::generateSalt方法代码示例

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


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

示例1: store

 public function store()
 {
     if ($this->restrictCall("post")) {
         $pass = true;
         $user = $this->model('User');
         $id = Post::_get('id');
         $email = Post::_get('email');
         $sql = "UPDATE `" . $user->table . "` SET  `email`='" . $email . "' WHERE `id`='" . $id . "'";
         $user->update($sql);
         // Kijk of wachtwoord ook is ingevult.
         $password1 = Post::_get('password1');
         $password2 = Post::_get('password2');
         // Passwords wijzigen als dit is ingevult
         if (isset($password1) && isset($password2)) {
             $result = Validator::password($password1, $password2);
             if ($result != true) {
                 return $this->view('admin/users/edit', ['user' => $user->get($id), 'error' => $result]);
             } else {
                 $salt = Acl::generateSalt();
                 $password = Acl::doHash($password1, $salt);
                 $sql = "UPDATE `" . $user->table . "` SET  `wachtwoord`='" . $password . "', `salt`='" . $salt . "' WHERE `id`='" . $id . "'";
                 $user->update($sql);
             }
         }
         //Rollen updaten
         $rollen = $this->super->getCore()->getDatabase()->getAll("SELECT * FROM `rollen`");
         $post_rollen = Post::_get('rollen');
         $this->super->getCore()->getDatabase()->raw("DELETE FROM `gebruiker_rollen` WHERE gebruiker_id=" . $id);
         foreach ($rollen as $rol) {
             if (in_array($rol['id'], $post_rollen)) {
                 $this->super->getCore()->getDatabase()->raw("INSERT INTO `gebruiker_rollen` (rol_id, gebruiker_id)VALUES(" . $rol['id'] . "," . $id . ")");
             }
         }
         // Redirect maar admin homepagina
         return Helpers::redirectWithMessage('/harmstercms/admin', 'Gebruiker is geupdate');
     } else {
         return $this->view('error/error', ['error_message' => 'Page is post restricted']);
     }
 }
开发者ID:Hawiak,项目名称:harmstercms,代码行数:39,代码来源:user.php

示例2: csrfTokenGenerate

 static function csrfTokenGenerate()
 {
     $token = Acl::generateSalt();
     Session::set('csrftoken', $token);
     return $token;
 }
开发者ID:Hawiak,项目名称:harmstercms,代码行数:6,代码来源:Session.php


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