Overview

Packages

  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Datatype
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Classes

  • cApiAction
  • cApiActionCollection
  • cApiActionlog
  • cApiActionlogCollection
  • cApiArea
  • cApiAreaCollection
  • cApiArticle
  • cApiArticleCollection
  • cApiArticleLanguage
  • cApiArticleLanguageCollection
  • cApiArticleSpecification
  • cApiArticleSpecificationCollection
  • cApiCategory
  • cApiCategoryArticle
  • cApiCategoryArticleCollection
  • cApiCategoryCollection
  • cApiCategoryLanguage
  • cApiCategoryLanguageCollection
  • cApiCategoryTree
  • cApiCategoryTreeCollection
  • cApiClient
  • cApiClientCollection
  • cApiClientLanguage
  • cApiClientLanguageCollection
  • cApiCommunication
  • cApiCommunicationCollection
  • cApiContainer
  • cApiContainerCollection
  • cApiContainerConfiguration
  • cApiContainerConfigurationCollection
  • cApiContent
  • cApiContentCollection
  • cApiDbfs
  • cApiDbfsCollection
  • cApiFile
  • cApiFileCollection
  • cApiFileInformation
  • cApiFileInformationCollection
  • cApiFrameFile
  • cApiFrameFileCollection
  • cApiFrontendGroup
  • cApiFrontendGroupCollection
  • cApiFrontendGroupMember
  • cApiFrontendGroupMemberCollection
  • cApiFrontendPermission
  • cApiFrontendPermissionCollection
  • cApiFrontendUser
  • cApiFrontendUserCollection
  • cApiGroup
  • cApiGroupCollection
  • cApiGroupMember
  • cApiGroupMemberCollection
  • cApiGroupProperty
  • cApiGroupPropertyCollection
  • cApiInUse
  • cApiInUseCollection
  • cApiIso3166
  • cApiIso3166Collection
  • cApiIso6392
  • cApiIso6392Collection
  • cApiKeyword
  • cApiKeywordCollection
  • cApiLanguage
  • cApiLanguageCollection
  • cApiLayout
  • cApiLayoutCollection
  • cApiMailLog
  • cApiMailLogCollection
  • cApiMailLogSuccess
  • cApiMailLogSuccessCollection
  • cApiMetaTag
  • cApiMetaTagCollection
  • cApiMetaType
  • cApiMetaTypeCollection
  • cApiModule
  • cApiModuleCollection
  • cApiNavMain
  • cApiNavMainCollection
  • cApiNavSub
  • cApiNavSubCollection
  • cApiOnlineUser
  • cApiOnlineUserCollection
  • cApiPathresolveCache
  • cApiPathresolveCacheCollection
  • cApiProperty
  • cApiPropertyCollection
  • cApiRight
  • cApiRightCollection
  • cApiSearchTracking
  • cApiSearchTrackingCollection
  • cApiStat
  • cApiStatCollection
  • cApiSystemProperty
  • cApiSystemPropertyCollection
  • cApiTemplate
  • cApiTemplateCollection
  • cApiTemplateConfiguration
  • cApiTemplateConfigurationCollection
  • cApiType
  • cApiTypeCollection
  • cApiUpload
  • cApiUploadCollection
  • cApiUploadMeta
  • cApiUploadMetaCollection
  • cApiUser
  • cApiUserCollection
  • cApiUserProperty
  • cApiUserPropertyCollection
  • NoteCollection
  • NoteItem
  • TODOCollection
  • TODOItem
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class cApiUser

User item

In current version you can administer optional password checks via following configuration values:

  • En- or disabling checks:

$cfg['password']['check_password_mask'] = [true|false] Use this flag to enable (true) or disable (false) the mask checks.

$cfg['password']['use_cracklib'] = [true|false] Use this to enable (true) or disable (false) the strength check, currently done with cracklib.

  • Mask checks:

Password mask checks are checks belonging to the "format" of the needed password string.

$cfg['password']['min_length'], int Minimum length a password has to have. If not set, 8 chars are set as default $cfg['password']['numbers_mandatory'], int If set to a value greater than 0, at least $cfg['password']['numbers_mandatory'] numbers must be in password $cfg['password']['symbols_mandatory'], int && $cfg['password']['symbols_regex'], String If 'symbols_mandatory' set to a value greater than 0, at least so many symbols has to appear in given password. What symbols are regcognized can be administrated via 'symbols_regex'. This has to be a regular expression which is used to "find" the symbols in $password. If not set, following RegEx is used: "/[|!@#$%&*\/=?,;.:\-_+~^ยจ\\\]/" $cfg['password']['mixed_case_mandatory'], int If set to a value greater than 0 so many lower and upper case character must appear in the password. (e.g.: if set to 2, 2 upper and 2 lower case characters must appear)

  • Strength check

Passwords should have some special characteristics to be a strong, i.e. not easy to guess, password. Currently cracklib is supported. These are the configuration possibilities:

$cfg['password']['cracklib_dict'], string Path and file name (without file extension!) to dictionary you want to use. This setting is mandatory!

Keep in mind that these type of check only works if crack module is available.

cGenericDb
Extended by cItemBaseAbstract
Extended by Item
Extended by cApiUser
Package: Core\GenericDB\Model
Copyright: four for business AG <www.4fb.de>
License: http://www.contenido.org/license/LIZENZ.txt
Author: Bjoern Behrens
Author: Holger Librenz
Located at classes/contenido/class.user.php
Methods summary
public
# __construct( mixed $mId = false )

Constructor function

Constructor function

Parameters

$mId
mixed
$mId Specifies the ID of item to load

Throws

cInvalidArgumentException
If table name or primary key is not set

Overrides

Item::__construct()
public boolean
# loadUserByUserID( string $userId )

Loads a user from the database by its userID.

Loads a user from the database by its userID.

Parameters

$userId
string
$userId Specifies the userID

Returns

boolean
True if the load was successful
public boolean
# loadUserByUsername( string $userName )

Loads a user entry by username.

Loads a user entry by username.

Parameters

$userName
string
$userName Specifies the username

Returns

boolean
True if the load was successful
public static boolean
# userExists( string $userId )

Checks if a user with the id $userId exists

Checks if a user with the id $userId exists

Parameters

$userId
string
$userId

Returns

boolean
user exists or not
public static boolean
# usernameExists( string $username )

Checks if a username exists

Checks if a username exists

Parameters

$username
string
$username the name

Returns

boolean
username exists or not
public static integer
# checkPasswordMask( string $password )

Checks a given password against some predefined rules like minimum character length, required special character, etc... This behaviour is configurable in global configuration $cfg['password'].

Checks a given password against some predefined rules like minimum character length, required special character, etc... This behaviour is configurable in global configuration $cfg['password'].

Parameters

$password
string
$password The password check

Returns

integer
One of defined PASS_* constants (PASS_OK if everything was ok)
public string
# encodePassword( string $password )

Encodes a passed password (uses md5 to generate a hash of it).

Encodes a passed password (uses md5 to generate a hash of it).

Parameters

$password
string
$password The password to encode

Returns

string
Encoded password
public boolean
# setField( string $sField, string $mValue, boolean $bSafe = true )

User defined field value setter.

User defined field value setter.

Parameters

$sField
string
$sField Field name
$mValue
string
$mValue Value to set
$bSafe
boolean
$bSafe Flag to run defined inFilter on passed value

Returns

boolean

See

Item::setField()

Overrides

Item::setField()
public string
# getUserId( )

Returns user id, currently set.

Returns user id, currently set.

Returns

string
public
# setUserId( string $uid )

User id settter. NOTE: Setting the user id by this method will load the user model.

User id settter. NOTE: Setting the user id by this method will load the user model.

Parameters

$uid
string
$uid
public integer
# setPassword( string $password )

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

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

Parameters

$password
string
$password

Returns

integer
public integer
# savePassword( string $password )

This method saves the given password $password. 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.

This method saves the given password $password. 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

$password
string
$password

Returns

integer
bool PASS_* or false if saving fails
public string
# getUserName( )

Returns user name, currently set

Returns user name, currently set

Returns

string
public
# setUserName( string $sUserName )

Sets up new user name.

Sets up new user name.

Parameters

$sUserName
string
$sUserName
public string
# getRealName( )

Getter method to get user realname

Getter method to get user realname

Returns

string
Realname of user
public string
# getEffectiveName( )

Returns effective user name (if exists realname , otherwhise username)

Returns effective user name (if exists realname , otherwhise username)

Returns

string
Realname or username of user
public string
# getMail( )

Getter method to get user mail

Getter method to get user mail

Returns

string
public string
# getTelNumber( )

Getter method to get user tel number

Getter method to get user tel number

Returns

string
public array
# getAddressData( )

Getter method to get user adress data

Getter method to get user adress data

Returns

array
Address data array like: <pre> $aAddress['street'], $aAddress['city'], $aAddress['country'], $aAddress['zip'] </pre>
public integer
# getUseWysi( )

Getter method to get user wysi

Getter method to get user wysi

Returns

integer
public string
# getValidDateTo( )

Getter method to get user valid date from-to

Getter method to get user valid date from-to

Returns

string
public string
# getValidDateFrom( )

Getter method to get user valid date from-to

Getter method to get user valid date from-to

Returns

string
public string
# getPerms( )

Getter method to get user perm name

Getter method to get user perm name

Returns

string
public array
# getPermsArray( )

Returns list of user permissions.

Returns list of user permissions.

Returns

array
public
# setRealName( string $sRealName )

Setter method to set user real name

Setter method to set user real name

Parameters

$sRealName
string
$sRealName
public
# setMail( string $sMail )

Setter method to set user mail address

Setter method to set user mail address

Parameters

$sMail
string
$sMail
public
# setTelNumber( string $sTelNumber )

Setter method to set user tel number

Setter method to set user tel number

Parameters

$sTelNumber
string
$sTelNumber
public
# setAddressData( string $sStreet, string $sCity, string $sZip, string $sCountry )

Setter method to set address data

Setter method to set address data

Parameters

$sStreet
string
$sStreet
$sCity
string
$sCity
$sZip
string
$sZip
$sCountry
string
$sCountry
public
# setStreet( string $sStreet )

Sets value for street.

Sets value for street.

Parameters

$sStreet
string
$sStreet
public
# setCity( string $sCity )

Sets value for city.

Sets value for city.

Parameters

$sCity
string
$sCity
public
# setZip( string $sZip )

Sets value for ZIP.

Sets value for ZIP.

Parameters

$sZip
string
$sZip
public
# setCountry( string $sCountry )

Sets value for country.

Sets value for country.

Parameters

$sCountry
string
$sCountry
public
# setUseWysi( integer $iUseWysi )

Setter method to set wysi

Setter method to set wysi

Parameters

$iUseWysi
integer
$iUseWysi
public
# setValidDateTo( string $sValidateTo )

Setter method to set valid_to

Setter method to set valid_to

Parameters

$sValidateTo
string
$sValidateTo TODO add type check
public
# setValidDateFrom( string $sValidateFrom )

Setter method to set valid_from

Setter method to set valid_from

Parameters

$sValidateFrom
string
$sValidateFrom TODO add type checks
public
# setPerms( array|string $perms )

Setter method to set perms

Setter method to set perms

Parameters

$perms
array|string
$perms
public string
# getEffectiveUserPerms( )

Function returns effective perms for user including group rights as perm string.

Function returns effective perms for user including group rights as perm string.

Returns

string
Current users permissions

Author

Timo Trautmann
public array
# getGroupNamesByUserID( string $userid = NULL, boolean $bAddDescription = true )

Returns group names where the user is in.

Returns group names where the user is in.

Parameters

$userid
string
$userid Optional user id, uses id of loaded user by default.
$bAddDescription
boolean
$bAddDescription Flag to add description like "groupname (description)"

Returns

array
public array
# getGroupIDsByUserID( string $userid )

Returns group ids where the user is in.

Returns group ids where the user is in.

Parameters

$userid
string
$userid Optional user id, uses id of loaded user by default.

Returns

array
public string
# getUserProperty( string $type, string $name, boolean $group = false )

Retrieves the effective user property.

Retrieves the effective user property.

Parameters

$type
string
$type Type (class, category etc) for the property to retrieve
$name
string
$name Name of the property to retrieve
$group
boolean
$group Flag to search in groups

Returns

string
bool value of the retrieved property or false
public array
# getUserPropertiesByType( string $type, boolean $group = false )

Returns all user properties by type.

Returns all user properties by type.

Parameters

$type
string
$type Type (class, category etc) of the properties to retrieve
$group
boolean
$group Flag to retrieve in group properties. If enabled, group properties will be merged with user properties where the user poperties will overwrite group properties

Returns

array
Assoziative properties array as follows: - $arr[name] = value

Todo

return value should be similar to getUserProperties()
public array
# getUserProperties( )

Retrieves all available properties of the user.

Retrieves all available properties of the user.

Returns

array
bool a array or false in downwards compatible mode, otherwhise a array. Return value in new mode is: - $arr[iduserprop][name] - $arr[iduserprop][type] - $arr[iduserprop][value] Return value in downwards compatible mode is: - $arr[pos][name] - $arr[pos][type]
public
# setUserProperty( string $type, string $name, string $value )

Stores a property to the database

Stores a property to the database

Parameters

$type
string
$type Type (class, category etc) for the property to retrieve
$name
string
$name Name of the property to retrieve
$value
string
$value Value to insert
public boolean
# deleteUserProperty( string $type, string $name )

Deletes a user property from the table.

Deletes a user property from the table.

Parameters

$type
string
$type Type (class, category etc) of property to retrieve
$name
string
$name Name of property to retrieve

Returns

boolean
public static string
# getErrorString( integer $iErrorCode )

This static method provides a simple way to get error messages depending on error code $iErrorCode, which is returned by checkPassword* methods.

This static method provides a simple way to get error messages depending on error code $iErrorCode, which is returned by checkPassword* methods.

Parameters

$iErrorCode
integer
$iErrorCode

Returns

string
Methods inherited from Item
_inFilter(), _loadByWhereClause(), _onLoad(), _outFilter(), _setMetaObject(), deleteProperty(), deletePropertyById(), get(), getField(), getMetaObject(), getProperty(), isLoaded(), loadBy(), loadByMany(), loadByPrimaryKey(), loadByRecordSet(), set(), setFilters(), setProperty(), store(), toArray(), toObject()
Methods inherited from cItemBaseAbstract
_getPropertiesCollectionInstance(), _getSecondDBInstance(), escape()
Methods inherited from cGenericDb
_executeCallbacks(), register(), unregister()
Constants summary
integer PASS_OK 0
#

Password is ok and stored.

Password is ok and stored.

integer PASS_TO_SHORT 1
#

Given password is to short

Given password is to short

integer PASS_NOT_STRONG 2
#

Given password is not strong enough

Given password is not strong enough

integer PASS_NOT_COMPLEX 3
#

Given password is not complex enough

Given password is not complex enough

integer PASS_NOT_ENOUGH_NUMBERS 4
#

Password does not contain enough numbers.

Password does not contain enough numbers.

integer PASS_NOT_ENOUGH_SYMBOLS 5
#

Password does not contain enough symbols.

Password does not contain enough symbols.

integer PASS_NOT_ENOUGH_MIXED_CHARS 6
#

Password does not contain enough mixed characters.

Password does not contain enough mixed characters.

integer PASS_NOT_ENOUGH_DIFFERENT_CHARS 7
#

Password does not contain enough different characters.

Password does not contain enough different characters.

integer EXCEPTION_USERNAME_EXISTS 8
#

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

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

integer EXCEPTION_PASSWORD_INVALID 9
#

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

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

integer MIN_PASS_LENGTH_DEFAULT 8
#

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

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

Constants inherited from cGenericDb
CREATE_BEFORE, CREATE_FAILURE, CREATE_SUCCESS, DELETE_BEFORE, DELETE_FAILURE, DELETE_SUCCESS, STORE_BEFORE, STORE_FAILURE, STORE_SUCCESS
Properties inherited from Item
$_arrInFilters, $_arrOutFilters, $_lastSQL, $_metaObject, $modifiedValues, $oldPrimaryKey, $values
Properties inherited from cItemBaseAbstract
$_className, $_oCache, $_settings, $db, $lasterror, $primaryKey, $properties, $secondDb, $table, $virgin
CMS CONTENIDO 4.9.5 API documentation generated by ApiGen 2.8.0