Alternc
latest
Alternc logiel libre pour l'hébergement
|
Go to the source code of this file.
Functions | |
fl ($str) | |
Format a field value for input or textarea : More... | |
checkhostallow ($domain, $dns) | |
Check if a domain can be hosted on this server : Return a negative value in case of an error, or a string for the index in $tld. More... | |
checkhostallow_nodns ($domain) | |
Check that a domain can be hosted in that server, without DNS managment. More... | |
get_remote_ip () | |
Return the remote IP. More... | |
checkurl ($url) | |
Check that $url is a correct url (http:// or https:// or ftp://) More... | |
checksubtxt ($txt) | |
Check that TXT domain is correct. More... | |
checkcname ($cname) | |
Check that CNAME domain is correct. More... | |
checkip ($ip) | |
Check that $ip is a correct 4 Dotted ip. More... | |
checkipv6 ($ip) | |
Check that $ip is a correct ipv6 ip. More... | |
checkloginmail ($mail) | |
Check a login mail, cf http://www.bortzmeyer.org/arreter-d-interdire-des-adresses-legales.html. More... | |
checkmail ($mail) | |
Check an email address, use filter_var with emails, which works great ;) More... | |
checkfqdn ($fqdn) | |
Check that a domain name is fqdn compliant. More... | |
checkuserpath ($path) | |
getuserpath ($user=null) | |
get the home of the user More... | |
cbox ($test, $echo=true) | |
ECHOes checked="checked" only if the parameter is true useful for checkboxes and radio buttons. More... | |
selected ($bool, $echo=TRUE) | |
ECHOes selected="selected" only if the parameter is true useful for checkboxes and radio buttons. More... | |
ecif ($test, $tr, $fa="", $affiche=1) | |
__ ($str) | |
ife ($test, $tr, $fa="") | |
format_size ($size, $html=0) | |
getlinkhelp ($hid) | |
linkhelp ($hid) | |
format_date ($format, $date) | |
ssla ($str) | |
Strip slashes if needed : More... | |
_md5cr ($pass, $salt="") | |
Hashe a password using proper crypto function. More... | |
split_mysql_database_name ($dbname) | |
split mysql database name between username and custom database name More... | |
xml_entities ($string) | |
Echappe les caract�res pouvant perturber un flux XML standard : More... | |
pretty_months ($months) | |
Converti un nombre de mois en une chaine plus lisible. More... | |
string $name Nom pour le composasnt | |
Fabrique un drop-down pour les dur�es de comptes @selected number Option selection�e du composant
| |
duration_list ($name, $selected=0) | |
eoption ($values, $cur, $onedim=false) | |
select_values($arr,$cur) echo des <option> du tableau $values ou de la table sql $values selectionne $current par defaut. More... | |
ehe ($str, $display=TRUE) | |
Echo the HTMLSpecialChars version of a value. More... | |
eue ($str, $display=TRUE) | |
Echo the URLENCODED version of a value. More... | |
getFields ($fields, $requestOnly=false) | |
Get the Fields of the posted form from $_REQUEST or POST or GET and check their type. More... | |
printVar ($array) | |
list_properties_order ($a, $b) | |
pager ($offset, $count, $total, $url, $before="", $after="", $echo=true) | |
Shows a pager : Previous page 0 1 2 ... More... | |
create_pass ($length=10, $classcount=3) | |
Create a password compatible with the password policy. More... | |
display_div_generate_password ($pass_size=DEFAULT_PASS_SIZE, $fields_to_fill1="", $fields_to_fill2="", $classcount=3) | |
Show a button to set a random password for a password field. More... | |
display_browser ($dir="", $caller="main.dir", $width=350, $height=450) | |
Show a button to select a folder on the server. More... | |
fHSVtoRGB ($iH, $iS, $iV) | |
hexa ($hex) | |
PercentToColor ($p=0) | |
panel_lock () | |
panel_unlock () | |
panel_islocked () | |
csrf_get ($return=false) | |
Give a new CSRF uniq token for a form the session must be up since the CSRF is linked to the session cookie. More... | |
csrf_check ($token=null) | |
Check a CSRF token against the current session a token can be only checked once, it's disabled then. More... | |
_sha512cr ($password, $salt=NULL) | |
Create a SHA512-CRYPT hash of a string. More... | |
_dovecot_hash ($password) | |
Create a password hash for use with dovecot. More... | |
add_line_to_file ($file, $line) | |
Add the line of text $line into file $file. More... | |
del_line_from_file ($file, $line) | |
Remove the line of text $line from file $file. More... | |
__ | ( | $str | ) |
string | $str |
Definition at line 404 of file functions.php.
Referenced by display_div_generate_password(), and sub_domains_edit().
_dovecot_hash | ( | $password | ) |
Create a password hash for use with dovecot.
Definition at line 1239 of file functions.php.
References $password, and _sha512cr().
Referenced by m_mail\set_passwd().
_md5cr | ( | $pass, | |
$salt = "" |
|||
) |
Hashe a password using proper crypto function.
string | $pass | a cleartext password to hash |
Definition at line 533 of file functions.php.
References $i.
Referenced by m_hta\add_user(), and m_hta\change_pass().
_sha512cr | ( | $password, | |
$salt = NULL |
|||
) |
Create a SHA512-CRYPT hash of a string.
Definition at line 1213 of file functions.php.
References $password.
Referenced by _dovecot_hash(), m_ftp\add_ftp(), and m_ftp\put_ftp_details().
add_line_to_file | ( | $file, | |
$line | |||
) |
Add the line of text $line into file $file.
do not duplicate (check)
$file | string the full path to the file where we should add the line |
$line | string the line to add (without the termination , WILL BE ADDED) |
Definition at line 1258 of file functions.php.
Referenced by m_mail\dkim_add(), and m_bind\hook_updatedomains_dns_add().
cbox | ( | $test, | |
$echo = true |
|||
) |
ECHOes checked="checked" only if the parameter is true useful for checkboxes and radio buttons.
boolean | $test | |
boolean | $echo |
Definition at line 345 of file functions.php.
Referenced by sub_domains_edit().
checkcname | ( | $cname | ) |
Check that CNAME domain is correct.
string | $cname |
Definition at line 184 of file functions.php.
References checkfqdn().
Referenced by m_dom\check_type_value().
checkfqdn | ( | $fqdn | ) |
Check that a domain name is fqdn compliant.
string | $fqdn |
Definition at line 258 of file functions.php.
Referenced by m_dom\add_domain(), checkcname(), checkurl(), m_dom\edit_domain(), m_dom\get_domain_all(), m_ssl\new_csr(), and m_dom\set_sub_domain().
checkhostallow | ( | $domain, | |
$dns | |||
) |
Check if a domain can be hosted on this server : Return a negative value in case of an error, or a string for the index in $tld.
global | string $L_NS1 | |
global | string $L_NS2 | |
global | m_mysql $db | |
global | m_dom $dom | |
string | $domain | |
array | $dns |
Definition at line 49 of file functions.php.
References $db, $dom, $domain, $found, $i, $key, and $val.
Referenced by m_dom\add_domain(), and m_dom\edit_domain().
checkhostallow_nodns | ( | $domain | ) |
Check that a domain can be hosted in that server, without DNS managment.
global | m_mysql $db | |
string | $domain |
Definition at line 103 of file functions.php.
References $db, $domain, $found, $key, and $val.
Referenced by m_dom\add_domain().
checkip | ( | $ip | ) |
Check that $ip is a correct 4 Dotted ip.
string | $ip |
Definition at line 210 of file functions.php.
Referenced by m_dom\add_slave_ip(), m_dom\check_type_value(), m_dom\del_slave_ip(), m_authip\ip_save(), and m_authip\list_ip().
checkipv6 | ( | $ip | ) |
Check that $ip is a correct ipv6 ip.
string | $ip |
Definition at line 221 of file functions.php.
Referenced by m_dom\check_type_value(), m_authip\ip_save(), and m_authip\list_ip().
checkloginmail | ( | ) |
Check a login mail, cf http://www.bortzmeyer.org/arreter-d-interdire-des-adresses-legales.html.
string |
Definition at line 233 of file functions.php.
Referenced by m_hta\add_user().
checkmail | ( | ) |
Check an email address, use filter_var with emails, which works great ;)
string |
Definition at line 244 of file functions.php.
Referenced by m_cron\_update_one(), m_admin\add_mem(), and m_admin\mailallmembers().
checksubtxt | ( | $txt | ) |
Check that TXT domain is correct.
string | $txt |
Definition at line 174 of file functions.php.
checkurl | ( | $url | ) |
Check that $url is a correct url (http:// or https:// or ftp://)
1 *
type | $url |
Definition at line 145 of file functions.php.
References $f, $t, and checkfqdn().
checkuserpath | ( | $path | ) |
global | m_mem $mem | |
string | $path |
Definition at line 297 of file functions.php.
References $mem, $user, ALTERNC_HTML, and getuserpath().
Referenced by m_dom\check_type_value().
create_pass | ( | $length = 10 , |
|
$classcount = 3 |
|||
) |
Create a password compatible with the password policy.
int | $length | |
int | $classcount |
Definition at line 879 of file functions.php.
Referenced by m_mysql\add_db(), m_mysql\alternc_add_member(), and m_piwik\user_add().
csrf_check | ( | $token = null | ) |
Check a CSRF token against the current session a token can be only checked once, it's disabled then.
$token | string the token to check in the DB + session |
Definition at line 1182 of file functions.php.
csrf_get | ( | $return = false | ) |
Give a new CSRF uniq token for a form the session must be up since the CSRF is linked to the session cookie.
We also need the $db pdo object
Definition at line 1159 of file functions.php.
References $db.
Referenced by sub_domains_edit().
del_line_from_file | ( | $file, | |
$line | |||
) |
Remove the line of text $line from file $file.
$file | string the full path to the file where we should remove the line |
$line | string the line to add (without the termination , WILL BE REMOVED) |
Definition at line 1282 of file functions.php.
Referenced by m_mail\dkim_del(), and m_bind\hook_updatedomains_dns_del().
display_browser | ( | $dir = "" , |
|
$caller = "main.dir" , |
|||
$width = 350 , |
|||
$height = 450 |
|||
) |
Show a button to select a folder on the server.
string | $dir | |
string | $caller | |
int | $width | |
int | $height |
Definition at line 941 of file functions.php.
Referenced by sub_domains_edit().
display_div_generate_password | ( | $pass_size = DEFAULT_PASS_SIZE , |
|
$fields_to_fill1 = "" , |
|||
$fields_to_fill2 = "" , |
|||
$classcount = 3 |
|||
) |
Show a button to set a random password for a password field.
int | $pass_size | size of the password |
string | $fields_to_fill1 | html field where we will put the password |
string | $fields_to_fill2 | a second (password confirmation) field where we will put the password |
Definition at line 922 of file functions.php.
duration_list | ( | $name, | |
$selected = 0 |
|||
) |
Definition at line 586 of file functions.php.
References $res, and pretty_months().
ecif | ( | $test, | |
$tr, | |||
$fa = "" , |
|||
$affiche = 1 |
|||
) |
boolean | $test | |
string | $tr | |
string | $fa | |
integer | $affiche |
Definition at line 387 of file functions.php.
ehe | ( | $str, | |
$display = TRUE |
|||
) |
Echo the HTMLSpecialChars version of a value.
(or return it if display=false Must be called when pre-filling fields values in forms such as : <input type="text" name="toto" value="<?php ehe($toto); ?>" > Use the charset of the current language for transcription
global | string $charset | |
string | $str | |
boolean | $display |
Definition at line 647 of file functions.php.
Referenced by display_browser(), and sub_domains_edit().
eoption | ( | $values, | |
$cur, | |||
$onedim = false |
|||
) |
select_values($arr,$cur) echo des <option> du tableau $values ou de la table sql $values selectionne $current par defaut.
Si on lui demande poliement, il prend un tableau a une dimension
array | $values | |
string | $cur | |
boolean | $onedim |
Definition at line 619 of file functions.php.
eue | ( | $str, | |
$display = TRUE |
|||
) |
Echo the URLENCODED version of a value.
(or return it if display=false) Must be called when pre-filling fields values in URLS such as : document.location='logs_tail.php?file=<?php eue($file); ?> Use the charset of the current language for transcription
global | string $charset | |
string | $str | |
boolean | $display |
Definition at line 670 of file functions.php.
fHSVtoRGB | ( | $iH, | |
$iS, | |||
$iV | |||
) |
Reference: http://en.wikipedia.org/wiki/HSL_and_HSV Purpose: Useful for generating colours with same hue-value for web designs. Input: Hue (H) Integer 0-360 Saturation (S) Integer 0-100 Lightness (V) Integer 0-100 Output: String "R,G,B" Suitable for CSS function RGB().
int | $iH | |
int | $iS | |
int | $iV |
Definition at line 998 of file functions.php.
Referenced by PercentToColor().
fl | ( | $str | ) |
Format a field value for input or textarea :
string | $str |
Definition at line 31 of file functions.php.
format_date | ( | $format, | |
$date | |||
) |
format_size | ( | $size, | |
$html = 0 |
|||
) |
int | string | $size | |
integer | $html |
Definition at line 430 of file functions.php.
Referenced by m_quota\display_val(), and m_quota\hook_menu().
get_remote_ip | ( | ) |
Return the remote IP.
If you are behind a proxy, use X_FORWARDED_FOR instead of REMOTE_ADDR
Definition at line 134 of file functions.php.
Referenced by m_mem\checkid(), m_messages\debug(), m_mem\del_session(), m_err\log(), m_messages\log(), m_messages\logAlternC(), m_mem\login(), m_mem\resetlast(), m_mem\setid(), and m_mem\temporary_login().
getFields | ( | $fields, | |
$requestOnly = false |
|||
) |
Get the Fields of the posted form from $_REQUEST or POST or GET and check their type.
array | $fields | |
boolean | $requestOnly |
Definition at line 688 of file functions.php.
getlinkhelp | ( | $hid | ) |
int | $hid |
Definition at line 474 of file functions.php.
Referenced by linkhelp().
getuserpath | ( | $user = null | ) |
get the home of the user
global | m_mem $mem @args string $user the username, if null will use the global $mem. no security checks performed on path |
Definition at line 329 of file functions.php.
References $mem, $user, and ALTERNC_HTML.
Referenced by m_ftp\add_ftp(), m_admin\add_mem(), m_bro\alternc_export_data(), checkuserpath(), m_admin\del_mem(), m_bro\DeleteFile(), m_bro\DownloadTBZ(), m_bro\DownloadTGZ(), m_bro\DownloadZ(), m_ftp\get_ftp_details(), m_mysql\get_mysql_details(), m_bro\get_user_root(), m_apache\hook_updatedomains_web_add(), m_ftp\is_ftp(), and m_ftp\put_ftp_details().
hexa | ( | $hex | ) |
int | $hex |
Definition at line 1085 of file functions.php.
Referenced by PercentToColor().
ife | ( | $test, | |
$tr, | |||
$fa = "" |
|||
) |
boolean | $test | |
string | $tr | |
string | $fa |
Definition at line 416 of file functions.php.
Referenced by _subbrowse(), browseforfolder(), and m_bro\viewurl().
linkhelp | ( | $hid | ) |
list_properties_order | ( | $a, | |
$b | |||
) |
pager | ( | $offset, | |
$count, | |||
$total, | |||
$url, | |||
$before = "" , |
|||
$after = "" , |
|||
$echo = true |
|||
) |
Shows a pager : Previous page 0 1 2 ...
16 17 18 19 20 ... 35 36 37 Next page
Arguments are as follow : $offset = the current offset from 0 $count = The number of elements shown per page $total = The total number of elements $url = The url to show for each page. %offset%% will be replace by the proper offset $before & $after are HTML code to show before and after the pager **only if the pager is to be shown
int | $offset | |
int | $count | |
int | $total | |
string | $url | |
string | $before | |
string | $after | |
boolean | $echo |
Definition at line 777 of file functions.php.
panel_islocked | ( | ) |
Definition at line 1149 of file functions.php.
References ALTERNC_LOCK_PANEL.
Referenced by m_mem\checkid(), m_mem\login(), and m_mem\temporary_login().
panel_lock | ( | ) |
global | m_messages $msg |
global | m_mem $mem |
global | int $cuid |
Definition at line 1120 of file functions.php.
References $cuid, and ALTERNC_LOCK_PANEL.
panel_unlock | ( | ) |
global | m_messages $msg |
global | m_mem $mem |
global | int $cuid |
Definition at line 1136 of file functions.php.
References $cuid, and ALTERNC_LOCK_PANEL.
PercentToColor | ( | $p = 0 | ) |
int | $p |
Definition at line 1096 of file functions.php.
References $p, fHSVtoRGB(), and hexa().
Referenced by m_quota\quota_displaybar().
pretty_months | ( | $months | ) |
Converti un nombre de mois en une chaine plus lisible.
integer | $months | Nombre de mois |
Definition at line 570 of file functions.php.
Referenced by duration_list().
printVar | ( | $array | ) |
array | $array |
Definition at line 737 of file functions.php.
selected | ( | $bool, | |
$echo = TRUE |
|||
) |
ECHOes selected="selected" only if the parameter is true useful for checkboxes and radio buttons.
boolean | $bool | |
boolean | $echo |
Definition at line 366 of file functions.php.
Referenced by sub_domains_edit().
split_mysql_database_name | ( | $dbname | ) |
split mysql database name between username and custom database name
string | $dbname | database name |
Definition at line 548 of file functions.php.
Referenced by m_mysql\get_dblist(), and m_mysql\get_mysql_details().
ssla | ( | $str | ) |
Strip slashes if needed :
string | $str |
Definition at line 519 of file functions.php.
Referenced by m_bro\ChangePermissions(), m_bro\CopyFile(), m_bro\CreateDir(), m_bro\CreateFile(), m_bro\DeleteFile(), m_bro\MoveFile(), and m_bro\RenameFile().
xml_entities | ( | $string | ) |
Echappe les caract�res pouvant perturber un flux XML standard :
string | $string | Chaine de caract�re � encoder en valeur xml. |
Definition at line 560 of file functions.php.
References $string.
Referenced by m_mail\alternc_export_conf().