/**
  * delete ListTableDescription object from database
  * this function also deletes the ListTable that is connected to current object
  * @param string $title title of ListTableDescription
  * @return bool indicates if ListTableDescription has been deleted
  */
 function delete($title)
 {
     $this->_log->trace("deleting ListTableDescription from database (title=" . $title . ")");
     # create encoded_key_string
     $encoded_key_string = parent::_encode_key_string(LISTTABLEDESCRIPTION_TITLE_FIELD_NAME . "='" . $title . "'");
     if (parent::delete($encoded_key_string) == FALSE) {
         return FALSE;
     }
     # create key string for user_list_permissions
     $permission_key_string = USERLISTTABLEPERMISSIONS_LISTTABLE_TITLE_FIELD_NAME . "='" . $title . "'";
     if ($this->_user_list_permissions->delete($permission_key_string) == FALSE) {
         # copy error strings from user_list_permissions
         $this->error_message_str = $this->_user_list_permissions->get_error_message_str();
         $this->error_log_str = $this->_user_list_permissions->get_error_log_str();
         $this->error_str = $this->_user_list_permissions->get_error_str();
         return FALSE;
     }
     $this->_log->trace("deleted ListTableDescription (title=" . $title . ")");
     return TRUE;
 }
Exemplo n.º 2
0
 /**
  * activate an existing ListTableItem in database
  * @param $encoded_key_string string unique identifier of ListTableItem to be archived
  * @return bool indicates if ListTableItem has been archived
  */
 function activate($encoded_key_string)
 {
     $this->_log->trace("activating record from ListTable (encoded_key_string=" . $encoded_key_string . ")");
     # call parent archive()
     if (parent::activate($encoded_key_string) == FALSE) {
         return FALSE;
     }
     # update list table description
     if ($this->_update_list_table_description_statistics() == FALSE) {
         return FALSE;
     }
     $this->_log->trace("activated record from ListTable");
     return TRUE;
 }
Exemplo n.º 3
0
 /**
  * delete a user from database
  * @param $encoded_key_string string unique identifier of user
  * @return bool indicates if user has been deleted
  */
 function delete($encoded_key_string)
 {
     $this->_log->trace("delete user (encoded_key_string=" . $encoded_key_string . ")");
     # first get the user name
     $user_array = $this->select_record($encoded_key_string);
     if (count($user_array) == 0) {
         return FALSE;
     }
     $user_name = $user_array[USER_NAME_FIELD_NAME];
     # delete the user
     if (parent::delete($encoded_key_string) == FALSE) {
         return FALSE;
     }
     # create key string for user_list_permissions
     $permission_key_string = USERLISTTABLEPERMISSIONS_USER_NAME_FIELD_NAME . "='" . $user_name . "'";
     if ($this->_user_list_permissions->delete($permission_key_string) == FALSE) {
         # copy error strings from user_list_permissions
         $this->error_message_str = $this->_user_list_permissions->get_error_message_str();
         $this->error_log_str = $this->_user_list_permissions->get_error_log_str();
         $this->error_str = $this->_user_list_permissions->get_error_str();
         return FALSE;
     }
     $this->_log->info("user deleted (encoded_key_string=" . $encoded_key_string . ")");
     return TRUE;
 }
 /**
  * delete specific user permissions
  * this function is used to check if a user has list permissions
  * @param $key_string string permissions key string
  * @return bool indicates if record has been deleted
  */
 function delete($key_string)
 {
     $this->_log->trace("delete user list permissions (key_string={$key_string})");
     # rerurn TRUE when database has not yet been created
     if (!$this->_database->table_exists($this->table_name)) {
         $this->_log->warn("table does not exist");
         return TRUE;
     }
     # call parent delete
     if (parent::delete($key_string) == FALSE) {
         return FALSE;
     }
     $this->_log->trace("deleted user list permissions");
     return TRUE;
 }