This abstract class implements interface iConUser and should be user as base class for backend user classes.

package Contenido Backend Classes
subpackage Backend User
version 0.0.1
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:$

 Methods

Constructor

__construct($aCfg, $oDb, $sUserId) 

Checks given values and initializes class.

Parameters

$aCfg

$oDb

$sUserId

Exceptions

\ConUserException

Checks given password $sNewPassword is complex enough.

checkPasswordMask(string $sNewPassword) : int
Inherited

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."

inherited_from \iConUser::checkPasswordMask()

Parameters

$sNewPassword

string

Returns

int

Checks given password $sNewPassword has a valid strength.

checkPasswordStrength(string $sNewPassword) : int
Inherited
inherited_from \iConUser::checkPasswordStrength()

Parameters

$sNewPassword

string

Returns

int

Encodes the password $sPassword.

encodePassword(string $sPassword) : string
InheritedStatic

You should use one-way encodings or hash-algorithms to ensure that nobody can read simply the passwords!

inherited_from \iConUser::encodePassword()

Parameters

$sPassword

string

Returns

string

Generates new user id based on current user name.

generateUserId() : string

Returns

string

Simple error messages, depending on error code $iErrorCode.

getErrorString(int $iErrorCode, array $aCfg) : string
InheritedStatic
inherited_from \iConUser::getErrorString()

Parameters

$iErrorCode

int

$aCfg

array

Contenido configuration array

Returns

string

Returns user id, currently set.

getUserId() : string

Returns

string

Returns user name, currently set

getUserName() : string

Returns

string

Loads data for user $sUserId.

load(string $sUserId) 
Inherited
inherited_from \iConUser::load()

Parameters

$sUserId

string

This method tries to save all information collected for an user.

save() : boolean
Inherited

If everything is fine, it returns true - otherwise false. On fatal errors a ConUserException will be thrown.

inherited_from \iConUser::save()

Returns

boolean

This method saves the given password $sNewPassword.

savePassword(string $sNewPassword) 
Inherited

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.

inherited_from \iConUser::savePassword()

Parameters

$sNewPassword

string

Checks password which has to be set and return PASS_* values (i.e.

setPassword(string $sPassword) : int

on success PASS_OK).

Parameters

$sPassword

string

Returns

int

Sets user ID.

setUserId(\unknown_type $sUserId) 

Parameters

$sUserId

\unknown_type

TODO check this

Sets up new user name.

setUserName(string $sUserName) 

Parameters

$sUserName

string

Returns (unencoded!) password.

getPassword() : string

This method should never be public available!

Returns

string

 Properties

 

$aCfg : array
 

$oDb : \DB_Contenido
 

$sPassword : \unknown_type
 

$sUserId : string
 

$sUserName : string

 Constants

 

Exception code, which is used if an password is set to save that is not valid.

EXCEPTION_PASSWORD_INVALID : int
Inherited
final
inherited_from \iConUser::EXCEPTION_PASSWORD_INVALID
 

Exception code, which is used if you try to add an user that already exists.

EXCEPTION_USERNAME_EXISTS : int
Inherited
final
inherited_from \iConUser::EXCEPTION_USERNAME_EXISTS
 

This value will be used if no minimum length for passwords are set via $cfg['password']['min_length']

MIN_PASS_LENGTH_DEFAULT 
Inherited
inherited_from \iConUser::MIN_PASS_LENGTH_DEFAULT
 

Given password is not complex enough

PASS_NOT_COMPLEX : int
Inherited
final
inherited_from \iConUser::PASS_NOT_COMPLEX
 

Password does not contain enough different characters.

PASS_NOT_ENOUGH_DIFFERENT_CHARS : int
Inherited
final
inherited_from \iConUser::PASS_NOT_ENOUGH_DIFFERENT_CHARS
 

Password does not contain enough mixed characters.

PASS_NOT_ENOUGH_MIXED_CHARS : int
Inherited
final
inherited_from \iConUser::PASS_NOT_ENOUGH_MIXED_CHARS
 

Password does not contain enough numbers.

PASS_NOT_ENOUGH_NUMBERS : int
Inherited
final
inherited_from \iConUser::PASS_NOT_ENOUGH_NUMBERS
 

Password does not contain enough symbols.

PASS_NOT_ENOUGH_SYMBOLS : int
Inherited
final
inherited_from \iConUser::PASS_NOT_ENOUGH_SYMBOLS
 

Given password is not strong enough

PASS_NOT_STRONG : int
Inherited
final
inherited_from \iConUser::PASS_NOT_STRONG
 

Password is ok and stored.

PASS_OK : int
Inherited
final
inherited_from \iConUser::PASS_OK
 

Given password is to short

PASS_TO_SHORT : int
Inherited
final
inherited_from \iConUser::PASS_TO_SHORT