Alternc
3.2
Alternc logiel libre pour l'hébergement
|
Public Member Functions | |
m_mysql () | |
Constructor m_mysql([$mid]) Constructeur de la classe m_mysql, initialise le membre concerne. | |
reload_dbus () | |
list_db_servers () | |
hook_menu () | |
alternc_password_policy () | |
Password kind used in this class (hook for admin class) | |
get_dblist () | |
Get the list of the database for the current user. | |
php_myadmin_connect () | |
Get the login and password of the special user able to connect to phpmyadmin. | |
get_mysql_details ($dbn) | |
Returns the details of a user's database. | |
test_get_param ($dbname) | |
add_db ($dbn) | |
Create a new database for the current user. | |
del_db ($dbn) | |
Delete a database for the current user. | |
put_mysql_backup ($dbn, $bck_mode, $bck_history, $bck_gzip, $bck_dir) | |
Set the backup parameters for the database $db. | |
put_mysql_details ($password) | |
Change the password of the user in MySQL. | |
grant ($base, $user, $rights=null, $pass=null, $table='*') | |
Function used to grant SQL rights to users: :database : database user : rights to apply ( optional, every rights apply given if missing : user password ( optional, if not given the pass stays the same, else it takes the new value ) : sql tables to apply rights. | |
restore ($file, $stdout, $id) | |
Restore a sql database. | |
get_db_size ($dbname) | |
Get the size of a database. | |
get_userslist ($all=null) | |
Returns the list of database users of an account. | |
get_defaultsparam ($dbn) | |
add_user ($usern, $password, $passconf) | |
Create a new user in MySQL rights tables. | |
change_user_password ($usern, $password, $passconf) | |
Change a user's MySQL password. | |
del_user ($user, $all=null) | |
Delete a user in MySQL rights tables. | |
get_user_dblist ($user) | |
Return the list of the database rights of user $user. | |
set_user_rights ($user, $dbn, $rights) | |
Set the access rights of user $user to database $dbn to be rights $rights. | |
available_sql_rights () | |
hook_lxc_params ($params) | |
Hook function called by the lxc class to set mysql_host and port parameters. | |
hook_quota_get () | |
Hook function called by the quota class to compute user used quota Returns the used quota for the $name service for the current user. | |
alternc_add_member () | |
Hook function called when a user is created. | |
alternc_del_member () | |
Hook function called when a user is deleted. | |
alternc_del_session () | |
Hook function called when a user is logged out. | |
alternc_export_conf () | |
Exporte all the mysql information of an account private EXPERIMENTAL 'sid' function ;) | |
alternc_export_data ($dir) | |
Exporte all the mysql databases a of give account to $dir directory private EXPERIMENTAL 'sid' function ;) | |
get_dbus_size ($db_name, $db_host, $db_login, $db_password, $db_client) | |
Return the size of each databases in a SQL Host given in parameter. |
Data Fields | |
$dbus |
Definition at line 76 of file m_mysql.php.
add_db | ( | $dbn | ) |
Create a new database for the current user.
$dbn | string Database name ($user_$dbn is the mysql db name) |
Definition at line 241 of file m_mysql.php.
References $cuid, $db, $err, $mem, $password, add_user(), create_pass(), and grant().
add_user | ( | $usern, | |
$password, | |||
$passconf | |||
) |
Create a new user in MySQL rights tables.
$usern | the username (we will add _[alternc-account] to it) |
$password | The password for this username |
$passconf | The password confirmation |
Definition at line 696 of file m_mysql.php.
References $cuid, $db, $err, $mem, $password, $user, and grant().
Referenced by add_db().
alternc_add_member | ( | ) |
Hook function called when a user is created.
AlternC's standard function that create a member private
Definition at line 1006 of file m_mysql.php.
References $cuid, $db, $err, $mem, $password, and create_pass().
alternc_del_member | ( | ) |
Hook function called when a user is deleted.
AlternC's standard function that delete a member private
Definition at line 1033 of file m_mysql.php.
References $c, $cuid, $d, $db, $err, $i, del_db(), del_user(), get_dblist(), and get_userslist().
alternc_del_session | ( | ) |
Hook function called when a user is logged out.
We just remove the cookie created in admin/sql_admin.php a private
Definition at line 1057 of file m_mysql.php.
alternc_export_conf | ( | ) |
Exporte all the mysql information of an account private EXPERIMENTAL 'sid' function ;)
Definition at line 1070 of file m_mysql.php.
References $cuid, $db, and $err.
alternc_export_data | ( | $dir | ) |
Exporte all the mysql databases a of give account to $dir directory private EXPERIMENTAL 'sid' function ;)
Definition at line 1101 of file m_mysql.php.
References $cuid, $db, $err, and $mem.
alternc_password_policy | ( | ) |
Password kind used in this class (hook for admin class)
Definition at line 144 of file m_mysql.php.
available_sql_rights | ( | ) |
Definition at line 957 of file m_mysql.php.
change_user_password | ( | $usern, | |
$password, | |||
$passconf | |||
) |
Change a user's MySQL password.
$usern | the username |
$password | The password for this username |
$passconf | The password confirmation |
Definition at line 760 of file m_mysql.php.
References $cuid, $db, $err, $mem, $password, and $user.
del_db | ( | $dbn | ) |
Delete a database for the current user.
$dbn | string Name of the database to delete. The db name is $user_$dbn |
Definition at line 322 of file m_mysql.php.
References $cuid, $db, $err, $mem, and del_user().
Referenced by alternc_del_member().
del_user | ( | $user, | |
$all = null |
|||
) |
Delete a user in MySQL rights tables.
$user | the username (we will add "[alternc-account]_" to it) to delete |
Definition at line 791 of file m_mysql.php.
References $cuid, $db, $err, $mem, and $user.
Referenced by alternc_del_member(), and del_db().
get_db_size | ( | $dbname | ) |
Get the size of a database.
$dbname | name of the database |
Definition at line 561 of file m_mysql.php.
Referenced by get_mysql_details().
get_dblist | ( | ) |
Get the list of the database for the current user.
Definition at line 155 of file m_mysql.php.
References $c, $cuid, $db, $err, and split_mysql_database_name().
Referenced by alternc_del_member(), get_user_dblist(), and hook_quota_get().
get_dbus_size | ( | $db_name, | |
$db_host, | |||
$db_login, | |||
$db_password, | |||
$db_client | |||
) |
Return the size of each databases in a SQL Host given in parameter.
$db_name | the human name of the host |
$db_host | the host hosting the SQL databases |
$db_login | the login to access the SQL db |
$db_password | the password to access the SQL db |
$db_client | the client to access the SQL db |
Definition at line 1128 of file m_mysql.php.
References $c, $d, $db, $err, and $res.
get_defaultsparam | ( | $dbn | ) |
Definition at line 600 of file m_mysql.php.
References $cuid, $db, $err, $q, and $r.
get_mysql_details | ( | $dbn | ) |
Returns the details of a user's database.
$dbn is the name of the database (after the _) or nothing for the database "$user"
Definition at line 204 of file m_mysql.php.
References $c, $cuid, $db, $err, $mem, $root, get_db_size(), getuserpath(), and split_mysql_database_name().
Referenced by restore().
get_user_dblist | ( | $user | ) |
Return the list of the database rights of user $user.
$user | the username |
Definition at line 829 of file m_mysql.php.
References $cuid, $db, $err, $mem, $r, $tab, $user, and get_dblist().
get_userslist | ( | $all = null | ) |
Returns the list of database users of an account.
Definition at line 578 of file m_mysql.php.
References $c, $cuid, $db, and $err.
Referenced by alternc_del_member().
grant | ( | $base, | |
$user, | |||
$rights = null , |
|||
$pass = null , |
|||
$table = '*' |
|||
) |
Function used to grant SQL rights to users: :database : database user : rights to apply ( optional, every rights apply given if missing : user password ( optional, if not given the pass stays the same, else it takes the new value ) : sql tables to apply rights.
Definition at line 457 of file m_mysql.php.
References $db, $err, and $user.
Referenced by add_db(), add_user(), and set_user_rights().
hook_lxc_params | ( | $params | ) |
Hook function called by the lxc class to set mysql_host and port parameters.
$name | string name of the quota |
Definition at line 971 of file m_mysql.php.
hook_menu | ( | ) |
Definition at line 105 of file m_mysql.php.
References $q.
hook_quota_get | ( | ) |
Hook function called by the quota class to compute user used quota Returns the used quota for the $name service for the current user.
$name | string name of the quota |
Definition at line 990 of file m_mysql.php.
list_db_servers | ( | ) |
Definition at line 95 of file m_mysql.php.
m_mysql | ( | ) |
Constructor m_mysql([$mid]) Constructeur de la classe m_mysql, initialise le membre concerne.
Definition at line 83 of file m_mysql.php.
References $cuid, and variable_get().
php_myadmin_connect | ( | ) |
Get the login and password of the special user able to connect to phpmyadmin.
Definition at line 173 of file m_mysql.php.
References $cuid, $db, $err, and $info.
put_mysql_backup | ( | $dbn, | |
$bck_mode, | |||
$bck_history, | |||
$bck_gzip, | |||
$bck_dir | |||
) |
Set the backup parameters for the database $db.
$db | string database name |
$bck_mode | integer Backup mode (0 = none 1 = daily 2 = weekly) |
$bck_history | integer How many backup should we keep ? |
$bck_gzip | boolean shall we compress the backup ? |
$bck_dir | string Directory relative to the user account where the backup will be stored |
Definition at line 362 of file m_mysql.php.
References $cuid, $db, $err, $mem, and variable_get().
put_mysql_details | ( | $password | ) |
Change the password of the user in MySQL.
$password | string new password (cleartext) |
Definition at line 415 of file m_mysql.php.
References $cuid, $db, $err, $mem, and $password.
reload_dbus | ( | ) |
Definition at line 91 of file m_mysql.php.
restore | ( | $file, | |
$stdout, | |||
$id | |||
) |
Restore a sql database.
$file | string The filename, relative to the user root dir, which contains a sql dump |
$stdout | boolean shall-we dump the error to stdout ? |
$id | integer The ID of the database to dump to. |
Definition at line 513 of file m_mysql.php.
References $db, $err, $mem, $r, false, get_mysql_details(), and true.
set_user_rights | ( | $user, | |
$dbn, | |||
$rights | |||
) |
Set the access rights of user $user to database $dbn to be rights $rights.
$user | the username to give rights to |
$dbn | The database to give rights to |
$rights | The rights as an array of MySQL keywords (insert, select ...) |
Definition at line 877 of file m_mysql.php.
References $db, $err, $i, $mem, $user, and grant().
test_get_param | ( | $dbname | ) |
$dbus |
Definition at line 77 of file m_mysql.php.