contenido\classes\abstract_classes\class.conuser.php

Show: PublicProtectedPrivateinherited
Table of Contents
Abstract implementation of iConUser interface.

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

Package: Contenido Backend Classes\Backend User
This abstract class implements interface iConUser and should be user as base class for backend user classes.
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

>VConstantint  PASS_OK = 0
inherited
Password is ok and stored.
Inherited from: \iConUser::PASS_OK
Final
 
Inherited_from
\iConUser::PASS_OK  
int

>VConstantint  PASS_TO_SHORT = 1
inherited
Given password is to short
Inherited from: \iConUser::PASS_TO_SHORT
Final
 
Inherited_from
\iConUser::PASS_TO_SHORT  
int

>VConstantint  PASS_NOT_STRONG = 2
inherited
Given password is not strong enough
Inherited from: \iConUser::PASS_NOT_STRONG
Final
 
Inherited_from
\iConUser::PASS_NOT_STRONG  
int

>VConstantint  PASS_NOT_COMPLEX = 3
inherited
Given password is not complex enough
Inherited from: \iConUser::PASS_NOT_COMPLEX
Final
 
Inherited_from
\iConUser::PASS_NOT_COMPLEX  
int

>VConstantint  PASS_NOT_ENOUGH_NUMBERS = 4
inherited
Password does not contain enough numbers.
Inherited from: \iConUser::PASS_NOT_ENOUGH_NUMBERS
Final
 
Inherited_from
\iConUser::PASS_NOT_ENOUGH_NUMBERS  
int

>VConstantint  PASS_NOT_ENOUGH_SYMBOLS = 5
inherited
Password does not contain enough symbols.
Inherited from: \iConUser::PASS_NOT_ENOUGH_SYMBOLS
Final
 
Inherited_from
\iConUser::PASS_NOT_ENOUGH_SYMBOLS  
int

>VConstantint  PASS_NOT_ENOUGH_MIXED_CHARS = 6
inherited
Password does not contain enough mixed characters.
Inherited from: \iConUser::PASS_NOT_ENOUGH_MIXED_CHARS
Final
 
Inherited_from
\iConUser::PASS_NOT_ENOUGH_MIXED_CHARS  
int

>VConstantint  PASS_NOT_ENOUGH_DIFFERENT_CHARS = 7
inherited
Password does not contain enough different characters.
Inherited from: \iConUser::PASS_NOT_ENOUGH_DIFFERENT_CHARS
Final
 
Inherited_from
\iConUser::PASS_NOT_ENOUGH_DIFFERENT_CHARS  
int

>VConstantint  EXCEPTION_USERNAME_EXISTS = 8
inherited
Exception code, which is used if you try to add an user that already exists.
Inherited from: \iConUser::EXCEPTION_USERNAME_EXISTS
Final
 
Inherited_from
\iConUser::EXCEPTION_USERNAME_EXISTS  
int

>VConstantint  EXCEPTION_PASSWORD_INVALID = 9
inherited
Exception code, which is used if an password is set to save that is not valid.
Inherited from: \iConUser::EXCEPTION_PASSWORD_INVALID
Final
 
Inherited_from
\iConUser::EXCEPTION_PASSWORD_INVALID  
int

>VConstant  MIN_PASS_LENGTH_DEFAULT = 8
inherited
This value will be used if no minimum length for passwords are set via $cfg['password']['min_length']
Inherited from: \iConUser::MIN_PASS_LENGTH_DEFAULT

Properties

>VPropertyprotectedarray $aCfg = null
Contenido configuration array
Default valuenullDetails
Type
array
>VPropertyprotected\DB_Contenido $oDb = null
Referemces database abstraction instance
Default valuenullDetails
Type
\DB_Contenido
>VPropertyprivate\unknown_type $sPassword = null
Holds the password which should be set.
Default valuenullDetails
Type
\unknown_type
>VPropertyprivatestring $sUserId = null
current User ID
Default valuenullDetails
Type
string
>VPropertyprivatestring $sUserName = null
Login name of current user.
Default valuenullDetails
Type
string

Methods

methodpublic__construct( $aCfg,  $oDb = null,  $sUserId = null) : void

Constructor

Checks given values and initializes class.

Parameters
NameTypeDescription
$aCfg
$oDb
$sUserId
Throws
ExceptionDescription
\ConUserException
methodpubliccheckPasswordMask(string $sNewPassword) : int
inherited

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

Parameters
NameTypeDescription
$sNewPasswordstring
Returns
TypeDescription
int
methodpubliccheckPasswordStrength(string $sNewPassword) : int
inherited

Checks given password $sNewPassword has a valid strength.

Inherited from: \iConUser::checkPasswordStrength()
Parameters
NameTypeDescription
$sNewPasswordstring
Returns
TypeDescription
int
methodpublicencodePassword(string $sPassword) : string
staticinherited

Encodes the password $sPassword.

Inherited from: \iConUser::encodePassword()

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

Parameters
NameTypeDescription
$sPasswordstring
Returns
TypeDescription
string
methodpublicgenerateUserId() : string

Generates new user id based on current user name.

Returns
TypeDescription
string
methodpublicgetErrorString(int $iErrorCode, array $aCfg) : string
staticinherited

Simple error messages, depending on error code $iErrorCode.

Inherited from: \iConUser::getErrorString()
Parameters
NameTypeDescription
$iErrorCodeint
$aCfgarray

Contenido configuration array

Returns
TypeDescription
string
methodprotectedgetPassword() : string

Returns (unencoded!) password.

This method should never be public available!

Returns
TypeDescription
string
methodpublicgetUserId() : string

Returns user id, currently set.

Returns
TypeDescription
string
methodpublicgetUserName() : string

Returns user name, currently set

Returns
TypeDescription
string
methodpublicload(string $sUserId) : void
inherited

Loads data for user $sUserId.

Inherited from: \iConUser::load()
Parameters
NameTypeDescription
$sUserIdstring
methodpublicsave() : boolean
inherited

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.

Returns
TypeDescription
boolean
methodpublicsavePassword(string $sNewPassword) : void
inherited

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.

Parameters
NameTypeDescription
$sNewPasswordstring
methodpublicsetPassword(string $sPassword) : int

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

on success PASS_OK).

Parameters
NameTypeDescription
$sPasswordstring
Returns
TypeDescription
int
methodpublicsetUserId(\unknown_type $sUserId) : void

Sets user ID.

Parameters
NameTypeDescription
$sUserId\unknown_type

TODO check this

methodpublicsetUserName(string $sUserName) : void

Sets up new user name.

Parameters
NameTypeDescription
$sUserNamestring
Documentation was generated by phpDocumentor 2.0.0a12.