Messages d'erreurs
This commit is contained in:
parent
f0bdadab79
commit
de6f7a4e98
|
@ -128,7 +128,7 @@ class m_cron {
|
|||
$db->query("SELECT uid FROM cron WHERE id = $id;");
|
||||
if (! $db->next_record()) { return "false"; } // return false if pb
|
||||
if ( $db->f('uid') != $cuid ) {
|
||||
$err->raise("cron","Identity problem");
|
||||
$err->raise("cron",_("Identity problem"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ class m_ftp {
|
|||
}
|
||||
return $r;
|
||||
} else {
|
||||
$err->raise("ftp",1);
|
||||
$err->raise("ftp",_("No ftp account found"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ class m_ftp {
|
|||
);
|
||||
return $r;
|
||||
} else {
|
||||
$err->raise("ftp",2);
|
||||
$err->raise("ftp",_("This ftp account does not exist"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -188,7 +188,7 @@ class m_ftp {
|
|||
$db->query("SELECT count(*) AS cnt FROM ftpusers WHERE id='$id' and uid='$cuid';");
|
||||
$db->next_record();
|
||||
if (!$db->f("cnt")) {
|
||||
$err->raise("ftp",2);
|
||||
$err->raise("ftp",_("This ftp account does not exist"));
|
||||
return false;
|
||||
}
|
||||
$dir=$bro->convertabsolute($dir);
|
||||
|
@ -197,7 +197,7 @@ class m_ftp {
|
|||
}
|
||||
$r=$this->prefix_list();
|
||||
if (!in_array($prefixe,$r)) {
|
||||
$err->raise("ftp",3);
|
||||
$err->raise("ftp",_("The chosen prefix is not allowed"));
|
||||
return false;
|
||||
}
|
||||
$lo=$mem->user["login"];
|
||||
|
@ -206,7 +206,7 @@ class m_ftp {
|
|||
$db->query("SELECT COUNT(*) AS cnt FROM ftpusers WHERE id!='$id' AND name='$prefixe$login';");
|
||||
$db->next_record();
|
||||
if ($db->f("cnt")) {
|
||||
$err->raise("ftp",4);
|
||||
$err->raise("ftp",_("This ftp account already exists"));
|
||||
return false;
|
||||
}
|
||||
$absolute=getuserpath()."/$dir";
|
||||
|
@ -214,7 +214,7 @@ class m_ftp {
|
|||
system("/bin/mkdir -p $absolute");
|
||||
}
|
||||
if (!is_dir($absolute)) {
|
||||
$err->raise("ftp",6);
|
||||
$err->raise("ftp",_("The directory cannot be created."));
|
||||
return false;
|
||||
}
|
||||
if (trim($pass)) {
|
||||
|
@ -246,7 +246,7 @@ class m_ftp {
|
|||
$db->next_record();
|
||||
$name=$db->f("name");
|
||||
if (!$name) {
|
||||
$err->raise("ftp",2);
|
||||
$err->raise("ftp",_("This ftp account does not exist"));
|
||||
return false;
|
||||
}
|
||||
$db->query("DELETE FROM ftpusers WHERE id='$id'");
|
||||
|
@ -271,14 +271,14 @@ class m_ftp {
|
|||
}
|
||||
$r=$this->prefix_list();
|
||||
if (!in_array($prefixe,$r) || $prefixe=="") {
|
||||
$err->raise("ftp",3);
|
||||
$err->raise("ftp",_("The chosen prefix is not allowed"));
|
||||
return false;
|
||||
}
|
||||
if ($login) $login="_".$login;
|
||||
$db->query("SELECT count(*) AS cnt FROM ftpusers WHERE name='".$prefixe.$login."'");
|
||||
$db->next_record();
|
||||
if ($db->f("cnt")) {
|
||||
$err->raise("ftp",4);
|
||||
$err->raise("ftp",_("This ftp account already exists"));
|
||||
return false;
|
||||
}
|
||||
$db->query("SELECT login FROM membres WHERE uid='$cuid';");
|
||||
|
@ -290,7 +290,7 @@ class m_ftp {
|
|||
system("/bin/mkdir -p $absolute");
|
||||
}
|
||||
if (!is_dir($absolute)) {
|
||||
$err->raise("ftp",6);
|
||||
$err->raise("ftp",_("The directory cannot be created."));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -306,7 +306,7 @@ class m_ftp {
|
|||
$db->query("INSERT INTO ftpusers (name,password, encrypted_password,homedir,uid) VALUES ('".$prefixe.$login."', '', '$encrypted_password', '$absolute', '$cuid')");
|
||||
return true;
|
||||
} else {
|
||||
$err->raise("ftp",5);
|
||||
$err->raise("ftp",_("Your ftp account quota is over. You cannot create more ftp accounts."));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ class m_hta {
|
|||
$err->log("hta","createdir",$dir);
|
||||
$absolute=$bro->convertabsolute($dir,0);
|
||||
if (!$absolute) {
|
||||
$err->raise("hta",8,$dir);
|
||||
$err->raise("hta",printf(_("The folder '%s' does not exist"),$dir));
|
||||
return false;
|
||||
}
|
||||
if (!file_exists($absolute)) {
|
||||
|
@ -75,12 +75,12 @@ class m_hta {
|
|||
}
|
||||
if (!file_exists("$absolute/.htaccess")) {
|
||||
if (!@touch("$absolute/.htaccess")) {
|
||||
$err->raise("hta",12);
|
||||
$err->raise("hta",_("File already exist"));
|
||||
return false;
|
||||
}
|
||||
$file = @fopen("$absolute/.htaccess","r+");
|
||||
if (!$file) {
|
||||
$err->raise("hta",12);
|
||||
$err->raise("hta",_("File already exist"));
|
||||
return false;
|
||||
}
|
||||
fseek($file,0);
|
||||
|
@ -90,7 +90,7 @@ class m_hta {
|
|||
}
|
||||
if (!file_exists("$absolute/.htpasswd")) {
|
||||
if (!touch("$absolute/.htpasswd")) {
|
||||
$err->raise("hta",12);
|
||||
$err->raise("hta",_("File already exist"));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -112,7 +112,7 @@ class m_hta {
|
|||
$absolute="$L_ALTERNC_LOC/html/".substr($mem->user["login"],0,1)."/".$mem->user["login"];
|
||||
exec("find $absolute -name .htpasswd|sort",$sortie);
|
||||
if(!count($sortie)){
|
||||
$err->raise("hta",4);
|
||||
$err->raise("hta",_("No protected folder"));
|
||||
return false;
|
||||
}
|
||||
$pattern="/^".preg_quote($L_ALTERNC_LOC,"/")."\/html\/.\/[^\/]*\/(.*)\/\.htpasswd/";
|
||||
|
@ -189,15 +189,15 @@ class m_hta {
|
|||
$err->log("hta","deldir",$dir);
|
||||
$dir=$bro->convertabsolute($dir,0);
|
||||
if (!$dir) {
|
||||
$err->raise("hta",8,$dir);
|
||||
$err->raise("hta",printf(("The folder '%s' does not exist"),$dir));
|
||||
return false;
|
||||
}
|
||||
if (!@unlink("$dir/.htaccess")) {
|
||||
$err->raise("hta",5,$dir);
|
||||
$err->raise("hta",printf(_("I cannot delete the file '%s'/.htaccess"),$dir));
|
||||
return false;
|
||||
}
|
||||
if (!@unlink("$dir/.htpasswd")) {
|
||||
$err->raise("hta",6,$dir);
|
||||
$err->raise("hta",printf(_("I cannot delete the file '%s'/.htpasswd"),$dir));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -217,7 +217,7 @@ class m_hta {
|
|||
$err->log("hta","add_user",$user."/".$dir);
|
||||
$absolute=$bro->convertabsolute($dir,0);
|
||||
if (!file_exists($absolute)) {
|
||||
$err->raise("hta",8,$dir);
|
||||
$err->raise("hta",printf(("The folder '%s' does not exist"),$dir));
|
||||
return false;
|
||||
}
|
||||
if (checkloginmail($user)){
|
||||
|
@ -230,7 +230,7 @@ class m_hta {
|
|||
|
||||
$file = @fopen("$absolute/.htpasswd","a+");
|
||||
if (!$file) {
|
||||
$err->raise("hta",12);
|
||||
$err->raise("hta",_("File already exist"));
|
||||
return false;
|
||||
}
|
||||
fseek($file,0);
|
||||
|
@ -238,7 +238,7 @@ class m_hta {
|
|||
$s=fgets($file,1024);
|
||||
$t=explode(":",$s);
|
||||
if ($t[0]==$user) {
|
||||
$err->raise("hta",10,$user);
|
||||
$err->raise("hta",printf(_("The user '%s' already exist for this folder"),$user));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -250,7 +250,7 @@ class m_hta {
|
|||
fclose($file);
|
||||
return true;
|
||||
} else {
|
||||
$err->raise("hta",11);
|
||||
$err->raise("hta",_("Please enter a valid username"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -268,14 +268,14 @@ class m_hta {
|
|||
$err->log("hta","del_user",$lst."/".$dir);
|
||||
$absolute=$bro->convertabsolute($dir,0);
|
||||
if (!file_exists($absolute)) {
|
||||
$err->raise("hta",8,$dir);
|
||||
$err->raise("hta",printf(_("The folder '%s' does not exist"),$dir));
|
||||
return false;
|
||||
}
|
||||
touch("$absolute/.htpasswd.new");
|
||||
$file = fopen("$absolute/.htpasswd","r");
|
||||
$newf = fopen("$absolute/.htpasswd.new","a");
|
||||
if (!$file || !$newf) {
|
||||
$err->raise("hta",12);
|
||||
$err->raise("hta",_("File already exist"));
|
||||
return false;
|
||||
}
|
||||
reset($lst);
|
||||
|
@ -309,7 +309,7 @@ class m_hta {
|
|||
$err->log("hta","change_pass",$user."/".$dir);
|
||||
$absolute=$bro->convertabsolute($dir,0);
|
||||
if (!file_exists($absolute)) {
|
||||
$err->raise("hta",8,$dir);
|
||||
$err->raise("hta",printf(_"The folder '%s' does not exist"),$dir));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -324,7 +324,7 @@ class m_hta {
|
|||
$file = fopen("$absolute/.htpasswd","r");
|
||||
$newf = fopen("$absolute/.htpasswd.new","a");
|
||||
if (!$file || !$newf) {
|
||||
$err->raise("hta",12);
|
||||
$err->raise("hta",_("File already exist"));
|
||||
return false;
|
||||
}
|
||||
while (!feof($file)) {
|
||||
|
@ -379,7 +379,7 @@ class m_hta {
|
|||
} // Reading config file
|
||||
fclose($file);
|
||||
if ($errr || in_array(0,$lignes)) {
|
||||
$err->raise("hta",1);
|
||||
$err->raise("hta",_("An incompatible .htaccess file exists in this folder."));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -181,7 +181,7 @@ class m_quota {
|
|||
// Now we check that the value has been written properly :
|
||||
exec("/usr/lib/alternc/quota_get $cuid &> /dev/null &",$a);
|
||||
if ($size!=$a[1]) {
|
||||
$err->raise("quota",1);
|
||||
$err->raise("quota",_("Error writing the quota entry !"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue