當前位置: 首頁>>代碼示例>>PHP>>正文


PHP security::print_user方法代碼示例

本文整理匯總了PHP中security::print_user方法的典型用法代碼示例。如果您正苦於以下問題:PHP security::print_user方法的具體用法?PHP security::print_user怎麽用?PHP security::print_user使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在security的用法示例。


在下文中一共展示了security::print_user方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: process

 public function process()
 {
     //load de security class
     $sec = new security();
     // if the user data send user and password post...!!
     if (!empty($_POST) && !empty($_POST["user"]) && !empty($_POST["password"])) {
         //we try to log in...!!
         $res = $sec->login($_POST["user"], $_POST["password"]);
     }
     // verify if we are login, this check session, and check
     $res = $sec->loged();
     if ($res["success"]) {
         //check the action we need
         //$this->debug->log($_GET);
         $Module = null;
         $option = null;
         $action = null;
         if (isset($_GET["Module"])) {
             $Module = $_GET["Module"];
         }
         if (isset($_GET["option"])) {
             $option = $_GET["option"];
         }
         if (isset($_GET["action"])) {
             $action = $_GET["action"];
         }
         if (isset($_POST["Module"])) {
             $Module = $_POST["Module"];
         }
         if (isset($_POST["option"])) {
             $option = $_POST["option"];
         }
         if (isset($_POST["action"])) {
             $action = $_POST["action"];
         }
         switch ($Module) {
             case "Main":
                 if ($action == "load_user/") {
                     $action = "load_user";
                 }
                 //TODO: dirty fix in update to ext js4
                 switch ($action) {
                     case "load_user":
                         // we get the languaje strings
                         $languaje = json_encode($this->lang["languaje"]);
                         // send a ok signal
                         $json = '{"success" : true, "login": true,';
                         // we print user data
                         $json = $json . '"user" : [{' . $sec->print_user();
                         $json = $json . '"strings":' . $languaje . ",";
                         $modules = new modules();
                         $moduleStr = $modules->getUserModules();
                         $json = $json . '"modules": ' . $moduleStr . ' }  ]}';
                         echo $json;
                         break;
                 }
                 //<--end case action
                 break;
             default:
                 //first check the user permisión
                 //this is a generic function
                 $modules = new modules();
                 $permision = $modules->checkPermision();
                 //KILL THIS FUCKING LINE IS JUST TO TEST
                 //$permision=1;
                 //$this->debug->log(var_dump($permision));
                 if ($permision == 1) {
                     switch ($Module) {
                         case 'Settings':
                             switch ($option) {
                                 case 'Wallpaper':
                                     if ($action = "save") {
                                         $isSet = $modules->saveWallpaper();
                                         if (!$isSet) {
                                             echo '{success:false, msg:"No se realizaron los cambios en el servidor"}';
                                         } else {
                                             echo '{success:true, msg:"Guardado"}';
                                         }
                                     }
                                     break;
                                 case "Shortcuts":
                                     if ($action = "save") {
                                         $isSet = $modules->saveShortcuts();
                                         if (!$isSet) {
                                             echo '{success:false, msg:"No se realizaron los cambios en el servidor"}';
                                         } else {
                                             echo '{success:true, msg:"Guardado"}';
                                         }
                                     }
                                     break;
                                 case "QLaunchs":
                                     if ($action = "save") {
                                         $isSet = $modules->saveQLaunchs();
                                         if (!$isSet) {
                                             echo '{success:false, msg:"No se realizaron los cambios en el servidor"}';
                                         } else {
                                             echo '{success:true, msg:"Guardado"}';
                                         }
                                     }
                                     break;
//.........這裏部分代碼省略.........
開發者ID:apocoder,項目名稱:ExtDesk,代碼行數:101,代碼來源:os.php


注:本文中的security::print_user方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。