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(); }
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(); }
/** * 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; }
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(); }
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); }
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'); }
public function btnSave_Click() { // Check for unique token $strToken = QApplication::Tokenize($this->txtToken->Text); if (strlen($strToken)) { if (is_numeric($strToken)) { $this->txtToken->Warning = 'URL must have more than just numbers'; } if (($objTest = SignupForm::LoadByToken($strToken)) && $objTest->Id != $this->mctSignupForm->SignupForm->Id) { $this->txtToken->Warning = 'URL is already taken'; } if ($this->txtToken->Warning) { $this->txtToken->Blink(); $this->txtToken->Focus(); return; } $this->txtToken->Text = $strToken; } else { $this->txtToken->Text = null; } $this->mctSignupForm->SaveSignupForm(); // Add Child switch ($this->mctSignupForm->SignupForm->SignupFormTypeId) { case SignupFormType::Event: if (!$this->mctSignupChild->EventSignupForm->SignupForm) { $this->mctSignupChild->EventSignupForm->SignupForm = $this->mctSignupForm->SignupForm; } $this->mctSignupChild->SaveEventSignupForm(); break; case SignupFormType::Course: if (!$this->mctSignupChild->ClassMeeting->SignupForm) { $this->mctSignupChild->ClassMeeting->SignupForm = $this->mctSignupForm->SignupForm; } $this->mctSignupChild->SaveClassMeeting(); break; default: throw new Exception('Invalid SignupFormTypeId: ' . $objSignupForm->SignupFormTypeId); } // Redirect to View Page QApplication::Redirect('/events/form.php/' . $this->mctSignupForm->SignupForm->Id); }
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; } }