contenido\classes\interfaces\interface.conuser.php
This interface describes the main methods an user class has to implement.
- Author
- Holger Librenz
- Copyright
- four for business AG {@internal created 2008-11-16, H. Librenz modified 2008-12-04, Timo Trautman, Added Contenido $cfg as param for getErrorString() $Id$ }}
- Package
- Contenido Backend Classes
- Subpackage
- Backend User
- Version
- $Revision$
\iConUser
This interface describes the main methods an user calss has to implement. It will be implemented in an abstract class, which will implement main features and should be used if you start implementing your own user class.
- Author
- Holger Librenz
- Copyright
- four for business AG
- Version
- 0.0.1
Constants
int
PASS_NOT_ENOUGH_DIFFERENT_CHARS
= 7- Final
- int
int
EXCEPTION_USERNAME_EXISTS
= 8- Final
- int
int
EXCEPTION_PASSWORD_INVALID
= 9- Final
- int
Methods

checkPasswordMask(string $sNewPassword) : intChecks given password $sNewPassword is complex enough.
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.
| Name | Type | Description |
|---|---|---|
| $sNewPassword | string |
| Type | Description |
|---|---|
| int |

encodePassword(string $sPassword) : stringEncodes the password $sPassword.
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 |

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

load(string $sUserId) : voidLoads data for user $sUserId.
| Name | Type | Description |
|---|---|---|
| $sUserId | string |

save() : booleanThis method tries to save all information collected for an user.
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.
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 |