/**
* PostgreSQL 8.1 support
*
- * $Id: Postgres81.php,v 1.12 2006/12/28 04:26:55 xzilla Exp $
+ * $Id: Postgres81.php,v 1.13 2006/12/31 15:32:40 soranzo Exp $
*/
include_once('./classes/database/Postgres80.php');
// Database Functions
/**
- * Return all database available on the server
+ * Returns all databases available on the server
* @return A list of databases, sorted alphabetically
*/
function getDatabases($currentdatabase = NULL) {
/**
* Returns prepared transactions information
- * @param $database (optional) Find only prepared trasactions executed in a specific database
+ * @param $database (optional) Find only prepared transactions executed in a specific database
* @return A recordset
*/
function getPreparedXacts($database = null) {
/**
* Returns all roles in the database cluster
- * @param $rolename (optional) The roleme to exclude from the select
+ * @param $rolename (optional) The role name to exclude from the select
* @return All roles
*/
function getRoles($rolename = '') {
/**
* Returns information about a single role
- * @param $rolename The rolename of the role to retrieve
+ * @param $rolename The name of the role to retrieve
* @return The role's data
*/
function getRole($rolename) {
/**
* Creates a new role
- * @param $rolename The rolename of the role to create
+ * @param $rolename The name of the role to create
* @param $password A password for the role
* @param $superuser Boolean whether or not the role is a superuser
* @param $createdb Boolean whether or not the role can create databases
/**
* Removes a role
- * @param $rolename The rolename of the role to drop
+ * @param $rolename The name of the role to drop
* @return 0 success
*/
function dropRole($rolename) {
/**
* Adjusts a role's info and renames it
- * @param $rolename The rolename of the role to create
+ * @param $rolename The name of the role to adjust
* @param $password A password for the role
* @param $superuser Boolean whether or not the role is a superuser
* @param $createdb Boolean whether or not the role can create databases
/**
* Adjusts a role's info
- * @param $rolename The rolename of the role to create
+ * @param $rolename The name of the role to adjust
* @param $password A password for the role
* @param $superuser Boolean whether or not the role is a superuser
* @param $createdb Boolean whether or not the role can create databases
/**
* Renames a role
- * @param $rolename The rolename of the role to rename
+ * @param $rolename The name of the role to rename
* @param $newrolename The new name of the role
* @return 0 success
*/
/**
* Changes a role's password
- * @param $rolename The rolename
+ * @param $rolename The role name
* @param $password The new password
* @return 0 success
*/
}
/**
- * Returns all rolenames which the role belongs to
- * @param $rolename The rolename
- * @return All rolenames
+ * Returns all role names which the role belongs to
+ * @param $rolename The role name
+ * @return All role names
*/
function getMemberOf($rolename) {
- $this->clean($rolname);
+ $this->clean($rolename);
$sql = "SELECT rolname FROM pg_catalog.pg_roles R, pg_auth_members M WHERE R.oid=M.roleid
AND member IN (SELECT oid FROM pg_catalog.pg_roles WHERE rolname='{$rolename}') ORDER BY rolname";
}
/**
- * Returns all rolenames that are members of a role
- * @param $rolename The rolename
+ * Returns all role names that are members of a role
+ * @param $rolename The role name
* @param $admin (optional) Find only admin members
- * @return All rolenames
+ * @return All role names
*/
function getMembers($rolename, $admin = 'f') {
- $this->clean($rolname);
+ $this->clean($rolename);
$sql = "SELECT rolname FROM pg_catalog.pg_roles R, pg_auth_members M WHERE R.oid=M.member AND admin_option='{$admin}'
AND roleid IN (SELECT oid FROM pg_catalog.pg_roles WHERE rolname='{$rolename}') ORDER BY rolname";