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


PHP Encryption::decryptIdWithDash方法代码示例

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


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

示例1: isAuthorized

 public function isAuthorized()
 {
     $action = $this->request->param('action');
     $role = Session::getUserRole();
     $resource = "files";
     //only for admins
     Permission::allow('admin', $resource, ['*']);
     //only for normal users
     Permission::allow('user', $resource, ['index', 'getAll', 'create']);
     Permission::allow('user', $resource, ['delete'], 'owner');
     $fileId = Encryption::decryptIdWithDash($this->request->data("file_id"));
     $config = ["user_id" => Session::getUserId(), "table" => "files", "id" => $fileId];
     return Permission::check($role, $resource, $action, $config);
 }
开发者ID:E01T,项目名称:miniPHP,代码行数:14,代码来源:FilesController.php

示例2: isAuthorized

 public function isAuthorized()
 {
     $action = $this->request->param('action');
     $role = Session::getUserRole();
     $resource = "todo";
     // only for admins
     Permission::allow('admin', $resource, ['*']);
     // only for normal users
     Permission::allow('user', $resource, ['delete'], 'owner');
     $todoId = $this->request->data("todo_id");
     if (!empty($todoId)) {
         $todoId = Encryption::decryptIdWithDash($todoId);
     }
     $config = ["user_id" => Session::getUserId(), "table" => "todo", "id" => $todoId];
     return Permission::check($role, $resource, $action, $config);
 }
开发者ID:mrSerg161,项目名称:miniPHP,代码行数:16,代码来源:TodoController.php

示例3: deleteUser

 /**
  * delete a user
  *
  */
 public function deleteUser()
 {
     $userId = Encryption::decryptIdWithDash($this->request->data("user_id"));
     if (!$this->user->exists($userId)) {
         return $this->error(404);
     }
     $this->admin->deleteUser(Session::getUserId(), $userId);
     $this->view->renderJson(array("success" => true));
 }
开发者ID:omarelgabry,项目名称:miniphp,代码行数:13,代码来源:AdminController.php

示例4: isAuthorized

 public function isAuthorized()
 {
     $action = $this->request->param('action');
     $role = Session::getUserRole();
     $resource = "newsfeed";
     // only for admins
     Permission::allow('admin', $resource, ['*']);
     // only for normal users
     Permission::allow('user', $resource, ['index', 'getAll', 'getById', 'create']);
     Permission::allow('user', $resource, ['update', 'delete', 'getUpdateForm'], 'owner');
     $newsfeedId = $this->request->data("newsfeed_id");
     if (!empty($newsfeedId)) {
         $newsfeedId = Encryption::decryptIdWithDash($newsfeedId);
     }
     $config = ["user_id" => Session::getUserId(), "table" => "newsfeed", "id" => $newsfeedId];
     return Permission::check($role, $resource, $action, $config);
 }
开发者ID:mrSerg161,项目名称:miniPHP,代码行数:17,代码来源:NewsFeedController.php

示例5: deleteUser

 /**
  * delete a user
  *
  */
 public function deleteUser()
 {
     $userId = Encryption::decryptIdWithDash($this->request->data("user_id"));
     if (!$this->user->exists($userId)) {
         $this->error("notfound");
     }
     $this->admin->deleteUser(Session::getUserId(), $userId);
     echo $this->view->JSONEncode(array("success" => true));
 }
开发者ID:mrSerg161,项目名称:miniPHP,代码行数:13,代码来源:AdminController.php


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