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 = nullnullDetails- Type
- \DB_Contenido

\unknown_type $sPassword = nullnullDetails- Type
- \unknown_type
Methods

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

checkPasswordMask(string $sNewPassword) : intChecks 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) : intChecks given password $sNewPassword has a valid strength.
Inherited from: \iConUser::checkPasswordStrength()| Name | Type | Description |
|---|---|---|
| $sNewPassword | string |
| Type | Description |
|---|---|
| int |

encodePassword(string $sPassword) : stringYou 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() : stringGenerates new user id based on current user name.
| Type | Description |
|---|---|
| string |

getErrorString(int $iErrorCode, array $aCfg) : stringSimple 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() : stringReturns (unencoded!) password.
This method should never be public available!
| Type | Description |
|---|---|
| string |

save() : booleanThis 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) : voidThis 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) : intChecks 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) : voidSets user ID.
| Name | Type | Description |
|---|---|---|
| $sUserId | \unknown_type | TODO check this |