本文整理汇总了PHP中ForceIncomingString函数的典型用法代码示例。如果您正苦于以下问题:PHP ForceIncomingString函数的具体用法?PHP ForceIncomingString怎么用?PHP ForceIncomingString使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ForceIncomingString函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PasswordRequestForm
function PasswordRequestForm(&$Context, $FormName = '')
{
$this->Name = 'PasswordRequestForm';
$this->ValidActions = array('PasswordRequestForm', 'RequestPasswordReset');
$this->Constructor($Context);
if ($this->IsPostBack) {
$this->FormName = $FormName;
$this->Username = ForceIncomingString('Username', '');
// Set up the page
global $Banner, $Foot;
$Banner->Properties['CssClass'] = 'PasswordRequest';
$Foot->CssClass = 'PasswordRequest';
$this->Context->PageTitle = $this->Context->GetDefinition('PasswordResetRequest');
$this->UserManager = $this->Context->ObjectFactory->NewContextObject($this->Context, 'UserManager');
if ($this->PostBackAction == 'RequestPasswordReset') {
$this->EmailSentTo = $this->UserManager->RequestPasswordReset($this->Username);
$aEmailSentTo = explode('@', $this->EmailSentTo);
if (count($aEmailSentTo) > 1) {
$this->EmailSentTo = $aEmailSentTo[1];
}
if ($this->EmailSentTo) {
$this->PostBackValidated = 1;
}
}
$this->CallDelegate('LoadData');
}
}
示例2: GetPropertiesFromForm
function GetPropertiesFromForm(&$Context)
{
$this->CategoryID = ForceIncomingInt('CategoryID', 0);
$this->Name = ForceIncomingString('Name', '');
$this->Description = ForceIncomingString('Description', '');
$this->AllowedRoles = ForceIncomingArray('CategoryRoleBlock', array());
}
示例3: PasswordRequestForm
function PasswordRequestForm(&$Context, $FormName = "")
{
$this->ValidActions = array("RequestPasswordReset");
$this->FormName = $FormName;
$this->Username = ForceIncomingString("Username", "");
$this->Constructor($Context);
}
示例4: PasswordResetForm
function PasswordResetForm(&$Context, $FormName = '')
{
$this->Name = 'PasswordResetForm';
$this->ValidActions = array('PasswordResetForm', 'ResetPassword');
$this->Constructor($Context);
if ($this->IsPostBack) {
$this->FormName = $FormName;
$this->ValidatedCredentials = 0;
// Set up the page
global $Banner, $Foot;
$Banner->Properties['CssClass'] = 'PasswordReset';
$Foot->CssClass = 'PasswordReset';
$this->Context->PageTitle = $this->Context->GetDefinition('ResetYourPassword');
// Form properties
$this->UserID = ForceIncomingInt('u', 0);
$this->EmailVerificationKey = ForceIncomingString('k', '');
$this->NewPassword = ForceIncomingString('NewPassword', '');
$this->ConfirmPassword = ForceIncomingString('ConfirmPassword', '');
$this->CallDelegate('Constructor');
$um = $this->Context->ObjectFactory->NewContextObject($this->Context, 'UserManager');
if ($this->IsPostBack && $this->PostBackAction == 'ResetPassword') {
$this->ValidatedCredentials = 1;
} else {
$this->ValidatedCredentials = $um->VerifyPasswordResetRequest($this->UserID, $this->EmailVerificationKey);
}
if ($this->ValidatedCredentials && $this->PostBackAction == 'ResetPassword') {
$this->PostBackValidated = $um->ResetPassword($this->UserID, $this->EmailVerificationKey, $this->NewPassword, $this->ConfirmPassword);
}
$this->CallDelegate('LoadData');
}
}
示例5: GlobalsForm
function GlobalsForm(&$Context)
{
$this->Name = 'GlobalsForm';
$this->ValidActions = array('Globals', 'ProcessGlobals');
$this->Constructor($Context);
if (!$this->Context->Session->User->Permission('PERMISSION_CHANGE_APPLICATION_SETTINGS')) {
$this->IsPostBack = 0;
} elseif ($this->IsPostBack) {
$this->Context->PageTitle = $this->Context->GetDefinition('ApplicationSettings');
$SettingsFile = $this->Context->Configuration['APPLICATION_PATH'] . 'conf/settings.php';
$this->ConfigurationManager = $this->Context->ObjectFactory->NewContextObject($this->Context, 'ConfigurationManager');
if ($this->PostBackAction == 'ProcessGlobals' && $this->IsValidFormPostBack()) {
$this->ConfigurationManager->GetSettingsFromForm($SettingsFile);
// Checkboxes aren't posted back if unchecked, so make sure that they are saved properly
$this->ConfigurationManager->DefineSetting('ENABLE_WHISPERS', ForceIncomingBool('ENABLE_WHISPERS', 0), 0);
$this->ConfigurationManager->DefineSetting('ALLOW_NAME_CHANGE', ForceIncomingBool('ALLOW_NAME_CHANGE', 0), 0);
$this->ConfigurationManager->DefineSetting('PUBLIC_BROWSING', ForceIncomingBool('PUBLIC_BROWSING', 0), 0);
$this->ConfigurationManager->DefineSetting('USE_CATEGORIES', ForceIncomingBool('USE_CATEGORIES', 0), 0);
$this->ConfigurationManager->DefineSetting('LOG_ALL_IPS', ForceIncomingBool('LOG_ALL_IPS', 0), 0);
//Validate cookie domain.
//The pattern is loose; eg, It won't stop "domain.tld" or ".co.uk" to be saved
//(the "domain.tld" can be set by the browser, the 2nd won't).
Validate($this->Context->GetDefinition('CookieDomain'), 0, ForceIncomingString('COOKIE_DOMAIN', ''), 255, '^[\\.-_~a-zA-Z0-9]*\\.?[-_~a-zA-Z0-9]+\\.[-_~a-zA-Z0-9]+$', $this->Context);
// And save everything
if ($this->ConfigurationManager->SaveSettingsToFile($SettingsFile)) {
header('Location: ' . GetUrl($this->Context->Configuration, 'settings.php', '', '', '', '', 'PostBackAction=Globals&Success=1'));
} else {
$this->PostBackAction = 'Globals';
}
}
}
$this->CallDelegate('Constructor');
}
示例6: ApplicantsForm
function ApplicantsForm(&$Context)
{
$this->Name = "ApplicantsForm";
$this->ValidActions = array("Applicants", "ProcessApplicants");
$this->Constructor($Context);
if (!$this->Context->Session->User->Permission("PERMISSION_APPROVE_APPLICANTS")) {
$this->IsPostBack = 0;
} elseif ($this->IsPostBack) {
$this->Context->PageTitle = $this->Context->GetDefinition('MembershipApplicants');
// See if the form has been submitted
if ($this->PostBackAction == 'ProcessApplicants' && $this->IsValidFormPostBack()) {
$Action = ForceIncomingString('btnSubmit', '');
// Compare to language dictionary to figure out exactly what should be done
if ($Action != '') {
$Action = $Context->GetDefinition('ApproveForMembership') == $Action ? 'Approve' : 'Decline';
}
// Retrieve the id's to manipulate
$ApplicantIDs = ForceIncomingArray('ApplicantID', array());
// Approve or decline the applicants
if ($Action != '' && is_array($ApplicantIDs) && count($ApplicantIDs) > 0) {
$um = $this->Context->ObjectFactory->NewContextObject($this->Context, 'UserManager');
if ($Action == 'Approve') {
$um->ApproveApplicant($ApplicantIDs);
} else {
$um->RemoveApplicant($ApplicantIDs);
}
}
}
// There is no need to load all of the applicants since they were already loaded by the settings.php page
// $um = $this->Context->ObjectFactory->NewContextObject($this->Context, 'UserManager');
// $this->ApplicantData = $um->GetUsersByRoleId(0);
}
$this->CallDelegate("Constructor");
}
示例7: LoadData
function LoadData()
{
$this->Reporter = ForceIncomingString("ReporterName", "");
$this->ReporterEmail = ForceIncomingString("ReporterEmail", "");
$this->BugUrl = ForceIncomingString("BugUrl", "");
$this->BugHappenedWhen = ForceIncomingString("BugHappenedWhen", "");
$this->BugDescription = ForceIncomingString("BugDescription", "");
if ($this->IsPostBack) {
if ($this->PostBackAction == "ReportBug") {
// Validate the inputs
Validate($this->Context->GetDefinition("YourNameLower"), 1, $this->Reporter, 100, "", $this->Context);
Validate($this->Context->GetDefinition("YourEmailLower"), 1, $this->ReporterEmail, 200, "(.+)@(.+)\\.(.+)", $this->Context);
Validate($this->Context->GetDefinition("BugUrlLower"), 1, $this->BugUrl, 255, "", $this->Context);
Validate($this->Context->GetDefinition("BugHappenedWhenLower"), 1, $this->BugHappenedWhen, 5000, "", $this->Context);
Validate($this->Context->GetDefinition("BugDescriptionLower"), 1, $this->BugDescription, 5000, "", $this->Context);
$this->PostBackValidated = $this->Context->WarningCollector->Iif();
}
if ($this->PostBackValidated) {
$e = $this->Context->ObjectFactory->NewContextObject($this->Context, "Email");
$e->HtmlOn = 0;
$e->WarningCollector =& $this->Context->WarningCollector;
$e->ErrorManager =& $this->Context->ErrorManager;
$e->AddFrom(agSUPPORT_EMAIL, agSUPPORT_NAME);
$e->AddRecipient(agSUPPORT_EMAIL, agSUPPORT_NAME);
$e->Subject = agAPPLICATION_TITLE . " " . $this->Context->GetDefinition("BugReport");
$e->BodyText = $this->Context->GetDefinition("BugReportSubmitted") . "\r\n" . $this->Context->GetDefinition("UserAgent") . ": " . ForceString(@$_SERVER["HTTP_USER_AGENT"], "") . "\r\n" . $this->Context->GetDefinition("ReporterName") . ": " . $this->Reporter . "\r\n" . $this->Context->GetDefinition("ReporterEmail") . ": " . $this->ReporterEmail . "\r\n" . $this->Context->GetDefinition("BugUrl") . ": " . $this->BugUrl . "\r\n" . $this->Context->GetDefinition("BugHappenedWhen") . ": " . $this->BugHappenedWhen . "\r\n" . $this->Context->GetDefinition("BugDescription") . ": " . $this->BugDescription . "\r\n" . $this->Context->GetDefinition("NoteOnBugsForAdmins");
$e->Send();
}
}
}
示例8: GetPropertiesFromForm
function GetPropertiesFromForm()
{
$this->StyleID = ForceIncomingInt("StyleID", 0);
$this->AuthUserID = ForceIncomingInt("AuthUserID", 0);
$this->AuthUsername = ForceIncomingString("AuthUsername", "");
$this->Name = ForceIncomingString("Name", "");
$this->Url = ForceIncomingString("Url", "");
$this->PreviewImage = ForceIncomingString("PreviewImage", "");
}
示例9: RoleHistory
function RoleHistory(&$Context, &$UserManager, $UserID)
{
$this->PostBackAction = ForceIncomingString("PostBackAction", "");
$this->Name = "RoleHistory";
$this->Control($Context);
if ($this->PostBackAction == "") {
$this->History = $UserManager->GetUserRoleHistoryByUserId($UserID);
}
}
示例10: SignInForm
function SignInForm(&$Context, $FormName)
{
$this->Name = 'SignInForm';
$this->ValidActions = array('SignIn');
$this->Constructor($Context);
if ($this->PostBackAction == '') {
$this->IsPostBack = 1;
}
if ($this->IsPostBack) {
$this->FormName = $FormName;
$this->ReturnUrl = urldecode(ForceIncomingString('ReturnUrl', ''));
$ValidateReturnUrl = strstr($this->ReturnUrl, $this->Context->Configuration['COOKIE_DOMAIN'] . $this->Context->Configuration['COOKIE_PATH']);
if ($this->ReturnUrl != '') {
$this->PostBackParams->Add('ReturnUrl', $this->ReturnUrl);
}
$this->Username = ForceIncomingString('Username', '');
$this->Password = ForceIncomingString('Password', '', false);
$this->RememberMe = ForceIncomingBool('RememberMe', 0);
// Set up the page
global $Banner, $Foot;
$Banner->Properties['CssClass'] = 'SignIn';
$Foot->CssClass = 'SignIn';
$this->Context->PageTitle = $this->Context->GetDefinition('SignIn');
if ($this->PostBackAction == 'SignIn') {
$UserManager = $this->Context->ObjectFactory->NewContextObject($this->Context, 'UserManager');
// Check for an already active session
if ($this->Context->Session->UserID != 0) {
$this->PostBackValidated = 1;
} else {
// Attempt to create a new session for the user
if ($UserManager->ValidateUserCredentials($this->Username, $this->Password, $this->RememberMe)) {
$this->PostBackValidated = 1;
//Automatically redirect if this user isn't a user administrator or there aren't any new applicants
$AutoRedirect = 1;
if ($this->Context->Session->User->Permission('PERMISSION_APPROVE_APPLICANTS')) {
$this->ApplicantCount = $UserManager->GetApplicantCount();
if ($this->ApplicantCount > 0) {
$AutoRedirect = 0;
}
}
if ($this->ReturnUrl == '' || empty($ValidateReturnUrl)) {
$this->ReturnUrl = $this->Context->Configuration['FORWARD_VALIDATED_USER_URL'];
} else {
$this->ReturnUrl = str_replace('&', '&', $this->ReturnUrl);
}
if ($AutoRedirect && $this->ReturnUrl != '') {
//@todo: Should the the process die here?
Redirect($this->ReturnUrl, '302', '', 0);
}
}
}
}
$this->Context->BodyAttributes = " onload=\"Focus('txtUsername');\"";
}
$this->CallDelegate('Constructor');
}
示例11: Account
function Account(&$Context, &$User)
{
$this->FatalError = 0;
$this->Name = 'Account';
$this->PostBackAction = ForceIncomingString('PostBackAction', '');
$this->Control($Context);
$this->User =& $User;
if ($this->Context->WarningCollector->Count() > 0) {
$this->FatalError = 1;
}
$this->CallDelegate('Constructor');
}
示例12: IpHistory
function IpHistory(&$Context, &$UserManager, $UserID)
{
$this->Name = "IpHistory";
$this->PostBackAction = ForceIncomingString("PostBackAction", "");
$this->Control($Context);
$this->History = false;
if ($this->Context->Session->User) {
if ($this->Context->Session->User->Permission("PERMISSION_IP_ADDRESSES_VISIBLE") && $this->PostBackAction == "") {
$this->History = $UserManager->GetIpHistory($UserID);
}
}
}
示例13: PasswordResetForm
function PasswordResetForm(&$Context, $FormName = "")
{
$this->ValidActions = array("ResetPassword");
$this->FormName = $FormName;
$this->ValidatedCredentials = 0;
$this->Constructor($Context);
// Form properties
$this->UserID = ForceIncomingInt("u", 0);
$this->EmailVerificationKey = ForceIncomingString("k", "");
$this->NewPassword = ForceIncomingString("NewPassword", "");
$this->ConfirmPassword = ForceIncomingString("ConfirmPassword", "");
}
示例14: RegistrationForm
function RegistrationForm(&$Context)
{
$this->Name = 'RegistrationForm';
$this->ValidActions = array('ProcessRegistrationChange', 'RegistrationChange');
$this->Constructor($Context);
if (!$this->Context->Session->User->Permission('PERMISSION_MANAGE_REGISTRATION')) {
$this->IsPostBack = 0;
} elseif ($this->IsPostBack) {
$this->Context->PageTitle = $this->Context->GetDefinition('RegistrationManagement');
$RoleID = ForceIncomingString('RoleID', '');
if ($RoleID == '') {
$RoleID = $this->Context->Configuration['DEFAULT_ROLE'];
}
$this->RoleManager = $this->Context->ObjectFactory->NewContextObject($this->Context, 'RoleManager');
$this->RoleSelect = $this->Context->ObjectFactory->NewObject($this->Context, 'Select');
$this->RoleSelect->Name = 'RoleID';
// Add the applicant faux-role
$this->RoleSelect->AddOption(0, $this->Context->GetDefinition('Applicant'));
// Add all other roles
$this->RoleSelect->AddOptionsFromDataSet($this->Context->Database, $this->RoleManager->GetRoles(), 'RoleID', 'Name');
$this->RoleSelect->SelectedValue = $RoleID;
$this->RoleSelect->Attributes = ' id="ddRoleID"';
$ApprovedRoleID = ForceIncomingInt('ApprovedRoleID', $this->Context->Configuration['APPROVAL_ROLE']);
$this->ApprovedRoleSelect = $this->Context->ObjectFactory->NewObject($this->Context, 'Select');
$this->ApprovedRoleSelect->Name = 'ApprovedRoleID';
$this->ApprovedRoleSelect->AddOptionsFromDataSet($this->Context->Database, $this->RoleManager->GetRoles(), 'RoleID', 'Name');
$this->ApprovedRoleSelect->SelectedValue = $ApprovedRoleID;
$this->ApprovedRoleSelect->Attributes = ' id="ddApprovedRoleID"';
if ($this->PostBackAction == 'ProcessRegistrationChange' && $this->IsValidFormPostBack()) {
// Make the immediate access option default to '0' if the 'default' role
// for new members is '0' (applicant)
$AllowImmediateAccess = 0;
if ($RoleID > 0) {
$Role = $this->RoleManager->GetRoleById($RoleID);
$AllowImmediateAccess = $Role->PERMISSION_SIGN_IN ? '1' : '0';
}
$ConstantsFile = $this->Context->Configuration['APPLICATION_PATH'] . 'conf/settings.php';
$ConstantManager = $this->Context->ObjectFactory->NewContextObject($this->Context, 'ConfigurationManager');
// Set the constants to their new values
$ConstantManager->DefineSetting('DEFAULT_ROLE', $RoleID);
$ConstantManager->DefineSetting('ALLOW_IMMEDIATE_ACCESS', $AllowImmediateAccess);
$ConstantManager->DefineSetting('APPROVAL_ROLE', $ApprovedRoleID);
$this->DelegateParameters['ConstantManager'] =& $ConstantManager;
$this->CallDelegate('PreSaveSettings');
// Save the settings file
$ConstantManager->SaveSettingsToFile($ConstantsFile);
if ($this->Context->WarningCollector->Iif()) {
$this->PostBackValidated = 1;
}
}
}
$this->CallDelegate('Constructor');
}
示例15: reCAPTCHA_CheckCaptcha
function reCAPTCHA_CheckCaptcha(&$ApplyForm)
{
// Check the submitted answer.
$ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '0.0.0.0';
$resp = recaptcha_check_answer($ApplyForm->Context->Configuration['reCAPTCHA.PrivateKey'], $ip, ForceIncomingString('recaptcha_challenge_field', ''), ForceIncomingString('recaptcha_response_field', ''));
// Report errors if necessary.
if (!$resp->is_valid) {
if ('incorrect-captcha-sol' == $resp->error) {
$ApplyForm->Context->WarningCollector->Add($ApplyForm->Context->GetDefinition('reCAPTCHA.Error.Incorrect'));
} else {
$ApplyForm->Context->WarningCollector->Add($ApplyForm->Context->GetDefinition('reCAPTCHA.Error.Config'));
}
}
}