Alternc
3.2
Alternc logiel libre pour l'hébergement
|
Manage the AlternC's account administration (create/edit/delete) More...
Public Member Functions | |
m_admin () | |
Constructor. | |
hook_menu () | |
stop_if_jobs_locked () | |
get_uid_by_login ($login) | |
get ($uid, $recheck=false) | |
Returns the known information about a hosted account. | |
get_creator ($uid) | |
Returns the known information about a specific hosted account Similar to get_list() but for creators/resellers. | |
onesu () | |
get_list ($all=0, $creator=0, $pattern=FALSE, $pattern_type=FALSE) | |
Returns the list of the hosted accounts. | |
mailallmembers ($subject, $message, $from) | |
Send an email to all AlternC's accounts. | |
get_creator_list () | |
Returns an array with the known information about resellers (uid, login, number of accounts) Does not include account 2000 in the list. | |
checkcreator ($uid) | |
Check if I am the creator of the member $uid. | |
add_shared_domain ($u, $domain_name) | |
add_mem ($login, $pass, $nom, $prenom, $mail, $canpass=1, $type='default', $duration=0, $notes="", $force=0, $create_dom=false, $db_server_id) | |
Creates a new hosted account. | |
hook_admin_add_member () | |
AlternC's standard function called when a user is created This sends an email if configured through the interface. | |
update_mem ($uid, $mail, $nom, $prenom, $pass, $enabled, $canpass, $type='default', $duration=0, $notes="", $reset_quotas=false) | |
Edit an account. | |
lock_mem ($uid) | |
Lock an account Lock an account and prevent the user to access its account. | |
unlock_mem ($uid) | |
UnLock an account UnLock an account and prevent the user to access its account. | |
del_mem ($uid) | |
Deletes an account Deletes the specified account. | |
renew_mem ($uid, $periods=1) | |
Renew an account Renew an account for its duration. | |
renew_update ($uid, $duration) | |
Update the duration information for an account. | |
renew_get_expiry ($uid) | |
Get the expiry date for an account. | |
renew_get_status ($uid) | |
Get the expiry status for an account. | |
renew_get_expiring_accounts () | |
Get the expired/about to expire accounts. | |
normal2su ($uid) | |
Turns a common account into a super-admin account. | |
su2normal ($uid) | |
Turns a super-admin account into a common account. | |
listtld () | |
List of the authorized TLDs Returns the list of the authorized TLDs and also the way they are authorized. | |
dom_list ($alsocheck=false, $forcecheck=false) | |
List the hosted domains on this server Return the list of hosted domains on this server, (an array of associative arrays) | |
checkalldom () | |
Check all the domains for their NS MX and IPs. | |
dom_lock ($domain) | |
Lock / Unlock a domain Lock (or unlock) a domain, so that the member will be (not be) able to delete it from its account. | |
gettld ($tld) | |
Add a new TLD to the list of the authorized TLDs. | |
selecttldmode ($current=false) | |
Prints the list of the actually authorized TLDs. | |
deltld ($tld) | |
Deletes the specified tld in the list of the authorized TLDs Note : This function does not delete the domains depending on this TLD. | |
addtld ($tld, $mode) | |
Add a TLD to the list of the authorized TLDs during the installation. | |
edittld ($tld, $mode) | |
Modify a TLD of the list of the authorized TLDs. | |
getadmin () | |
Get the login name of the main administrator account. | |
listPasswordPolicies () | |
List the password policies currently installed in the policy table. | |
editPolicy ($policy, $minsize, $maxsize, $classcount, $allowlogin) | |
Change a password policy for one kind of password. | |
checkPolicy ($policy, $login, $password) | |
Check a password and a login for a specific policy. | |
hook_upnp_list () | |
hook function called by AlternC-upnp to know which open tcp or udp ports this class requires or suggests |
Data Fields | |
$enabled = 0 | |
$enabled tells if the logged user is super-admin or not | |
$tldmode = array() | |
List of the controls made for each TLD. | |
$archive = '' |
Manage the AlternC's account administration (create/edit/delete)
Definition at line 31 of file m_admin.php.
add_mem | ( | $login, | |
$pass, | |||
$nom, | |||
$prenom, | |||
$mail, | |||
$canpass = 1 , |
|||
$type = 'default' , |
|||
$duration = 0 , |
|||
$notes = "" , |
|||
$force = 0 , |
|||
$create_dom = false , |
|||
$db_server_id | |||
) |
Creates a new hosted account.
Creates a new hosted account (in the tables membres
and local
). Prevents any manipulation of the account if the account $mid is not super-admin.
$login | string Login name like [a-z][a-z0-9]* |
$pass | string Password (max. 64 characters) |
$nom | string Name of the account owner |
$prenom | string First name of the account owner |
string Email address of the account owner, useful to get one's lost password $type string Account type for quotas |
Definition at line 494 of file m_admin.php.
References $classes, $cuid, $db, $err, $force, $hooks, $mem, $uid, _md5cr(), add_shared_domain(), checkmail(), enabled, getuserpath(), and renew_update().
add_shared_domain | ( | $u, | |
$domain_name | |||
) |
Definition at line 450 of file m_admin.php.
References $cuid, $db, $dom, $err, and $mem.
Referenced by add_mem().
addtld | ( | $tld, | |
$mode | |||
) |
Add a TLD to the list of the authorized TLDs during the installation.
$tld | string TLD we want to authorize |
$mode | integer Controls to make on this TLD. Note: If you check in the whois, be sure that m_domains knows how to name the whois of the specified domain ! |
Definition at line 1137 of file m_admin.php.
References $db, $err, and $mode.
checkalldom | ( | ) |
Check all the domains for their NS MX and IPs.
Definition at line 992 of file m_admin.php.
References $c, $d, $db, $r, and $t.
Referenced by dom_list().
checkcreator | ( | $uid | ) |
Check if I am the creator of the member $uid.
integer | $uid | a unique integer identifying the account |
Definition at line 435 of file m_admin.php.
checkPolicy | ( | $policy, | |
$login, | |||
$password | |||
) |
Check a password and a login for a specific policy.
$policy | string Name of the policy to check for |
$login | The login that will be set |
$password | The password we have to check |
Definition at line 1278 of file m_admin.php.
References $db, $err, $i, $p, $password, and listPasswordPolicies().
del_mem | ( | $uid | ) |
Deletes an account Deletes the specified account.
Prevents any manipulation of the account if the account $mid is not super-admin.
$uid | integer the uid number of the account we want to delete |
Definition at line 748 of file m_admin.php.
References $classes, $cuid, $db, $dom, $err, $hooks, $mem, $uid, enabled, and getuserpath().
deltld | ( | $tld | ) |
Deletes the specified tld in the list of the authorized TLDs Note : This function does not delete the domains depending on this TLD.
$tld | string The TLD you want to delete |
Definition at line 1115 of file m_admin.php.
List the hosted domains on this server Return the list of hosted domains on this server, (an array of associative arrays)
boolean | $alsocheck | Returns also errstr and errno telling the domains dig checks |
boolean | $forcecheck | Force the check of dig domain even if a cache exists. |
Definition at line 963 of file m_admin.php.
References $c, $db, $forcecheck, and checkalldom().
dom_lock | ( | $domain | ) |
Lock / Unlock a domain Lock (or unlock) a domain, so that the member will be (not be) able to delete it from its account.
$dom | string Domain name to lock / unlock |
Definition at line 1064 of file m_admin.php.
editPolicy | ( | $policy, | |
$minsize, | |||
$maxsize, | |||
$classcount, | |||
$allowlogin | |||
) |
Change a password policy for one kind of password.
$policy | string Name of the policy to edit |
$minsize | integer Minimum Password size |
$maxsize | integer Maximum Password size |
$classcount | integer How many class of characters must this password have |
$allowlogin | boolean Do we allow the password to be like the login ? |
Definition at line 1251 of file m_admin.php.
References $db.
edittld | ( | $tld, | |
$mode | |||
) |
Modify a TLD of the list of the authorized TLDs.
$tld | string TLD we want to modify |
$mode | integer Controls to make on this TLD. |
Definition at line 1165 of file m_admin.php.
get | ( | $uid, | |
$recheck = false |
|||
) |
Returns the known information about a hosted account.
Returns all what we know about an account (contents of the tables membres
et local
) Ckecks if the account is super-admin
integer | $uid | a unique integer identifying the account |
membres
and local
of the corresponding account. Returns FALSE if an error occurs. Definition at line 170 of file m_admin.php.
get_creator | ( | $uid | ) |
Returns the known information about a specific hosted account Similar to get_list() but for creators/resellers.
Definition at line 220 of file m_admin.php.
References $c, $db, $err, $key, $val, and enabled.
Referenced by get_creator_list().
get_creator_list | ( | ) |
Returns an array with the known information about resellers (uid, login, number of accounts) Does not include account 2000 in the list.
May only be called by the admin account (2000) If there are no reseller accounts, returns an empty array.
Definition at line 405 of file m_admin.php.
References $cuid, $db, $err, $mem, enabled, and get_creator().
get_list | ( | $all = 0 , |
|
$creator = 0 , |
|||
$pattern = FALSE , |
|||
$pattern_type = FALSE |
|||
) |
Returns the list of the hosted accounts.
Returns all what we know about ALL the accounts (contents of the tables membres
et local
) Check for super-admin accounts
@return | an associative array containing all the fields of the table membres and local of all the accounts. Returns FALSE if an error occurs. |
Definition at line 284 of file m_admin.php.
References $c, $creator, $cuid, $db, $err, $mem, and enabled.
get_uid_by_login | ( | $login | ) |
Definition at line 149 of file m_admin.php.
getadmin | ( | ) |
Get the login name of the main administrator account.
Definition at line 1183 of file m_admin.php.
References $db.
gettld | ( | $tld | ) |
Add a new TLD to the list of the authorized TLDs.
$tld | string top-level domain to add (org, com...) |
$mode | integer number of the authorized mode (0 to 5) |
Definition at line 1083 of file m_admin.php.
hook_admin_add_member | ( | ) |
AlternC's standard function called when a user is created This sends an email if configured through the interface.
Definition at line 588 of file m_admin.php.
References $cuid, $db, $err, and variable_get().
hook_menu | ( | ) |
Definition at line 70 of file m_admin.php.
hook_upnp_list | ( | ) |
hook function called by AlternC-upnp to know which open tcp or udp ports this class requires or suggests
Definition at line 1353 of file m_admin.php.
listPasswordPolicies | ( | ) |
List the password policies currently installed in the policy table.
Definition at line 1195 of file m_admin.php.
References $classes, $db, $hooks, and isset.
Referenced by checkPolicy().
listtld | ( | ) |
List of the authorized TLDs Returns the list of the authorized TLDs and also the way they are authorized.
A TLD is the last members (or the last two) of a domain. For example, "com", "org" etc... AlternC keeps a table containing the list of the TLDs authorized to be installed on the server with the instructions to validate the installation of a domain for each TLD (if necessary).
Definition at line 946 of file m_admin.php.
lock_mem | ( | $uid | ) |
Lock an account Lock an account and prevent the user to access its account.
$uid | integer the uid number of the account we want to lock |
Definition at line 699 of file m_admin.php.
References $db, $err, $uid, and enabled.
m_admin | ( | ) |
Constructor.
Definition at line 53 of file m_admin.php.
References $cuid, $db, enabled, and variable_get().
mailallmembers | ( | $subject, | |
$message, | |||
$from | |||
) |
Send an email to all AlternC's accounts.
$subject | string Subject of the email to send |
$message | string Message to send |
$from | string expeditor of that email. |
Definition at line 367 of file m_admin.php.
References $cuid, $db, $err, $mem, checkmail(), and enabled.
normal2su | ( | $uid | ) |
Turns a common account into a super-admin account.
$uid | integer the uid number of the common account we want to turn into a super-admin account. |
Definition at line 897 of file m_admin.php.
onesu | ( | ) |
Definition at line 265 of file m_admin.php.
References $db.
renew_get_expiring_accounts | ( | ) |
Get the expired/about to expire accounts.
Definition at line 871 of file m_admin.php.
renew_get_expiry | ( | $uid | ) |
Get the expiry date for an account.
$uid | integer The uid number of the account |
Definition at line 838 of file m_admin.php.
renew_get_status | ( | $uid | ) |
Get the expiry status for an account.
$uid | integer The uid number of the account |
Definition at line 856 of file m_admin.php.
renew_mem | ( | $uid, | |
$periods = 1 |
|||
) |
Renew an account Renew an account for its duration.
$uid | integer the uid number of the account we want to renew |
$periods | integer the number of periods we renew for |
Definition at line 793 of file m_admin.php.
renew_update | ( | $uid, | |
$duration | |||
) |
Update the duration information for an account.
$uid | integer the uid number of the account we want to update |
$duration | integer the new duration, in months, of the account |
Definition at line 816 of file m_admin.php.
Referenced by add_mem(), and update_mem().
selecttldmode | ( | $current = false | ) |
Prints the list of the actually authorized TLDs.
$current | integer Value to select in the list |
Definition at line 1098 of file m_admin.php.
References $i.
stop_if_jobs_locked | ( | ) |
Definition at line 139 of file m_admin.php.
su2normal | ( | $uid | ) |
Turns a super-admin account into a common account.
$uid | integer the uid number of the super-admin account we want to turn into a common account. |
Definition at line 919 of file m_admin.php.
unlock_mem | ( | $uid | ) |
UnLock an account UnLock an account and prevent the user to access its account.
$uid | integer the uid number of the account we want to unlock |
Definition at line 723 of file m_admin.php.
References $db, $err, $uid, and enabled.
update_mem | ( | $uid, | |
$mail, | |||
$nom, | |||
$prenom, | |||
$pass, | |||
$enabled, | |||
$canpass, | |||
$type = 'default' , |
|||
$duration = 0 , |
|||
$notes = "" , |
|||
$reset_quotas = false |
|||
) |
Edit an account.
Change an account (in the tables membres
and local
). Prevents any manipulation of the account if the account $mid is not super-admin.
$uid | integer the uid number of the account we want to modify |
login | string new login name like [a-z][a-z0-9]* |
$pass | string new password (max. 64 characters) |
$nom | string new name of the account owner |
$prenom | string new first name of the account owner |
string new email address of the account owner | |
$enabled | integer (value: 0 or 1) activates or desactivates the |
$type | string new type of account access to the virtual desktop of this account. |
Definition at line 656 of file m_admin.php.
References $cuid, $db, $err, $uid, _md5cr(), enabled, and renew_update().
$archive = '' |
Definition at line 47 of file m_admin.php.
$enabled = 0 |
$enabled tells if the logged user is super-admin or not
Definition at line 37 of file m_admin.php.
$tldmode = array() |
List of the controls made for each TLD.
$tldmode is used by the administration panel, while choosing the authorized TLDs. It's an array of strings explaining the current state of the TLD.
Definition at line 45 of file m_admin.php.