contenido\classes\interfaces\interface.conuser.php

Show: PublicProtectedPrivateinherited
    Table of Contents
    Contenido Content Management System User Interface

    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

    Package: Contenido Backend Classes\Backend User
    Interface to describe main user functionallities.

    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

    >VConstantint  PASS_OK = 0
    Password is ok and stored.
    Final
     
    int

    >VConstantint  PASS_TO_SHORT = 1
    Given password is to short
    Final
     
    int

    >VConstantint  PASS_NOT_STRONG = 2
    Given password is not strong enough
    Final
     
    int

    >VConstantint  PASS_NOT_COMPLEX = 3
    Given password is not complex enough
    Final
     
    int

    >VConstantint  PASS_NOT_ENOUGH_NUMBERS = 4
    Password does not contain enough numbers.
    Final
     
    int

    >VConstantint  PASS_NOT_ENOUGH_SYMBOLS = 5
    Password does not contain enough symbols.
    Final
     
    int

    >VConstantint  PASS_NOT_ENOUGH_MIXED_CHARS = 6
    Password does not contain enough mixed characters.
    Final
     
    int

    >VConstantint  PASS_NOT_ENOUGH_DIFFERENT_CHARS = 7
    Password does not contain enough different characters.
    Final
     
    int

    >VConstantint  EXCEPTION_USERNAME_EXISTS = 8
    Exception code, which is used if you try to add an user that already exists.
    Final
     
    int

    >VConstantint  EXCEPTION_PASSWORD_INVALID = 9
    Exception code, which is used if an password is set to save that is not valid.
    Final
     
    int

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

    Methods

    methodpubliccheckPasswordMask(string $sNewPassword) : int

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

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

    Checks given password $sNewPassword has a valid strength.

    Parameters
    NameTypeDescription
    $sNewPasswordstring
    Returns
    TypeDescription
    int
    methodpublicencodePassword(string $sPassword) : string
    static

    Encodes the password $sPassword.

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

    Parameters
    NameTypeDescription
    $sPasswordstring
    Returns
    TypeDescription
    string
    methodpublicgetErrorString(int $iErrorCode, array $aCfg) : string
    static

    Simple error messages, depending on error code $iErrorCode.

    Parameters
    NameTypeDescription
    $iErrorCodeint
    $aCfgarray

    Contenido configuration array

    Returns
    TypeDescription
    string
    methodpublicload(string $sUserId) : void

    Loads data for user $sUserId.

    Parameters
    NameTypeDescription
    $sUserIdstring
    methodpublicsave() : boolean

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

    Returns
    TypeDescription
    boolean
    methodpublicsavePassword(string $sNewPassword) : void

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

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