/** Constructor that will create an object of a recordset of the table adm_organizations. * If the id is set than the specific organization will be loaded. * @param object $db Object of the class database. This should be the default object $gDb. * @param $organization The recordset of the organization with this id will be loaded. * The organization can be the table id or the organization shortname. * If id isn't set than an empty object of the table is created. */ public function __construct(&$db, $organization = '') { parent::__construct($db, TBL_ORGANIZATIONS, 'org'); if (is_numeric($organization)) { $this->readDataById($organization); } else { $this->readDataByColumns(array('org_shortname' => $organization)); } }
/** * Constructor that will create an object of a recordset of the table adm_auto_login. * If the id is set than the specific auto login will be loaded. * @param object $db Object of the class database. This should be the default object $gDb. * @param $session The recordset of the auto login with this session will be loaded. If session isn't set than an empty object of the table is created. */ public function __construct(&$db, $session = 0) { parent::__construct($db, TBL_AUTO_LOGIN, 'atl'); // if not numeric than the session id is commited if (is_numeric($session)) { $this->readDataById($session); } else { $this->readDataByColumns(array('atl_session_id' => $session)); } }
/** * Constructor that will create an object of a recordset of the table adm_sessions. * If the id is set than the specific session will be loaded. * @param object $database Object of the class Database. This should be the default global object @b $gDb. * @param int|string $session The recordset of the session with this id will be loaded. * The session can be the table id or the alphanumeric session id. * If id isn't set than an empty object of the table is created. */ public function __construct(&$database, $session = 0) { parent::__construct($database, TBL_SESSIONS, 'ses'); if (is_numeric($session)) { $this->readDataById($session); } else { $this->readDataByColumns(array('ses_session_id' => $session)); if ($this->new_record) { // if PHP session id was commited then store them in that field $this->setValue('ses_session_id', $session); } } }
/** * Constructor that will create an object of a recordset of the table adm_sessions. * If the id is set than the specific session will be loaded. * @param object $database Object of the class Database. This should be the default global object @b $gDb. * @param int|string $session The recordset of the session with this id will be loaded. * The session can be the table id or the alphanumeric session id. * If id isn't set than an empty object of the table is created. * @param string $cookiePrefix The prefix that is used for cookies */ public function __construct(&$database, $session = 0, $cookiePrefix = '') { parent::__construct($database, TBL_SESSIONS, 'ses'); $this->mCookiePrefix = $cookiePrefix; $this->mDomain = substr($_SERVER['HTTP_HOST'], 0, strpos($_SERVER['HTTP_HOST'], ':')); if (is_numeric($session)) { $this->readDataById($session); } else { $this->readDataByColumns(array('ses_session_id' => $session)); if ($this->new_record) { // if PHP session id was commited then store them in that field $this->setValue('ses_session_id', $session); $this->setValue('ses_timestamp', DATETIME_NOW); } } // if cookie ADMIDIO_DATA is set then there could be an auto login // the auto login must be done here because after that the corresponding organization must be set if (array_key_exists($cookiePrefix . '_AUTO_LOGIN_ID', $_COOKIE)) { // restore user from auto login session $this->mAutoLogin = new AutoLogin($database, $_COOKIE[$cookiePrefix . '_AUTO_LOGIN_ID']); // valid AutoLogin found if ($this->mAutoLogin->getValue('atl_id') > 0) { $this->mAutoLogin->setValue('atl_session_id', $session); $this->mAutoLogin->save(); $this->setValue('ses_usr_id', $this->mAutoLogin->getValue('atl_usr_id')); } else { // an invalid AutoLogin should be executed made the current AutoLogin unusable $this->mAutoLogin = null; setcookie($this->mCookiePrefix . '_AUTO_LOGIN_ID', $_COOKIE[$cookiePrefix . '_AUTO_LOGIN_ID'], 0, '/', $this->mDomain, 0); // now count invalid auto login for this user and delete all auto login of this users if number of wrong logins > 3 $userId = substr($_COOKIE[$cookiePrefix . '_AUTO_LOGIN_ID'], 0, strpos($_COOKIE[$cookiePrefix . '_AUTO_LOGIN_ID'], ':')); $sql = 'UPDATE ' . TBL_AUTO_LOGIN . ' SET atl_number_invalid = atl_number_invalid + 1 WHERE atl_usr_id = ' . $userId; $this->db->query($sql); $sql = 'DELETE FROM ' . TBL_AUTO_LOGIN . ' WHERE atl_usr_id = ' . $userId . ' AND atl_number_invalid > 3 '; $this->db->query($sql); } } }
/** * Constructor that will create an object of a recordset of the table adm_lists. * If the id is set than the specific list will be loaded. * @param object $database Object of the class Database. This should be the default global object @b $gDb. * @param int $lst_id The recordset of the list with this id will be loaded. If id isn't set than an empty object of the table is created. */ public function __construct(&$database, $lst_id = 0) { parent::__construct($database, TBL_LISTS, 'lst', $lst_id); }
/** * Constructor that will create an object of a recordset of the table adm_roles. * If the id is set than the specific role will be loaded. * @param object $database Object of the class Database. This should be the default global object @b $gDb. * @param int $rol_id The recordset of the role with this id will be loaded. If id isn't set than an empty object of the table is created. */ public function __construct(&$database, $rol_id = 0) { // read also data of assigned category $this->connectAdditionalTable(TBL_CATEGORIES, 'cat_id', 'rol_cat_id'); parent::__construct($database, TBL_ROLES, 'rol', $rol_id); }
/** * Constructor that will create an object of a recordset of the table adm_invent. * If the id is set than the specific item will be loaded. * @param object $database Object of the class Database. This should be the default global object @b $gDb. * @param int $itemId The recordset of the item with this id will be loaded. If id isn't set than an empty object of the table is created. */ public function __construct(&$database, $itemId = 0) { parent::__construct($database, TBL_INVENT, 'inv', $itemId); }
/** * Constructor that will create an object of a recordset of the table adm_invent_fields. * If the id is set than the specific item field will be loaded. * @param object $database Object of the class Database. This should be the default global object @b $gDb. * @param int $inf_id The recordset of the item field with this id will be loaded. If id isn't set than an empty object of the table is created. */ public function __construct(&$database, $inf_id = 0) { // read also data of assigned category $this->connectAdditionalTable(TBL_CATEGORIES, 'cat_id', 'inf_cat_id'); parent::__construct($database, TBL_INVENT_FIELDS, 'inf', $inf_id); }
/** Constructor that will create an object of a recordset of the table adm_photos. * If the id is set than the specific photo album will be loaded. * @param $db Object of the class database. This should be the default object $gDb. * @param $pho_id The recordset of the photo album with this id will be loaded. If id isn't set than an empty object of the table is created. */ public function __construct(&$db, $photo_id = 0) { parent::__construct($db, TBL_PHOTOS, 'pho', $photo_id); $hasChildAlbums = null; }
/** * Constructor that will create an object of a recordset of the table adm_rooms. * If the id is set than the specific room will be loaded. * @param object $database Object of the class Database. This should be the default global object @b $gDb. * @param int $room_id The recordset of the room with this id will be loaded. If id isn't set than an empty object of the table is created. */ public function __construct(&$database, $room_id = 0) { parent::__construct($database, TBL_ROOMS, 'room', $room_id); }
/** Constructor that will create an object of a recordset of the table adm_messages. * If the id is set than the specific message will be loaded. * @param $db Object of the class database. This should be the default object $gDb. * @param $msg_converation_id The recordset of the message with this conversation id will be loaded. If id isn't set than an empty object of the table is created. */ public function __construct(&$db, $msg_id = 0) { $this->msg_id = $msg_id; parent::__construct($db, TBL_MESSAGES, 'msg', $this->msg_id); }
/** * Constructor that will create an object of a recordset of the table adm_category. * If the id is set than the specific category will be loaded. * @param object $database Object of the class Database. This should be the default global object @b $gDb. * @param int $cat_id The recordset of the category with this id will be loaded. If id isn't set than an empty object of the table is created. */ public function __construct(&$database, $cat_id = 0) { parent::__construct($database, TBL_CATEGORIES, 'cat', $cat_id); }
/** * Constructor that will create an object of a recordset of the table adm_texts. * If the id is set than the specific text will be loaded. * @param object $database Object of the class Database. This should be the default global object @b $gDb. * @param string $name The recordset of the text with this name will be loaded. * If name isn't set than an empty object of the table is created. */ public function __construct(&$database, $name = '') { parent::__construct($database, TBL_TEXTS, 'txt', $name); }
/** * Constructor that will create an object of a recordset of the table adm_users. * If the id is set than the specific user will be loaded. * @param object $db Object of the class database. This should be the default object $gDb. * @param int $userId The recordset of the user with this id will be loaded. If id isn't set than an empty object of the table is created. */ public function __construct(&$db, $userId = 0) { parent::__construct($db, TBL_USERS, 'usr', $userId); }
/** * Constructor that will create an object of a recordset of the table adm_guestbook. * If the id is set than the specific guestbook will be loaded. * @param object $database Object of the class Database. This should be the default global object @b $gDb. * @param int $gbo_id The recordset of the guestbook with this id will be loaded. If id isn't set than an empty object of the table is created. */ public function __construct(&$database, $gbo_id = 0) { parent::__construct($database, TBL_GUESTBOOK, 'gbo', $gbo_id); }
/** Constuctor that will create an object of a recordset of the table adm_announcements. * If the id is set than the specific announcement will be loaded. * @param $db Object of the class database. This should be the default object $gDb. * @param $ann_id The recordset of the announcement with this id will be loaded. If id isn't set than an empty object of the table is created. */ public function __construct(&$db, $hist_id = 0) { parent::__construct($db, TBL_USER_HISTORY, 'hist', $hist_id); }
/** * Constructor that will create an object of a recordset of the table adm_dates. * If the id is set than the specific date will be loaded. * @param $db Object of the class database. This should be the default object $gDb. * @param $dat_id The recordset of the date with this id will be loaded. If id isn't set than an empty object of the table is created. */ public function __construct(&$db, $dat_id = 0) { // read also data of assigned category $this->connectAdditionalTable(TBL_CATEGORIES, 'cat_id', 'dat_cat_id'); parent::__construct($db, TBL_DATES, 'dat', $dat_id); }
/** * 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. * @param object $database Object of the class Database. This should be the default global object @b $gDb. * @param int $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. */ public function __construct(&$database, $mem_id = 0) { // read also data of assigned category $this->connectAdditionalTable(TBL_ROLES, 'rol_id', 'mem_rol_id'); parent::__construct($database, TBL_MEMBERS, 'mem', $mem_id); }
/** * Constructor that will create an object of a recordset of the table adm_guestbook_comments. * If the id is set than the specific guestbook comment will be loaded. * @param object $database Object of the class Database. This should be the default global object @b $gDb. * @param int $gbc_id The recordset of the guestbook comment with this id will be loaded. If id isn't set than an empty object of the table is created. */ public function __construct(&$database, $gbc_id = 0) { // read also data of assigned guestbook entry $this->connectAdditionalTable(TBL_GUESTBOOK, 'gbo_id', 'gbc_gbo_id'); parent::__construct($database, TBL_GUESTBOOK_COMMENTS, 'gbc', $gbc_id); }
/** * Constructor that will create an object of a recordset of the table adm_component. * If the id is set than the specific component will be loaded. * @param object $database Object of the class Database. This should be the default global object @b $gDb. * @param int $com_id The recordset of the component with this id will be loaded. * If com_id isn't set than an empty object of the table is created. */ public function __construct(&$database, $com_id = 0) { parent::__construct($database, TBL_COMPONENTS, 'com', $com_id); }
/** Constructor that will create an object of a recordset of the table adm_folders. * If the id is set than the specific folder will be loaded. * @param $db Object of the class database. This should be the default object $gDb. * @param $folderId The recordset of the folder with this id will be loaded. If id isn't set than an empty object of the table is created. */ public function __construct(&$db, $folderId = 0) { parent::__construct($db, TBL_FOLDERS, 'fol', $folderId); $this->folderPath = new Folder(); }
/** Constuctor that will create an object of a recordset of the table. * If the id is set than the specific announcement will be loaded. * @param $db Object of the class database. This should be the default object $gDb. * @param $ann_id The recordset of the announcement with this id will be loaded. If id isn't set than an empty object of the table is created. */ public function __construct(&$db, $sts_id = 0) { parent::__construct($db, TBL_USER_STS, 'sts', $sts_id); }
/** * Constructor that will create an object of a recordset of the table adm_files. * If the id is set than the specific files will be loaded. * @param object $database Object of the class Database. This should be the default global object @b $gDb. * @param int $fil_id The recordset of the files with this id will be loaded. If id isn't set than an empty object of the table is created. */ public function __construct(&$database, $fil_id = 0) { // read also data of assigned folder $this->connectAdditionalTable(TBL_FOLDERS, 'fol_id', 'fil_fol_id'); parent::__construct($database, TBL_FILES, 'fil', $fil_id); }
/** Constructor that will create an object of a recordset of the table adm_announcements. * If the id is set than the specific announcement will be loaded. * @param $db Object of the class database. This should be the default object $gDb. * @param $ann_id The recordset of the announcement with this id will be loaded. If id isn't set than an empty object of the table is created. */ public function __construct(&$db, $ann_id = 0) { parent::__construct($db, TBL_ANNOUNCEMENTS, 'ann', $ann_id); }
/** Constuctor that will create an object of a recordset of the table. * If the id is set than the specific announcement will be loaded. * @param $db Object of the class database. This should be the default object $gDb. * @param $ann_id The recordset of the announcement with this id will be loaded. If id isn't set than an empty object of the table is created. */ public function __construct(&$db, $support_id = 0) { parent::__construct($db, TBL_USER_SUPPORT, 'support', $support_id); }