Alternc
latest
Alternc logiel libre pour l'hébergement
|
Manage the AlternC's account administration (create/edit/delete) More...
Public Member Functions | |
__construct () | |
Constructor. More... | |
hook_menu () | |
Hook function called by the menu class to add menu to the left panel. More... | |
alternc_password_policy () | |
Password kind used in this class (hook for admin class) More... | |
stop_if_jobs_locked () | |
get_uid_by_login ($login) | |
return the uid of an alternc account More... | |
get_login_by_uid ($uid) | |
return the name of an alternc account More... | |
get ($uid, $recheck=false) | |
Returns the known information about a hosted account. More... | |
get_creator ($uid) | |
Returns the known information about a specific hosted account. More... | |
onesu () | |
get_list ($all=0, $creator=0, $pattern=FALSE, $pattern_type=FALSE) | |
@TODO :EM: those request should have been escaped Returns the list of the hosted accounts More... | |
mailallmembers ($subject, $message, $from) | |
Send an email to all AlternC's accounts. More... | |
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. More... | |
checkcreator ($uid) | |
Check if I am the creator of the member $uid. More... | |
add_shared_domain ($u, $domain_name) | |
When the admin want to delegate a subdomain to an account. More... | |
add_mem ($login, $pass, $nom, $prenom, $mail, $canpass=1, $type='default', $duration=0, $notes="", $force=0, $create_dom='', $db_server_id) | |
Creates a new hosted account. More... | |
hook_admin_add_member () | |
AlternC's standard function called when a user is created This sends an email if configured through the interface. More... | |
update_mem ($uid, $mail, $nom, $prenom, $pass, $enabled, $canpass, $type='default', $duration=0, $notes="", $reset_quotas=false) | |
Edit an account. More... | |
lock_mem ($uid) | |
Lock an account. More... | |
unlock_mem ($uid) | |
UnLock an account. More... | |
del_mem ($uid) | |
Deletes an account Deletes the specified account. More... | |
renew_mem ($uid, $periods=1) | |
Renew an account. More... | |
renew_update ($uid, $duration) | |
Update the duration information for an account. More... | |
renew_get_expiry ($uid) | |
Get the expiry date for an account. More... | |
renew_get_status ($uid) | |
Get the expiry status for an account. More... | |
renew_get_expiring_accounts () | |
Get the expired/about to expire accounts. More... | |
normal2su ($uid) | |
Turns a common account into a super-admin account. More... | |
su2normal ($uid) | |
Turns a super-admin account into a common account. More... | |
listtld () | |
List of the authorized TLDs Returns the list of the authorized TLDs and also the way they are authorized. More... | |
dom_list ($alsocheck=false, $forcecheck=false) | |
List the hosted domains on this server. More... | |
checkalldom () | |
Check all the domains for their NS MX and IPs. More... | |
dom_lock ($domain) | |
Lock / Unlock a domain. More... | |
gettld ($tld) | |
Add a new TLD to the list of the authorized TLDs. More... | |
selecttldmode ($current=false) | |
Prints the list of the actually authorized TLDs. More... | |
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. More... | |
addtld ($tld, $mode) | |
Add a TLD to the list of the authorized TLDs during the installation. More... | |
edittld ($tld, $mode) | |
Modify a TLD of the list of the authorized TLDs. More... | |
getadmin () | |
Get the login name of the main administrator account. More... | |
listPasswordPolicies () | |
List the password policies currently installed in the policy table. More... | |
editPolicy ($policy, $minsize, $maxsize, $classcount, $allowlogin) | |
Change a password policy for one kind of password. More... | |
checkPolicy ($policy, $login, $password, $canbeempty=false) | |
Public Attributes | |
$enabled = 0 | |
$enabled tells if the logged user is super-admin or not More... | |
$tldmode = array() | |
List of the controls made for each TLD. More... | |
$archive = '' | |
Manage the AlternC's account administration (create/edit/delete)
Definition at line 26 of file m_admin.php.
m_admin::__construct | ( | ) |
Constructor.
global | type $db |
global | type $cuid |
Definition at line 50 of file m_admin.php.
References $cuid, $db, enabled, and variable_get().
m_admin::add_mem | ( | $login, | |
$pass, | |||
$nom, | |||
$prenom, | |||
$mail, | |||
$canpass = 1 , |
|||
$type = 'default' , |
|||
$duration = 0 , |
|||
$notes = "" , |
|||
$force = 0 , |
|||
$create_dom = '' , |
|||
$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.
global | m_messages $msg | |
global | m_quota $quota | |
global | array $classes | |
global | int $cuid | |
global | m_mem $mem | |
global | string $L_MYSQL_DATABASE | |
global | string $L_MYSQL_LOGIN | |
global | m_hooks $hooks | |
global | m_action $action | |
string | $login | Login name like [a-z][a-z0-9]* |
string | $pass | Password (max. 64 characters) |
string | $nom | Name of the account owner |
string | $prenom | First name of the account owner |
string | Email address of the account owner, useful to get one's lost password | |
integer | $canpass | |
string | $type | Account type for quotas |
int | $duration | |
string | $notes | |
integer | $force | |
string | $create_dom | |
int | $db_server_id |
Definition at line 593 of file m_admin.php.
References $cuid, $db, $hooks, $L_MYSQL_DATABASE, $L_MYSQL_LOGIN, $login, $mem, $msg, $uid, add_shared_domain(), checkmail(), enabled, getuserpath(), and renew_update().
m_admin::add_shared_domain | ( | $u, | |
$domain_name | |||
) |
When the admin want to delegate a subdomain to an account.
global | m_mysql $db | |
global | m_messages $msg | |
global | m_dom $dom | |
global | m_mem $mem | |
global | int $cuid | |
string | $u | |
string | $domain_name |
Definition at line 531 of file m_admin.php.
References $dom, $mem, $msg, and variable_get().
Referenced by add_mem().
m_admin::addtld | ( | $tld, | |
$mode | |||
) |
Add a TLD to the list of the authorized TLDs during the installation.
Note: If you check in the whois, be sure that m_domains
knows how to name the whois of the specified domain!
global | m_mysql $db | |
global | m_messages $msg | |
string | $tld | string TLD we want to authorize |
boolean | $mode | Controls to make on this TLD. |
Definition at line 1336 of file m_admin.php.
m_admin::alternc_password_policy | ( | ) |
Password kind used in this class (hook for admin class)
Definition at line 144 of file m_admin.php.
m_admin::checkalldom | ( | ) |
Check all the domains for their NS MX and IPs.
global | m_mysql $db |
global | string $L_NS1 |
global | string $L_NS2 |
global | string $L_MX |
global | string $L_PUBLIC_IP |
Definition at line 1154 of file m_admin.php.
References $c, $d, $db, $dl, $errstr, $query, $t, and variable_get().
Referenced by dom_list().
m_admin::checkcreator | ( | $uid | ) |
Check if I am the creator of the member $uid.
global | type $msg | |
global | type $mem | |
global | type $db | |
global | type $cuid | |
int | $uid | a unique integer identifying the account |
Definition at line 504 of file m_admin.php.
m_admin::checkPolicy | ( | $policy, | |
$login, | |||
$password, | |||
$canbeempty = false |
|||
) |
global | m_mysql $db | |
global | m_messages $msg | |
string | $policy | Name of the policy to check for |
string | $login | The login that will be set |
string | $password | The password we have to check |
Definition at line 1485 of file m_admin.php.
References $i, $login, $msg, $p, $password, elseif, and listPasswordPolicies().
m_admin::del_mem | ( | $uid | ) |
Deletes an account Deletes the specified account.
Prevents any manipulation of the account if the account $mid is not super-admin.
global | m_messages $msg | |
global | m_quota $quota | |
global | array $classes | |
global | int $cuid | |
global | m_mem $mem | |
global | m_dom $dom | |
global | m_hooks $hooks | |
global | m_action $action | |
int | $uid | The uid number of the account |
Definition at line 871 of file m_admin.php.
References $db, $dom, $hooks, $mem, $msg, $uid, enabled, and getuserpath().
m_admin::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.
global | m_mysql $db | |
global | m_messages $msg | |
string | $tld | The TLD you want to delete |
Definition at line 1311 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)
global | m_mysql $db | |
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 1109 of file m_admin.php.
References $c, $db, $forcecheck, $query, checkalldom(), and variable_get().
m_admin::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
global | m_mysql $db | |
global | m_messages $msg | |
string | $domain | Domain name to lock / unlock |
Definition at line 1253 of file m_admin.php.
m_admin::editPolicy | ( | $policy, | |
$minsize, | |||
$maxsize, | |||
$classcount, | |||
$allowlogin | |||
) |
Change a password policy for one kind of password.
global | m_mysql $db | |
string | $policy | Name of the policy to edit |
int | $minsize | Minimum Password size |
int | $maxsize | Maximum Password size |
int | $classcount | How many class of characters must this password have |
boolean | $allowlogin | Do we allow the password to be like the login ? |
Definition at line 1456 of file m_admin.php.
References $db.
m_admin::edittld | ( | $tld, | |
$mode | |||
) |
Modify a TLD of the list of the authorized TLDs.
global | m_mysql $db | |
global | m_messages $msg | |
string | $tld | TLD we want to modify |
int | $mode | Controls to make on this TLD. |
Definition at line 1372 of file m_admin.php.
m_admin::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
global | type $msg | |
global | type $db | |
global | string $lst_users_properties | |
int | $uid | a unique integer identifying the account |
boolean | $recheck |
membres
and local
of the corresponding account. Returns FALSE if an error occurs. Definition at line 212 of file m_admin.php.
m_admin::get_creator | ( | $uid | ) |
Returns the known information about a specific hosted account.
Similar to get_list() but for creators/resellers.
global | type $msg | |
global | type $db | |
int | $uid |
Definition at line 268 of file m_admin.php.
References $c, $db, $key, $msg, $uid, $val, and enabled.
Referenced by get_creator_list().
m_admin::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.
global | type $msg |
global | type $mem |
global | type $cuid |
Definition at line 468 of file m_admin.php.
References $cuid, $db, $msg, enabled, and get_creator().
m_admin::get_list | ( | $all = 0 , |
|
$creator = 0 , |
|||
$pattern = FALSE , |
|||
$pattern_type = FALSE |
|||
) |
@TODO :EM: those request should have been escaped 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
Definition at line 343 of file m_admin.php.
References $c, $cuid, $db, $mem, $msg, $request, elseif, and enabled.
m_admin::get_login_by_uid | ( | $uid | ) |
return the name of an alternc account
global | type $db | |
type | $uid |
Definition at line 186 of file m_admin.php.
m_admin::get_uid_by_login | ( | $login | ) |
return the uid of an alternc account
global | type $db | |
type | $login |
Definition at line 169 of file m_admin.php.
m_admin::getadmin | ( | ) |
Get the login name of the main administrator account.
global | m_mysql $db |
Definition at line 1394 of file m_admin.php.
References $db.
m_admin::gettld | ( | $tld | ) |
Add a new TLD to the list of the authorized TLDs.
global | m_mysql $db | |
global | m_messages $msg | |
string | $tld | top-level domain to add (org, com...) |
Definition at line 1273 of file m_admin.php.
m_admin::hook_admin_add_member | ( | ) |
AlternC's standard function called when a user is created This sends an email if configured through the interface.
global | m_messages $msg |
global | int $cuid |
global | string $L_FQDN |
global | string $L_HOSTING |
Definition at line 688 of file m_admin.php.
References $cuid, $db, $msg, and variable_get().
m_admin::hook_menu | ( | ) |
Hook function called by the menu class to add menu to the left panel.
global | type $mem |
global | type $cuid |
global | type $debug_alternc |
global | type $L_INOTIFY_UPDATE_DOMAIN |
Definition at line 76 of file m_admin.php.
m_admin::listPasswordPolicies | ( | ) |
List the password policies currently installed in the policy table.
Definition at line 1410 of file m_admin.php.
Referenced by checkPolicy().
m_admin::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).
global | m_mysql $db |
Definition at line 1088 of file m_admin.php.
m_admin::lock_mem | ( | $uid | ) |
Lock an account.
Lock an account and prevent the user to access its account.
global | m_messages $msg | |
global | m_mysql $db | |
int | $uid | The uid number of the account |
Definition at line 811 of file m_admin.php.
m_admin::mailallmembers | ( | $subject, | |
$message, | |||
$from | |||
) |
Send an email to all AlternC's accounts.
global | type $msg | |
global | type $mem | |
global | type $cuid | |
global | type $db | |
string | $subject | Subject of the email to send |
string | $message | Message to send |
string | $from | Expeditor of that email |
Definition at line 425 of file m_admin.php.
References $db, $msg, checkmail(), and enabled.
m_admin::normal2su | ( | $uid | ) |
Turns a common account into a super-admin account.
global | m_messages $msg | |
global | m_mysql $db | |
int | $uid | The uid number of the account |
Definition at line 1035 of file m_admin.php.
m_admin::onesu | ( | ) |
global | type $db |
Definition at line 314 of file m_admin.php.
References $db.
m_admin::renew_get_expiring_accounts | ( | ) |
Get the expired/about to expire accounts.
global | m_mysql $db |
Definition at line 1006 of file m_admin.php.
m_admin::renew_get_expiry | ( | $uid | ) |
Get the expiry date for an account.
int | $uid | The uid number of the account |
Definition at line 970 of file m_admin.php.
References $uid.
m_admin::renew_get_status | ( | $uid | ) |
Get the expiry status for an account.
int | $uid | The uid number of the account |
Definition at line 989 of file m_admin.php.
References $uid.
m_admin::renew_mem | ( | $uid, | |
$periods = 1 |
|||
) |
Renew an account.
Renew an account for its duration
global | m_messages $msg | |
global | m_mysql $db | |
int | $uid | The uid number of the account |
int | $periods | The new duration, in months, of the account |
Definition at line 920 of file m_admin.php.
m_admin::renew_update | ( | $uid, | |
$duration | |||
) |
Update the duration information for an account.
global | m_messages $msg | |
global | m_mysql $db | |
int | $uid | The uid number of the account |
int | $duration | The new duration, in months, of the account |
Definition at line 945 of file m_admin.php.
References $db, $msg, and $uid.
Referenced by add_mem(), and update_mem().
m_admin::selecttldmode | ( | $current = false | ) |
Prints the list of the actually authorized TLDs.
boolean | $current | Value to select in the list |
Definition at line 1289 of file m_admin.php.
References $i.
m_admin::stop_if_jobs_locked | ( | ) |
Definition at line 152 of file m_admin.php.
m_admin::su2normal | ( | $uid | ) |
Turns a super-admin account into a common account.
global | m_messages $msg | |
global | m_mysql $db | |
int | $uid | The uid number of the account |
Definition at line 1059 of file m_admin.php.
m_admin::unlock_mem | ( | $uid | ) |
UnLock an account.
UnLock an account and prevent the user to access its account.
global | m_messages $msg | |
global | m_mysql $db | |
int | $uid | The uid number of the account |
Definition at line 839 of file m_admin.php.
m_admin::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.
global | m_messages $msg | |
global | m_mysql $db | |
global | int $cuid | |
global | m_quota $quota | |
int | $uid | The uid number of the account we want to modify |
string | New email address of the account owner | |
string | $nom | New name of the account owner |
string | $prenom | New first name of the account owner |
string | $pass | New password (max. 64 characters) |
string | $enabled | (value: 0 or 1) activates or desactivates the |
boolean | $canpass | |
int | $type | New type of account |
int | $duration | |
string | $notes | |
boolean | $reset_quotas |
Definition at line 762 of file m_admin.php.
References $db, $enabled, $msg, $uid, enabled, and renew_update().
m_admin::$archive = '' |
Definition at line 41 of file m_admin.php.
m_admin::$enabled = 0 |
$enabled tells if the logged user is super-admin or not
Definition at line 32 of file m_admin.php.
Referenced by update_mem().
m_admin::$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 40 of file m_admin.php.