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


PHP LogActions::getNumberOfActionsBySession方法代碼示例

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


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

示例1: SMSEntry

 function SMSEntry()
 {
     // check for return from tester, in which case we need to switch back to normal mode to look in the correct actions table
     if (isset($_SESSION[SURVEY_EXECUTION_MODE]) && $_SESSION[SURVEY_EXECUTION_MODE] == SURVEY_EXECUTION_MODE_TEST) {
         $_SESSION[SURVEY_EXECUTION_MODE] = SURVEY_EXECUTION_MODE_NORMAL;
     }
     $logactions = new LogActions();
     $nosessionactions = $logactions->getNumberOfActionsBySession($this->phpid, USCIC_SMS);
     //echo 'ytytytyt';
     //echo ' [[[[' . $this->phpid;
     if ($nosessionactions == 0) {
         //no entry yet: ask for prim_key!
         $logactions->addAction('', '', "loginstart", USCIC_SMS);
         $login = new Login($this->phpid);
         return $login->getSMSLoginScreen();
     } else {
         //echo ']]]]]';
         $loggedin = $logactions->getLoggedInSMSSession($this->phpid);
         if ($loggedin["count"] == 0) {
             //no prim_key (=username in sms) assigned to this sessionid. Assign if given (and check for pwd etc??)!
             $username = loadvar('username');
             $_SESSION['username'] = $username;
             if ($username != '' && loadvar('password') != '') {
                 //check username!!
                 $login = new Login($this->phpid);
                 if ($login->checkSMSAccess()) {
                     $urid = $_SESSION['URID'];
                     $logactions->addAction('', $urid, "loggedin", USCIC_SMS);
                     $sms = new SMS($urid, $this->phpid);
                     return $sms->getPage();
                 } else {
                     // incorrect login..start new session
                     endSession();
                     session_start();
                     session_regenerate_id(true);
                     $logactions->addAction('', '', "loginempty", USCIC_SMS);
                     $login = new Login(session_id());
                     return $login->getSMSLoginScreen(Language::messageCheckUsernamePassword());
                 }
             } else {
                 $logactions->addAction('', '', "loginempty", USCIC_SMS);
                 $login = new Login($this->phpid);
                 return $login->getSMSLoginScreen(Language::messageEnterUsernamePassword());
             }
         } else {
             //continue with the sms! EXTRA CHECK!!!!
             $_SESSION['URID'] = $loggedin["urid"];
             if (isset($_SESSION['URID'])) {
                 $sms = new SMS($_SESSION['URID'], $this->phpid);
                 return $sms->getPage();
             } else {
                 //something went wrong.. no urid..start new session
                 //echo 'ohno';
                 endSession();
                 session_start();
                 session_regenerate_id(true);
                 $logactions->addAction('', '', "loginempty", USCIC_SMS);
                 $login = new Login(session_id());
                 return $login->getSMSLoginScreen(Language::messageCheckUsernamePassword());
             }
         }
     }
 }
開發者ID:nubissurveying,項目名稱:nubis,代碼行數:63,代碼來源:action.php


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