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


PHP Authenticate::is_authorized方法代码示例

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


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

示例1: login

 /**
  * check administrator authentication
  * role: administrator
  */
 public function login()
 {
     if (Authenticate::is_authorized()) {
         transport("dashboard");
     } else {
         $model_administrator = new Authenticate();
         /*
          * populate login data for administrator
          * use setter method to registering information of authentication
          */
         $model_administrator->set_email($_POST['username']);
         $model_administrator->set_password($_POST['password']);
         $model_administrator->set_type(Authenticate::SUPERUSER);
         $login = $model_administrator->authenticate();
         /*
          * $login variable contain array which have 2 keys [granted] and [state]
          * granted {true|false} and state {active|pending}
          * just grant credential that return active and match email and password
          */
         if ($login["granted"] && $login["state"] == User::ACTIVE) {
             transport("dashboard");
         } else {
             $_SESSION['operation'] = 'error';
             $_SESSION['message'] = $login["state"];
             transport("administrator");
         }
     }
 }
开发者ID:anggadarkprince,项目名称:web-businesscareer,代码行数:32,代码来源:AdministratorController.php

示例2: index

 /**
  * show feedback management page on administrator feature.
  * role: administrator
  */
 public function index()
 {
     if (Authenticate::is_authorized()) {
         $model_player = Player::getInstance();
         $model_player->get_total_player();
         $model_player->unread_new_player();
         $this->framework->view->page = "feedback";
         $this->framework->view->content = "/backend/pages/feedback";
         $this->framework->view->show("backend/template");
     } else {
         transport("administrator");
     }
 }
开发者ID:anggadarkprince,项目名称:web-businesscareer,代码行数:17,代码来源:FeedbackController.php

示例3: get_overall

 /**
  * export/download overall report into pdf
  * role: administrator
  */
 public function get_overall()
 {
     if (Authenticate::is_authorized()) {
         $model_player = Player::getInstance();
         $model_feedback = Feedback::getInstance();
         $model_administrator = Administrator::getInstance();
         $model_leaderboard = Leaderboard::getInstance();
         $model_report = new ReportGenerator();
         $model_report->get_report_overall($model_player->get_player_report(), $model_feedback->retrieve_feedback_report(), $model_administrator->retrieve_traffic_report(), $model_leaderboard->get_top10_ranking());
         $model_report->print_report();
     } else {
         transport("administrator");
     }
 }
开发者ID:anggadarkprince,项目名称:web-businesscareer,代码行数:18,代码来源:ReportController.php

示例4: delete

 /**
  * delete player and all related data with this player
  * role: administrator
  */
 public function delete()
 {
     if (Authenticate::is_authorized()) {
         $model_player = Player::getInstance();
         $id = $_POST["id"];
         if ($model_player->delete_player($id)) {
             $_SESSION['operation'] = 'success';
         } else {
             $_SESSION['operation'] = 'error';
         }
         transport("player");
     } else {
         transport("administrator");
     }
 }
开发者ID:anggadarkprince,项目名称:web-businesscareer,代码行数:19,代码来源:PlayerController.php

示例5: setting_update

 /**
  * update profile data from setting page.
  * role: administrator
  */
 public function setting_update()
 {
     if (Authenticate::is_authorized()) {
         $model_administrator = Administrator::getInstance();
         /*
          * populate data from post request.
          * make sure form data match with setting keys
          */
         $data = [Administrator::COLUMN_STG_NAME => $_POST["website_name"], Administrator::COLUMN_STG_DESCRIPTION => $_POST["website_description"], Administrator::COLUMN_STG_KEYWORD => $_POST["website_keyword"], Administrator::COLUMN_STG_EMAIL => $_POST["website_email"], Administrator::COLUMN_STG_NUMBER => $_POST["website_number"], Administrator::COLUMN_STG_ADDRESS => $_POST["website_address"], Administrator::COLUMN_STG_FACEBOOK => $_POST["website_facebook"], Administrator::COLUMN_STG_TWITTER => $_POST["website_twitter"]];
         /*
          * invoke update_setting() method in administrator model.
          * check the return value that indicate upload favicon and update database are success
          */
         if ($model_administrator->update_setting($data)) {
             $_SESSION['setting_operation'] = 'success';
         } else {
             $_SESSION['setting_operation'] = 'error';
         }
         transport("dashboard/setting");
     } else {
         transport("administrator");
     }
 }
开发者ID:anggadarkprince,项目名称:web-businesscareer,代码行数:27,代码来源:DashboardController.php


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