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


PHP Authenticate类代码示例

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


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

示例1: actionAuthenticate

 public function actionAuthenticate()
 {
     $model = new Authenticate();
     $authenticate_json = http_get_request_body();
     //$authenticate_json = json_encode(array("username"=>"kailesh","password"=>"1c3dd8b850b055bb7b6fb0fb59a7cd4","deviceID"=>"90:C1:15:BC:97:4F"));
     $model->verifyDetails($authenticate_json);
     $verification = $model->getAccess();
     $responseMsg = $model->generateJsonResponse();
     //var_dump($responseMsg);
     /*HttpResponse::status(200);
     		HttpResponse::setContentType('text/HTML');
     		HttpResponse::setData("Orders Recieved");
     		HttpResponse::send();*/
     //var_dump($responseMsg);
     if ($verification === true) {
         HttpResponse::status(200);
         HttpResponse::setContentType('application/json');
         HttpResponse::setData($responseMsg);
         HttpResponse::send();
     } else {
         HttpResponse::status(200);
         HttpResponse::setContentType('application/json');
         HttpResponse::setData($responseMsg);
         HttpResponse::send();
     }
 }
开发者ID:nsawant942,项目名称:Canteen-Management-Software-System--Witwatersrand,代码行数:26,代码来源:MobileController.php

示例2: index

 /**
  * Default method
  * @return [type] [description]
  */
 public function index()
 {
     if (Session::get('logined') !== null) {
         if (Session::get('logined')) {
             $this->getUserLogin();
             exit;
         }
     }
     $auth = new Authenticate();
     if (isset($_POST['user_id']) && isset($_POST['id_token'])) {
         $user_id = $_POST['user_id'];
         $id_token = $_POST['id_token'];
         if ($auth->checkLogin($user_id, $id_token)) {
             Session::init();
             Session::set('id_token', $id_token);
             Session::set('user_id', $user_id);
             Session::set('logined', true);
             echo json_encode('success');
             exit;
         } else {
             echo json_encode('need login with google ID');
             exit;
         }
     } else {
         echo json_encode('need login with google ID');
         exit;
     }
 }
开发者ID:uethackathon,项目名称:uethackathon2015_team5,代码行数:32,代码来源:login.php

示例3: CreateNav

 function CreateNav($token, $skin)
 {
     global $defined;
     $auth = new Authenticate();
     $level = new AccessLevels();
     if (empty($token)) {
         $data->menu = 'menu.default.tpl';
     } else {
         if ($auth->AuthUser(NULL, NULL, $token) === -1 || $auth->AuthUser(NULL, NULL, $token) === -2) {
             //    $data->menu = $msg;
             $data->menu = 'menu.default.tpl';
         } else {
             if ($level->ChkLevel($token) === "admin") {
                 $data->menu = 'menu.admin.tpl';
             } elseif ($level->ChkLevel($token) === "user") {
                 $data->menu = 'menu.user.tpl';
             } elseif ($level->ChkLevel($token) === "view") {
                 $data->menu = 'menu.view.tpl';
             } else {
                 $data->menu = 'menu.default.tpl';
             }
         }
     }
     return $data->menu;
 }
开发者ID:brahimmachkouri,项目名称:phpDHCPAdmin,代码行数:25,代码来源:class.menu.php

示例4: testUnknownUser

 public function testUnknownUser()
 {
     $authenticate = new Authenticate();
     $authenticate_json = json_encode(array("username" => "bob", "password" => "1c3dd8b823we055bb7b6fb0fb59a7cd04", "deviceID" => "85:D5:76:AA:97:4F"));
     $authenticate->verifyDetails($authenticate_json);
     $expected_response = json_encode(array("access" => false, "reason" => "RMB-01", "balance" => "0"));
     $returned_response = $authenticate->generateJsonResponse();
     $this->assertEquals($expected_response, $returned_response);
 }
开发者ID:nsawant942,项目名称:Canteen-Management-Software-System--Witwatersrand,代码行数:9,代码来源:AuthenticationTest.php

示例5: logout

 /**
  * destroy administrator session
  * role: administrator
  */
 public function logout()
 {
     $auth = new Authenticate();
     if ($auth->logout(Authenticate::SUPERUSER)) {
         transport("administrator");
     } else {
         transport("dashboard");
     }
 }
开发者ID:anggadarkprince,项目名称:web-businesscareer,代码行数:13,代码来源:AdministratorController.php

示例6: addToDatabase

function addToDatabase($rname, $rsize, $rtype, $rname_usr, $rtype_usr, $rdesc, $extension, $rprio)
{
    $auth = new Authenticate();
    $con = new Connection();
    $link = $con->getConnection();
    $query = "INSERT INTO `resources`(`ID`, `name`,`rNameUsr`,`rsize`, `rtype`, `format`, `doc_by`,`user_r_type`,`rDescription`,`rprio`, `when`, `approved`) VALUES (NULL,?,?,?,?,?,?,?,?,?,?,?)";
    //$query = "INSERT INTO `categories`(`cat_id`,`cat_name`,`cat_description`,`cat_by`) VALUES (NULL,?,?,?)";
    $stmt = $link->prepare($query);
    $stmt->execute(array($rname, $rname_usr, $rsize, $rtype, $extension, $auth->getFullName($_SESSION['user_id']), $rtype_usr, $rdesc, $rprio, date("Y-m-d H:i:m", time()), 0));
    $stmt = null;
    return TRUE;
}
开发者ID:jerryhanks,项目名称:E-Leraning-System,代码行数:12,代码来源:ResourceProcessor.php

示例7: pre

 public function pre()
 {
     $this->user = Authenticate::session();
     if (!is_a($this->user, 'Kadmin')) {
         throw new Exception('Not Authorized', 401);
     }
 }
开发者ID:monkeytie,项目名称:korona,代码行数:7,代码来源:list.ctrl.php

示例8: preprocess

 function preprocess()
 {
     $me = CoreLocal::get('CashierNo');
     $this->security = Authenticate::getPermission($me);
     if (isset($_REQUEST['selectlist'])) {
         if (!FormLib::validateToken()) {
             return false;
         }
         if (empty($_REQUEST['selectlist'])) {
             $this->change_page($this->page_url . "gui-modules/pos2.php");
             return False;
         } elseif ($_REQUEST['selectlist'] == 'SUSPEND') {
             Database::getsubtotals();
             if (CoreLocal::get("LastID") == 0) {
                 CoreLocal::set("boxMsg", _("no transaction in progress"));
                 CoreLocal::set('boxMsgButtons', array('Dismiss [clear]' => '$(\'#reginput\').val(\'CL\');submitWrapper();'));
                 $this->change_page($this->page_url . "gui-modules/boxMsg2.php");
                 return False;
             } else {
                 // ajax call to end transaction
                 // and print receipt
                 $ref = SuspendLib::suspendorder();
                 $this->add_onload_command("\$.ajax({\n                        type:'post',\n                        url:'{$this->page_url}ajax-callbacks/ajax-end.php',\n                        cache: false,\n                        data: 'receiptType=suspended&ref={$ref}',\n                        dataType: 'json',\n                        success: function(data){\n                            \$.ajax({\n                            type:'post',\n                            url:'{$this->page_url}ajax-callbacks/ajax-transaction-sync.php',\n                            cache: false,\n                            success: function(data){\n                                location='{$this->page_url}gui-modules/pos2.php';\n                            },\n                            error: function(e1){\n                                location='{$this->page_url}gui-modules/pos2.php';\n                            }\n                            });\n                        },\n                        error: function(e1){\n                            location='{$this->page_url}gui-modules/pos2.php';\n                        }\n                        });");
                 return True;
             }
         } else {
             if ($_REQUEST['selectlist'] == 'RESUME') {
                 Database::getsubtotals();
                 if (CoreLocal::get("LastID") != 0) {
                     CoreLocal::set("boxMsg", _("transaction in progress"));
                     CoreLocal::set('boxMsgButtons', array('Dismiss [clear]' => '$(\'#reginput\').val(\'CL\');submitWrapper();'));
                     $this->change_page($this->page_url . "gui-modules/boxMsg2.php");
                 } elseif (SuspendLib::checksuspended() == 0) {
                     CoreLocal::set("boxMsg", _("no suspended transaction"));
                     CoreLocal::set('boxMsgButtons', array('Dismiss [clear]' => '$(\'#reginput\').val(\'CL\');submitWrapper();'));
                     CoreLocal::set("strRemembered", "");
                     $this->change_page($this->page_url . "gui-modules/boxMsg2.php");
                 } else {
                     $this->change_page($this->page_url . "gui-modules/suspendedlist.php");
                 }
                 return False;
             } else {
                 if ($_REQUEST['selectlist'] == 'TR') {
                     TenderReport::printReport();
                     $this->change_page($this->page_url . "gui-modules/pos2.php");
                     return False;
                 } else {
                     if ($_REQUEST['selectlist'] == 'OTR' && $this->security >= 30) {
                         $this->change_page($this->page_url . 'gui-modules/requestInfo.php?class=AnyTenderReportRequest');
                         return False;
                     } elseif ($_REQUEST['selectlist'] == 'UNDO' && $this->security >= 30) {
                         $this->change_page($this->page_url . 'gui-modules/undo.php');
                         return false;
                     }
                 }
             }
         }
     }
     return True;
 }
开发者ID:phpsmith,项目名称:IS4C,代码行数:60,代码来源:adminlist.php

示例9: index

 /**
  * PAGE: index
  * This method handles what happens when you move to http://yourproject/home/index (which is the default page btw)
  */
 public function index()
 {
     // check if user has an active menu
     Authenticate::menuIsActive();
     // header
     require APP_PATH . 'views/templates/header_alt.php';
     // navbar
     // <body>
     // <container>
     // <navbar></navbar>
     require APP_PATH . 'views/templates/navbar_alt.php';
     // sidebar
     // <row>
     // <col-sm-3></end-col>
     require APP_PATH . 'views/recipes/default/sidebar.php';
     // content
     // <col-sm-9></end-col>
     require APP_PATH . 'views/recipes/default/content.php';
     // footer
     // <footer></footer>
     // </container>
     // </body>
     // </html>
     require APP_PATH . 'views/templates/footer.php';
 }
开发者ID:puiu91,项目名称:Learning-MVC,代码行数:29,代码来源:RecipesController.php

示例10: pre

 public function pre()
 {
     $this->user = Authenticate::me();
     if (!is_a($this->user, 'Kadmin') || $this->user->getType() != 'admin') {
         throw new Exception('Not Authorized', 401);
     }
 }
开发者ID:monkeytie,项目名称:korona,代码行数:7,代码来源:seo.ctrl.php

示例11: preprocess

 public function preprocess()
 {
     $this->box_css_class = 'coloredArea';
     $this->msg = _('please enter your password');
     $this->body_class = '';
     if (isset($_REQUEST['reginput']) || isset($_REQUEST['userPassword'])) {
         $passwd = '';
         if (isset($_REQUEST['reginput']) && !empty($_REQUEST['reginput'])) {
             $passwd = $_REQUEST['reginput'];
             UdpComm::udpSend('goodBeep');
         } elseif (isset($_REQUEST['userPassword']) && !empty($_REQUEST['userPassword'])) {
             $passwd = $_REQUEST['userPassword'];
         }
         if (Authenticate::checkPassword($passwd)) {
             Database::testremote();
             $sd = MiscLib::scaleObject();
             if (is_object($sd)) {
                 $sd->ReadReset();
             }
             /**
               Find a drawer for the cashier
             */
             $my_drawer = ReceiptLib::currentDrawer();
             if ($my_drawer == 0) {
                 $available = ReceiptLib::availableDrawers();
                 if (count($available) > 0) {
                     ReceiptLib::assignDrawer(CoreLocal::get('CashierNo'), $available[0]);
                     $my_drawer = $available[0];
                 }
             } else {
                 ReceiptLib::assignDrawer(CoreLocal::get('CashierNo'), $my_drawer);
             }
             TransRecord::addLogRecord(array('upc' => 'SIGNIN', 'description' => 'Sign In Emp#' . CoreLocal::get('CashierNo')));
             /**
               Use Kicker object to determine whether the drawer should open
               The first line is just a failsafe in case the setting has not
               been configured.
             */
             if (session_id() != '') {
                 session_write_close();
             }
             $kicker_class = CoreLocal::get("kickerModule") == "" ? 'Kicker' : CoreLocal::get('kickerModule');
             $kicker_object = new $kicker_class();
             if ($kicker_object->kickOnSignIn()) {
                 ReceiptLib::drawerKick();
             }
             if ($my_drawer == 0) {
                 $this->change_page($this->page_url . "gui-modules/drawerPage.php");
             } else {
                 $this->change_page($this->page_url . "gui-modules/pos2.php");
             }
             return false;
         } else {
             $this->box_css_class = 'errorColoredArea';
             $this->msg = _('password invalid, please re-enter');
         }
     }
     return true;
 }
开发者ID:phpsmith,项目名称:IS4C,代码行数:59,代码来源:login2.php

示例12: preprocess

 function preprocess()
 {
     $this->my_drawer = ReceiptLib::currentDrawer();
     $this->available = ReceiptLib::availableDrawers();
     $this->is_admin = false;
     $db = Database::pDataConnect();
     $sec = Authenticate::getPermission(CoreLocal::get('CashierNo'));
     if ($sec >= 30) {
         $this->is_admin = true;
     }
     if (isset($_REQUEST['selectlist'])) {
         if (empty($_REQUEST['selectlist'])) {
             if (empty($this->available) && !$this->is_admin && $this->my_drawer == 0) {
                 // no drawer available and not admin
                 // sign out and go back to main login screen
                 Database::setglobalvalue("LoggedIn", 0);
                 CoreLocal::set("LoggedIn", 0);
                 CoreLocal::set("training", 0);
                 CoreLocal::set("gui-scale", "no");
                 $this->change_page($this->page_url . "gui-modules/login2.php");
             } else {
                 $this->change_page($this->page_url . "gui-modules/pos2.php");
             }
             return False;
         }
         if (substr($_REQUEST['selectlist'], 0, 2) == 'TO' && $this->is_admin) {
             // take over a drawer
             $new_drawer = substr($_REQUEST['selectlist'], 2);
             if ($this->my_drawer != 0) {
                 // free up the current drawer if it exists
                 ReceiptLib::drawerKick();
                 ReceiptLib::freeDrawer($this->my_drawer);
             }
             // switch to the requested drawer
             ReceiptLib::assignDrawer(CoreLocal::get('CashierNo'), $new_drawer);
             ReceiptLib::drawerKick();
             $this->my_drawer = $new_drawer;
         } elseif (substr($_REQUEST['selectlist'], 0, 2) == 'SW') {
             // switch to available drawer
             $new_drawer = substr($_REQUEST['selectlist'], 2);
             foreach ($this->available as $id) {
                 // verify the requested drawer is available
                 if ($new_drawer == $id) {
                     if ($this->my_drawer != 0) {
                         // free up the current drawer if it exists
                         ReceiptLib::drawerKick();
                         ReceiptLib::freeDrawer($this->my_drawer);
                     }
                     // switch to the requested drawer
                     ReceiptLib::assignDrawer(CoreLocal::get('CashierNo'), $new_drawer);
                     ReceiptLib::drawerKick();
                     $this->my_drawer = $new_drawer;
                     break;
                 }
             }
         }
     }
     return True;
 }
开发者ID:phpsmith,项目名称:IS4C,代码行数:59,代码来源:drawerPage.php

示例13: getUser

 public static function getUser()
 {
     $session = self::getSession();
     $user = $session->get('user');
     if (empty($user)) {
         $user = Authenticate::set_public_user();
     }
     return $user;
 }
开发者ID:ejailesb,项目名称:repo_empr,代码行数:9,代码来源:base.php

示例14: preprocess

 function preprocess()
 {
     // check for posts before drawing anything, so we can redirect
     if (isset($_REQUEST['reginput'])) {
         $input = strtoupper(trim($_REQUEST['reginput']));
         // CL always exits
         if ($input == "CL") {
             PaycardLib::paycard_reset();
             CoreLocal::set("msgrepeat", 1);
             CoreLocal::set("strRemembered", 'TO');
             CoreLocal::set("toggletax", 0);
             CoreLocal::set("togglefoodstamp", 0);
             $this->change_page($this->page_url . "gui-modules/pos2.php");
             return False;
         }
         $continue = false;
         // when voiding tenders, the input must be an FEC's passcode
         if (CoreLocal::get("paycard_mode") == PaycardLib::PAYCARD_MODE_VOID && $input != "" && substr($input, -2) != "CL") {
             $db = Database::pDataConnect();
             if (Authenticate::checkPermission($input, 11)) {
                 CoreLocal::set("adminP", $input);
                 $continue = true;
             }
         }
         // when voiding items, no code is necessary, only confirmation
         if (CoreLocal::get("paycard_mode") != PaycardLib::PAYCARD_MODE_VOID && $input == "") {
             $continue = true;
         }
         // go?
         if ($continue) {
             // send the request, then disable the form
             $this->add_onload_command('paycard_submitWrapper();');
             $this->action = "onsubmit=\"return false;\"";
         }
         // if we're still here, display prompt again
     } else {
         if (CoreLocal::get("paycard_mode") == PaycardLib::PAYCARD_MODE_AUTH) {
             // call paycard_void on first load to set up
             // transaction and check for problems
             $id = CoreLocal::get("paycard_id");
             foreach (CoreLocal::get("RegisteredPaycardClasses") as $rpc) {
                 $myObj = new $rpc();
                 if ($myObj->handlesType(CoreLocal::get("paycard_type"))) {
                     $ret = $myObj->paycard_void($id);
                     if (isset($ret['output']) && !empty($ret['output'])) {
                         CoreLocal::set("boxMsg", $ret['output']);
                         $this->change_page($this->page_url . "gui-modules/boxMsg2.php");
                         return False;
                     }
                     break;
                 }
             }
         }
     }
     return True;
 }
开发者ID:phpsmith,项目名称:IS4C,代码行数:56,代码来源:paycardboxMsgVoid.php

示例15: pre

 public function pre()
 {
     $this->user = Authenticate::session();
     if (!is_a($this->user, 'Kadmin') || $this->user->getType() != 'admin') {
         throw new Exception('Not Authorized', 401);
     }
     if (is_string($this->param2) && !empty($this->param2)) {
         $this->block = Block::getById($this->param2);
     }
 }
开发者ID:monkeytie,项目名称:korona,代码行数:10,代码来源:block.ctrl.php


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