.pdf)
WHM Plugins
| API Version: | 1 - Click here for documentation |
|---|---|
| Syntax: | Postgres::listusersopt( ) |
| Description: | List PostgreSQL database users associated with a cPanel account. |
| Returns: | |
The output should resemble the following: <option value="cpanelusername_user">cpanelusername_user</option> <option value="cpanelusername_user2">cpanelusername_user2</option> |
| API Version: | 1 - Click here for documentation |
|---|---|
| Syntax: | Postgres::deluser( user ) |
| Description: | Delete a PostgreSQL database user. This function requires access to the 'postgres' feature. This function is not available in demo mode. |
| Parameters: | |
| user (string) | |
| The name of the database user to delete. Remember: The account's cPanel username and an underscore should be prepended to the database user's name (e.g., $user_database-user). | |
| Returns: | |
This function will not generate any output if it is successful.
|
| API Version: | 1 - Click here for documentation |
|---|---|
| Syntax: | Postgres::number_of_dbs( ) |
| Description: | Print the number of PostgreSQL databases associated with a cPanel account. |
| Returns: | |
The output will be an integer value, such as: 2 |
| API Version: | 1 - Click here for documentation |
|---|---|
| Syntax: | Postgres::adduser( user, password ) |
| Description: | Add a PostgreSQL database user. This function requires access to the 'postgres' feature. This function is not available in demo mode. |
| Parameters: | |
| user (string) | |
| The database to which to add the new user. Remember: The account's cPanel username and an underscore need to be prepended to the database's name (e.g., $user_database). | |
| password (string) | |
| The password for the new database user. | |
| Returns: | |
This function will not display any output if it is successful.
|
| API Version: | 1 - Click here for documentation |
|---|---|
| Syntax: | Postgres::initcache( ) |
| Description: | Initialize cPanel's PostgreSQL caches. |
| Returns: | |
This function does not generate any output.
|
| API Version: | 1 - Click here for documentation |
|---|---|
| Syntax: | Postgres::listdbsopt( ) |
| Description: | List PostgreSQL databases owned by a cPanel account. |
| Returns: | |
The output should resemble the following: <option value="cpanelusername_dbname">cpanelusername_dbname</option> <option value="cpanelusername_dbname2">cpanelusername_dbname2</option> |
| API Version: | 1 - Click here for documentation |
|---|---|
| Syntax: | Postgres::deluserdb( db, user ) |
| Description: | Remove a PostgreSQL database user's access to a database. This function requires access to the 'postgres' feature. This function is not available in demo mode. |
| Parameters: | |
| db (string) | |
| The name of the database from which to remove the user's access. Remember: The account's cPanel username and an underscore must be prepended to the database's name (e.g., $user_database). | |
| user (string) | |
| The name of the user whose access will be removed. Remember: The account's cPanel username and an underscore must be prepended to the user's name (e.g., $user_database-user). | |
| Returns: | |
This function will not generate any output if it is successful.
|
| API Version: | 1 - Click here for documentation |
|---|---|
| Syntax: | Postgres::deldb( dbname ) |
| Description: | Remove a PostgreSQL database. This function requires access to the 'postgres' feature. This function is not available in demo mode. |
| Parameters: | |
| dbname (string) | |
| The name of the database to delete. Remember: This value must include the account's cPanel username and an underscore before the name of the database (e.g., $user_database). | |
| Returns: | |
This function does not produce any output if it is successful.
|
| API Version: | 1 - Click here for documentation |
|---|---|
| Syntax: | Postgres::adduserdb( db, user ) |
| Description: | Add an existing PostgreSQL user to a database. This function requires access to the 'postgres' feature. This function is not available in demo mode. |
| Parameters: | |
| db (string) | |
| The name of the database to which to add the new user. Remember: The database's full name should be specified, including the account's cPanel username and an underscore (e.g., $user_database). | |
| user (string) | |
| The name of the database user to add to the database. Remember: The account's cPanel username and an underscore should prepend the database user's name (e.g., $user_database-user). | |
| Returns: | |
This function will not display any output if it is successful.
|
| API Version: | 1 - Click here for documentation |
|---|---|
| Syntax: | Postgres::number_of_users( ) |
| Description: | Print the number of PostgreSQL users associated with a cPanel account. |
| Returns: | |
The output will be an integer, such as: 2 |
| API Version: | 1 - Click here for documentation |
|---|---|
| Syntax: | Postgres::adddb( dbname ) |
| Description: | Add a PostgreSQL database to the cPanel account. This function requires access to the 'postgres' feature. This function is not available in demo mode. |
| Parameters: | |
| dbname (string) | |
| The name of the database to create. Note: The account's username and an underscore are automatically prepended to the name of the database. For example, if a database name test were specified, the database's name would be $user_test. | |
| Returns: | |
This function does not generate any output if it is successful.
|