diff --git a/.gitattributes b/.gitattributes
index 24120ce7..5cdc900d 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -605,6 +605,7 @@ nightlybuild/READMEFIRST -text
nightlybuild/build.sh -text
nightlybuild/mchroot.sh -text
nightlybuild/nightly.key -text
+phpunit/tests/_datasets/domaines.yml -text
po/alternc-admintools.pot -text
po/fr/LC_MESSAGES/.svnignore -text
po/fr/LC_MESSAGES/alternc-admintools.po -text
@@ -614,7 +615,6 @@ roundcube/class/m_roundcube.php -text
roundcube/roundcube-install -text
roundcube/roundcube_alternc_logo.png -text
roundcube/templates/apache2/roundcube.conf -text
-roundcube/templates/logrotate.d/roundcube-core -text
roundcube/templates/roundcube/main.inc.php -text
roundcube/templates/roundcube/plugins/managesieve/config.inc.php -text
roundcube/templates/roundcube/plugins/password/config.inc.php -text
@@ -663,6 +663,7 @@ src/quota-warning.sh -text
src/quota_delete -text
src/quota_edit -text
src/quota_get -text
+src/quota_get_all -text
src/quota_init -text
src/rebuild_all_webconf.sh -text
src/sendmail -text
diff --git a/bureau/admin/adm_dodel.php b/bureau/admin/adm_dodel.php
index 3103ad31..03a765c9 100644
--- a/bureau/admin/adm_dodel.php
+++ b/bureau/admin/adm_dodel.php
@@ -35,24 +35,18 @@ if (!$admin->enabled) {
}
$fields = array (
- "d" => array ("request", "array", array()),
+ "accountList" => array ("request", "array", array()),
"del_confirm" => array("request", "string", ""),
);
getFields($fields);
-
if($del_confirm == "y"){
- if (!is_array($accountList)) {
- $accountList[] = $accountList;
- }
-
- reset($accountList);
- while (list($key,$val)=each($accountList)) {
+ $error = "";
+ foreach ($accountList as $key => $val) {
if (!$admin->checkcreator($val)) {
__("This page is restricted to authorized staff");
exit();
}
- $error = "";
if (!($u=$admin->get($val)) || !$admin->del_mem($val)) {
$error .= sprintf(_("Member '%s' does not exist"),$val)."
";
} else {
@@ -77,12 +71,14 @@ if($del_confirm == "y"){
- get($userid);
- echo "".$membre['login']."
";
- }
- ?>
+
" /> diff --git a/bureau/admin/adm_list.php b/bureau/admin/adm_list.php index 74c1ee8a..b66ceee1 100644 --- a/bureau/admin/adm_list.php +++ b/bureau/admin/adm_list.php @@ -174,7 +174,7 @@ if (!is_array($accountList) || empty($accountList)) {"> -" value="" /> +" value="" /> > " href="mailto:"> @@ -250,7 +250,7 @@ if ($mem->user["admlist"] == 1) { // SHORT MODE if ($val["su"]) { echo ''; } else { - echo ' '; + echo ' '; } // if $val["su"] ?> diff --git a/bureau/admin/adm_mxaccount.php b/bureau/admin/adm_mxaccount.php index 6df1875a..408d9145 100644 --- a/bureau/admin/adm_mxaccount.php +++ b/bureau/admin/adm_mxaccount.php @@ -51,7 +51,7 @@ if ($newlogin) { // Add an account if ($mail->add_slave_account($newlogin,$newpass)) { $error=_("The requested account address has been created. It is now allowed."); - $newlogin=false;$newpass=false; + $newlogin='';$newpass=''; } } diff --git a/bureau/admin/adm_var_edit.php b/bureau/admin/adm_var_edit.php index c6a34f6b..f4c1dc8f 100644 --- a/bureau/admin/adm_var_edit.php +++ b/bureau/admin/adm_var_edit.php @@ -138,7 +138,7 @@ function var_input($infotype, $name, $value='') { break; case "boolean": echo ""; // This way, there is allways something send, even if checkbox is unchecked - echo ""; + echo ""; break; default: echo "WTF ? Dunno what to do with a ".$infotype['type']; @@ -251,7 +251,7 @@ foreach ( $variables->strata_order as $strata) { foreach ($allvars['FQDN_CREATOR'] as $ttk => $ttv ) { if ( isset($ttv[$var]) && is_array( $ttv[$var])) { echo sprintf(_("Overwritted by %s"), $members[$ttk]['login'])." → "; - echo ""; echo $variables->display_valueraw_html($ttv[$var]['value'], $var);echo ""; + echo ""; $variables->display_valueraw_html($ttv[$var]['value'], $var);echo ""; edit_var($ttv[$var]); } echo "
"; @@ -267,7 +267,7 @@ foreach ( $variables->strata_order as $strata) { foreach ($allvars['FQDN'] as $ttk => $ttv ) { if ( isset($ttv[$var]) && is_array( $ttv[$var])) { echo sprintf(_("Overwritted by %s"), $panel_url[$ttk])." → "; - echo ""; echo $variables->display_valueraw_html($ttv[$var]['value'], $var);echo ""; + echo ""; $variables->display_valueraw_html($ttv[$var]['value'], $var);echo ""; edit_var($ttv[$var]); } echo "
"; @@ -283,7 +283,7 @@ foreach ( $variables->strata_order as $strata) { foreach ($allvars['CREATOR'] as $ttk => $ttv ) { if ( isset($ttv[$var]) && is_array( $ttv[$var])) { echo sprintf(_("Overwritted by %s"), $members[$ttk]['login'])." → "; - echo ""; echo $variables->display_valueraw_html($ttv[$var]['value'], $var);echo ""; + echo ""; $variables->display_valueraw_html($ttv[$var]['value'], $var);echo ""; edit_var($ttv[$var]); } echo "
"; @@ -299,7 +299,7 @@ foreach ( $variables->strata_order as $strata) { foreach ($allvars['MEMBER'] as $ttk => $ttv ) { if ( isset($ttv[$var]) && is_array( $ttv[$var])) { echo sprintf(_("Overwritted by %s"), $members[$ttk]['login'])." → "; - echo ""; echo $variables->display_valueraw_html($ttv[$var]['value'], $var);echo ""; + echo ""; $variables->display_valueraw_html($ttv[$var]['value'], $var);echo ""; edit_var($ttv[$var]); } echo "
"; diff --git a/bureau/admin/adm_variables.php b/bureau/admin/adm_variables.php index 714a16ba..7559e5cb 100644 --- a/bureau/admin/adm_variables.php +++ b/bureau/admin/adm_variables.php @@ -92,7 +92,7 @@ echo _("See the vars for the account")." "; echo ""; echo " "._("logged via")." "; echo " "; -echo ""; +echo ""; ?> diff --git a/bureau/admin/head.php b/bureau/admin/head.php index 04badcfd..4e4d031e 100644 --- a/bureau/admin/head.php +++ b/bureau/admin/head.php @@ -37,14 +37,17 @@ if (!isset($charset) || ! $charset) $charset="UTF-8"; if (file_exists("styles/style-custom.css") ) { echo ''; } + +$favicon = variable_get('favicon', 'favicon.ico' ,'You can specify a favicon, for example /images/my_logo.ico', array(array('desc'=>'URL','type'=>'string'))); + ?> - - + + diff --git a/bureau/admin/hta_del.php b/bureau/admin/hta_del.php index 52ffe975..48a7e9ea 100644 --- a/bureau/admin/hta_del.php +++ b/bureau/admin/hta_del.php @@ -35,11 +35,12 @@ reset($_POST); while (list($key,$val)=each($_POST)) { if (substr($key,0,4)=="del_") { // Effacement du dossier $val - $r=$hta->DelDir($val); - if (!$r) { - $error.=$err->errstr()."
"; +// $r=$hta->DelDir($val); + $return = $hta->DelDir($val); + if (!$return) { + $error.= $err->errstr()."
"; } else { - $error.=sprintf(_("The protected folder %s has been successfully unprotected"),$val)."
"; + $error.= sprintf(_("The protected folder %s has been successfully unprotected"),$val)."
"; } } } diff --git a/bureau/class/class_system_bind.php b/bureau/class/class_system_bind.php index cd2ffac9..9596af07 100644 --- a/bureau/class/class_system_bind.php +++ b/bureau/class/class_system_bind.php @@ -143,7 +143,7 @@ class system_bind { * * @global m_dom $dom * @param string $domain - * @return string + * @return array */ function get_domain_summary($domain=false) { global $dom; diff --git a/bureau/class/functions.php b/bureau/class/functions.php index c099c315..892061b2 100644 --- a/bureau/class/functions.php +++ b/bureau/class/functions.php @@ -44,7 +44,7 @@ function fl($str) { return str_replace("<","<",str_replace("\"",""",$str * @param struing $type * @return mixed */ -function variable_get($name, $default = null, $createit_comment = null, $type=null) { +function variable_get($name, $default = null, $createit_comment = null, $type = null) { global $variables; return $variables->variable_get($name, $default, $createit_comment, $type); } @@ -66,16 +66,16 @@ function variable_get($name, $default = null, $createit_comment = null, $type=nu */ function checkhostallow($domain,$dns) { global $L_NS1,$L_NS2,$db,$dom; - $sizefound=0; - $found=""; + $sizefound = 0; + $found = ""; $db->query("SELECT tld,mode FROM tld;"); while ($db->next_record()) { - list($key,$val)=$db->Record; + list($key,$val) = $db->Record; if (substr($domain,-1-strlen($key))==".".$key) { if ($sizefound2) // OK, in the case 3 4 5 return $found; - $n1=false; $n2=false; - for ($i=0;$i query("SELECT tld,mode FROM tld;"); while ($db->next_record()) { - list($key,$val)=$db->Record; + list($key,$val) = $db->Record; if (substr($domain,-1-strlen($key))==".".$key) { if ($sizefound 255) return 1; - $members=explode(".", $fqdn); - if (count($members)>1) $ret=0; else $ret=4; + $members = explode(".", $fqdn); + if (count($members)>1) $ret = 0; else $ret = 4; reset($members); while (list ($key, $val) = each ($members)) { if (strlen($val)>63) @@ -262,10 +262,10 @@ function checkfqdn($fqdn) { */ function checkuserpath($path) { global $mem; - $user=$mem->user["login"]; - $usar=substr($user,0,1); + $user = $mem->user["login"]; + $usar = substr($user,0,1); if (substr($path,0,1)!="/") - $path="/".$path; + $path = "/".$path; $rpath = realpath(ALTERNC_HTML."/$usar/$user$path"); if (!$rpath) { // if file or directory does not exist @@ -310,7 +310,7 @@ function cbox($test, $echo = TRUE) { if ($test) { $return = " checked=\"checked\""; } else { - $return=''; + $return = ''; } if( $echo ){ echo $return; @@ -331,7 +331,7 @@ function selected($bool, $echo = TRUE) { if ($bool) { $return = " selected=\"selected\""; } else { - $return=''; + $return = ''; } if( $echo ){ echo $return; @@ -347,7 +347,7 @@ function selected($bool, $echo = TRUE) { * @param integer $affiche * @return string */ -function ecif($test,$tr,$fa="",$affiche=1) { +function ecif($test,$tr,$fa = "",$affiche = 1) { if ($test){ $retour = $tr; } @@ -375,7 +375,7 @@ function __($str) { * @param string $fa * @return string */ -function ife($test,$tr,$fa="") { +function ife($test,$tr,$fa = "") { if ($test){ return $tr; } @@ -388,33 +388,33 @@ function ife($test,$tr,$fa="") { * @param integer $html * @return string */ -function format_size($size,$html=0) { +function format_size($size,$html = 0) { // Retourne une taille formatt�e en Octets, Kilo-octets, M�ga-octets ou Giga-Octets, avec 2 d�cimales. if ("-" == $size) { return $size; } - $size=(float)$size; + $size = (float)$size; if ($size<1024) { - $r=$size; + $r = $size; if ($size!=1) { $r.=" "._("Bytes"); } else { $r.=" "._("Byte"); } } else { - $size=$size/1024; + $size = $size/1024; if ($size<1024) { - $r=round($size,2)." "._("Kb"); + $r = round($size,2)." "._("Kb"); } else { - $size=$size/1024; + $size = $size/1024; if ($size<1024) { - $r=round($size,2)." "._("Mb"); + $r = round($size,2)." "._("Mb"); } else { - $size=$size/1024; + $size = $size/1024; if ($size<1024) { - $r=round($size,2)." "._("Gb"); + $r = round($size,2)." "._("Gb"); } else { - $r=round($size/1024,2)." "._("Tb"); + $r = round($size/1024,2)." "._("Tb"); } } } @@ -448,17 +448,17 @@ function linkhelp($hid) { * @return string */ function format_date($format,$date) { - $d=substr($date,8,2); - $m=substr($date,5,2); - $y=substr($date,0,4); - $h=substr($date,11,2); - $i=substr($date,14,2); + $d = substr($date,8,2); + $m = substr($date,5,2); + $y = substr($date,0,4); + $h = substr($date,11,2); + $i = substr($date,14,2); if ($h>12) { - $hh=$h-12; - $am="pm"; + $hh = $h-12; + $am = "pm"; } else { - $hh=$h; - $am="am"; + $hh = $h; + $am = "am"; } return sprintf($format,$d,$m,$y,$h,$i,$hh,$am); } @@ -482,13 +482,13 @@ function ssla($str) { * @return string Retourne le mot de passe crypt� * @access private */ - function _md5cr($pass,$salt="") { + function _md5cr($pass,$salt = "") { if (!$salt) { - $chars="./0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; - for ($i=0;$i<12;$i++) { + $chars = "./0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + for ($i = 0;$i<12;$i++) { $salt.=substr($chars,(mt_rand(0,strlen($chars))),1); } - $salt="$1$".$salt; + $salt = "$1$".$salt; } return crypt($pass,$salt); } @@ -536,7 +536,7 @@ function pretty_months($months) { * @return string Code html pour le drop-down * @access private */ -function duration_list($name, $selected=0) { +function duration_list($name, $selected = 0) { $res = "