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


PHP Hook::processHook方法代码示例

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


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

示例1: process_login

 function process_login()
 {
     $username = addslashes($_POST["admin_email"]);
     $password = addslashes($_POST["admin_password"]);
     $rememberme = isset($_POST["rememberme"]) ? 1 : 0;
     if ($password == "") {
         $password = "emptynoGakMkgAda yang pakai718";
     }
     $row = array("admin_email" => $username, "admin_password" => $password, "rememberme" => $rememberme);
     /*if ($this->ldapLogin($username, $password)) {
     			$row["admin_ldap"] = 1;
     		}*/
     //login pakai row credential
     Auth::login($row);
     //kalau sukses
     if (Auth::isLogged()) {
         //load school setting
         // $ss = new Schoolsetting();
         // $ss->loadToSession();
         //redirect
         //Account::setRedirection ();
         Hook::processHook($this->login_hook);
         Redirect::firstPage();
     } else {
         Redirect::loginFailed();
     }
 }
开发者ID:CapsuleCorpIndonesia,项目名称:biji_katak,代码行数:27,代码来源:AccountLogin.php

示例2: save

 public function save($onDuplicateKey = 0)
 {
     $var = parent::save($onDuplicateKey);
     //pr($this);
     if ($var) {
         $acc = new Account();
         $load = isset($this->load) ? addslashes($this->load) : 0;
         if (!$load) {
             $acc->getByID($var);
         } else {
             $mainValue = $this->admin_id;
             $acc = $this;
         }
         $role2Acc = new Role2Account();
         $arr = $role2Acc->getWhere("role_admin_id = '{$acc->admin_id}'");
         //pr($arr);
         if (count($arr) > 0) {
             //sudah ada role2acc nya
             $role2Acc = $arr[0];
             $role2Acc->load = 1;
             //$role2Acc->role_admin_id = $var;
             $role2Acc->role_id = $acc->admin_role;
             //$role2Acc->account_username = $acc->admin_username;
         } else {
             //belum ada role2acc nya
             //$role2Acc = $arr[0];
             //$role2Acc->load = 1;
             $role2Acc->role_admin_id = $var;
             $role2Acc->role_id = $acc->admin_role;
             //$role2Acc->account_username = $acc->admin_username;
         }
         //process Hook just in case
         Hook::processHook($this->save_hook);
         return $role2Acc->save();
     }
     return 0;
 }
开发者ID:CapsuleCorpIndonesia,项目名称:biji_katak,代码行数:37,代码来源:Account.php

示例3: process_login_fb

 public function process_login_fb()
 {
     $email = $_SESSION['sementara']['admin_email'];
     $fbid = $_SESSION['sementara']['admin_fb_id'];
     if ($fbid == "" || $email == "") {
         Redirect::loginFailed();
     }
     $arr = $this->getWhere("admin_email = '{$email}' AND admin_fb_id='{$fbid}' AND admin_aktiv = 1 ");
     if (count($arr) > 0) {
         //load by login ID
         $obj = $arr[0];
         $row = toRow($obj);
         $this->fill($row);
         if (isset($this->admin_id)) {
             $_SESSION["admin_session"] = 1;
             $_SESSION["account"] = $obj;
             //Update setlastlogin
             self::setLastUpdate($_SESSION["account"]->admin_id);
             //lanjut
             //loading metadata
             $meta = new AccountMeta();
             $meta->getMeta($this->admin_id);
             //now loading roles
             $this->loadRole();
             //set cookie
             Auth::setCookie($this->rememberme, $this->admin_id, $this->admin_email, $this->admin_password);
             //kalau sukses
             if (Auth::isLogged()) {
                 //load school setting
                 // $ss = new Schoolsetting();
                 // $ss->loadToSession();
                 //redirect
                 //Account::setRedirection ();
                 $acl = new AccountLogin();
                 Hook::processHook($acl->login_hook);
                 //login hook doesnt seem to work =>bypass
                 $qp = new QuizPoints();
                 $qp->getPoints();
                 $qp->saveUnsaved();
                 Redirect::firstPage();
             } else {
                 Redirect::loginFailed();
             }
         } else {
             return 0;
         }
     }
 }
开发者ID:CapsuleCorpIndonesia,项目名称:elang-combo,代码行数:48,代码来源:SiteMember.php


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