本文整理汇总了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();
}
示例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();
}
示例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;
}
示例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();
}
示例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);
}
示例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');
}
示例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;
}
}