Admidio API
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Packages

  • com
    • tecnick
      • tcpdf
  • None
  • PHPMailer
    • easypeasyics
  • PHPWavUtils
  • Securimage
    • classes

Classes

  • AutoLogin
  • Component
  • ComponentUpdate
  • ConditionParser
  • Database
  • DateTimeExtended
  • Email
  • Folder
  • FormValidation
  • FunctionClass
  • Htaccess
  • HtmlDiv
  • HtmlElement
  • HtmlForm
  • HtmlFormBasic
  • HtmlFormInstallation
  • HtmlList
  • HtmlNavbar
  • HtmlPage
  • HtmlTable
  • HtmlTableBasic
  • Image
  • Inventory
  • InventoryFields
  • Language
  • LanguageData
  • ListConfiguration
  • Menu
  • Message
  • ModuleAnnouncements
  • ModuleDates
  • ModuleLists
  • ModuleMenu
  • ModuleMessages
  • Modules
  • ModuleWeblinks
  • MyFiles
  • Navigation
  • ntlm_sasl_client_class
  • Organization
  • Participants
  • PasswordHash
  • PasswordHashing
  • ProfileFields
  • RoleDependency
  • RolesRights
  • RSSfeed
  • Session
  • SystemMail
  • TableAccess
  • TableAnnouncement
  • TableCategory
  • TableDate
  • TableFile
  • TableFolder
  • TableGuestbook
  • TableGuestbookComment
  • TableInventory
  • TableInventoryField
  • TableLists
  • TableMembers
  • TableMessage
  • TablePhotos
  • TableRoles
  • TableRooms
  • TableText
  • TableUserField
  • TableUsers
  • TableWeblink
  • UploadHandlerDownload
  • UploadHandlerPhoto
  • User
  • UserRegistration

Exceptions

  • AdmException
  • WavFileException
  • WavFormatException

Functions

  • admFuncAutoload
  • admFuncGeneratePagination
  • admFuncGetBytesFromSize
  • admFuncGetDirectoryEntries
  • admFuncMaxUploadSize
  • admFuncProcessableImageSize
  • admFuncShowCreateChangeInfoById
  • admFuncShowCreateChangeInfoByName
  • admFuncVariableIsValid
  • admReadTemplateFile
  • admStrIsValidFileName
  • admStrStripTagsSpecial
  • admStrToLower
  • admStrToUpper
  • bzip2Version
  • checkDatabaseVersion
  • checkPhpVersion
  • EmailAttachment
  • FileSizeNiceDisplay
  • FormattedTimeRemaining
  • FunctionIsDisabled
  • getFormerRolesFromDatabase
  • getFutureRolesFromDatabase
  • getmicrotime
  • getRoleMemberships
  • getRolesFromDatabase
  • gzipVersion
  • hasRole
  • hl_attrval
  • hl_bal
  • hl_cmtcd
  • hl_ent
  • hl_prot
  • hl_regex
  • hl_spec
  • hl_tag
  • hl_tag2
  • hl_tidy
  • hl_version
  • htmLawed
  • HTMLFilter
  • isGroupLeader
  • isMember
  • kses
  • kses_hook
  • MySQLdumpVersion
  • OutputInformation
  • SafeExec
  • showNotice
  • strAddSlashesDeep
  • strNextLetter
  • strStripSlashesDeep
  • strStripTags
  • strValidCharacters
  • tln_body2div
  • tln_casenormalize
  • tln_deent
  • tln_defang
  • tln_findnxreg
  • tln_findnxstr
  • tln_fixatts
  • tln_fixstyle
  • tln_fixurl
  • tln_getnxtag
  • tln_sanitize
  • tln_skipspace
  • tln_tagprint
  • tln_unspace
  • version_compare_replacement
  • version_compare_replacement_sub

Class Inventory

TableAccess
Extended by TableInventory
Extended by Inventory
Copyright: 2004-2016 The Admidio Team
License: GNU General Public License v2.0 only **********************************************************************************************
Class:

Inventory Diese Klasse dient dazu ein Userobjekt zu erstellen. Ein User kann ueber diese Klasse in der Datenbank verwaltet werden

Beside the methods of the parent class there are the following additional methods:

deleteUserFieldData() - delete all user data of profile fields; user record will not be deleted getListViewRights() - Liefert ein Array mit allen Rollen und der Berechtigung, ob der User die Liste einsehen darf - aehnlich getProperty, allerdings suche ueber usf_id viewProfile - Ueberprueft ob der User das Profil eines uebrgebenen Users einsehen darf


Located at inventory.php

Methods summary

public
# __construct( Database & $database, InventoryFields $inventoryFields, integer $itemId = 0 )

Constructor that will create an object of a recordset of the users table. If the id is set than this recordset will be loaded.

Constructor that will create an object of a recordset of the users table. If the id is set than this recordset will be loaded.

Parameters

$database
Object of the class database. This could be the default object @b $gDb.
$inventoryFields

An object of the ProfileFields class with the profile field structure of the current organization. This could be the default object @b $gProfileFields.

$itemId
The id of the user who should be loaded. If id isn't set than an empty object with no specific user is created.

Overrides

TableInventory::__construct
public
# clear( )

Additional to the parent method the user profile fields and all user rights and role memberships will be initialized

Additional to the parent method the user profile fields and all user rights and role memberships will be initialized

Overrides

TableInventory::clear
public boolean
# columnsValueChanged( )

Returns

boolean
returns true if a column of user table or profile fields has changed
public
# deleteUserFieldData( )

delete all user data of profile fields; user record will not be deleted

delete all user data of profile fields; user record will not be deleted

public integer
# getOrganization( )

Returns the id of the organization this user object has been assigned. This is in the default case the default organization of the config file.

Returns the id of the organization this user object has been assigned. This is in the default case the default organization of the config file.

Returns

integer
Returns the id of the organization this user object has been assigned
public mixed
# getValue( string $columnName, string $format = '' )

Get the value of a column of the database table if the column has the praefix @b usr_ otherwise the value of the profile field of the table adm_user_data will be returned. If the value was manipulated before with @b setValue than the manipulated value is returned.

Get the value of a column of the database table if the column has the praefix @b usr_ otherwise the value of the profile field of the table adm_user_data will be returned. If the value was manipulated before with @b setValue than the manipulated value is returned.

Parameters

$columnName
The name of the database column whose value should be read or the internal unique profile field name
$format

For date or timestamp columns the format should be the date/time format e.g. @b d.m.Y = '02.04.2011'. @n For text columns the format can be @b database that would return the original database value without any transformations

Returns

mixed

Returns the value of the database column or the value of adm_user_fields If the value was manipulated before with @b setValue than the manipulated value is returned.

Code

// reads data of adm_users column $loginname = $gCurrentUser->getValue('usr_login_name'); // reads data of adm_user_fields $email = $gCurrentUser->getValue('EMAIL'); @endcode


Par

Examples

Overrides

TableAccess::getValue
public
# noValueCheck( )

If this method is called than all further calls of method @b setValue will not check the values. The values will be stored in database without any inspections !

If this method is called than all further calls of method @b setValue will not check the values. The values will be stored in database without any inspections !

public boolean
# readDataById( integer $itemId )

Reads a user record out of the table adm_users in database selected by the unique user id. Also all profile fields of the object @b mProfileFieldsData will be read.

Reads a user record out of the table adm_users in database selected by the unique user id. Also all profile fields of the object @b mProfileFieldsData will be read.

Parameters

$itemId
Unique id of the user that should be read

Returns

boolean
Returns @b true if one record is found

Overrides

TableAccess::readDataById
public boolean
# save( boolean $updateFingerPrint = true )

Save all changed columns of the recordset in table of database. Therefore the class remembers if it's a new record or if only an update is necessary. The update statement will only update the changed columns. If the table has columns for creator or editor than these column with their timestamp will be updated. First save recordset and then save all user fields. After that the session of this got a renew for the user object. If the user doesn't have the right to save data of this user than an exception will be thrown.

Save all changed columns of the recordset in table of database. Therefore the class remembers if it's a new record or if only an update is necessary. The update statement will only update the changed columns. If the table has columns for creator or editor than these column with their timestamp will be updated. First save recordset and then save all user fields. After that the session of this got a renew for the user object. If the user doesn't have the right to save data of this user than an exception will be thrown.

Parameters

$updateFingerPrint

Default @b true. Will update the creator or editor of the recordset if table has columns like @b usr_id_create or @b usr_id_changed

Returns

boolean
If an update or insert into the database was done then return true, otherwise false.

Throws

AdmException

Overrides

TableAccess::save
public
# setOrganization( integer $organizationId )

Set the id of the organization which should be used in this user object. The organization is used to read the rights of the user. If @b setOrganization isn't called than the default organization @b gCurrentOrganization is set for the current user object.

Set the id of the organization which should be used in this user object. The organization is used to read the rights of the user. If @b setOrganization isn't called than the default organization @b gCurrentOrganization is set for the current user object.

Parameters

$organizationId
Id of the organization
public boolean
# setValue( string $columnName, mixed $newValue )

Set a new value for a column of the database table if the column has the praefix @b usr_ otherwise the value of the profile field of the table adm_user_data will set. If the user log is activated than the change of the value will be logged in @b adm_user_log. The value is only saved in the object. You must call the method @b save to store the new value to the database

Set a new value for a column of the database table if the column has the praefix @b usr_ otherwise the value of the profile field of the table adm_user_data will set. If the user log is activated than the change of the value will be logged in @b adm_user_log. The value is only saved in the object. You must call the method @b save to store the new value to the database

Parameters

$columnName
The name of the database column whose value should get a new value or the internal unique profile field name
$newValue
The new value that should be stored in the database field

Returns

boolean
Returns @b true if the value is stored in the current object and @b false if a check failed

Code

// set data of adm_users column $gCurrentUser->getValue('usr_login_name', 'Admidio'); // reads data of adm_user_fields $gCurrentUser->getValue('EMAIL', 'webmaster@admidio.org');


Endcode

Par

Examples

Overrides

TableAccess::setValue
public boolean
# hasRightViewItem( $item )

Checks if the current user is allowed to view the profile of the user of the parameter. If will check if user has edit rights with method editProfile or if the user is a member of a role where the current user has the right to view profiles.

Checks if the current user is allowed to view the profile of the user of the parameter. If will check if user has edit rights with method editProfile or if the user is a member of a role where the current user has the right to view profiles.

Parameters

$item
object of the user that should be checked if the current user can view his profile.

Returns

boolean
Return @b true if the current user is allowed to view the profile of the user from @b $user.

Methods inherited from TableInventory

delete()

Methods inherited from TableAccess

__sleep(), connectAdditionalTable(), countAllRecords(), hasColumnsValueChanged(), isNewRecord(), readData(), readDataByColumns(), setArray(), setDatabase()

Properties summary

public $mInventoryFieldsData
#
public array $mProfileFieldsData
# array()
protected array $list_view_rights
# array()
protected $organizationId
#

Properties inherited from TableAccess

$additionalTables, $columnPrefix, $columnsInfos, $columnsValueChanged, $db, $dbColumns, $keyColumnName, $new_record, $tableName

Admidio API API documentation generated by ApiGen