Some cosmetics
This commit is contained in:
parent
e63de8a403
commit
8e93341cd3
|
@ -51,7 +51,7 @@ if ($newlogin) {
|
||||||
// Add an account
|
// Add an account
|
||||||
if ($mail->add_slave_account($newlogin,$newpass)) {
|
if ($mail->add_slave_account($newlogin,$newpass)) {
|
||||||
$error=_("The requested account address has been created. It is now allowed.");
|
$error=_("The requested account address has been created. It is now allowed.");
|
||||||
$newlogin=false;$newpass=false;
|
$newlogin='';$newpass='';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -138,7 +138,7 @@ function var_input($infotype, $name, $value='') {
|
||||||
break;
|
break;
|
||||||
case "boolean":
|
case "boolean":
|
||||||
echo "<input type='hidden' name='$name' value='0' />"; // This way, there is allways something send, even if checkbox is unchecked
|
echo "<input type='hidden' name='$name' value='0' />"; // This way, there is allways something send, even if checkbox is unchecked
|
||||||
echo "<input type='checkbox' id='add_$id' name='$name' value='1' ";cbox($value);echo " />";
|
echo "<input type='checkbox' id='add_$id' name='$name' value='1' ";cbox((bool)$value);echo " />";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
echo "WTF ? Dunno what to do with a ".$infotype['type'];
|
echo "WTF ? Dunno what to do with a ".$infotype['type'];
|
||||||
|
|
|
@ -143,7 +143,7 @@ class system_bind {
|
||||||
*
|
*
|
||||||
* @global m_dom $dom
|
* @global m_dom $dom
|
||||||
* @param string $domain
|
* @param string $domain
|
||||||
* @return string
|
* @return array
|
||||||
*/
|
*/
|
||||||
function get_domain_summary($domain=false) {
|
function get_domain_summary($domain=false) {
|
||||||
global $dom;
|
global $dom;
|
||||||
|
|
|
@ -50,7 +50,7 @@ class m_action {
|
||||||
function do_action() {
|
function do_action() {
|
||||||
global $err, $L_INOTIFY_DO_ACTION;
|
global $err, $L_INOTIFY_DO_ACTION;
|
||||||
$err->log("action", "do_action");
|
$err->log("action", "do_action");
|
||||||
if( ! touch($L_INOTIFY_DO_ACTION) ){
|
if( ! @touch($L_INOTIFY_DO_ACTION) ){
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -569,11 +569,11 @@ class m_admin {
|
||||||
* @param int $duration
|
* @param int $duration
|
||||||
* @param string $notes
|
* @param string $notes
|
||||||
* @param integer $force
|
* @param integer $force
|
||||||
* @param boolean $create_dom
|
* @param string $create_dom
|
||||||
* @param int $db_server_id
|
* @param int $db_server_id
|
||||||
* @return boolean Returns FALSE if an error occurs, TRUE if not.
|
* @return boolean Returns FALSE if an error occurs, TRUE if not.
|
||||||
*/
|
*/
|
||||||
function add_mem($login, $pass, $nom, $prenom, $mail, $canpass=1, $type='default', $duration=0, $notes = "", $force=0, $create_dom=false, $db_server_id) {
|
function add_mem($login, $pass, $nom, $prenom, $mail, $canpass=1, $type='default', $duration=0, $notes = "", $force=0, $create_dom='', $db_server_id) {
|
||||||
global $err,$quota,$classes,$cuid,$mem,$L_MYSQL_DATABASE,$L_MYSQL_LOGIN,$hooks,$action;
|
global $err,$quota,$classes,$cuid,$mem,$L_MYSQL_DATABASE,$L_MYSQL_LOGIN,$hooks,$action;
|
||||||
$err->log("admin","add_mem",$login."/".$mail);
|
$err->log("admin","add_mem",$login."/".$mail);
|
||||||
if (!$this->enabled) {
|
if (!$this->enabled) {
|
||||||
|
@ -1135,7 +1135,7 @@ EOF;
|
||||||
function checkalldom() {
|
function checkalldom() {
|
||||||
global $db,$L_NS1,$L_NS2,$L_MX,$L_PUBLIC_IP;
|
global $db,$L_NS1,$L_NS2,$L_MX,$L_PUBLIC_IP;
|
||||||
$checked=array();
|
$checked=array();
|
||||||
$r=$db->query("SELECT * FROM domaines ORDER BY domaine;");
|
$db->query("SELECT * FROM domaines ORDER BY domaine;");
|
||||||
$dl=array();
|
$dl=array();
|
||||||
while ($db->next_record()) {
|
while ($db->next_record()) {
|
||||||
$dl[$db->Record["domaine"]]=$db->Record;
|
$dl[$db->Record["domaine"]]=$db->Record;
|
||||||
|
@ -1179,10 +1179,14 @@ EOF;
|
||||||
// Check the IP:
|
// Check the IP:
|
||||||
$out=array();
|
$out=array();
|
||||||
exec("dig +short A ".escapeshellarg($d["sub"].(($d["sub"]!="")?".":"").$c["domaine"]),$out);
|
exec("dig +short A ".escapeshellarg($d["sub"].(($d["sub"]!="")?".":"").$c["domaine"]),$out);
|
||||||
if (!in_array($L_PUBLIC_IP,$out)) {
|
if (! is_array($out)) { // exec dig can fail
|
||||||
$errstr.="subdomain '".$d["sub"]."' don't point to $L_PUBLIC_IP but to ".implode(",",$out)."\n";
|
$errno=1; $errstr.="Fail to get the DNS information. Try again.\n";
|
||||||
$errno=1;
|
} else {
|
||||||
}
|
if (!in_array($L_PUBLIC_IP,$out)) {
|
||||||
|
$errstr.="subdomain '".$d["sub"]."' don't point to $L_PUBLIC_IP but to ".implode(",",$out)."\n";
|
||||||
|
$errno=1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1362,7 +1366,6 @@ EOF;
|
||||||
global $db,$classes,$hooks;
|
global $db,$classes,$hooks;
|
||||||
$tmp1=array();
|
$tmp1=array();
|
||||||
$tmp2=array();
|
$tmp2=array();
|
||||||
$tmp3=array();
|
|
||||||
$policies=array();
|
$policies=array();
|
||||||
$db->query("SELECT * FROM policy;");
|
$db->query("SELECT * FROM policy;");
|
||||||
while ($db->next_record()) {
|
while ($db->next_record()) {
|
||||||
|
|
|
@ -99,12 +99,12 @@ class m_bro {
|
||||||
* @param string $dir
|
* @param string $dir
|
||||||
* @global m_mem $mem
|
* @global m_mem $mem
|
||||||
* @param string $dir Dossier absolu que l'on souhaite vérifier
|
* @param string $dir Dossier absolu que l'on souhaite vérifier
|
||||||
* @param integer $strip
|
* @param boolean $strip
|
||||||
* @return false|string Retourne le nom du dossier vrifi, relatif au
|
* @return false|string Retourne le nom du dossier vrifi, relatif au
|
||||||
* dossier de l'utilisateur courant, ventuellement corrig.
|
* dossier de l'utilisateur courant, ventuellement corrig.
|
||||||
* ou FALSE si le dossier n'est pas dans le dossier de l'utilisateur.
|
* ou FALSE si le dossier n'est pas dans le dossier de l'utilisateur.
|
||||||
*/
|
*/
|
||||||
function convertabsolute($dir,$strip=1) {
|
function convertabsolute($dir,$strip=true) {
|
||||||
global $mem;
|
global $mem;
|
||||||
$root=$this->get_user_root($mem->user["login"]);
|
$root=$this->get_user_root($mem->user["login"]);
|
||||||
// Sauvegarde du chemin de base.
|
// Sauvegarde du chemin de base.
|
||||||
|
|
|
@ -435,7 +435,7 @@ class m_dom {
|
||||||
$this->lock();
|
$this->lock();
|
||||||
|
|
||||||
// function add_domain($domain,$dns,$noerase=0,$force=0,$isslave=0,$slavedom="")
|
// function add_domain($domain,$dns,$noerase=0,$force=0,$isslave=0,$slavedom="")
|
||||||
if (! $this->add_domain($domain, true, false, 1) ) {
|
if (! $this->add_domain($domain, true, false, true) ) {
|
||||||
$err->raise('dom', "Error adding domain");
|
$err->raise('dom', "Error adding domain");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -652,7 +652,7 @@ class m_dom {
|
||||||
* force ne devrait être utilisé que par le super-admin.
|
* force ne devrait être utilisé que par le super-admin.
|
||||||
$ @return boolean Retourne FALSE si une erreur s'est produite, TRUE sinon.
|
$ @return boolean Retourne FALSE si une erreur s'est produite, TRUE sinon.
|
||||||
*/
|
*/
|
||||||
function add_domain($domain,$dns,$noerase=0,$force=0,$isslave=0,$slavedom="") {
|
function add_domain($domain,$dns,$noerase=false,$force=false,$isslave=false,$slavedom="") {
|
||||||
global $db,$err,$quota,$classes,$L_MX,$L_FQDN,$tld,$cuid,$bro,$hooks;
|
global $db,$err,$quota,$classes,$L_MX,$L_FQDN,$tld,$cuid,$bro,$hooks;
|
||||||
$err->log("dom","add_domain",$domain);
|
$err->log("dom","add_domain",$domain);
|
||||||
|
|
||||||
|
@ -1608,6 +1608,10 @@ class m_dom {
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
function get_domain_all_summary() {
|
function get_domain_all_summary() {
|
||||||
global $db,$err;
|
global $db,$err;
|
||||||
$res=array();
|
$res=array();
|
||||||
|
|
|
@ -23,6 +23,9 @@ abstract class AlterncTest extends PHPUnit_Extensions_Database_TestCase
|
||||||
*/
|
*/
|
||||||
public function loadDataSet($fileList)
|
public function loadDataSet($fileList)
|
||||||
{
|
{
|
||||||
|
if (empty($fileList)) {
|
||||||
|
throw new \Exception("No files specified");
|
||||||
|
}
|
||||||
if( !is_array($fileList)){
|
if( !is_array($fileList)){
|
||||||
$fileList = array($fileList);
|
$fileList = array($fileList);
|
||||||
}
|
}
|
||||||
|
@ -41,4 +44,4 @@ abstract class AlterncTest extends PHPUnit_Extensions_Database_TestCase
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,8 @@ if ( $nb != 1 ){
|
||||||
}
|
}
|
||||||
|
|
||||||
#we check that for that type only one option is specified
|
#we check that for that type only one option is specified
|
||||||
|
# FIXME je doute que ca fasse un truc pertinent ce morceau
|
||||||
|
$nb2=0;
|
||||||
foreach($options as $opt => $val){
|
foreach($options as $opt => $val){
|
||||||
$nb2=count($options[$opt]);
|
$nb2=count($options[$opt]);
|
||||||
}
|
}
|
||||||
|
@ -61,6 +63,7 @@ function FixQuotaDovecot($conditions){
|
||||||
}
|
}
|
||||||
|
|
||||||
#We construct a sql query to get the mailbox root based on the option.
|
#We construct a sql query to get the mailbox root based on the option.
|
||||||
|
// FIXME where does $opt come from ??
|
||||||
switch($opt){
|
switch($opt){
|
||||||
case "m":
|
case "m":
|
||||||
if (!filter_var($val,FILTER_VALIDATE_EMAIL)) {
|
if (!filter_var($val,FILTER_VALIDATE_EMAIL)) {
|
||||||
|
|
Loading…
Reference in New Issue