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


PHP sapp_Global::escapeString方法代碼示例

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


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

示例1: loginpopupsaveAction

 /**
  * @name loginAction
  *
  * This method is used to display the login data errors
  *
  * @author Mainak
  * @version 1.0
  *
  * values used in this method
  * ==========================
  * @param username => Email given in Login Form
  * @param password => Password given in Login Form
  */
 public function loginpopupsaveAction()
 {
     $emailParam = $this->getRequest()->getParam('username');
     $opt = array('custom' => array('timeout' => $this->_options['auth']['timeout']));
     $options = array();
     $options['username'] = $this->getRequest()->getParam('username');
     $options['user_password'] = $this->getRequest()->getParam('password');
     $usersModel = new Default_Model_Users();
     $userData = $usersModel->isActiveUser($options['username']);
     $check = 0;
     foreach ($userData as $user) {
         $check = $user['count'] == 1 ? 1 : 0;
     }
     if (!$check) {
         $userStatusArr = $usersModel->getActiveStatus($options['username']);
         if (!empty($userStatusArr)) {
             $userStatus = $userStatusArr[0]['status'];
             $islockaccount = $userStatusArr[0]['isaccountlock'];
             if ($userStatus == 0) {
                 $this->_helper->getHelper("FlashMessenger")->addMessage("Login failed. Employee has been inactivated from the organization.");
             } else {
                 if ($userStatus == 2) {
                     $this->_helper->getHelper("FlashMessenger")->addMessage("Login failed. Employee has resigned from the organization.");
                 } else {
                     if ($userStatus == 3) {
                         $this->_helper->getHelper("FlashMessenger")->addMessage("Login failed. Employee has left the organization.");
                     } else {
                         if ($userStatus == 4) {
                             $this->_helper->getHelper("FlashMessenger")->addMessage("Login failed. Employee has been suspended from the organization.");
                         } else {
                             if ($userStatus == 5) {
                                 $this->_helper->getHelper("FlashMessenger")->addMessage("Login failed. Employee deleted.");
                             } else {
                                 if ($islockaccount == 1) {
                                     $this->_helper->getHelper("FlashMessenger")->addMessage("Login failed. Employee has been locked.");
                                 } else {
                                     $this->_helper->getHelper("FlashMessenger")->addMessage("Login failed. Not a valid employee.");
                                 }
                             }
                         }
                     }
                 }
             }
         } else {
             $this->_helper->getHelper("FlashMessenger")->addMessage("The username or password you entered is incorrect.");
         }
         $this->_redirect('index');
     }
     $auth = Zend_Auth::getInstance();
     try {
         $db = $this->getInvokeArg('bootstrap')->getResource('db');
         $user = new Default_Model_Users($db);
         if ($user->isLdapUser(sapp_Global::escapeString($options['username']))) {
             $options['ldap'] = $this->_options['ldap'];
             $authAdapter = Login_Auth::_getAdapter('ldap', $options);
         } else {
             $options['db'] = $db;
             $options['salt'] = $this->_options['auth']['salt'];
             if ($isemail = filter_var($options['username'], FILTER_VALIDATE_EMAIL)) {
                 $authAdapter = Login_Auth::_getAdapter('email', $options);
             } else {
                 $authAdapter = Login_Auth::_getAdapter('db', $options);
             }
         }
         $result = $auth->authenticate($authAdapter);
         if ($result->isValid()) {
             $admin_data = $user->getUserObject($options['username']);
             $auth->getStorage()->write($admin_data);
             $storage = $auth->getStorage()->read();
             $dataTmp = array();
             $dataTmp['userid'] = $storage->id ? $storage->id : 0;
             $dataTmp['emprole'] = $storage->emprole ? $storage->emprole : 0;
             $dataTmp['group_id'] = $storage->group_id ? $storage->group_id : 0;
             $dataTmp['employeeId'] = $storage->employeeId ? $storage->employeeId : 0;
             $dataTmp['emailaddress'] = $storage->emailaddress ? $storage->emailaddress : '';
             $dataTmp['userfullname'] = $storage->userfullname ? $storage->userfullname : '';
             $dataTmp['logindatetime'] = gmdate("Y-m-d H:i:s");
             if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != '') {
                 $ip_address = $_SERVER['HTTP_X_FORWARDED_FOR'];
             } else {
                 $ip_address = $_SERVER['REMOTE_ADDR'];
             }
             if ($ip_address == '::1') {
                 $ip_address = '127.0.0.1';
             }
             $dataTmp['empipaddress'] = $ip_address;
             $dataTmp['profileimg'] = $storage->profileimg ? $storage->profileimg : '';
//.........這裏部分代碼省略.........
開發者ID:sura2k,項目名稱:sentrifugo,代碼行數:101,代碼來源:IndexController.php


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