/** * overwrite __construct() function * @param $list_title string name of this list * @return bool indicates if object was contstructed */ function __construct($list_title) { $fields = array(); $this->creator_modifier_array = array(); # object is only valid when this function has run completely $this->is_valid = FALSE; $record = $this->_get_list_table_description_record($list_title); if (count($record) == 0) { return; } # set list title and list definition $this->list_title = $list_title; $definition = $record[LISTTABLEDESCRIPTION_DEFINITION_FIELD_NAME]; $table_name = $this->_convert_list_name_to_table_name($list_title); $db_field_names = array_keys($definition); foreach ($db_field_names as $db_field_name) { $fields[$db_field_name] = array($this->_get_field_name($db_field_name), $definition[$db_field_name][0], $definition[$db_field_name][1], $definition[$db_field_name][2]); } # call parent construct() parent::__construct($table_name, $fields, "111"); # initialize ListTableNote $this->_list_table_note = new ListTableNote($list_title); # initialize ListTableAttachment $this->_list_table_attachment = new ListTableAttachment($list_title); $this->is_valid = TRUE; $this->_log->debug("constructed new ListTable object (table_name=" . $this->table_name . ")"); }
/** * overwrite __construct() function * @return void */ function __construct() { # these variables are assumed to be globally available global $class_listtabledescription_fields; # call parent __construct() parent::__construct(LISTTABLEDESCRIPTION_TABLE_NAME, $class_listtabledescription_fields, LISTTABLEDESCRIPTION_METADATA); $this->_log->debug("constructed new ListTableDescription object"); }
/** * overwrite __construct() function * @return void */ function __construct() { # these variables are assumed to be globally available global $class_userlisttablepermissions_fields; # call parent __construct() parent::__construct(USERLISTTABLEPERMISSIONS_TABLE_NAME, $class_userlisttablepermissions_fields, USERLISTTABLEPERMISSIONS_METADATA); $this->_log->debug("constructed new UserListTablePermissions object"); }
/** * overwrite __construct() function * @return void */ function __construct() { # these variables are assumed to be globally available global $class_user_fields; global $firstthingsfirst_session_time; # call parent __construct() parent::__construct(USER_TABLE_NAME, $class_user_fields, USER_METADATA); # set session name session_name(USER_SESSION_NAME); # set cookie time and path # the path is constructed from the request uri $request_uri_array = explode('/', $_SERVER["REQUEST_URI"]); $array_length = count($request_uri_array); $cookie_path_str = ""; # firstthingsfirst is installed in the document root if ($array_length == 1) { $cookie_path_str = "/"; } else { for ($position = 0; $position < $array_length - 1; $position += 1) { $cookie_path_str .= $request_uri_array[$position] . "/"; } } session_set_cookie_params($firstthingsfirst_session_time * 60, $cookie_path_str); # start a session # session_cache_limiter('private, must-revalidate'); session_start(); # reset relevant session parameters if (isset($_SESSION["login"])) { $this->_log->debug("user session is still active (name=" . $this->get_name() . ")"); # adjust cookie life time setcookie(USER_SESSION_NAME, $_COOKIE[USER_SESSION_NAME], time() + $firstthingsfirst_session_time * 60); } else { $this->reset(); } $this->_log->debug("constructed new User object"); }