Alternc  latest
Alternc logiel libre pour l'hébergement
functions.php File Reference

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

Returns
string Code html pour le drop-down @access private
 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...
 

Function Documentation

◆ __()

__ (   $str)
Parameters
string$str

Definition at line 404 of file functions.php.

404  {
405  echo _($str);
406 }

Referenced by display_div_generate_password(), and sub_domains_edit().

◆ _dovecot_hash()

_dovecot_hash (   $password)

Create a password hash for use with dovecot.

Definition at line 1239 of file functions.php.

1239  {
1240  // In any case the final password saved for dovecot can store the
1241  // scheme to override the default on a per-account basis.
1242  // Ideally this is updated to bcrypt or argon2 when those become
1243  // available in dovecot.
1244  // @see https://wiki.dovecot.org/Authentication/PasswordSchemes
1245  $hash = _sha512cr($password);
1246  return '{SHA512-CRYPT}' . $hash;
1247 }
_sha512cr($password, $salt=NULL)
Create a SHA512-CRYPT hash of a string.
Definition: functions.php:1213
$password
Definition: bootstrap.php:85

References $password, and _sha512cr().

Referenced by m_mail\set_passwd().

◆ _md5cr()

_md5cr (   $pass,
  $salt = "" 
)

Hashe a password using proper crypto function.

Parameters
string$passa cleartext password to hash
Returns
string the hash @access private

Definition at line 533 of file functions.php.

533  {
534  if (!$salt) {
535  $chars = "./0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
536  for ($i = 0; $i < 12; $i++) {
537  $salt.=substr($chars, (mt_rand(0, strlen($chars))), 1);
538  }
539  $salt = "$1$" . $salt;
540  }
541  return crypt($pass, $salt);
542 }
$i

References $i.

Referenced by m_hta\add_user(), and m_hta\change_pass().

◆ _sha512cr()

_sha512cr (   $password,
  $salt = NULL 
)

Create a SHA512-CRYPT hash of a string.

Definition at line 1213 of file functions.php.

1213  {
1214  if (!$salt) {
1215  // Aim to have a 16 character salt for SHA-512 crypt.
1216  // @see https://secure.php.net/manual/en/function.crypt.php
1217  if (function_exists('random_bytes')) {
1218  // PHP >= 7.0
1219  $salt = base64_encode(random_bytes(12));
1220  }
1221  else if (function_exists('mcrypt_create_iv')) {
1222  $salt = base64_encode(mcrypt_create_iv(12, MCRYPT_DEV_URANDOM));
1223  }
1224  else if (function_exists('openssl_random_pseudo_bytes')) {
1225  $salt = base64_encode(openssl_random_pseudo_bytes(12));
1226  }
1227  if (!$salt) {
1228  throw Exception('Unable to generate salt');
1229  }
1230  }
1231  $salt = '$6$rounds=20000$' . $salt;
1232  $hash = crypt($password, $salt);
1233  return $hash;
1234 }

References $password.

Referenced by _dovecot_hash(), m_ftp\add_ftp(), and m_ftp\put_ftp_details().

◆ add_line_to_file()

add_line_to_file (   $file,
  $line 
)

Add the line of text $line into file $file.

do not duplicate (check)

Parameters
$filestring the full path to the file where we should add the line
$linestring the line to add (without the termination
, WILL BE ADDED)
Returns
boolean TRUE if the line has been added, or FALSE if the line ALREADY EXISTED

Definition at line 1258 of file functions.php.

1258  {
1259  $f=fopen($file,"rb");
1260  $found=false;
1261  while($s=fgets($f,1024)) {
1262  if (trim($s)==$line) {
1263  $found=true;
1264  return false;
1265  }
1266  }
1267  fclose($f);
1268  $f=fopen($file,"ab");
1269  fputs($f,trim($line)."\n");
1270  fclose($f);
1271  return true;
1272 }
$found
Definition: aws_del.php:29

References $f, and $found.

Referenced by m_mail\dkim_add(), and m_bind\hook_updatedomains_dns_add().

◆ cbox()

cbox (   $test,
  $echo = true 
)

ECHOes checked="checked" only if the parameter is true useful for checkboxes and radio buttons.

Parameters
boolean$test
boolean$echo

Definition at line 345 of file functions.php.

345  {
346  if ($test) {
347  $return = " checked=\"checked\"";
348  } else {
349  $return = '';
350  }
351  if ($echo) {
352  echo $return;
353  }
354  return $return;
355 }

Referenced by sub_domains_edit().

◆ checkcname()

checkcname (   $cname)

Check that CNAME domain is correct.

Parameters
string$cname
Returns
boolean

Definition at line 184 of file functions.php.

184  {
185  if (($check = checkfqdn(rtrim($cname, ".")))) {
186  if ($check != 4) { // ALLOW non-fully qualified (no .)
187  return false; // bad FQDN
188  }
189  }
190  if (substr($cname, -1) != ".") {
191  // Not fully qualified :
192  if (strpos($cname, ".") === false) {
193  // NO DOT in the middle, no DOT elsewhere => seems fine
194  return true;
195  } else {
196  // NO DOT at the end, but A DOT ELSEWHERE => seems broken (please use fully qualified)
197  return false;
198  }
199  }
200  // fully qualified => fine
201  return true;
202 }
checkfqdn($fqdn)
Check that a domain name is fqdn compliant.
Definition: functions.php:258

References checkfqdn().

Referenced by m_dom\check_type_value().

◆ checkfqdn()

checkfqdn (   $fqdn)

Check that a domain name is fqdn compliant.

Parameters
string$fqdn
Returns
int

Definition at line 258 of file functions.php.

258  {
259  // (RFC 1035 http://www.ietf.org/rfc/rfc1035.txt)
260  // Retourne 0 si tout va bien, sinon, retourne un code erreur...
261  // 1. Nom de domaine complet trop long.
262  // 2. L'un des membres est trop long.
263  // 3. Caractere interdit dans l'un des membres.
264  // 4. Le fqdn ne fait qu'un seul membre (il n'est donc pas fq...)
265  if (strlen($fqdn) > 255) {
266  return 1;
267  }
268  $members = explode(".", $fqdn);
269  if (count($members) > 1) {
270  $ret = 0;
271  } else {
272  $ret = 4;
273  }
274  reset($members);
275  while (list ($key, $val) = each($members)) {
276  if (strlen($val) > 63) {
277  return 2;
278  }
279  // Note: a.foo.net is a valid domain
280  // Note: RFC1035 tells us that a domain should not start by a digit, but every registrar allows such a domain to be created ... too bad.
281  if (!preg_match("#^[a-z0-9_]([a-z0-9-]*[a-z0-9])?$#i", $val)) {
282  return 3;
283  }
284  }
285  return $ret;
286 }
$val
Definition: tempovars.php:15
if(empty($_POST['key'])||empty($_POST['val'])) $key
Definition: tempovars.php:14

References $key, and $val.

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()

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.

Parameters
globalstring $L_NS1
globalstring $L_NS2
globalm_mysql $db
globalm_dom $dom
string$domain
array$dns
Returns
int

Definition at line 49 of file functions.php.

49  {
50  global $L_NS1, $L_NS2, $db, $dom;
51  $sizefound = 0;
52  $found = "";
53  $db->query("SELECT tld,mode FROM tld;");
54  while ($db->next_record()) {
55  list($key, $val) = $db->Record;
56  if (substr($domain, -1 - strlen($key)) == "." . $key) {
57  if ($sizefound < strlen($key)) {
58  $sizefound = strlen($key);
59  $found = $key;
60  $fmode = $val;
61  }
62  }
63  }
64  if ($dom->tld_no_check_at_all) {
65  return 0; // OK , the boss say that you can.
66  }
67  if (!$found || $fmode == 0) { // TLD not allowed at all
68  return -1;
69  }
70  if (($fmode != 4) && (!is_array($dns))) { // NO dns found in the whois, and domain MUST exists
71  return -2;
72  }
73  if ($fmode > 2) { // OK, in the case 3 4 5
74  return $found;
75  }
76  $n1 = false;
77  $n2 = false;
78  for ($i = 0; $i < count($dns); $i++) {
79  if (strtolower($dns[$i]) == strtolower($L_NS1)) {
80  $n1 = true;
81  }
82  if (strtolower($dns[$i]) == strtolower($L_NS2)) {
83  $n2 = true;
84  }
85  }
86  if ($fmode == 1 && $n1) {
87  return $found;
88  }
89  if ($fmode == 2 && $n1 && $n2) {
90  return $found;
91  }
92  return -3; // DNS incorrect in the whois
93 }
global $db
Definition: bootstrap.php:26
$domain
Definition: dom_import.php:36
$dom
Definition: whois_test.php:10

References $db, $dom, $domain, $found, $i, $key, and $val.

Referenced by m_dom\add_domain(), and m_dom\edit_domain().

◆ checkhostallow_nodns()

checkhostallow_nodns (   $domain)

Check that a domain can be hosted in that server, without DNS managment.

Parameters
globalm_mysql $db
string$domain
Returns
int

Definition at line 103 of file functions.php.

103  {
104  global $db;
105  $sizefound = 0;
106  $found = "";
107  $db->query("SELECT tld,mode FROM tld;");
108  while ($db->next_record()) {
109  list($key, $val) = $db->Record;
110  if (substr($domain, -1 - strlen($key)) == "." . $key) {
111  if ($sizefound < strlen($key)) {
112  $sizefound = strlen($key);
113  $found = $key;
114  $fmode = $val;
115  }
116  }
117  }
118  // If we found a correct tld, let's find how many . before ;)
119  if (!$found || $fmode == 0) { // TLD not allowed at all
120  return 1;
121  }
122  if (count(explode(".", substr($domain, 0, -$sizefound))) > 2) {
123  return 1;
124  }
125  return 0;
126 }

References $db, $domain, $found, $key, and $val.

Referenced by m_dom\add_domain().

◆ checkip()

checkip (   $ip)

Check that $ip is a correct 4 Dotted ip.

Parameters
string$ip
Returns
type

Definition at line 210 of file functions.php.

210  {
211  // return true or false whether the ip is correctly formatted
212  return filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4);
213 }

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()

checkipv6 (   $ip)

Check that $ip is a correct ipv6 ip.

Parameters
string$ip
Returns
type

Definition at line 221 of file functions.php.

221  {
222  // return true or false whether the ip is correctly formatted
223  return filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);
224 }

Referenced by m_dom\check_type_value(), m_authip\ip_save(), and m_authip\list_ip().

◆ checkloginmail()

checkloginmail (   $mail)

Check a login mail, cf http://www.bortzmeyer.org/arreter-d-interdire-des-adresses-legales.html.

Todo:
Check who is using that function and delete it when unused
Parameters
string$mail
Returns
boolean

Definition at line 233 of file functions.php.

233  {
234  return true;
235 }

Referenced by m_hta\add_user().

◆ checkmail()

checkmail (   $mail)

Check an email address, use filter_var with emails, which works great ;)

Todo:
check who is using that function and delete it when unused
Parameters
string$mail
Returns
boolean

Definition at line 244 of file functions.php.

244  {
245  if (filter_var($mail, FILTER_VALIDATE_EMAIL)) {
246  return FALSE;
247  } else {
248  return TRUE;
249  }
250 }

Referenced by m_cron\_update_one(), m_admin\add_mem(), and m_admin\mailallmembers().

◆ checksubtxt()

checksubtxt (   $txt)

Check that TXT domain is correct.

Parameters
string$txt
Returns
boolean

Definition at line 174 of file functions.php.

174  {
175  return true;
176 }

◆ checkurl()

checkurl (   $url)

Check that $url is a correct url (http:// or https:// or ftp://)

1 *

Parameters
type$url
Returns
boolean

Definition at line 145 of file functions.php.

145  {
146  // TODO : add a path/file check
147  if (substr($url, 0, 7) != "http://" && substr($url, 0, 8) != "https://" && substr($url, 0, 6) != "ftp://") {
148  return false;
149  }
150  if (substr($url, 0, 7) == "http://") {
151  $fq = substr($url, 7);
152  }
153  if (substr($url, 0, 8) == "https://") {
154  $fq = substr($url, 8);
155  }
156  if (substr($url, 0, 6) == "ftp://") {
157  $fq = substr($url, 6);
158  }
159  $f = explode("/", $fq);
160  if (!is_array($f)) {
161  $f = array($f);
162  }
163  $t = checkfqdn($f[0]);
164  return !$t;
165 }
foreach($domaines_user as $domaine) $t

References $f, $t, and checkfqdn().

◆ checkuserpath()

checkuserpath (   $path)
Parameters
globalm_mem $mem
string$path
Returns
int return 0 if the path is not in the user's space return 1 if this is a directory return 2 if this is a regular file

Definition at line 297 of file functions.php.

297  {
298  global $mem;
299  $user = $mem->user["login"];
300  $usar = substr($user, 0, 1);
301  if (substr($path, 0, 1) != "/") {
302  $path = "/" . $path;
303  }
304  $rpath = realpath(ALTERNC_HTML . "/$usar/$user$path");
305  if (!$rpath) { // if file or directory does not exist
306  return 1; // FIXME is it safe to say OK in this case ?
307  }
308  $userpath = getuserpath();
309  if (strpos($rpath, $userpath) === 0) {
310  if (is_dir(ALTERNC_HTML . "/$usar/$user$path")) {
311  return 1;
312  }
313  if (is_file(ALTERNC_HTML . "/$usar/$user$path")) {
314  return 2;
315  }
316  }
317  return 0;
318 }
$mem
Definition: bootstrap.php:71
const ALTERNC_HTML
Definition: bootstrap.php:10
getuserpath($user=null)
get the home of the user
Definition: functions.php:329
$user
Definition: bootstrap.php:84

References $mem, $user, ALTERNC_HTML, and getuserpath().

Referenced by m_dom\check_type_value().

◆ create_pass()

create_pass (   $length = 10,
  $classcount = 3 
)

Create a password compatible with the password policy.

Parameters
int$length
int$classcount
Returns
string a random password

Definition at line 879 of file functions.php.

879  {
880  $sets = array();
881 
882  // Use up to 4 character classes, 3 by default.
883  if ($classcount < 4)
884  $available_sets='lud';
885  else
886  $available_sets='luds';
887 
888  if(strpos($available_sets, 'l') !== false)
889  $sets[] = 'abcdefghijklmnopqrstuvwxyz';
890  if(strpos($available_sets, 'u') !== false)
891  $sets[] = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
892  if(strpos($available_sets, 'd') !== false)
893  $sets[] = '0123456789';
894  if(strpos($available_sets, 's') !== false)
895  $sets[] = '(!#$%)*+,-./:;<=>?@[\]^_';
896 
897  $all = '';
898  $password = '';
899  foreach($sets as $set) {
900  $password .= $set[array_rand(str_split($set))];
901  $all .= $set;
902  }
903 
904  $all = str_split($all);
905  for($i = 0; $i < $length - count($sets); $i++)
906  $password .= $all[array_rand($all)];
907 
908  $password = str_shuffle($password);
909 
910  return $password;
911 }

References $i, and $password.

Referenced by m_mysql\add_db(), m_mysql\alternc_add_member(), and m_piwik\user_add().

◆ csrf_check()

csrf_check (   $token = null)

Check a CSRF token against the current session a token can be only checked once, it's disabled then.

Parameters
$tokenstring the token to check in the DB + session
Returns
$result integer 0 for invalid token, 1 for good token, -1 for expired token (already used) if a token is invalid or expired, an $msg is raised, that can be displayed

Definition at line 1182 of file functions.php.

1182  {
1183  global $db,$msg;
1184 
1185  if (is_null($token)) $token=$_POST["csrf"];
1186 
1187  if (!isset($_SESSION["csrf"])) {
1188  $msg->raise("ERROR", "functions", _("The posted form token is incorrect. Maybe you need to allow cookies"));
1189  return 0; // no csrf cookie :/
1190  }
1191  if (strlen($token)!=32 || strlen($_SESSION["csrf"])!=32) {
1192  unset($_SESSION["csrf"]);
1193  $msg->raise("ERROR", "functions", _("Your cookie or token is invalid"));
1194  return 0; // invalid csrf cookie
1195  }
1196  $db->query("SELECT used FROM csrf WHERE cookie=? AND token=?;",array($_SESSION["csrf"],$token));
1197  if (!$db->next_record()) {
1198  $msg->raise("ERROR", "functions", _("You can't post twice the same form, please retry."));
1199  return 0; // invalid csrf cookie
1200  }
1201  if ($db->f("used")) {
1202  $msg->raise("ERROR", "functions", _("You can't post twice the same form, please retry."));
1203  return -1; // expired
1204  }
1205  $db->query("UPDATE csrf SET used=1 WHERE cookie=? AND token=?;",array($_SESSION["csrf"],$token));
1206  $db->exec("DELETE FROM csrf WHERE created<DATE_SUB(NOW(), INTERVAL 1 DAY);");
1207  return 1;
1208 }
$msg
Definition: bootstrap.php:75

References $db, and $msg.

◆ csrf_get()

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

Returns
the csrf cookie to add into a csrf hidden field in your form

Definition at line 1159 of file functions.php.

1159  {
1160  global $db;
1161  static $token="";
1162  if (!isset($_SESSION["csrf"])) {
1163  $_SESSION["csrf"]=md5(mt_rand().mt_rand().mt_rand());
1164  }
1165  if ($token=="") {
1166  $token=md5(mt_rand().mt_rand().mt_rand());
1167  $db->query("INSERT INTO csrf SET cookie=?, token=?, created=NOW(), used=0;",array($_SESSION["csrf"],$token));
1168  }
1169  if ($return)
1170  return $token;
1171  echo '<input type="hidden" name="csrf" value="'.$token.'" />';
1172  return true;
1173 }

References $db.

Referenced by sub_domains_edit().

◆ del_line_from_file()

del_line_from_file (   $file,
  $line 
)

Remove the line of text $line from file $file.

Parameters
$filestring the full path to the file where we should remove the line
$linestring the line to add (without the termination
, WILL BE REMOVED)
Returns
boolean TRUE if the line has been found and removed, or FALSE if the line DIDN'T EXIST

Definition at line 1282 of file functions.php.

1282  {
1283  $f=fopen($file,"rb");
1284  $g=fopen($file.".new","wb");
1285  $found=false;
1286  while($s=fgets($f,1024)) {
1287  if (trim($s)!=$line) {
1288  fputs($g,$s);
1289  } else {
1290  $found=true;
1291  }
1292  }
1293  fclose($f);
1294  fclose($g);
1295  rename($file.".new",$file); // overwrite atomically
1296  return $found;
1297 }

References $f, and $found.

Referenced by m_mail\dkim_del(), and m_bind\hook_updatedomains_dns_del().

◆ display_browser()

display_browser (   $dir = "",
  $caller = "main.dir",
  $width = 350,
  $height = 450 
)

Show a button to select a folder on the server.

Parameters
string$dir
string$caller
int$width
int$height

Definition at line 941 of file functions.php.

941  {
942  // Browser id
943  static $id=0;
944  $id++;
945  $bid = "b" . $id;
946  echo "<script type=\"text/javascript\">
947  <!--
948  $(function() {
949  $( \"#" . $bid . "\" ).dialog({
950  autoOpen: false,
951  width: " . $width . ",
952  height: " . $height . ",
953  modal: true,
954  open: function()
955  {
956  $('.ui-widget-overlay').css('opacity', .70);
957  $('.ui-dialog-content').css('background-color', '#F0F0FA');
958  },
959  });
960 
961  $( \"#bt" . $bid . "\" )
962  .button()
963  .attr(\"class\", \"ina\")
964  .click(function() {
965  $( \"#" . $bid . "\" ).dialog( \"open\" );
966  return false;
967  });
968  });
969 
970 
971  document.write('&nbsp;<input type=\"button\" id=\"bt" . $bid . "\" value=\"" . _("Choose a folder...") . "\" class=\"ina\">');
972  document.write('<div id=\"" . $bid . "\" title=\"" . _("Choose a folder...") . "\" style=\"display: none; bgcolor:red;\">');
973  document.write(' <iframe src=\"/browseforfolder2.php?caller=" . $caller . "&amp;file=" . ehe($dir, false) . "&amp;bid=" . $bid . "\" width=\"" . ($width - 40) . "\" height=\"" . ($height - 64) . "\" frameborder=\"no\" id=\"browseiframe\"></iframe>');
974  document.write('</div>');
975  // -->
976  </script>
977  ";
978 }
ehe($str, $display=TRUE)
Echo the HTMLSpecialChars version of a value.
Definition: functions.php:647
if(!isset($is_include)) if(! $key &&! $crt) $id

References $id, and ehe().

Referenced by sub_domains_edit().

◆ display_div_generate_password()

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.

Parameters
int$pass_sizesize of the password
string$fields_to_fill1html field where we will put the password
string$fields_to_fill2a second (password confirmation) field where we will put the password
Returns
int

Definition at line 922 of file functions.php.

922  {
923  static $id=1;
924  echo "<div id='z$id' style='display:none;'><a href=\"javascript:generate_password_html('$id',$pass_size,'$fields_to_fill1','$fields_to_fill2',$classcount);\">";
925  __("Click here to generate a password");
926  echo "</a></div>";
927  echo "<script type='text/javascript'>$('#z$id').show();</script>";
928  $id++;
929  return 0;
930 }
__($str)
Definition: functions.php:404

References $id, and __().

◆ duration_list()

duration_list (   $name,
  $selected = 0 
)

Definition at line 586 of file functions.php.

586  {
587  $res = "<select name=\"$name\" id=\"$name\" class=\"inl\">";
588 
589  foreach (array(0, 1, 2, 3, 4, 6, 12, 24) as $dur) {
590  $res .= "<option value=\"$dur\"";
591  if ($selected == $dur) {
592  $res .= ' selected="selected" ';
593  }
594 
595  $res .= '>';
596 
597  if ($dur == 0) {
598  $res .= _('Not managed');
599  } else {
600  $res .= pretty_months($dur);
601  }
602  $res .= '</option>';
603  }
604 
605  $res .= '</select>';
606  return $res;
607 }
$res
Definition: index.php:111
pretty_months($months)
Converti un nombre de mois en une chaine plus lisible.
Definition: functions.php:570

References $res, and pretty_months().

◆ ecif()

ecif (   $test,
  $tr,
  $fa = "",
  $affiche = 1 
)
Parameters
boolean$test
string$tr
string$fa
integer$affiche
Returns
string

Definition at line 387 of file functions.php.

387  {
388  if ($test) {
389  $retour = $tr;
390  } else {
391  $retour = $fa;
392  }
393  if ($affiche) {
394  echo $retour;
395  }
396  return $retour;
397 }

◆ ehe()

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

Parameters
globalstring $charset
string$str
boolean$display
Returns
string

Definition at line 647 of file functions.php.

647  {
648  global $charset;
649  $quoted = htmlspecialchars($str, ENT_QUOTES|ENT_SUBSTITUTE, $charset);
650  if ($display) {
651  echo $quoted;
652  }
653  return $quoted;
654 }

Referenced by display_browser(), and sub_domains_edit().

◆ eoption()

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

Parameters
array$values
string$cur
boolean$onedim

Definition at line 619 of file functions.php.

619  {
620  if (is_array($values)) {
621  foreach ($values as $k => $v) {
622  if ($onedim) {
623  $k = $v;
624  }
625  echo "<option value=\"$k\"";
626  if ($k == $cur) {
627  echo " selected=\"selected\"";
628  }
629  echo ">" . $v . "</option>";
630  }
631  }
632 }

◆ eue()

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

Parameters
globalstring $charset
string$str
boolean$display
Returns
string

Definition at line 670 of file functions.php.

670  {
671  global $charset;
672  $quoted = urlencode($str);
673  if ($display) {
674  echo $quoted;
675  }
676  return $quoted;
677 }

◆ fHSVtoRGB()

fHSVtoRGB (   $iH,
  $iS,
  $iV 
)

Converts HSV to RGB values

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().

Parameters
int$iH
int$iS
int$iV
Returns
array

Definition at line 998 of file functions.php.

998  {
999 
1000  if ($iH < 0) {
1001  $iH = 0; // Hue:
1002  }
1003  if ($iH > 360) {
1004  $iH = 360; // 0-360
1005  }
1006  if ($iS < 0) {
1007  $iS = 0; // Saturation:
1008  }
1009  if ($iS > 100) {
1010  $iS = 100; // 0-100
1011  }
1012  if ($iV < 0) {
1013  $iV = 0; // Lightness:
1014  }
1015  if ($iV > 100) {
1016  $iV = 100; // 0-100
1017  }
1018 
1019  $dS = $iS / 100.0; // Saturation: 0.0-1.0
1020  $dV = $iV / 100.0; // Lightness: 0.0-1.0
1021  $dC = $dV * $dS; // Chroma: 0.0-1.0
1022  $dH = $iH / 60.0; // H-Prime: 0.0-6.0
1023  $dT = $dH; // Temp variable
1024 
1025  while ($dT >= 2.0) {
1026  $dT -= 2.0; // php modulus does not work with float
1027  }
1028  $dX = $dC * (1 - abs($dT - 1)); // as used in the Wikipedia link
1029 
1030  switch ($dH) {
1031  case($dH >= 0.0 && $dH < 1.0):
1032  $dR = $dC;
1033  $dG = $dX;
1034  $dB = 0.0;
1035  break;
1036  case($dH >= 1.0 && $dH < 2.0):
1037  $dR = $dX;
1038  $dG = $dC;
1039  $dB = 0.0;
1040  break;
1041  case($dH >= 2.0 && $dH < 3.0):
1042  $dR = 0.0;
1043  $dG = $dC;
1044  $dB = $dX;
1045  break;
1046  case($dH >= 3.0 && $dH < 4.0):
1047  $dR = 0.0;
1048  $dG = $dX;
1049  $dB = $dC;
1050  break;
1051  case($dH >= 4.0 && $dH < 5.0):
1052  $dR = $dX;
1053  $dG = 0.0;
1054  $dB = $dC;
1055  break;
1056  case($dH >= 5.0 && $dH < 6.0):
1057  $dR = $dC;
1058  $dG = 0.0;
1059  $dB = $dX;
1060  break;
1061  default:
1062  $dR = 0.0;
1063  $dG = 0.0;
1064  $dB = 0.0;
1065  break;
1066  }
1067 
1068  $dM = $dV - $dC;
1069  $dR += $dM;
1070  $dG += $dM;
1071  $dB += $dM;
1072  $dR *= 255;
1073  $dG *= 255;
1074  $dB *= 255;
1075 
1076  return array('r' => round($dR), 'g' => round($dG), 'b' => round($dB));
1077 }

Referenced by PercentToColor().

◆ fl()

fl (   $str)

Format a field value for input or textarea :

Parameters
string$str
Returns
string

Definition at line 31 of file functions.php.

31  {
32  return str_replace("<", "&lt;", str_replace("\"", "&quot;", $str));
33 }

◆ format_date()

format_date (   $format,
  $date 
)
Parameters
string$format
string$date
Returns
string

Definition at line 494 of file functions.php.

494  {
495  $d = substr($date, 8, 2);
496  $m = substr($date, 5, 2);
497  $y = substr($date, 0, 4);
498  $h = substr($date, 11, 2);
499  $i = substr($date, 14, 2);
500  if ($h > 12) {
501  $hh = $h - 12;
502  $am = "pm";
503  } else {
504  $hh = $h;
505  $am = "am";
506  }
507 
508  // we want every number to be treated as a string.
509  $format=str_replace('$d', '$s', $format);
510  return sprintf($format, $d, $m, $y, $h, $i, $hh, $am);
511 }
$d

References $d, and $i.

◆ format_size()

format_size (   $size,
  $html = 0 
)
Parameters
int | string$size
integer$html
Returns
string

Definition at line 430 of file functions.php.

430  {
431  // Retourne une taille formatt�e en Octets, Kilo-octets, M�ga-octets ou Giga-Octets, avec 2 d�cimales.
432  if ("-" == $size) {
433  return $size;
434  }
435  $size = (float) $size;
436  if ($size < 1024) {
437  $r = $size;
438  if ($size != 1) {
439  $r.=" " . _("Bytes");
440  } else {
441  $r.=" " . _("Byte");
442  }
443  } else {
444  $size = $size / 1024;
445  if ($size < 1024) {
446  $r = round($size, 2) . " " . _("Kb");
447  } else {
448  $size = $size / 1024;
449  if ($size < 1024) {
450  $r = round($size, 2) . " " . _("Mb");
451  } else {
452  $size = $size / 1024;
453  if ($size < 1024) {
454  $r = round($size, 2) . " " . _("Gb");
455  } else {
456  $r = round($size / 1024, 2) . " " . _("Tb");
457  }
458  }
459  }
460  }
461  if ($html) {
462  return str_replace(" ", "&nbsp;", $r);
463  } else {
464  return $r;
465  }
466 }
$r
Definition: aws_add.php:75
$html
Definition: mail_edit.php:117

References $html, and $r.

Referenced by m_quota\display_val(), and m_quota\hook_menu().

◆ get_remote_ip()

get_remote_ip ( )

Return the remote IP.

If you are behind a proxy, use X_FORWARDED_FOR instead of REMOTE_ADDR

Returns
string

Definition at line 134 of file functions.php.

134  {
135  return getenv('REMOTE_ADDR');
136 }

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()

getFields (   $fields,
  $requestOnly = false 
)

Get the Fields of the posted form from $_REQUEST or POST or GET and check their type.

Parameters
array$fields
boolean$requestOnly
Returns
array

Definition at line 688 of file functions.php.

688  {
689  $vars = array();
690  $methodType = array("get", "post", "request", "files", "server");
691 
692  foreach ($fields AS $name => $options) {
693  if (in_array(strtolower($options[0]), $methodType) === false) {
694  die("Unrecognized method type used for field " . $name . " : " . $options[0]);
695  }
696  if ($requestOnly === true) {
697  $method = "_REQUEST";
698  } else {
699  $method = "_" . strtoupper($options[0]);
700  }
701  switch ($options[1]) {
702  case "integer":
703  $vars[$name] = (isset($GLOBALS[$method][$name]) && is_numeric($GLOBALS[$method][$name]) ? intval($GLOBALS[$method][$name]) : $options[2]);
704  break;
705  case "float":
706  $vars[$name] = (isset($GLOBALS[$method][$name]) && is_numeric($GLOBALS[$method][$name]) ? floatval($GLOBALS[$method][$name]) : $options[2]);
707  break;
708  case "string":
709  $vars[$name] = (isset($GLOBALS[$method][$name]) ? trim($GLOBALS[$method][$name]) : $options[2]);
710  break;
711  case "array":
712  $vars[$name] = (isset($GLOBALS[$method][$name]) && is_array($GLOBALS[$method][$name]) ? $GLOBALS[$method][$name] : $options[2]);
713  break;
714  case "boolean":
715  $vars[$name] = (isset($GLOBALS[$method][$name]) ? $GLOBALS[$method][$name] : $options[2]);
716  break;
717  case "file":
718  $vars[$name] = (isset($GLOBALS[$method][$name]) ? $GLOBALS[$method][$name] : $options[2]);
719  break;
720  default:
721  die("Illegal method type used for field " . $name . " : " . $options[1]);
722  }
723  }
724 
725  // Insert into $GLOBALS.
726  foreach ($vars AS $var => $value) {
727  $GLOBALS[$var] = $value;
728  }
729  return $vars;
730 }
$fields
Definition: aws_add.php:27
$value

References $fields, and $value.

◆ getlinkhelp()

getlinkhelp (   $hid)
Parameters
int$hid
Returns
string

Definition at line 474 of file functions.php.

474  {
475  return "(<a href=\"javascript:help($hid);\">?</a>)";
476 }

Referenced by linkhelp().

◆ getuserpath()

getuserpath (   $user = null)

get the home of the user

Parameters
globalm_mem $mem @args string $user the username, if null will use the global $mem. no security checks performed on path
Returns
string the actual absolute path

Definition at line 329 of file functions.php.

329  {
330  if (is_null($user)) {
331  global $mem;
332  $user = $mem->user['login'];
333  }
334  return rtrim(ALTERNC_HTML, "/") . "/" . substr($user, 0, 1) . "/" . $user;
335 }

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()

hexa (   $hex)
Parameters
int$hex
Returns
int

Definition at line 1085 of file functions.php.

1085  {
1086  $num = dechex($hex);
1087  return (strlen("$num") >= 2) ? "$num" : "0$num";
1088 }

Referenced by PercentToColor().

◆ ife()

ife (   $test,
  $tr,
  $fa = "" 
)
Parameters
boolean$test
string$tr
string$fa
Returns
string

Definition at line 416 of file functions.php.

416  {
417  if ($test) {
418  return $tr;
419  }
420  return $fa;
421 }

Referenced by _subbrowse(), browseforfolder(), and m_bro\viewurl().

◆ linkhelp()

linkhelp (   $hid)
Parameters
int$hid

Definition at line 483 of file functions.php.

483  {
484  echo getlinkhelp($hid);
485 }
getlinkhelp($hid)
Definition: functions.php:474

References getlinkhelp().

◆ list_properties_order()

list_properties_order (   $a,
  $b 
)
Parameters
array$a
array$b
Returns
int

Definition at line 750 of file functions.php.

750  {
751  if ($a['label'] == $b['label']) {
752  return 0;
753  }
754  return ($a['label'] < $b['label']) ? -1 : 1;
755 }

◆ pager()

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

Parameters
int$offset
int$count
int$total
string$url
string$before
string$after
boolean$echo
Returns
string

Definition at line 777 of file functions.php.

777  {
778  $return = "";
779  $offset = intval($offset);
780  $count = intval($count);
781  $total = intval($total);
782  if ($offset <= 0) {
783  $offset = "0";
784  }
785  if ($count <= 1) {
786  $count = "1";
787  }
788  if ($total <= 0) {
789  $total = "0";
790  }
791  if ($total < $offset) {
792  $offset = max(0, $total - $count);
793  }
794  if ($total <= $count) { // When there is less element than 1 complete page, just don't do anything :-D
795  return true;
796  }
797  $return .= $before;
798  // Shall-we show previous page link ?
799  if ($offset) {
800  $o = max($offset - $count, 0);
801  $return .= "<a href=\"" . str_replace("%%offset%%", $o, $url) . "\" alt=\"(Ctl/Alt-p)\" title=\"(Alt-p)\" accesskey=\"p\">" . _("Previous Page") . "</a> ";
802  } else {
803  $return .= _("Previous Page") . " ";
804  }
805 
806  if ($total > (2 * $count)) { // On n'affiche le pager central (0 1 2 ...) s'il y a au moins 2 pages.
807  $return .= " - ";
808  if (($total < ($count * 10)) && ($total > $count)) { // moins de 10 pages :
809  for ($i = 0; $i < $total / $count; $i++) {
810  $o = $i * $count;
811  if ($offset == $o) {
812  $return .= $i . " ";
813  } else {
814  $return .= "<a href = \"" . str_replace("%%offset%%", $o, $url) . "\">$i</a> ";
815  }
816  }
817  } else { // Plus de 10 pages, on affiche 0 1 2 , 2 avant et 2 apr�s la page courante, et les 3 dernieres
818  for ($i = 0; $i <= 2; $i++) {
819  $o = $i * $count;
820  if ($offset == $o) {
821  $return .= $i . " ";
822  } else {
823  $return .= "<a href=\"" . str_replace("%%offset%%", $o, $url) . "\">$i</a> ";
824  }
825  }
826  if ($offset >= $count && $offset < ($total - 2 * $count)) { // On est entre les milieux ...
827  // On affiche 2 avant jusque 2 apr�s l'offset courant mais sans d�border sur les indices affich�s autour
828  $start = max(3, intval($offset / $count) - 2);
829  $end = min(intval($offset / $count) + 3, intval($total / $count) - 3);
830  if ($start != 3) {
831  $return .= " ... ";
832  }
833  for ($i = $start; $i < $end; $i++) {
834  $o = $i * $count;
835  if ($offset == $o) {
836  $return .= $i . " ";
837  } else {
838  $return .= "<a href=\"" . str_replace("%%offset%%", $o, $url) . "\">$i</a> ";
839  }
840  }
841  if ($end != intval($total / $count) - 3) {
842  $return .= " ... ";
843  }
844  } else {
845  $return .= " ... ";
846  }
847  for ($i = intval($total / $count) - 3; $i < $total / $count; $i++) {
848  $o = $i * $count;
849  if ($offset == $o) {
850  $return .= $i . " ";
851  } else {
852  $return .= "<a href=\"" . str_replace("%%offset%%", $o, $url) . "\">$i</a> ";
853  }
854  }
855  $return .= " - ";
856  } // More than 10 pages?
857  }
858  // Shall-we show the next page link ?
859  if ($offset + $count < $total) {
860  $o = $offset + $count;
861  $return .= "<a href=\"" . str_replace("%%offset%%", $o, $url) . "\" alt=\"(Ctl/Alt-s)\" title=\"(Alt-s)\" accesskey=\"s\">" . _("Next Page") . "</a> ";
862  } else {
863  $return .= _("Next Page") . " ";
864  }
865  $return .= $after;
866  if ($echo) {
867  echo $return;
868  }
869  return $return;
870 }
$total

References $i, and $total.

◆ panel_islocked()

panel_islocked ( )
Returns
boolean

Definition at line 1149 of file functions.php.

1149  {
1150  return file_exists(ALTERNC_LOCK_PANEL);
1151 }
const ALTERNC_LOCK_PANEL
Definition: bootstrap.php:17

References ALTERNC_LOCK_PANEL.

Referenced by m_mem\checkid(), m_mem\login(), and m_mem\temporary_login().

◆ panel_lock()

panel_lock ( )
Parameters
globalm_messages $msg
globalm_mem $mem
globalint $cuid
Returns
boolean

Definition at line 1120 of file functions.php.

1120  {
1121  global $cuid;
1122  if ($cuid != 2000) {
1123  return false;
1124  }
1125  return touch(ALTERNC_LOCK_PANEL);
1126 }
$cuid
Definition: bootstrap.php:43

References $cuid, and ALTERNC_LOCK_PANEL.

◆ panel_unlock()

panel_unlock ( )
Parameters
globalm_messages $msg
globalm_mem $mem
globalint $cuid
Returns
boolean

Definition at line 1136 of file functions.php.

1136  {
1137  global $cuid;
1138  if ($cuid != 2000) {
1139  return false;
1140  }
1141  return unlink(ALTERNC_LOCK_PANEL);
1142 }

References $cuid, and ALTERNC_LOCK_PANEL.

◆ PercentToColor()

PercentToColor (   $p = 0)
Parameters
int$p
Returns
string

Definition at line 1096 of file functions.php.

1096  {
1097  if ($p > 100) {
1098  $p = 100;
1099  }
1100  if ($p < 0) {
1101  $p = 0;
1102  }
1103  // Pour aller de vert a rouge en passant par jaune et orange
1104  $h = 1 + ((100 - $p) * 130 / 100);
1105 
1106  $rvb = fHSVtoRGB((int) $h, 96, 93);
1107  $color = "#" . hexa($rvb['r']) . hexa($rvb['g']) . hexa($rvb['b']);
1108 
1109  return $color;
1110 }
$p
Definition: bro_editor.php:46
fHSVtoRGB($iH, $iS, $iV)
Definition: functions.php:998
hexa($hex)
Definition: functions.php:1085

References $p, fHSVtoRGB(), and hexa().

Referenced by m_quota\quota_displaybar().

◆ pretty_months()

pretty_months (   $months)

Converti un nombre de mois en une chaine plus lisible.

Parameters
integer$monthsNombre de mois
Returns
string Cha�ne repr�sentant le nombre de mois @access private

Definition at line 570 of file functions.php.

570  {
571  if ($months % 12 == 0 && $months > 11) {
572  $years = $months / 12;
573  return "$years " . ($years > 1 ? _("years") : _("year"));
574  } else {
575  return "$months " . ($months > 1 ? _("months") : _("month"));
576  }
577 }

Referenced by duration_list().

◆ printVar()

printVar (   $array)
Parameters
array$array

Definition at line 737 of file functions.php.

737  {
738  echo "<pre style=\"border: 1px solid black; text-align: left; font-size: 9px\">\n";
739  print_r($array);
740  echo "</pre>\n";
741 }

◆ selected()

selected (   $bool,
  $echo = TRUE 
)

ECHOes selected="selected" only if the parameter is true useful for checkboxes and radio buttons.

Parameters
boolean$bool
boolean$echo
Returns
string

Definition at line 366 of file functions.php.

366  {
367  if ($bool) {
368  $return = " selected=\"selected\"";
369  } else {
370  $return = '';
371  }
372  if ($echo) {
373  echo $return;
374  }
375  return $return;
376 }

Referenced by sub_domains_edit().

◆ split_mysql_database_name()

split_mysql_database_name (   $dbname)

split mysql database name between username and custom database name

Parameters
string$dbnamedatabase name
Returns
array returns username as first element, custom name as second

Definition at line 548 of file functions.php.

548  {
549  $db_exploded_name = explode("_", $dbname);
550  return array($db_exploded_name[0],
551  implode("_", array_slice($db_exploded_name, 1)));
552 }

Referenced by m_mysql\get_dblist(), and m_mysql\get_mysql_details().

◆ ssla()

ssla (   $str)

Strip slashes if needed :

Parameters
string$str
Returns
string

Definition at line 519 of file functions.php.

519  {
520  if (get_magic_quotes_gpc()) {
521  return stripslashes($str);
522  } else {
523  return $str;
524  }
525 }

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()

xml_entities (   $string)

Echappe les caract�res pouvant perturber un flux XML standard :

Parameters
string$stringChaine de caract�re � encoder en valeur xml.
Returns
string Retourne la cha�ne modifi�e si besoin. @access private

Definition at line 560 of file functions.php.

560  {
561  return str_replace("<", "&lt;", str_replace(">", "&gt;", str_replace("&", "&amp;", $string)));
562 }
$string
Definition: logs_tail.php:38

References $string.

Referenced by m_mail\alternc_export_conf().