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


PHP QApplication::Tokenize方法代碼示例

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


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

示例1: btnSave_Click

 public function btnSave_Click()
 {
     $strToken = QApplication::Tokenize($this->txtToken->Text);
     if (Group::LoadByToken($strToken) || ($objList = CommunicationList::LoadByToken($strToken)) && $objList->Id != $this->mctList->CommunicationList->Id) {
         $this->txtToken->Warning = 'Email Address is already taken';
         return;
     }
     $this->txtToken->Text = $strToken;
     $this->mctList->SaveCommunicationList();
     $this->RedirectToView();
 }
開發者ID:alcf,項目名稱:chms,代碼行數:11,代碼來源:edit.php

示例2: btnSave_Click

 protected function btnSave_Click($strFormId, $strControlId, $strParameter)
 {
     $this->txtName->Text = trim($this->txtName->Text);
     $this->txtToken->Text = QApplication::Tokenize($this->txtToken->Text);
     $this->txtDescription->Text = trim($this->txtDescription->Text);
     $this->txtDisclaimer->Text = trim($this->txtDisclaimer->Text);
     $this->txtInstructions->Text = trim($this->txtInstructions->Text);
     // Check Token for Unique
     if (($objCategory = ClassifiedCategory::LoadByToken($this->txtToken->Text)) && $objCategory->Id != $this->mctClassifiedCategory->ClassifiedCategory->Id) {
         $this->txtToken->Warning = 'Token is already taken';
         $this->txtToken->Blink();
         $this->txtToken->Focus();
         return;
     }
     $this->mctClassifiedCategory->SaveClassifiedCategory();
     ClassifiedCategory::RefreshOrderNumber();
     $this->ReturnToList();
 }
開發者ID:alcf,項目名稱:chms,代碼行數:18,代碼來源:category.php

示例3: IsProvisionalCreatableForUsername

 /**
  * Will check to see if a given username is creatable for a provisional account.  If it is already
  * taken by a non-provisional account, this will return false.  Otherwise, if it doesn't exist
  * (or the existing one is still provisional), it will return true.
  * @param $strUsername
  * @return boolean
  */
 public static function IsProvisionalCreatableForUsername($strUsername)
 {
     $strUsername = QApplication::Tokenize($strUsername, false);
     if ($objPublicLogin = PublicLogin::LoadByUsername($strUsername)) {
         if ($objPublicLogin->Person) {
             return false;
         }
     }
     return true;
 }
開發者ID:alcf,項目名稱:chms,代碼行數:17,代碼來源:PublicLogin.class.php

示例4: btnUpdate_Security_Click

 protected function btnUpdate_Security_Click()
 {
     // Validate Security Stuff
     $blnProceed = true;
     $strUsernameCandidate = null;
     if ($this->txtUsername->Text != QApplication::$PublicLogin->Username) {
         $strUsernameCandidate = QApplication::Tokenize($this->txtUsername->Text, false);
         if ($strUsernameCandidate != trim(strtolower($this->txtUsername->Text))) {
             $this->txtUsername->Warning = 'Must only contain letters and numbers';
             $blnProceed = false;
         }
         if (strlen($strUsernameCandidate) < 4) {
             $this->txtUsername->Warning = 'Must have at least 4 characters';
             $blnProceed = false;
         }
         if (PublicLogin::LoadByUsername($strUsernameCandidate)) {
             $this->txtUsername->Warning = 'Username is taken';
             $blnProceed = false;
         }
     }
     if ($this->txtOldPassword->Text || $this->txtNewPassword->Text || $this->txtConfirmPassword->Text) {
         if (!QApplication::$PublicLogin->IsPasswordValid($this->txtOldPassword->Text)) {
             $this->txtOldPassword->Warning = 'Password is incorrect';
             $blnProceed = false;
         }
         if (strlen(trim($this->txtNewPassword->Text)) < 6) {
             $blnProceed = false;
             $this->txtNewPassword->Warning = 'Must have at least 6 characters';
         }
         if ($this->txtNewPassword->Text != $this->txtConfirmPassword->Text) {
             $this->txtConfirmPassword->Warning = 'Does not match above';
             $blnProceed = false;
         }
     }
     if (!$blnProceed) {
         $blnFirst = true;
         foreach ($this->GetErrorControls() as $objErrorControl) {
             $objErrorControl->Blink();
             if ($blnFirst) {
                 $blnFirst = false;
                 $objErrorControl->Focus();
             }
         }
         return;
     }
     // Update Stuff
     if ($strUsernameCandidate) {
         QApplication::$PublicLogin->Username = $strUsernameCandidate;
     }
     QApplication::$PublicLogin->LostPasswordQuestion = trim($this->txtQuestion->Text);
     QApplication::$PublicLogin->LostPasswordAnswer = strtolower(trim($this->txtAnswer->Text));
     if ($this->txtNewPassword->Text) {
         QApplication::$PublicLogin->SetPassword($this->txtNewPassword->Text);
         QApplication::$PublicLogin->TemporaryPasswordFlag = false;
     }
     QApplication::$PublicLogin->Save();
     // Refresh Stuff
     $this->mctPerson->Person->Reload();
     $this->Refresh();
     // Cleanup Stuff
     $this->btnCancel_Security_Click();
 }
開發者ID:alcf,項目名稱:chms,代碼行數:62,代碼來源:index.php

示例5: btnRegister_Click

 protected function btnRegister_Click($strFormId, $strControlId, $strParameter)
 {
     $strUsernameCandidate = QApplication::Tokenize($this->txtUsername->Text, false);
     $objProvisionalPublicLogin = PublicLogin::CreateProvisional($strUsernameCandidate, $this->txtEmail->Text, $this->txtFirstName->Text, $this->txtLastName->Text);
     QApplication::Redirect($objProvisionalPublicLogin->AwaitingConfirmationUrl);
 }
開發者ID:alcf,項目名稱:chms,代碼行數:6,代碼來源:index.php

示例6: btnRegister_Click

 protected function btnRegister_Click()
 {
     $strUsernameCandidate = QApplication::Tokenize($this->txtUsername->Text, false);
     // Create the Public Login record
     $objPublicLogin = PublicLogin::CreateForPerson($this->objOnlineDonation->Person, $this->txtUsername->Text, $this->txtPassword->Text, $this->lstQuestion->SelectedValue ? $this->lstQuestion->SelectedValue : $this->txtQuestion->Text, $this->txtAnswer->Text);
     // Set the Primary Email Address
     $objPublicLogin->Person->ChangePrimaryEmailTo($_SESSION['onlineDonationEmailAddress' . $this->objOnlineDonation->Id], false);
     // Login and Redirect
     QApplication::PublicLogin($objPublicLogin);
     QApplication::Redirect('/register/thankyou.php');
 }
開發者ID:alcf,項目名稱:chms,代碼行數:11,代碼來源:confirmation.php

示例7: ValidateToken

 public function ValidateToken()
 {
     if (!$this->txtToken) {
         return true;
     }
     $strToken = QApplication::Tokenize($this->txtToken->Text);
     if (strlen($strToken)) {
         if (CommunicationList::LoadByToken($strToken) || ($objGroup = Group::LoadByToken($strToken)) && $objGroup->Id != $this->mctGroup->Group->Id) {
             $this->txtToken->Warning = 'Email Address is already taken';
             return false;
         } else {
             $this->txtToken->Text = $strToken;
             return true;
         }
     } else {
         return true;
     }
 }
開發者ID:alcf,項目名稱:chms,代碼行數:18,代碼來源:CpGroup_Base.class.php


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