contenido\classes\abstract_classes\class.conuser.php
This class is a basic implementation of iConUser interface. It should be used as base class for specific user class.
- Author
- Holger Librenz
- Copyright
- four for business AG {@internal created 2008-11-16 }}
- Package
- Contenido Backend Classes
- Subpackages
- Backend User
- Version
- 1.4.0
\ConUser_Abstract
- Implements
- \iConUser
- Children
- \ConUser
- Author
- Holger Librenz
- Copyright
- four for business AG modified 2011-02-26, Ortwin Pinke, added unset for pw-request-marker, changed header svn-id and version declaration $Id:$
- Version
- 0.0.1
Constants

int
PASS_NOT_ENOUGH_NUMBERS
= 4
- Final
- Inherited_from
- \iConUser::PASS_NOT_ENOUGH_NUMBERS
- int

int
PASS_NOT_ENOUGH_SYMBOLS
= 5
- Final
- Inherited_from
- \iConUser::PASS_NOT_ENOUGH_SYMBOLS
- int

int
PASS_NOT_ENOUGH_MIXED_CHARS
= 6
- Final
- Inherited_from
- \iConUser::PASS_NOT_ENOUGH_MIXED_CHARS
- int

int
PASS_NOT_ENOUGH_DIFFERENT_CHARS
= 7
- Final
- Inherited_from
- \iConUser::PASS_NOT_ENOUGH_DIFFERENT_CHARS
- int

int
EXCEPTION_USERNAME_EXISTS
= 8
- Final
- Inherited_from
- \iConUser::EXCEPTION_USERNAME_EXISTS
- int

int
EXCEPTION_PASSWORD_INVALID
= 9
- Final
- Inherited_from
- \iConUser::EXCEPTION_PASSWORD_INVALID
- int

MIN_PASS_LENGTH_DEFAULT
= 8
- Inherited_from
- \iConUser::MIN_PASS_LENGTH_DEFAULT
Properties


\DB_Contenido $oDb = null
null
Details- Type
- \DB_Contenido


\unknown_type $sPassword = null
null
Details- Type
- \unknown_type
Methods


__construct( $aCfg, $oDb = null, $sUserId = null) : void
Constructor
Checks given values and initializes class.
Name | Type | Description |
---|---|---|
$aCfg | ||
$oDb | ||
$sUserId |
Exception | Description |
---|---|
\ConUserException |


checkPasswordMask(string $sNewPassword) : int
Checks given password $sNewPassword is complex enough.
Inherited from: \iConUser::checkPasswordMask()This method should check everything the user has to do to have a "valid" password. Such a check can be "User has to use symbols in password, but not as first sign."
Name | Type | Description |
---|---|---|
$sNewPassword | string |
Type | Description |
---|---|
int |


checkPasswordStrength(string $sNewPassword) : int
Checks given password $sNewPassword has a valid strength.
Inherited from: \iConUser::checkPasswordStrength()Name | Type | Description |
---|---|---|
$sNewPassword | string |
Type | Description |
---|---|
int |


encodePassword(string $sPassword) : string
You should use one-way encodings or hash-algorithms to ensure that nobody can read simply the passwords!
Name | Type | Description |
---|---|---|
$sPassword | string |
Type | Description |
---|---|
string |


generateUserId() : string
Generates new user id based on current user name.
Type | Description |
---|---|
string |


getErrorString(int $iErrorCode, array $aCfg) : string
Simple error messages, depending on error code $iErrorCode.
Inherited from: \iConUser::getErrorString()Name | Type | Description |
---|---|---|
$iErrorCode | int | |
$aCfg | array | Contenido configuration array |
Type | Description |
---|---|
string |


getPassword() : string
Returns (unencoded!) password.
This method should never be public available!
Type | Description |
---|---|
string |


save() : boolean
This method tries to save all information collected for an user.
Inherited from: \iConUser::save()If everything is fine, it returns true - otherwise false. On fatal errors a ConUserException will be thrown.
Type | Description |
---|---|
boolean |


savePassword(string $sNewPassword) : void
This method saves the given password $sNewPassword.
Inherited from: \iConUser::savePassword()The password has to be checked, before it is set to the database. The resulting integer value represents the result code. Use the PASS_* constants to check what happens.
Name | Type | Description |
---|---|---|
$sNewPassword | string |


setPassword(string $sPassword) : int
Checks password which has to be set and return PASS_* values (i.e.
on success PASS_OK).
Name | Type | Description |
---|---|---|
$sPassword | string |
Type | Description |
---|---|
int |


setUserId(\unknown_type $sUserId) : void
Sets user ID.
Name | Type | Description |
---|---|---|
$sUserId | \unknown_type | TODO check this |