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 TableMembers

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

Handle memberships of roles and manage it in the database table adm_members

The class search in the database table @b adm_members for role memberships of users. It has easy methods to start or stop a membership.


Class: TableMembers
Code:

// start membership without read data before $membership = new TableMembers($gDb); $membership->startMembership($roleId, $userId);

// read membership data and then stop membership $membership = new TableMembers($gDb); $membership->readDataByColumns(array('mem_rol_id' => $roleId, 'mem_usr_id' => $userId)); $membership->stopMembership(); @endcode


Par: Examples
Located at tablemembers.php

Methods summary

public
# __construct( Database & $database, integer $mem_id = 0 )

Constructor that will create an object of a recordset of the table adm_members. If the id is set than the specific membership will be loaded.

Constructor that will create an object of a recordset of the table adm_members. If the id is set than the specific membership will be loaded.

Parameters

$database
Object of the class Database. This should be the default global object @b $gDb.
$mem_id
The recordset of the membership with this id will be loaded. If id isn't set than an empty object of the table is created.

Overrides

TableAccess::__construct
public boolean
# deleteMembership( integer $roleId = 0, integer $userId = 0 )

Deletes a membership for the assigned role and user. In opposite to removeMembership this method will delete the entry and you can't see any history assignment. If the user is the current user then initiate a refresh of his role cache.

Deletes a membership for the assigned role and user. In opposite to removeMembership this method will delete the entry and you can't see any history assignment. If the user is the current user then initiate a refresh of his role cache.

Parameters

$roleId
Stops the membership of this role
$userId
The user who should loose the member of the role.

Returns

boolean
Return @b true if the membership was successful deleted.
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.

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.

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.

Overrides

TableAccess::save
public boolean
# startMembership( integer $roleId = 0, integer $userId = 0, boolean $leader = null )

Starts a membership for the assigned role and user from now until 31.12.9999. An existing membership will be extended if necessary. If the user is the current user then initiate a refresh of his role cache.

Starts a membership for the assigned role and user from now until 31.12.9999. An existing membership will be extended if necessary. If the user is the current user then initiate a refresh of his role cache.

Parameters

$roleId
Assign the membership to this role
$userId
The user who should get a member of the role.
$leader
If value @b 1 then the user will be a leader of the role and get more rights.

Returns

boolean
Return @b true if the assignment was successful.
public boolean
# stopMembership( integer $roleId = 0, integer $userId = 0 )

Stops a membership for the assigned role and user from now until 31.12.9999. If the user is the current user then initiate a refresh of his role cache. If the last membership of a administrator role should be stopped then throw an exception.

Stops a membership for the assigned role and user from now until 31.12.9999. If the user is the current user then initiate a refresh of his role cache. If the last membership of a administrator role should be stopped then throw an exception.

Parameters

$roleId
Stops the membership of this role
$userId
The user who should loose the member of the role.

Returns

boolean
Return @b true if the membership removal was successful.

Throws

AdmException

Methods inherited from TableAccess

__sleep(), clear(), connectAdditionalTable(), countAllRecords(), delete(), getValue(), hasColumnsValueChanged(), isNewRecord(), readData(), readDataByColumns(), readDataById(), setArray(), setDatabase(), setValue()

Properties summary

Properties inherited from TableAccess

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

Admidio API API documentation generated by ApiGen