Cosmetic, again
This commit is contained in:
parent
6adef177c9
commit
0bf6596466
|
@ -139,7 +139,6 @@ class m_aws {
|
||||||
function get_stats_details($id) {
|
function get_stats_details($id) {
|
||||||
global $db,$err,$cuid;
|
global $db,$err,$cuid;
|
||||||
$err->log("aws","get_stats_details",$id);
|
$err->log("aws","get_stats_details",$id);
|
||||||
$r=array();
|
|
||||||
$db->query("SELECT id, hostname, hostaliases, public FROM aws WHERE uid='$cuid' AND id='$id';");
|
$db->query("SELECT id, hostname, hostaliases, public FROM aws WHERE uid='$cuid' AND id='$id';");
|
||||||
if ($db->num_rows()) {
|
if ($db->num_rows()) {
|
||||||
$db->next_record();
|
$db->next_record();
|
||||||
|
@ -295,7 +294,7 @@ class m_aws {
|
||||||
*/
|
*/
|
||||||
function put_stats_details($id,$users,$hostaliases,$public) {
|
function put_stats_details($id,$users,$hostaliases,$public) {
|
||||||
global $err,$db,$cuid;
|
global $err,$db,$cuid;
|
||||||
if ($c=$this->get_stats_details($id)) {
|
if ($this->get_stats_details($id)) {
|
||||||
$this->delete_allowed_login($id, 1);
|
$this->delete_allowed_login($id, 1);
|
||||||
if (is_array($users)) {
|
if (is_array($users)) {
|
||||||
foreach($users as $v) {
|
foreach($users as $v) {
|
||||||
|
@ -306,7 +305,9 @@ class m_aws {
|
||||||
$this->_createconf($id);
|
$this->_createconf($id);
|
||||||
$this->_createhtpasswd();
|
$this->_createhtpasswd();
|
||||||
return true;
|
return true;
|
||||||
} else return false;
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ if ($fatal) {
|
||||||
echo "<div class=\"alert alert-danger\">$error</div>";
|
echo "<div class=\"alert alert-danger\">$error</div>";
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (!empty($error)) { echo "<p class='alert alert-danger'>$error</p>"; }
|
if (isset($error) && !empty($error)) { echo "<p class='alert alert-danger'>$error</p>"; }
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
|
|
@ -136,7 +136,7 @@ class system_bind {
|
||||||
* @param string $domain
|
* @param string $domain
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function get_zone_header($domain) {
|
function get_zone_header() {
|
||||||
return file_get_contents($this->ZONE_TEMPLATE);
|
return file_get_contents($this->ZONE_TEMPLATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -315,7 +315,7 @@ class system_bind {
|
||||||
function get_zone($domain) {
|
function get_zone($domain) {
|
||||||
global $L_FQDN, $L_NS1_HOSTNAME, $L_NS2_HOSTNAME, $L_DEFAULT_MX, $L_DEFAULT_SECONDARY_MX, $L_PUBLIC_IP;
|
global $L_FQDN, $L_NS1_HOSTNAME, $L_NS2_HOSTNAME, $L_DEFAULT_MX, $L_DEFAULT_SECONDARY_MX, $L_PUBLIC_IP;
|
||||||
|
|
||||||
$zone =$this->get_zone_header($domain);
|
$zone =$this->get_zone_header();
|
||||||
$zone.=implode("\n",$this->conf_from_db($domain));
|
$zone.=implode("\n",$this->conf_from_db($domain));
|
||||||
$zone.="\n;;;HOOKED ENTRY\n";
|
$zone.="\n;;;HOOKED ENTRY\n";
|
||||||
|
|
||||||
|
|
|
@ -79,6 +79,8 @@ class m_dom {
|
||||||
var $action_delete = "2";
|
var $action_delete = "2";
|
||||||
|
|
||||||
var $tld_no_check_at_all = "1";
|
var $tld_no_check_at_all = "1";
|
||||||
|
|
||||||
|
var $cache_domains_type_lst=false;
|
||||||
/* ----------------------------------------------------------------- */
|
/* ----------------------------------------------------------------- */
|
||||||
/**
|
/**
|
||||||
* Constructeur
|
* Constructeur
|
||||||
|
@ -148,14 +150,16 @@ class m_dom {
|
||||||
* authorisé. Retourne FALSE si une erreur s'est produite.
|
* authorisé. Retourne FALSE si une erreur s'est produite.
|
||||||
*/
|
*/
|
||||||
function domains_type_lst() {
|
function domains_type_lst() {
|
||||||
global $db,$err,$cuid;
|
global $db,$err;
|
||||||
$err->log("dom","domains_type_lst");
|
$err->log("dom","domains_type_lst");
|
||||||
$db->query("select * from domaines_type order by advanced;");
|
if (empty($this->cache_domains_type_lst)) {
|
||||||
$this->domains_type_lst=false;
|
$db->query("select * from domaines_type order by advanced;");
|
||||||
while ($db->next_record()) {
|
$this->cache_domains_type_lst=array();
|
||||||
$this->domains_type_lst[strtolower($db->Record["name"])] = $db->Record;
|
while ($db->next_record()) {
|
||||||
|
$this->cache_domains_type_lst[strtolower($db->Record["name"])] = $db->Record;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return $this->domains_type_lst;
|
return $this->cache_domains_type_lst;
|
||||||
}
|
}
|
||||||
|
|
||||||
function domains_type_enable_values() {
|
function domains_type_enable_values() {
|
||||||
|
@ -405,7 +409,7 @@ class m_dom {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If it is a know domains type
|
// If it is an unknown domains type
|
||||||
if (! array_key_exists( strtolower($val['type']), $this->domains_type_lst() ) ) {
|
if (! array_key_exists( strtolower($val['type']), $this->domains_type_lst() ) ) {
|
||||||
echo "what is this shit ?\n";
|
echo "what is this shit ?\n";
|
||||||
print_r($entry);
|
print_r($entry);
|
||||||
|
|
|
@ -168,7 +168,7 @@ class m_ftp {
|
||||||
$db->next_record();
|
$db->next_record();
|
||||||
|
|
||||||
$regexp="/^".preg_quote(getuserpath(),"/")."\/(.*)$/";
|
$regexp="/^".preg_quote(getuserpath(),"/")."\/(.*)$/";
|
||||||
$tr=preg_match($regexp, $db->f("homedir"),$match);
|
preg_match($regexp, $db->f("homedir"),$match);
|
||||||
|
|
||||||
$lg=explode("_",$db->f("name"));
|
$lg=explode("_",$db->f("name"));
|
||||||
if ((!is_array($lg)) || (count($lg)!=2)) {
|
if ((!is_array($lg)) || (count($lg)!=2)) {
|
||||||
|
@ -272,7 +272,7 @@ class m_ftp {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$lo=$mem->user["login"];
|
$lo=$mem->user["login"];
|
||||||
$l=substr($lo,0,1);
|
|
||||||
$full_login=$prefixe;
|
$full_login=$prefixe;
|
||||||
if ($login) $full_login.="_".$login;
|
if ($login) $full_login.="_".$login;
|
||||||
if (! $this->check_login($full_login) ) return false;
|
if (! $this->check_login($full_login) ) return false;
|
||||||
|
@ -363,10 +363,9 @@ class m_ftp {
|
||||||
$db->query("SELECT login FROM membres WHERE uid='$cuid';");
|
$db->query("SELECT login FROM membres WHERE uid='$cuid';");
|
||||||
$db->next_record();
|
$db->next_record();
|
||||||
$lo=$db->f("login");
|
$lo=$db->f("login");
|
||||||
$l=substr($lo,0,1);
|
|
||||||
$absolute=getuserpath()."/$dir";
|
$absolute=getuserpath()."/$dir";
|
||||||
if (!file_exists($absolute)) {
|
if (!file_exists($absolute)) {
|
||||||
system("/bin/mkdir -p $absolute");
|
system("/bin/mkdir -p $absolute"); // FIXME replace with action
|
||||||
}
|
}
|
||||||
if (!is_dir($absolute)) {
|
if (!is_dir($absolute)) {
|
||||||
$err->raise("ftp",_("The directory cannot be created"));
|
$err->raise("ftp",_("The directory cannot be created"));
|
||||||
|
@ -399,7 +398,6 @@ class m_ftp {
|
||||||
global $mem,$db,$err;
|
global $mem,$db,$err;
|
||||||
$err->log("ftp","is_ftp",$dir);
|
$err->log("ftp","is_ftp",$dir);
|
||||||
$lo=$mem->user["login"];
|
$lo=$mem->user["login"];
|
||||||
$l=substr($lo,0,1);
|
|
||||||
if (substr($dir,0,1)=="/") $dir=substr($dir,1);
|
if (substr($dir,0,1)=="/") $dir=substr($dir,1);
|
||||||
$db->query("SELECT id FROM ftpusers WHERE homedir='".getuserpath()."/$dir';");
|
$db->query("SELECT id FROM ftpusers WHERE homedir='".getuserpath()."/$dir';");
|
||||||
if ($db->num_rows()) {
|
if ($db->num_rows()) {
|
||||||
|
|
|
@ -158,6 +158,7 @@ class m_mail {
|
||||||
}
|
}
|
||||||
|
|
||||||
function catchall_set($domain_id, $target) {
|
function catchall_set($domain_id, $target) {
|
||||||
|
global $err;
|
||||||
// target :
|
// target :
|
||||||
$target=rtrim($target);
|
$target=rtrim($target);
|
||||||
if ( substr_count($target,'@') == 0 ) { // Pas de @
|
if ( substr_count($target,'@') == 0 ) { // Pas de @
|
||||||
|
@ -885,7 +886,7 @@ ORDER BY
|
||||||
|
|
||||||
$db->query("SELECT value FROM variable where name='mailname_bounce';");
|
$db->query("SELECT value FROM variable where name='mailname_bounce';");
|
||||||
if (!$db->next_record()) {
|
if (!$db->next_record()) {
|
||||||
$err->raise("mail",_("The email %s does not exist, it can't be deleted"),$mail);
|
$err->raise("mail",_("Problem: can't create default bounce mail"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$mailname=$db->f("value");
|
$mailname=$db->f("value");
|
||||||
|
|
|
@ -219,7 +219,6 @@ class m_mysql {
|
||||||
$err->raise("mysql",_("Database %s not found"),$dbn);
|
$err->raise("mysql",_("Database %s not found"),$dbn);
|
||||||
return array("enabled"=>false);
|
return array("enabled"=>false);
|
||||||
}
|
}
|
||||||
$c=array();
|
|
||||||
$db->next_record();
|
$db->next_record();
|
||||||
list($dbu,$dbn)=split_mysql_database_name($db->f("db"));
|
list($dbu,$dbn)=split_mysql_database_name($db->f("db"));
|
||||||
return array("enabled"=>true,"login"=>$db->f("login"),"db"=>$db->f("db"), "name"=>$dbn,"bck"=>$db->f("bck_mode"), "dir"=>substr($db->f("bck_dir"),strlen($root)), "size"=>$size, "pass"=>$db->f("pass"), "history"=>$db->f("bck_history"), "gzip"=>$db->f("bck_gzip"));
|
return array("enabled"=>true,"login"=>$db->f("login"),"db"=>$db->f("db"), "name"=>$dbn,"bck"=>$db->f("bck_mode"), "dir"=>substr($db->f("bck_dir"),strlen($root)), "size"=>$size, "pass"=>$db->f("pass"), "history"=>$db->f("bck_history"), "gzip"=>$db->f("bck_gzip"));
|
||||||
|
@ -604,7 +603,7 @@ class m_mysql {
|
||||||
$dbu=$dbn;
|
$dbu=$dbn;
|
||||||
$r=array();
|
$r=array();
|
||||||
$dbn=str_replace('_','\_',$dbn);
|
$dbn=str_replace('_','\_',$dbn);
|
||||||
$q=$this->dbus->query("Select * from mysql.db where Db='".$dbn."' and User!='".$cuid."_myadm';");
|
$this->dbus->query("Select * from mysql.db where Db='".$dbn."' and User!='".$cuid."_myadm';");
|
||||||
|
|
||||||
if(!$db->num_rows()){
|
if(!$db->num_rows()){
|
||||||
return $r;
|
return $r;
|
||||||
|
@ -1073,14 +1072,14 @@ class m_mysql {
|
||||||
$err->log("mysql","export");
|
$err->log("mysql","export");
|
||||||
$db->query("SELECT login, pass, db, bck_mode, bck_dir, bck_history, bck_gzip FROM db WHERE uid='$cuid';");
|
$db->query("SELECT login, pass, db, bck_mode, bck_dir, bck_history, bck_gzip FROM db WHERE uid='$cuid';");
|
||||||
if ($db->next_record()) {
|
if ($db->next_record()) {
|
||||||
$str.=" <sql>\n";
|
$str =" <sql>\n";
|
||||||
$str.=" <login>".$db->Record["login"]."</login>\n";
|
$str.=" <login>".$db->Record["login"]."</login>\n";
|
||||||
$str.=" <pass>".$db->Record["pass"]."</pass>\n";
|
$str.=" <pass>".$db->Record["pass"]."</pass>\n";
|
||||||
do {
|
do {
|
||||||
$filename=$tmpdir."/mysql.".$db->Record["db"].".sql.gz";
|
$filename=$tmpdir."/mysql.".$db->Record["db"].".sql.gz";
|
||||||
$str.=" <database>".($db->Record["db"])."</database>\n";
|
$str.=" <database>".($db->Record["db"])."</database>\n";
|
||||||
$str.=" <password>".($db->Record["pass"])."</password>\n";
|
$str.=" <password>".($db->Record["pass"])."</password>\n";
|
||||||
if ($s["bck_mode"]!=0) {
|
if ($s["bck_mode"]!=0) { // FIXME what is $s ?
|
||||||
$str.=" <backup-mode>".($db->Record["bck_mode"])."</backup-mode>\n";
|
$str.=" <backup-mode>".($db->Record["bck_mode"])."</backup-mode>\n";
|
||||||
$str.=" <backup-dir>".($db->Record["bck_dir"])."</backup-dir>\n";
|
$str.=" <backup-dir>".($db->Record["bck_dir"])."</backup-dir>\n";
|
||||||
$str.=" <backup-history>".($db->Record["bck_history"])."</backup-history>\n";
|
$str.=" <backup-history>".($db->Record["bck_history"])."</backup-history>\n";
|
||||||
|
@ -1140,7 +1139,6 @@ class m_mysql {
|
||||||
|
|
||||||
$this->dbus->query("show databases;");
|
$this->dbus->query("show databases;");
|
||||||
$res=array();
|
$res=array();
|
||||||
$d=array();
|
|
||||||
while($this->dbus->next_record()) {
|
while($this->dbus->next_record()) {
|
||||||
$dbname=$this->dbus->f("Database");
|
$dbname=$this->dbus->f("Database");
|
||||||
$c=mysql_query("SHOW TABLE STATUS FROM $dbname;");
|
$c=mysql_query("SHOW TABLE STATUS FROM $dbname;");
|
||||||
|
|
|
@ -157,7 +157,7 @@ class m_quota {
|
||||||
$err->log("quota","getquota",$ressource);
|
$err->log("quota","getquota",$ressource);
|
||||||
if ($recheck) { // rebuilding quota
|
if ($recheck) { // rebuilding quota
|
||||||
$get_quota_cache=null;
|
$get_quota_cache=null;
|
||||||
$this->quota=array();
|
$this->quotas=array();
|
||||||
}
|
}
|
||||||
if (! empty($get_quota_cache[$cuid]) ) {
|
if (! empty($get_quota_cache[$cuid]) ) {
|
||||||
// This function is called many time each webpage, so I cache the result
|
// This function is called many time each webpage, so I cache the result
|
||||||
|
@ -346,7 +346,6 @@ class m_quota {
|
||||||
*/
|
*/
|
||||||
function deltype($type) {
|
function deltype($type) {
|
||||||
global $db;
|
global $db;
|
||||||
$qlist=$this->qlist();
|
|
||||||
|
|
||||||
if($db->query("UPDATE membres SET type='default' WHERE type='$type'") &&
|
if($db->query("UPDATE membres SET type='default' WHERE type='$type'") &&
|
||||||
$db->query("DELETE FROM defquotas WHERE type='$type'")) {
|
$db->query("DELETE FROM defquotas WHERE type='$type'")) {
|
||||||
|
|
|
@ -26,9 +26,9 @@ require_once ALTERNC_PANEL."/class/functions.php";
|
||||||
// General variables setup
|
// General variables setup
|
||||||
// *********************
|
// *********************
|
||||||
if(is_readable('local.sh')){
|
if(is_readable('local.sh')){
|
||||||
$configFile = file_get_contents('local.sh', 'r');
|
$configFile = file_get_contents('local.sh';
|
||||||
} else if(is_readable('local.sh_generic')){
|
} else if(is_readable('local.sh_generic')){
|
||||||
$configFile = file_get_contents('local.sh_generic', 'r');
|
$configFile = file_get_contents('local.sh_generic');
|
||||||
} else {
|
} else {
|
||||||
throw new Exception("You must provide a local.sh file", 1 );
|
throw new Exception("You must provide a local.sh file", 1 );
|
||||||
}
|
}
|
||||||
|
@ -88,6 +88,8 @@ if ( is_readable("my.cnf") ) {
|
||||||
$mysqlConfigFile = file("my.cnf");
|
$mysqlConfigFile = file("my.cnf");
|
||||||
} else if(is_readable('my.cnf_generic')){
|
} else if(is_readable('my.cnf_generic')){
|
||||||
$mysqlConfigFile = file('my.cnf_generic');
|
$mysqlConfigFile = file('my.cnf_generic');
|
||||||
|
} else {
|
||||||
|
throw new Exception("You must provide a my.cnf file", 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($mysqlConfigFile as $line) {
|
foreach ($mysqlConfigFile as $line) {
|
||||||
|
|
|
@ -39,7 +39,6 @@ class m_roundcube {
|
||||||
global $db;
|
global $db;
|
||||||
// Search for the domain where the panel is hosted, then search for a webmail in it.
|
// Search for the domain where the panel is hosted, then search for a webmail in it.
|
||||||
$i=2;
|
$i=2;
|
||||||
$domain="";
|
|
||||||
if (!empty($_SERVER["HTTP_HOST"])) {
|
if (!empty($_SERVER["HTTP_HOST"])) {
|
||||||
do { // for each domain part (search panel.alternc.org then alternc.org then org, if the current panel is at www.panel.alternc.org)
|
do { // for each domain part (search panel.alternc.org then alternc.org then org, if the current panel is at www.panel.alternc.org)
|
||||||
$expl=explode(".",$_SERVER["HTTP_HOST"],$i);
|
$expl=explode(".",$_SERVER["HTTP_HOST"],$i);
|
||||||
|
@ -79,6 +78,11 @@ class m_roundcube {
|
||||||
// Use cleandb.sh filled by roundcube ? http://trac.roundcube.net/browser/github/bin/cleandb.sh
|
// Use cleandb.sh filled by roundcube ? http://trac.roundcube.net/browser/github/bin/cleandb.sh
|
||||||
|
|
||||||
include_once("/etc/roundcube/debian-db.php");
|
include_once("/etc/roundcube/debian-db.php");
|
||||||
|
if (! isset($dbtype)) {
|
||||||
|
global $err;
|
||||||
|
$err->raise("roundcube::hook_mail_delete_for_real",_("Problem: missing var in Debian Roundcube configuration file"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
switch ($dbtype) {
|
switch ($dbtype) {
|
||||||
case "sqlite":
|
case "sqlite":
|
||||||
|
@ -89,7 +93,7 @@ class m_roundcube {
|
||||||
if ($dbport != '') $dbport=":$dbport";
|
if ($dbport != '') $dbport=":$dbport";
|
||||||
if ($dbserver == '') $dbserver="localhost";
|
if ($dbserver == '') $dbserver="localhost";
|
||||||
$dbh= new PDO("$dbtype:host=$dbserver;dbname=$dbname;dbport=$dbport", $dbuser, $dbpass);
|
$dbh= new PDO("$dbtype:host=$dbserver;dbname=$dbname;dbport=$dbport", $dbuser, $dbpass);
|
||||||
$rcdb = "$dbtype:$dbuser:$dbpass@$dbserver$dbport/$dbname";
|
#$rcdb = "$dbtype:$dbuser:$dbpass@$dbserver$dbport/$dbname";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,6 @@ class m_squirrelmail {
|
||||||
global $db;
|
global $db;
|
||||||
// Search for the domain where the panel is hosted, then search for a webmail in it.
|
// Search for the domain where the panel is hosted, then search for a webmail in it.
|
||||||
$i=2;
|
$i=2;
|
||||||
$domain="";
|
|
||||||
if (!empty($_SERVER["HTTP_HOST"])) {
|
if (!empty($_SERVER["HTTP_HOST"])) {
|
||||||
do { // for each domain part (search panel.alternc.org then alternc.org then org, if the current panel is at www.panel.alternc.org)
|
do { // for each domain part (search panel.alternc.org then alternc.org then org, if the current panel is at www.panel.alternc.org)
|
||||||
$expl=explode(".",$_SERVER["HTTP_HOST"],$i);
|
$expl=explode(".",$_SERVER["HTTP_HOST"],$i);
|
||||||
|
|
Loading…
Reference in New Issue