public function delete_oke($item_id) { if (parent::delete_oke($item_id) == false) { return false; } if (($item = $this->db->entry("settings", $item_id)) == false) { return false; } if (in_array($item["key"], $this->hidden_keys)) { $this->output->add_message("You are not allowed to delete this setting."); return false; } return true; }
public function delete_oke($item_id) { if (parent::delete_oke($item_id) == false) { return false; } $query = "select count(*) as count from users where organisation_id=%d"; if (($result = $this->db->execute($query, $item_id)) === false) { $this->output->add_message("Database error."); return false; } if ((int) $result[0]["count"] > 0) { $this->output->add_message("Organisation in use."); return false; } return true; }