OXID eShop CE  4.9.6
 All Classes Files Functions Variables Pages
oxInputValidator Class Reference
+ Inheritance diagram for oxInputValidator:
+ Collaboration diagram for oxInputValidator:

Public Member Functions

 __construct ()
 checkLogin ($oUser, $sLogin, $aInvAddress)
 checkEmail ($oUser, $sEmail)
 checkPassword ($oUser, $sNewPass, $sConfPass, $blCheckLength=false)
 checkRequiredArrayFields ($oUser, $sFieldName, $aFieldValues)
 checkCountries ($oUser, $aInvAddress, $aDelAddress)
 getFieldValidationErrors ()
 getFirstValidationError ()
 validatePaymentInputData ($sPaymentId, &$aDynValue)
 setCompanyVatInValidator ($oCompanyVatInValidator)
- Public Member Functions inherited from oxSuperCfg
 __call ($sMethod, $aArgs)
 getConfig ()
 setConfig ($oConfig)
 getSession ()
 setSession ($oSession)
 getUser ()
 setUser ($oUser)
 isAdmin ()
 setAdminMode ($blAdmin)

Public Attributes

const INVALID_ACCOUNT_NUMBER = -5
const INVALID_BANK_CODE = -4

Protected Member Functions

 _getCountry ($sCountryId)
 _addValidationError ($sFieldName, $oErr)
 _validateDebitNote ($aDebitInformation)
 _validateOldDebitInfo ($aDebitInfo)
 _fixAccountNumber ($aDebitInfo)
 _isAllBankInformationSet ($aRequiredFields, $aBankInformation)
 _cleanDebitInformation ($aDebitInformation)
 _hasRequiredParametersForVatInCheck ($aInvAddress)
 _getVatIdValidator ()

Protected Attributes

 $_aRequiredCCFields
 $_aInputValidationErrors = array()
 $_oCompanyVatInValidator = null
 $_aPossibleCCType
 $_aRequiredDCFields

Private Member Functions

 _setFields ($oObject, $aFields)
 _isVATIdentificationNumberInvalid ($aInvAddress, $oCountry)

Additional Inherited Members

- Static Protected Attributes inherited from oxSuperCfg
static $_oConfig = null
static $_oSession = null
static $_oRights = null
static $_oActUser = null
static $_blIsAdmin = null

Detailed Description

Class for validating input

Definition at line 7 of file oxinputvalidator.php.

Constructor & Destructor Documentation

oxInputValidator::__construct ( )

Class constructor. The constructor is defined in order to be possible to call parent::__construct() in modules.

Reimplemented from oxSuperCfg.

Definition at line 73 of file oxinputvalidator.php.

Member Function Documentation

oxInputValidator::_addValidationError (   $sFieldName,
  $oErr 
)
protected

Used to collect user validation errors. This method is called from all of the input checking functionality to report found error.

Parameters
string$sFieldNamefield name
exception$oErrexception
Returns
exception

Definition at line 471 of file oxinputvalidator.php.

oxInputValidator::_cleanDebitInformation (   $aDebitInformation)
protected

Clean up spaces.

Parameters
array$aDebitInformationDebit information
Returns
mixed

Definition at line 583 of file oxinputvalidator.php.

oxInputValidator::_fixAccountNumber (   $aDebitInfo)
protected

If account number is shorter than 10, add zeros in front of number.

Parameters
array$aDebitInfoDebit info
Returns
array

Definition at line 540 of file oxinputvalidator.php.

oxInputValidator::_getCountry (   $sCountryId)
protected

Load and return oxCountry

Parameters
string$sCountryId
Returns
oxCountry

Definition at line 386 of file oxinputvalidator.php.

oxInputValidator::_getVatIdValidator ( )
protected

Gets VAT in validator.

Returns
oxOnlineVatIdCheck
Deprecated:
since v5.2 (2014-07-28); This logic was moved to oxCompanyVatInValidator

Definition at line 626 of file oxinputvalidator.php.

oxInputValidator::_hasRequiredParametersForVatInCheck (   $aInvAddress)
protected

Check if all need parameters entered

Parameters
array$aInvAddressAddress
Returns
bool

Definition at line 598 of file oxinputvalidator.php.

oxInputValidator::_isAllBankInformationSet (   $aRequiredFields,
  $aBankInformation 
)
protected

Checks if all bank information is set.

Parameters
array$aRequiredFieldsfields must be set.
array$aBankInformationactual information.
Returns
bool

Definition at line 563 of file oxinputvalidator.php.

oxInputValidator::_isVATIdentificationNumberInvalid (   $aInvAddress,
  $oCountry 
)
private

Compares country VAT identification number with it's prefix.

Parameters
array$aInvAddress
oxCountry$oCountry
Deprecated:
since v5.2 (2014-07-28); This logic was moved to oxCompanyVatInValidator
Returns
bool

Definition at line 613 of file oxinputvalidator.php.

oxInputValidator::_setFields (   $oObject,
  $aFields 
)
private

Creates oxAddress object from given array.

Parameters
oxUser | oxAddress$oObject
array$aFields
Returns
oxUser|oxAddress

Definition at line 276 of file oxinputvalidator.php.

oxInputValidator::_validateDebitNote (   $aDebitInformation)
protected

Validates debit note.

Parameters
array$aDebitInformationDebit information
Returns
bool|int

Definition at line 483 of file oxinputvalidator.php.

oxInputValidator::_validateOldDebitInfo (   $aDebitInfo)
protected

Validates old debit info.

Parameters
array$aDebitInfoDebit info
Returns
bool|int

Definition at line 512 of file oxinputvalidator.php.

oxInputValidator::checkCountries (   $oUser,
  $aInvAddress,
  $aDelAddress 
)

Checks if user defined countries (billing and delivery) are active

Parameters
oxUser$oUseractive user
array$aInvAddressbilling address info
array$aDelAddressdelivery address info

Definition at line 314 of file oxinputvalidator.php.

oxInputValidator::checkEmail (   $oUser,
  $sEmail 
)

Checks if email (used as login) is not empty and is valid.

Parameters
oxUser$oUseractive user
string$sEmailuser email/login
Returns
null

Definition at line 172 of file oxinputvalidator.php.

oxInputValidator::checkLogin (   $oUser,
  $sLogin,
  $aInvAddress 
)

Checks if user name does not break logic:

  • if user wants to UPDATE his login name, performing check if user entered correct password
  • additionally checking for user name duplicates. This is usually needed when creating new users. On any error exception is thrown.
Parameters
oxUser$oUseractive user
string$sLoginuser preferred login name
array$aInvAddressuser information
Returns
string login name

Definition at line 123 of file oxinputvalidator.php.

oxInputValidator::checkPassword (   $oUser,
  $sNewPass,
  $sConfPass,
  $blCheckLength = false 
)

Checking if user password is fine. In case of error exception is thrown

Parameters
oxUser$oUseractive user
string$sNewPassnew user password
string$sConfPassretyped user password
bool$blCheckLengthoption to check password length
Returns
oxException|null

Definition at line 202 of file oxinputvalidator.php.

oxInputValidator::checkRequiredArrayFields (   $oUser,
  $sFieldName,
  $aFieldValues 
)

Checks if all values are filled up

Parameters
oxUser$oUseractive user
string$sFieldNamechecking field name
array$aFieldValuesfield values
Deprecated:
since v5.2 (2014-06-19); This logic was moved to oxRequiredFieldValidator and checkRequiredFields() method.

Definition at line 295 of file oxinputvalidator.php.

oxInputValidator::getFieldValidationErrors ( )

Returns error array if input validation for current field and rule reported an error

Returns
array

Definition at line 399 of file oxinputvalidator.php.

oxInputValidator::getFirstValidationError ( )

Returns first user input validation error

Returns
exception

Definition at line 409 of file oxinputvalidator.php.

oxInputValidator::setCompanyVatInValidator (   $oCompanyVatInValidator)

VATIN validator setter

Parameters
oxCompanyVatInValidator$oCompanyVatInValidator

Definition at line 638 of file oxinputvalidator.php.

oxInputValidator::validatePaymentInputData (   $sPaymentId,
$aDynValue 
)

Validates payment input data for credit card and debit note

Parameters
string$sPaymentIdthe payment id of current payment
array&$aDynValuevalues of payment
Returns
bool

Definition at line 428 of file oxinputvalidator.php.

Member Data Documentation

oxInputValidator::$_aInputValidationErrors = array()
protected

Definition at line 38 of file oxinputvalidator.php.

oxInputValidator::$_aPossibleCCType
protected
Initial value:
array('mcd',
'vis',
'amx',
'dsc',
'dnc',
'jcb',
'swi',
'dlt',
'enr'
)

Definition at line 48 of file oxinputvalidator.php.

oxInputValidator::$_aRequiredCCFields
protected
Initial value:
array('kktype',
'kknumber',
'kkmonth',
'kkyear',
'kkname',
'kkpruef'
)

Definition at line 25 of file oxinputvalidator.php.

oxInputValidator::$_aRequiredDCFields
protected
Initial value:
array('lsbankname',
'lsktonr',
'lsktoinhaber'
)

Definition at line 64 of file oxinputvalidator.php.

oxInputValidator::$_oCompanyVatInValidator = null
protected

Definition at line 41 of file oxinputvalidator.php.

const oxInputValidator::INVALID_ACCOUNT_NUMBER = -5

Invalid account number error code for template.

Definition at line 13 of file oxinputvalidator.php.

const oxInputValidator::INVALID_BANK_CODE = -4

Invalid bank number error code for template.

Definition at line 18 of file oxinputvalidator.php.


The documentation for this class was generated from the following file: