[fix] class m_messages fixed to use 'level' instead of 'type' or 'cat' + force CAP on levels + merge OK and INFO
This commit is contained in:
parent
8c524bd80d
commit
33f8e78885
|
@ -28,7 +28,7 @@ require_once("../class/config.php");
|
||||||
include_once("head.php");
|
include_once("head.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,13 +15,13 @@ getFields($fields);
|
||||||
|
|
||||||
if (!empty($delete_id)) {
|
if (!empty($delete_id)) {
|
||||||
if (! $authip->ip_delete($delete_id)) {
|
if (! $authip->ip_delete($delete_id)) {
|
||||||
$msg->raise('Error', "admin", _("Error during deletion"));
|
$msg->raise("ERROR", "admin", _("Error during deletion"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($ipsub)) {
|
if (!empty($ipsub)) {
|
||||||
if (! $authip->ip_save_whitelist($id, $ipsub, $infos)) {
|
if (! $authip->ip_save_whitelist($id, $ipsub, $infos)) {
|
||||||
$msg->raise('Error', "admin", _("Error during recording"));
|
$msg->raise("ERROR", "admin", _("Error during recording"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ require_once("../class/config.php");
|
||||||
include("head.php");
|
include("head.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ require_once("../class/config.php");
|
||||||
include_once("head.php");
|
include_once("head.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
@ -44,21 +44,21 @@ $fields = array (
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
|
|
||||||
if (!$uid) {
|
if (!$uid) {
|
||||||
$msg->raise('Error', "admin", _("Account not found"));
|
$msg->raise("ERROR", "admin", _("Account not found"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
include_once("foot.php");
|
include_once("foot.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$admin->checkcreator($uid)) {
|
if (!$admin->checkcreator($uid)) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
include_once("foot.php");
|
include_once("foot.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$r=$admin->get($uid)) {
|
if (!$r=$admin->get($uid)) {
|
||||||
$msg->raise('Error', "admin", _("User does not exist"));
|
$msg->raise("ERROR", "admin", _("User does not exist"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
include_once("foot.php");
|
include_once("foot.php");
|
||||||
exit();
|
exit();
|
||||||
|
@ -83,7 +83,7 @@ if (! ($confirmed ) ) {
|
||||||
print "<h3>" . _("Domains of user: ") . $r["login"] . "</h3>";
|
print "<h3>" . _("Domains of user: ") . $r["login"] . "</h3>";
|
||||||
} else {
|
} else {
|
||||||
if (empty($redirect)) {
|
if (empty($redirect)) {
|
||||||
$msg->raise('Error', "admin", _("Missing redirect url."));
|
$msg->raise("ERROR", "admin", _("Missing redirect url."));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
include_once("foot.php");
|
include_once("foot.php");
|
||||||
exit();
|
exit();
|
||||||
|
@ -135,7 +135,8 @@ foreach ($domains as $key => $domain) {
|
||||||
# 2.2 change the subdomain to redirect to http://spam.koumbit.org/
|
# 2.2 change the subdomain to redirect to http://spam.koumbit.org/
|
||||||
$dom->lock();
|
$dom->lock();
|
||||||
if (!$dom->set_sub_domain($domain, $sub, $dom->type_url, "edit", $redirect)) {
|
if (!$dom->set_sub_domain($domain, $sub, $dom->type_url, "edit", $redirect)) {
|
||||||
print "-- error in $sub.$domain: " . $msg->msg_str("Error", "") . "\n";
|
print "-- error in $sub.$domain: ";
|
||||||
|
echo $msg->msg_html("ERROR");
|
||||||
}
|
}
|
||||||
$dom->unlock();
|
$dom->unlock();
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ if ($create_dom && !empty($create_dom_list) ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($pass != $passconf) {
|
if ($pass != $passconf) {
|
||||||
$msg->raise("Error", "admin", _("Passwords do not match"));
|
$msg->raise("ERROR", "admin", _("Passwords do not match"));
|
||||||
include("adm_add.php");
|
include("adm_add.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ if (!($u=$admin->add_mem($login, $pass, $nom, $prenom, $nmail, $canpass, $type,
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$msg->raise("Ok", "admin", _("The new member has been successfully created"));
|
$msg->raise("INFO", "admin", _("The new member has been successfully created"));
|
||||||
|
|
||||||
include("adm_list.php");
|
include("adm_list.php");
|
||||||
exit;
|
exit;
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -46,18 +46,18 @@ getFields($fields);
|
||||||
if($action == "add") {
|
if($action == "add") {
|
||||||
|
|
||||||
if($quota->addtype($type)) {
|
if($quota->addtype($type)) {
|
||||||
$msg->raise('Ok', "admin", _("Account type"). " \"".htmlentities($type)."\" "._("added"));
|
$msg->raise("INFO", "admin", _("Account type"). " \"".htmlentities($type)."\" "._("added"));
|
||||||
} else {
|
} else {
|
||||||
$msg->raise('Error', "admin", _("Account type"). " \"".htmlentities($type)."\" "._("could not be added"));
|
$msg->raise("ERROR", "admin", _("Account type"). " \"".htmlentities($type)."\" "._("could not be added"));
|
||||||
}
|
}
|
||||||
include("adm_defquotas.php");
|
include("adm_defquotas.php");
|
||||||
} else if($action == "delete") {
|
} else if($action == "delete") {
|
||||||
if($del_confirm == "y"){
|
if($del_confirm == "y"){
|
||||||
if(!empty($type)) {
|
if(!empty($type)) {
|
||||||
if($quota->deltype($type)) {
|
if($quota->deltype($type)) {
|
||||||
$msg->raise('Ok', "admin", _("Account type"). " \"".htmlentities($type)."\" "._("deleted"));
|
$msg->raise("INFO", "admin", _("Account type"). " \"".htmlentities($type)."\" "._("deleted"));
|
||||||
} else {
|
} else {
|
||||||
$msg->raise('Error', "admin", _("Account type"). " \"".htmlentities($type)."\" "._("could not be deleted"));
|
$msg->raise("ERROR", "admin", _("Account type"). " \"".htmlentities($type)."\" "._("could not be deleted"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
include("adm_defquotas.php");
|
include("adm_defquotas.php");
|
||||||
|
@ -93,9 +93,9 @@ if($action == "add") {
|
||||||
}
|
}
|
||||||
|
|
||||||
if($quota->setdefaults($c)) {
|
if($quota->setdefaults($c)) {
|
||||||
$msg->raise('Ok', "admin", _("Default quotas successfully changed"));
|
$msg->raise("INFO", "admin", _("Default quotas successfully changed"));
|
||||||
} else {
|
} else {
|
||||||
$msg->raise('Error', "admin", _("Default quotas could not be set."));
|
$msg->raise("ERROR", "admin", _("Default quotas could not be set."));
|
||||||
}
|
}
|
||||||
include("adm_panel.php");
|
include("adm_panel.php");
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -44,21 +44,21 @@ getFields($fields);
|
||||||
if($del_confirm == "y"){
|
if($del_confirm == "y"){
|
||||||
foreach ($accountList as $key => $val) {
|
foreach ($accountList as $key => $val) {
|
||||||
if (!$admin->checkcreator($val)) {
|
if (!$admin->checkcreator($val)) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
if (!($u=$admin->get($val)) || !$admin->del_mem($val)) {
|
if (!($u=$admin->get($val)) || !$admin->del_mem($val)) {
|
||||||
$msg->raise("Error", "admin", _("Member '%s' does not exist"),$val);
|
$msg->raise("ERROR", "admin", _("Member '%s' does not exist"),$val);
|
||||||
} else {
|
} else {
|
||||||
$msg->raise("Ok", "admin", _("Member %s successfully deleted"),$u["login"]);
|
$msg->raise("INFO", "admin", _("Member %s successfully deleted"),$u["login"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
include("adm_list.php");
|
include("adm_list.php");
|
||||||
exit();
|
exit();
|
||||||
} else {
|
} else {
|
||||||
if (!is_array($accountList) || count($accountList)==0) {
|
if (!is_array($accountList) || count($accountList)==0) {
|
||||||
$msg->raise("Error", "admin", _("Please check the accounts you want to delete"));
|
$msg->raise("ERROR", "admin", _("Please check the accounts you want to delete"));
|
||||||
require("adm_list.php");
|
require("adm_list.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -57,13 +57,13 @@ getFields($fields);
|
||||||
|
|
||||||
|
|
||||||
if ($subadmin==0 && !$admin->checkcreator($uid)) {
|
if ($subadmin==0 && !$admin->checkcreator($uid)) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($pass != $passconf) {
|
if ($pass != $passconf) {
|
||||||
$msg->raise("Error", "admin", _("Passwords do not match"));
|
$msg->raise("ERROR", "admin", _("Passwords do not match"));
|
||||||
include("adm_edit.php");
|
include("adm_edit.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -75,6 +75,6 @@ if ($uid==$mem->user["uid"]) {
|
||||||
if (!$admin->update_mem($uid, $nmail, $nom, $prenom, $pass, $enabled, $canpass, $type, $duration, $notes, $reset_quotas)){
|
if (!$admin->update_mem($uid, $nmail, $nom, $prenom, $pass, $enabled, $canpass, $type, $duration, $notes, $reset_quotas)){
|
||||||
include("adm_edit.php");
|
include("adm_edit.php");
|
||||||
} else {
|
} else {
|
||||||
$msg->raise("Ok", "admin", _("The member has been successfully edited"));
|
$msg->raise("INFO", "admin", _("The member has been successfully edited"));
|
||||||
include("adm_list.php");
|
include("adm_list.php");
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -30,9 +30,9 @@ getFields($fields);
|
||||||
|
|
||||||
if (!empty($domup)) {
|
if (!empty($domup)) {
|
||||||
if (!$dom->update_default_subdomains($domup)) {
|
if (!$dom->update_default_subdomains($domup)) {
|
||||||
$msg->raise('Error', "admin", _("There was an error during the record."));
|
$msg->raise("ERROR", "admin", _("There was an error during the record."));
|
||||||
} else {
|
} else {
|
||||||
$msg->raise('Ok', "admin", _("Save done."));
|
$msg->raise("INFO", "admin", _("Save done."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ getFields($fields);
|
||||||
if (! $dom->domains_type_update($name, $description, $target, $entry, $compatibility, $enable, $only_dns, $need_dns, $advanced,$create_tmpdir,$create_targetdir) ) {
|
if (! $dom->domains_type_update($name, $description, $target, $entry, $compatibility, $enable, $only_dns, $need_dns, $advanced,$create_tmpdir,$create_targetdir) ) {
|
||||||
include("adm_domstypedoedit.php");
|
include("adm_domstypedoedit.php");
|
||||||
} else {
|
} else {
|
||||||
$msg->raise('Ok', "admin", _("Domain type is updated"));
|
$msg->raise("INFO", "admin", _("Domain type is updated"));
|
||||||
include("adm_domstype.php");
|
include("adm_domstype.php");
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
*/
|
*/
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ getFields($fields);
|
||||||
|
|
||||||
|
|
||||||
if (! empty($name) || ($dom->domains_type_regenerate($name)) ) {
|
if (! empty($name) || ($dom->domains_type_regenerate($name)) ) {
|
||||||
$msg->raise('Ok', "admin", _("Regenerate pending"));
|
$msg->raise("INFO", "admin", _("Regenerate pending"));
|
||||||
}
|
}
|
||||||
|
|
||||||
include("adm_domstype.php");
|
include("adm_domstype.php");
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ $fields = array (
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
|
|
||||||
if ($admin->su2normal($uid)) {
|
if ($admin->su2normal($uid)) {
|
||||||
$msg->raise("Ok", "admin", _("This account is now a normal account"));
|
$msg->raise("INFO", "admin", _("This account is now a normal account"));
|
||||||
}
|
}
|
||||||
|
|
||||||
include("adm_edit.php");
|
include("adm_edit.php");
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ $fields = array (
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
|
|
||||||
if (!$admin->checkcreator($uid)) {
|
if (!$admin->checkcreator($uid)) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ if (!$admin->checkcreator($uid)) {
|
||||||
if (!$admin->renew_mem($uid, $periods)){
|
if (!$admin->renew_mem($uid, $periods)){
|
||||||
include("adm_edit.php");
|
include("adm_edit.php");
|
||||||
} else {
|
} else {
|
||||||
$msg->raise("Ok", "admin", _("The member has been successfully renewed"));
|
$msg->raise("INFO", "admin", _("The member has been successfully renewed"));
|
||||||
include("adm_list.php");
|
include("adm_list.php");
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ $fields = array (
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
|
|
||||||
if ($admin->normal2su($uid)) {
|
if ($admin->normal2su($uid)) {
|
||||||
$msg->raise("Ok", "admin", _("This account is now an administrator account"));
|
$msg->raise("INFO", "admin", _("This account is now an administrator account"));
|
||||||
}
|
}
|
||||||
|
|
||||||
include("adm_edit.php");
|
include("adm_edit.php");
|
||||||
|
|
|
@ -33,7 +33,7 @@ require_once("../class/config.php");
|
||||||
include_once("head.php");
|
include_once("head.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ getFields($fields);
|
||||||
$subadmin=variable_get("subadmin_restriction");
|
$subadmin=variable_get("subadmin_restriction");
|
||||||
|
|
||||||
if ($subadmin==0 && !$admin->checkcreator($uid)) {
|
if ($subadmin==0 && !$admin->checkcreator($uid)) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ require_once("../class/config.php");
|
||||||
include("head.php");
|
include("head.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -46,9 +46,9 @@ getFields($fields);
|
||||||
|
|
||||||
if ( !empty($submit) ) {
|
if ( !empty($submit) ) {
|
||||||
if ($admin->mailallmembers($subject,$message,$from)) {
|
if ($admin->mailallmembers($subject,$message,$from)) {
|
||||||
$msg->raise("Ok", "admin", _("The email was successfully sent"));
|
$msg->raise("INFO", "admin", _("The email was successfully sent"));
|
||||||
} else {
|
} else {
|
||||||
$msg->raise("Ok", "admin", _("There was an error"));
|
$msg->raise("INFO", "admin", _("There was an error"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ require_once("../class/config.php");
|
||||||
include_once("head.php");
|
include_once("head.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
include_once('foot.php');
|
include_once('foot.php');
|
||||||
exit();
|
exit();
|
||||||
|
@ -55,7 +55,7 @@ $subadmin = variable_get("subadmin_restriction", 0);
|
||||||
// If we ask for all account but we aren't "admin" and
|
// If we ask for all account but we aren't "admin" and
|
||||||
// subadmin var is not 1
|
// subadmin var is not 1
|
||||||
if ($show == "all" && !$subadmin == 1 && $cuid != 2000) {
|
if ($show == "all" && !$subadmin == 1 && $cuid != 2000) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
include('foot.php');
|
include('foot.php');
|
||||||
exit();
|
exit();
|
||||||
|
@ -143,7 +143,7 @@ echo $msg->msg_html_all();
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if (!is_array($accountList) || empty($accountList)) {
|
if (!is_array($accountList) || empty($accountList)) {
|
||||||
$msg->raise('Error', "admin", _("No account defined for now"));
|
$msg->raise("ERROR", "admin", _("No account defined for now"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
include('foot.php');
|
include('foot.php');
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled || $cuid!=2000) {
|
if (!$admin->enabled || $cuid!=2000) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,14 +46,14 @@ if ( empty($id) && isset($_COOKIE["oldid"]) && !empty($_COOKIE["oldid"])) {
|
||||||
list($newuid,$passcheck)=explode("/",$_COOKIE["oldid"]);
|
list($newuid,$passcheck)=explode("/",$_COOKIE["oldid"]);
|
||||||
$newuid=intval($newuid);
|
$newuid=intval($newuid);
|
||||||
if (!$newuid) {
|
if (!$newuid) {
|
||||||
$msg->raise("Error", "admin", _("Your authentication information are incorrect"));
|
$msg->raise("ERROR", "admin", _("Your authentication information are incorrect"));
|
||||||
include("index.php");
|
include("index.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
$admin->enabled=true;
|
$admin->enabled=true;
|
||||||
$r=$admin->get($newuid);
|
$r=$admin->get($newuid);
|
||||||
if ($passcheck!=md5($r["pass"])) {
|
if ($passcheck!=md5($r["pass"])) {
|
||||||
$msg->raise("Ok", "admin", _("Your authentication information are incorrect"));
|
$msg->raise("INFO", "admin", _("Your authentication information are incorrect"));
|
||||||
include("index.php");
|
include("index.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ if ( empty($id) && isset($_COOKIE["oldid"]) && !empty($_COOKIE["oldid"])) {
|
||||||
|
|
||||||
// * with a user id to go to (we check the current account is admin and is allowed to connect to this account)
|
// * with a user id to go to (we check the current account is admin and is allowed to connect to this account)
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ if (!$admin->enabled) {
|
||||||
// Depending on subadmin_restriction, a subadmin can (or cannot) connect to account he didn't create
|
// Depending on subadmin_restriction, a subadmin can (or cannot) connect to account he didn't create
|
||||||
$subadmin=variable_get("subadmin_restriction");
|
$subadmin=variable_get("subadmin_restriction");
|
||||||
if ($subadmin==0 && !$admin->checkcreator($id)) {
|
if ($subadmin==0 && !$admin->checkcreator($id)) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -45,13 +45,13 @@ getFields($fields);
|
||||||
if ($delaccount) {
|
if ($delaccount) {
|
||||||
// Delete an account
|
// Delete an account
|
||||||
if ($mail->del_slave_account($delaccount)) {
|
if ($mail->del_slave_account($delaccount)) {
|
||||||
$msg->raise('Ok', "admin", _("The requested account has been deleted. It is now denied."));
|
$msg->raise("INFO", "admin", _("The requested account has been deleted. It is now denied."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($newlogin) {
|
if ($newlogin) {
|
||||||
// Add an account
|
// Add an account
|
||||||
if ($mail->add_slave_account($newlogin,$newpass)) {
|
if ($mail->add_slave_account($newlogin,$newpass)) {
|
||||||
$msg->raise('Ok', "admin", _("The requested account address has been created. It is now allowed."));
|
$msg->raise("INFO", "admin", _("The requested account address has been created. It is now allowed."));
|
||||||
$newlogin='';$newpass='';
|
$newlogin='';$newpass='';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -55,23 +55,23 @@ $c=$admin->listPasswordPolicies();
|
||||||
|
|
||||||
if (isset($doedit) && $doedit) {
|
if (isset($doedit) && $doedit) {
|
||||||
if (!$c[$doedit]) {
|
if (!$c[$doedit]) {
|
||||||
$msg->raise('Error', "admin", _("Policy not found"));
|
$msg->raise("ERROR", "admin", _("Policy not found"));
|
||||||
} else {
|
} else {
|
||||||
// Change it ;)
|
// Change it ;)
|
||||||
if ($admin->editPolicy($doedit,$minsize,$maxsize,$classcount,$allowlogin)) {
|
if ($admin->editPolicy($doedit,$minsize,$maxsize,$classcount,$allowlogin)) {
|
||||||
$msg->raise('Ok', "admin", _("Policy changed"));
|
$msg->raise("INFO", "admin", _("Policy changed"));
|
||||||
unset($edit);
|
unset($edit);
|
||||||
$c=$admin->listPasswordPolicies();
|
$c=$admin->listPasswordPolicies();
|
||||||
} else {
|
} else {
|
||||||
$msg->raise('Error', "admin", _("Cannot edit the policy, an error occurred"));
|
$msg->raise("ERROR", "admin", _("Cannot edit the policy, an error occurred"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo $msg->msg_html_all("<li>", true, true);
|
echo $msg->msg_html_all(true, true);
|
||||||
|
|
||||||
if (!empty($edit)) {
|
if (!empty($edit)) {
|
||||||
if (!$c[$edit]) {
|
if (!$c[$edit]) {
|
||||||
$msg->raise('Error', "admin", _("Policy not found"));
|
$msg->raise("ERROR", "admin", _("Policy not found"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
} else {
|
} else {
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ while (list($key,$val)=each($qlist)) {
|
||||||
$mem->unsu();
|
$mem->unsu();
|
||||||
|
|
||||||
if (!$msg->has_msgs("Error"))
|
if (!$msg->has_msgs("Error"))
|
||||||
$msg->raise("Ok", "admin", _("The quotas has been successfully edited"));
|
$msg->raise("INFO", "admin", _("The quotas has been successfully edited"));
|
||||||
|
|
||||||
include("adm_list.php");
|
include("adm_list.php");
|
||||||
exit;
|
exit;
|
||||||
|
|
|
@ -31,7 +31,7 @@ require_once("../class/config.php");
|
||||||
include_once("head.php");
|
include_once("head.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
include_once("foot.php");
|
include_once("foot.php");
|
||||||
exit();
|
exit();
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -49,13 +49,13 @@ getFields($fields);
|
||||||
if ($delaccount) {
|
if ($delaccount) {
|
||||||
// Delete an account
|
// Delete an account
|
||||||
if ($dom->del_slave_account($delaccount)) {
|
if ($dom->del_slave_account($delaccount)) {
|
||||||
$msg->raise('Ok', "admin", _("The requested account has been deleted. It is now denied."));
|
$msg->raise("INFO", "admin", _("The requested account has been deleted. It is now denied."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($newlogin) {
|
if ($newlogin) {
|
||||||
// Add an account
|
// Add an account
|
||||||
if ($dom->add_slave_account($newlogin,$newpass)) {
|
if ($dom->add_slave_account($newlogin,$newpass)) {
|
||||||
$msg->raise('Ok', "admin", _("The requested account address has been created. It is now allowed."));
|
$msg->raise("INFO", "admin", _("The requested account address has been created. It is now allowed."));
|
||||||
unset($newlogin); unset($newpass);
|
unset($newlogin); unset($newpass);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,13 +63,13 @@ if ($newlogin) {
|
||||||
if ($delip) {
|
if ($delip) {
|
||||||
// Delete an ip address/class
|
// Delete an ip address/class
|
||||||
if ($dom->del_slave_ip($delip)) {
|
if ($dom->del_slave_ip($delip)) {
|
||||||
$msg->raise('Ok', "admin", _("The requested ip address has been deleted. It will be denied in one hour."));
|
$msg->raise("INFO", "admin", _("The requested ip address has been deleted. It will be denied in one hour."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($newip) {
|
if ($newip) {
|
||||||
// Add an ip address/class
|
// Add an ip address/class
|
||||||
if ($dom->add_slave_ip($newip,$newclass)) {
|
if ($dom->add_slave_ip($newip,$newclass)) {
|
||||||
$msg->raise('Ok', "admin", _("The requested ip address has been added to the list. It will be allowed in one hour."));
|
$msg->raise("INFO", "admin", _("The requested ip address has been added to the list. It will be allowed in one hour."));
|
||||||
unset($newip); unset($newclass);
|
unset($newip); unset($newclass);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -44,11 +44,11 @@ getFields($fields);
|
||||||
if (is_array($sel)) {
|
if (is_array($sel)) {
|
||||||
for($i=0;$i<count($sel);$i++) {
|
for($i=0;$i<count($sel);$i++) {
|
||||||
if (!$admin->deltld($sel[$i])) {
|
if (!$admin->deltld($sel[$i])) {
|
||||||
$msg->raise("Error", "admin", _("Some TLD cannot be deleted...")." : ".$sel[$i]);
|
$msg->raise("ERROR", "admin", _("Some TLD cannot be deleted...")." : ".$sel[$i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!$msg->has_msgs("Error"))
|
if (!$msg->has_msgs("Error"))
|
||||||
$msg->raise("Ok", "admin", _("The requested TLD has been deleted"));
|
$msg->raise("INFO", "admin", _("The requested TLD has been deleted"));
|
||||||
}
|
}
|
||||||
|
|
||||||
include_once("head.php");
|
include_once("head.php");
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ if (!$admin->addtld($tld,$mode)) {
|
||||||
include("adm_tldadd.php");
|
include("adm_tldadd.php");
|
||||||
exit();
|
exit();
|
||||||
} else {
|
} else {
|
||||||
$msg->raise("Ok", "admin", _("The TLD has been successfully added"));
|
$msg->raise("INFO", "admin", _("The TLD has been successfully added"));
|
||||||
include("adm_tld.php");
|
include("adm_tld.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ getFields($fields);
|
||||||
|
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ if (!$admin->edittld($tld,$mode)) {
|
||||||
include("adm_tldedit.php");
|
include("adm_tldedit.php");
|
||||||
exit();
|
exit();
|
||||||
} else {
|
} else {
|
||||||
$msg->raise("Ok", "admin", _("The TLD has been successfully edited"));
|
$msg->raise("INFO", "admin", _("The TLD has been successfully edited"));
|
||||||
include("adm_tld.php");
|
include("adm_tld.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,14 +31,14 @@ require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
if ( ! ( $isinvited && isset($oldid) && !empty($oldid) && $oldid==2000) ) { // Allow sub admins
|
if ( ! ( $isinvited && isset($oldid) && !empty($oldid) && $oldid==2000) ) { // Allow sub admins
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! isset($L_INOTIFY_UPDATE_DOMAIN)) {
|
if (! isset($L_INOTIFY_UPDATE_DOMAIN)) {
|
||||||
$msg->raise('Error', "admin", _("Missing INOTIFY_UPDATE_DOMAIN var in /etc/alternc/local.sh . Fix it!"));
|
$msg->raise("ERROR", "admin", _("Missing INOTIFY_UPDATE_DOMAIN var in /etc/alternc/local.sh . Fix it!"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,14 +68,14 @@ if (isset($saveret) && $saveret) {
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
if ($bro->save($editfile,$R,$texte)) {
|
if ($bro->save($editfile,$R,$texte)) {
|
||||||
$msg->raise("Ok", "bro", _("Your file %s has been saved")." (".format_date(_('%3$d-%2$d-%1$d %4$d:%5$d'),date("Y-m-d H:i:s")).")", $editfile);
|
$msg->raise("INFO", "bro", _("Your file %s has been saved")." (".format_date(_('%3$d-%2$d-%1$d %4$d:%5$d'),date("Y-m-d H:i:s")).")", $editfile);
|
||||||
include("bro_main.php");
|
include("bro_main.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isset($save) && $save) {
|
if (isset($save) && $save) {
|
||||||
if ($bro->save($editfile,$R,$texte)) {
|
if ($bro->save($editfile,$R,$texte)) {
|
||||||
$msg->raise("Ok", "bro", _("Your file %s has been saved")." (".format_date(_('%3$d-%2$d-%1$d %4$d:%5$d'),date("Y-m-d H:i:s")).")", $editfile);
|
$msg->raise("INFO", "bro", _("Your file %s has been saved")." (".format_date(_('%3$d-%2$d-%1$d %4$d:%5$d'),date("Y-m-d H:i:s")).")", $editfile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,13 +71,13 @@ if (!empty($formu) && $formu) {
|
||||||
switch ($formu) {
|
switch ($formu) {
|
||||||
case 1: // Create the folder $R.$nomfich
|
case 1: // Create the folder $R.$nomfich
|
||||||
if ($bro->CreateDir($R,$nomfich)) {
|
if ($bro->CreateDir($R,$nomfich)) {
|
||||||
$msg->raise("Ok", "bro", _("The folder '%s' was successfully created"), $nomfich);
|
$msg->raise("INFO", "bro", _("The folder '%s' was successfully created"), $nomfich);
|
||||||
}
|
}
|
||||||
$p=$bro->GetPrefs();
|
$p=$bro->GetPrefs();
|
||||||
break;
|
break;
|
||||||
case 6: // Create the file $R.$nomfich
|
case 6: // Create the file $R.$nomfich
|
||||||
if ($bro->CreateFile($R,$nomfich)) {
|
if ($bro->CreateFile($R,$nomfich)) {
|
||||||
$msg->raise("Ok", "bro", _("The file '%s' was successfully created"), $nomfich);
|
$msg->raise("INFO", "bro", _("The file '%s' was successfully created"), $nomfich);
|
||||||
}
|
}
|
||||||
$p=$bro->GetPrefs();
|
$p=$bro->GetPrefs();
|
||||||
if ($p["createfile"]==1) {
|
if ($p["createfile"]==1) {
|
||||||
|
@ -92,9 +92,9 @@ if (!empty($formu) && $formu) {
|
||||||
if ($bro->DeleteFile($d,$R)) {
|
if ($bro->DeleteFile($d,$R)) {
|
||||||
foreach ($d as $v) {
|
foreach ($d as $v) {
|
||||||
if (is_dir($absolute . "/" . $v))
|
if (is_dir($absolute . "/" . $v))
|
||||||
$msg->raise("Ok", "bro", _("The folder '%s' was successfully deleted"), $v);
|
$msg->raise("INFO", "bro", _("The folder '%s' was successfully deleted"), $v);
|
||||||
else
|
else
|
||||||
$msg->raise("Ok", "bro", _("The file '%s' was successfully deleted"), $v);
|
$msg->raise("INFO", "bro", _("The file '%s' was successfully deleted"), $v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elseif (empty($cancel) && is_array($d)) {
|
} elseif (empty($cancel) && is_array($d)) {
|
||||||
|
@ -128,22 +128,22 @@ if (!empty($formu) && $formu) {
|
||||||
if ($bro->CopyFile($d,$R,$actmoveto)) {
|
if ($bro->CopyFile($d,$R,$actmoveto)) {
|
||||||
if (count($d) == 1) {
|
if (count($d) == 1) {
|
||||||
if (is_dir($absolute . "/" . $d[0]))
|
if (is_dir($absolute . "/" . $d[0]))
|
||||||
$msg->raise("Ok", "bro", _("The folder '%s' was successfully copied to '%s'"), array($d[0], $actmoveto));
|
$msg->raise("INFO", "bro", _("The folder '%s' was successfully copied to '%s'"), array($d[0], $actmoveto));
|
||||||
else
|
else
|
||||||
$msg->raise("Ok", "bro", _("The file '%s' was successfully copied to '%s'"), array($d[0], $actmoveto));
|
$msg->raise("INFO", "bro", _("The file '%s' was successfully copied to '%s'"), array($d[0], $actmoveto));
|
||||||
} else
|
} else
|
||||||
$msg->raise("Ok", "bro", _("The files / folders were successfully copied"));
|
$msg->raise("INFO", "bro", _("The files / folders were successfully copied"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($actmove) {
|
if ($actmove) {
|
||||||
if ($bro->MoveFile($d,$R,$actmoveto)) {
|
if ($bro->MoveFile($d,$R,$actmoveto)) {
|
||||||
if (count($d) == 1) {
|
if (count($d) == 1) {
|
||||||
if (is_dir($absolute . "/" . $d[0]))
|
if (is_dir($absolute . "/" . $d[0]))
|
||||||
$msg->raise("Ok", "bro", _("The folder '%s' was successfully moved to '%s'"), array($d[0], $actmoveto));
|
$msg->raise("INFO", "bro", _("The folder '%s' was successfully moved to '%s'"), array($d[0], $actmoveto));
|
||||||
else
|
else
|
||||||
$msg->raise("Ok", "bro", _("The file '%s' was successfully moved to '%s'"), array($d[0], $actmoveto));
|
$msg->raise("INFO", "bro", _("The file '%s' was successfully moved to '%s'"), array($d[0], $actmoveto));
|
||||||
} else
|
} else
|
||||||
$msg->raise("Ok", "bro", _("The files / folders were successfully moved"));
|
$msg->raise("INFO", "bro", _("The files / folders were successfully moved"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -151,21 +151,21 @@ if (!empty($formu) && $formu) {
|
||||||
if ($bro->RenameFile($R,$o,$d)) { // Rename $R (directory) $o (old) $d (new) names
|
if ($bro->RenameFile($R,$o,$d)) { // Rename $R (directory) $o (old) $d (new) names
|
||||||
if (count($d) == 1) {
|
if (count($d) == 1) {
|
||||||
if (is_dir($absolute . "/" . $d[0]))
|
if (is_dir($absolute . "/" . $d[0]))
|
||||||
$msg->raise("Ok", "bro", _("The folder '%s' was successfully renamed to '%s'"), array($o[0], $d[0]));
|
$msg->raise("INFO", "bro", _("The folder '%s' was successfully renamed to '%s'"), array($o[0], $d[0]));
|
||||||
else
|
else
|
||||||
$msg->raise("Ok", "bro", _("The file '%s' was successfully renamed to '%s'"), array($o[0], $d[0]));
|
$msg->raise("INFO", "bro", _("The file '%s' was successfully renamed to '%s'"), array($o[0], $d[0]));
|
||||||
} else
|
} else
|
||||||
$msg->raise("Ok", "bro", _("The files / folders were successfully renamed"));
|
$msg->raise("INFO", "bro", _("The files / folders were successfully renamed"));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3: // Upload de fichier...
|
case 3: // Upload de fichier...
|
||||||
if ($bro->UploadFile($R)) {
|
if ($bro->UploadFile($R)) {
|
||||||
$msg->raise("Ok", "bro", _("The file '%s' was successfully uploaded"), $_FILES['userfile']['name']);
|
$msg->raise("INFO", "bro", _("The file '%s' was successfully uploaded"), $_FILES['userfile']['name']);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7: // Changement de permissions [ML]
|
case 7: // Changement de permissions [ML]
|
||||||
if ($bro->ChangePermissions($R, $d)) {
|
if ($bro->ChangePermissions($R, $d)) {
|
||||||
$msg->raise("Ok", "bro", _("The permissions were successfully set"));
|
$msg->raise("INFO", "bro", _("The permissions were successfully set"));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -173,7 +173,7 @@ if (!empty($formu) && $formu) {
|
||||||
|
|
||||||
if (isset($actextract) && $actextract) {
|
if (isset($actextract) && $actextract) {
|
||||||
if ($bro->ExtractFile($R. '/' . $fileextract, $R)) {
|
if ($bro->ExtractFile($R. '/' . $fileextract, $R)) {
|
||||||
$msg->raise("Ok", "bro", _("The extraction of the file '%s' was successfull"), $fileextract);
|
$msg->raise("INFO", "bro", _("The extraction of the file '%s' was successfull"), $fileextract);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ getFields($fields);
|
||||||
|
|
||||||
if (!empty($submit)) {
|
if (!empty($submit)) {
|
||||||
$bro->SetPrefs($editsizex, $editsizey, $listmode, $showicons, $downfmt, $createfile, $showtype, $editor_font, $editor_size, $golastdir);
|
$bro->SetPrefs($editsizex, $editsizey, $listmode, $showicons, $downfmt, $createfile, $showtype, $editor_font, $editor_size, $golastdir);
|
||||||
$msg->raise("Ok", "bro", _("Your preferences have been updated."));
|
$msg->raise("INFO", "bro", _("Your preferences have been updated."));
|
||||||
include("bro_main.php");
|
include("bro_main.php");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ getFields($fields);
|
||||||
|
|
||||||
if (!empty($cronupdate)) {
|
if (!empty($cronupdate)) {
|
||||||
if ($cron->update($cronupdate)) {
|
if ($cron->update($cronupdate)) {
|
||||||
$msg->raise("ok", "mysql", _("Save done."));
|
$msg->raise("INFO", "mysql", _("Save done."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ if (!isset($dns)) $dns="1";
|
||||||
<hr />
|
<hr />
|
||||||
<?php
|
<?php
|
||||||
if (!$quota->cancreate("dom")) {
|
if (!$quota->cancreate("dom")) {
|
||||||
$msg->raise('Alert', "dom", _("You cannot add any new domain, your quota is over.")." "._("Contact your administrator for more information."));
|
$msg->raise("ALERT", "dom", _("You cannot add any new domain, your quota is over.")." "._("Contact your administrator for more information."));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ if (!$dom->add_domain($newdomain,$dns,0,0,$newisslave,$slavedom)) {
|
||||||
include("dom_add.php");
|
include("dom_add.php");
|
||||||
exit();
|
exit();
|
||||||
} else
|
} else
|
||||||
$msg->raise('Ok', "dom", _("Your new domain %s has been successfully installed"),$newdomain);
|
$msg->raise("INFO", "dom", _("Your new domain %s has been successfully installed"),$newdomain);
|
||||||
|
|
||||||
$dom->unlock();
|
$dom->unlock();
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ if (! empty($del_cancel)) {
|
||||||
$dom->unlock();
|
$dom->unlock();
|
||||||
|
|
||||||
// The link to this function is disable : the del_domain_cancel function need some modification
|
// The link to this function is disable : the del_domain_cancel function need some modification
|
||||||
$msg->raise('Ok', "dom", _("Deletion have been successfully cancelled"));
|
$msg->raise("INFO", "dom", _("Deletion have been successfully cancelled"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
?>
|
?>
|
||||||
<p>
|
<p>
|
||||||
|
@ -84,7 +84,7 @@ if ($del_confirm!="y") {
|
||||||
<hr id="topbar"/>
|
<hr id="topbar"/>
|
||||||
<br />
|
<br />
|
||||||
<?php
|
<?php
|
||||||
$msg->raise('Ok', "dom", _("The domain %s has been successfully deleted."),$domain);
|
$msg->raise("INFO", "dom", _("The domain %s has been successfully deleted."),$domain);
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
?>
|
?>
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -42,12 +42,12 @@ $dom->lock();
|
||||||
|
|
||||||
$r = $dom->get_domain_all($domain);
|
$r = $dom->get_domain_all($domain);
|
||||||
if ($r["dns"] == $dns && $r["mail"] == $email && $r["zonettl"] == $ttl) {
|
if ($r["dns"] == $dns && $r["mail"] == $email && $r["zonettl"] == $ttl) {
|
||||||
$msg->raise('Ok', "dom", _("No change has been requested..."));
|
$msg->raise("INFO", "dom", _("No change has been requested..."));
|
||||||
} else if ($dom->edit_domain($domain,$dns,$email,0,$ttl)) {
|
} else if ($dom->edit_domain($domain,$dns,$email,0,$ttl)) {
|
||||||
$msg->raise('Ok', "dom", _("The domain %s has been changed."),$domain);
|
$msg->raise("INFO", "dom", _("The domain %s has been changed."),$domain);
|
||||||
$t = time();
|
$t = time();
|
||||||
// XXX: we assume the cron job is at every 5 minutes
|
// XXX: we assume the cron job is at every 5 minutes
|
||||||
$msg->raise('Ok', "dom", _("The modifications will take effect at %s. Server time is %s."), array(date('H:i:s', ($t-($t%300)+300)), date('H:i:s', $t)));
|
$msg->raise("INFO", "dom", _("The modifications will take effect at %s. Server time is %s."), array(date('H:i:s', ($t-($t%300)+300)), date('H:i:s', $t)));
|
||||||
}
|
}
|
||||||
$dom->unlock();
|
$dom->unlock();
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ $domain=trim($domain);
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if ( !empty($zone) && empty($domain) ) {
|
if ( !empty($zone) && empty($domain) ) {
|
||||||
$msg->raise('Alert', "dom", _("The domain field seems to be empty"));
|
$msg->raise("ALERT", "dom", _("The domain field seems to be empty"));
|
||||||
}
|
}
|
||||||
|
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
|
|
|
@ -41,7 +41,7 @@ $dom->unlock();
|
||||||
|
|
||||||
$dt=$dom->domains_type_lst();
|
$dt=$dom->domains_type_lst();
|
||||||
if (!$isinvited && $dt[strtolower($r['type'])]["enable"] != "ALL" ) {
|
if (!$isinvited && $dt[strtolower($r['type'])]["enable"] != "ALL" ) {
|
||||||
$msg->raise('Error', "dom", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "dom", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ $dt=$dom->domains_type_lst();
|
||||||
$dom->unlock();
|
$dom->unlock();
|
||||||
|
|
||||||
if (!$isinvited && $dt[strtolower($r['type'])]["enable"] != "ALL" ) {
|
if (!$isinvited && $dt[strtolower($r['type'])]["enable"] != "ALL" ) {
|
||||||
$msg->raise('Error', "dom", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "dom", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ $dom->unlock();
|
||||||
} else {
|
} else {
|
||||||
$t = time();
|
$t = time();
|
||||||
// XXX: we assume the cron job is at every 5 minutes
|
// XXX: we assume the cron job is at every 5 minutes
|
||||||
$msg->raise('Ok', "dom", _("The modifications will take effect at %s. Server time is %s."), array(date('H:i:s', ($t-($t%300)+300)), date('H:i:s', $t)));
|
$msg->raise("INFO", "dom", _("The modifications will take effect at %s. Server time is %s."), array(date('H:i:s', ($t-($t%300)+300)), date('H:i:s', $t)));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -50,7 +50,7 @@ $dom->lock();
|
||||||
|
|
||||||
$dt=$dom->domains_type_lst();
|
$dt=$dom->domains_type_lst();
|
||||||
if ( (!isset($isinvited) || !$isinvited) && $dt[strtolower($type)]["enable"] != "ALL" ) {
|
if ( (!isset($isinvited) || !$isinvited) && $dt[strtolower($type)]["enable"] != "ALL" ) {
|
||||||
$msg->raise('Error', "dom", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "dom", _("This page is restricted to authorized staff"));
|
||||||
include("dom_edit.php");
|
include("dom_edit.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ if (!$r) {
|
||||||
$t = time();
|
$t = time();
|
||||||
// XXX: we assume the cron job is at every 5 minutes
|
// XXX: we assume the cron job is at every 5 minutes
|
||||||
$noread=false;
|
$noread=false;
|
||||||
$msg->raise('Ok', "dom", _("The modifications will take effect at %s. Server time is %s."), array(date('H:i:s', ($t-($t%300)+300)), date('H:i:s', $t)));
|
$msg->raise("INFO", "dom", _("The modifications will take effect at %s. Server time is %s."), array(date('H:i:s', ($t-($t%300)+300)), date('H:i:s', $t)));
|
||||||
foreach($fields as $k=>$v) unset($$k);
|
foreach($fields as $k=>$v) unset($$k);
|
||||||
}
|
}
|
||||||
include("dom_edit.php");
|
include("dom_edit.php");
|
||||||
|
|
|
@ -55,7 +55,7 @@ if (!$r) {
|
||||||
|
|
||||||
$dt=$dom->domains_type_lst();
|
$dt=$dom->domains_type_lst();
|
||||||
if (!$isinvited && $dt[strtolower($r['type'])]["enable"] != "ALL" ) {
|
if (!$isinvited && $dt[strtolower($r['type'])]["enable"] != "ALL" ) {
|
||||||
$msg->raise('Error', "dom", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "dom", _("This page is restricted to authorized staff"));
|
||||||
include("dom_edit.php");
|
include("dom_edit.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ if (!$r) {
|
||||||
} else {
|
} else {
|
||||||
$t = time();
|
$t = time();
|
||||||
// XXX: we assume the cron job is at every 5 minutes
|
// XXX: we assume the cron job is at every 5 minutes
|
||||||
$msg->raise('Ok', "dom", _("The modifications will take effect at %s. Server time is %s."), array(date('H:i:s', ($t-($t%300)+300)), date('H:i:s', $t)));
|
$msg->raise("INFO", "dom", _("The modifications will take effect at %s. Server time is %s."), array(date('H:i:s', ($t-($t%300)+300)), date('H:i:s', $t)));
|
||||||
foreach($fields as $k=>$v) unset($k);
|
foreach($fields as $k=>$v) unset($k);
|
||||||
}
|
}
|
||||||
include("dom_edit.php");
|
include("dom_edit.php");
|
||||||
|
|
|
@ -54,7 +54,7 @@ if(!empty($confirm_del)) {
|
||||||
foreach($lst_todel as $v) {
|
foreach($lst_todel as $v) {
|
||||||
$r=$ftp->delete_ftp($v);
|
$r=$ftp->delete_ftp($v);
|
||||||
if ($r) {
|
if ($r) {
|
||||||
$msg->raise("Ok", "ftp", _("The ftp account %s has been successfully deleted"),$r);
|
$msg->raise("INFO", "ftp", _("The ftp account %s has been successfully deleted"),$r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
include("ftp_list.php");
|
include("ftp_list.php");
|
||||||
|
|
|
@ -40,7 +40,7 @@ $fields = array (
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
|
|
||||||
if (! $id && !$create) { //not a creation and not an edit
|
if (! $id && !$create) { //not a creation and not an edit
|
||||||
$msg->raise("Error", "ftp", _("Error: neither a creation nor an edition"));
|
$msg->raise("ERROR", "ftp", _("Error: neither a creation nor an edition"));
|
||||||
include("ftp_list.php");
|
include("ftp_list.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -60,9 +60,9 @@ if (!$r) {
|
||||||
exit();
|
exit();
|
||||||
} else {
|
} else {
|
||||||
if ($create)
|
if ($create)
|
||||||
$msg->raise("Ok", "ftp", _("The ftp account has been successfully created"));
|
$msg->raise("INFO", "ftp", _("The ftp account has been successfully created"));
|
||||||
else
|
else
|
||||||
$msg->raise("Ok", "ftp", _("The ftp account has been successfully saved"));
|
$msg->raise("INFO", "ftp", _("The ftp account has been successfully saved"));
|
||||||
|
|
||||||
include("ftp_list.php");
|
include("ftp_list.php");
|
||||||
exit();
|
exit();
|
||||||
|
|
|
@ -40,7 +40,7 @@ if ( !isset($is_include) ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$id && !$create) {
|
if (!$id && !$create) {
|
||||||
$msg->raise("Error", "ftp", _("Neither a creation nor a edition"));
|
$msg->raise("ERROR", "ftp", _("Neither a creation nor a edition"));
|
||||||
echo "<h3>"._("Create a FTP account")."</h3>";
|
echo "<h3>"._("Create a FTP account")."</h3>";
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
include_once("foot.php");
|
include_once("foot.php");
|
||||||
|
|
|
@ -33,9 +33,9 @@ getFields($fields);
|
||||||
|
|
||||||
if ($ftp->switch_enabled($id,$status)) {
|
if ($ftp->switch_enabled($id,$status)) {
|
||||||
if ($status)
|
if ($status)
|
||||||
$msg->raise("Ok", "ftp", _("The ftp account is enabled"));
|
$msg->raise("INFO", "ftp", _("The ftp account is enabled"));
|
||||||
else
|
else
|
||||||
$msg->raise("Ok", "ftp", _("The ftp account is disabled"));
|
$msg->raise("INFO", "ftp", _("The ftp account is disabled"));
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once('ftp_list.php');
|
require_once('ftp_list.php');
|
||||||
|
|
|
@ -36,7 +36,7 @@ while (list($key,$val)=each($_POST)) {
|
||||||
// Effacement du dossier $val
|
// Effacement du dossier $val
|
||||||
$return = $hta->DelDir($val);
|
$return = $hta->DelDir($val);
|
||||||
if ($return) {
|
if ($return) {
|
||||||
$msg->raise("Ok", "hta",_("The protected folder %s has been successfully unprotected"),$val);
|
$msg->raise("INFO", "hta",_("The protected folder %s has been successfully unprotected"),$val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,13 +36,13 @@ $fields = array (
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
|
|
||||||
if(empty($dir)) {
|
if(empty($dir)) {
|
||||||
$msg->raise("Error", "hta", _("No directory specified"));
|
$msg->raise("ERROR", "hta", _("No directory specified"));
|
||||||
include("hta_list.php");
|
include("hta_list.php");
|
||||||
} else if(!$hta->CreateDir($dir)) {
|
} else if(!$hta->CreateDir($dir)) {
|
||||||
$is_include=true;
|
$is_include=true;
|
||||||
include("hta_add.php");
|
include("hta_add.php");
|
||||||
} else {
|
} else {
|
||||||
$msg->raise("Ok", "hta", _("Folder %s is protected"), $dir);
|
$msg->raise("INFO", "hta", _("Folder %s is protected"), $dir);
|
||||||
include("hta_list.php");
|
include("hta_list.php");
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -38,7 +38,7 @@ getFields($fields);
|
||||||
|
|
||||||
|
|
||||||
if ($password != $passwordconf) {
|
if ($password != $passwordconf) {
|
||||||
$msg->raise("Error", "hta", _("Passwords do not match"));
|
$msg->raise("ERROR", "hta", _("Passwords do not match"));
|
||||||
include("hta_adduser.php");
|
include("hta_adduser.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ if ($password != $passwordconf) {
|
||||||
if (!$hta->add_user($user, $password, $dir)) {
|
if (!$hta->add_user($user, $password, $dir)) {
|
||||||
include ("hta_adduser.php");
|
include ("hta_adduser.php");
|
||||||
} else {
|
} else {
|
||||||
$msg->raise("Ok", "hta", _("The user %s was added to th protected folder %s"), array($user, $dir));
|
$msg->raise("INFO", "hta", _("The user %s was added to th protected folder %s"), array($user, $dir));
|
||||||
include ("hta_edit.php");
|
include ("hta_edit.php");
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -40,7 +40,7 @@ if (!empty($confirm_del)) {
|
||||||
reset($d);
|
reset($d);
|
||||||
if ($hta->del_user($d,$dir)) {
|
if ($hta->del_user($d,$dir)) {
|
||||||
foreach ($d as $v) {
|
foreach ($d as $v) {
|
||||||
$msg->raise("Ok", "hta", _("The user '%s' was successfully deleted"), $v);
|
$msg->raise("INFO", "hta", _("The user '%s' was successfully deleted"), $v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$is_include=true;
|
$is_include=true;
|
||||||
|
|
|
@ -39,13 +39,13 @@ $fields = array (
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
|
|
||||||
if ($newpass != $newpassconf) {
|
if ($newpass != $newpassconf) {
|
||||||
$msg->raise("Error", "hta", _("Passwords do not match"));
|
$msg->raise("ERROR", "hta", _("Passwords do not match"));
|
||||||
include("hta_edituser.php");
|
include("hta_edituser.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($hta->change_pass($user,$newpass,$dir)) {
|
if ($hta->change_pass($user,$newpass,$dir)) {
|
||||||
$msg->raise("Ok", "hta", _("The password of the user %s has been successfully changed"), $user);
|
$msg->raise("INFO", "hta", _("The password of the user %s has been successfully changed"), $user);
|
||||||
$is_include=true;
|
$is_include=true;
|
||||||
include_once("hta_edit.php");
|
include_once("hta_edit.php");
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -54,7 +54,7 @@ $passwd_classcount = $c['hta']['classcount'];
|
||||||
<br />
|
<br />
|
||||||
<?php
|
<?php
|
||||||
if (!count($r)) {
|
if (!count($r)) {
|
||||||
$msg->raise("Info", "hta", _("No authorized user in %s"),$dir);
|
$msg->raise("INFO", "hta", _("No authorized user in %s"),$dir);
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
} else {
|
} else {
|
||||||
reset($r);
|
reset($r);
|
||||||
|
|
|
@ -20,25 +20,25 @@ if (!empty($s_protocol)) {
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
|
|
||||||
if (! $authip->ip_affected_save($s_ipsub, $s_protocol, $$val) ) {
|
if (! $authip->ip_affected_save($s_ipsub, $s_protocol, $$val) ) {
|
||||||
$msg->raise('Error', "ftp", _("Error during ip_affected_save"));
|
$msg->raise("ERROR", "ftp", _("Error during ip_affected_save"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($delete_affected_id)) {
|
if (!empty($delete_affected_id)) {
|
||||||
if (! $authip->ip_affected_delete($delete_affected_id)) {
|
if (! $authip->ip_affected_delete($delete_affected_id)) {
|
||||||
$msg->raise('Error', "ftp", _("Error during deletion"));
|
$msg->raise("ERROR", "ftp", _("Error during deletion"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($delete_id)) {
|
if (!empty($delete_id)) {
|
||||||
if (! $authip->ip_delete($delete_id)) {
|
if (! $authip->ip_delete($delete_id)) {
|
||||||
$msg->raise('Error', "ftp", _("Error during deletion"));
|
$msg->raise("ERROR", "ftp", _("Error during deletion"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($ipsub)) {
|
if (!empty($ipsub)) {
|
||||||
if (! $authip->ip_save($id, $ipsub, $infos)) {
|
if (! $authip->ip_save($id, $ipsub, $infos)) {
|
||||||
$msg->raise('Error', "ftp", _("Error during recording"));
|
$msg->raise("ERROR", "ftp", _("Error during recording"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ $list=$log->list_logs_directory_all($log->get_logs_directory());
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
|
|
||||||
if(!$list || empty($list['dir'])){
|
if(!$list || empty($list['dir'])){
|
||||||
$msg->raise('Info', "logs", _("You have no web logs to list at the moment."));
|
$msg->raise("INFO", "logs", _("You have no web logs to list at the moment."));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
include_once('foot.php');
|
include_once('foot.php');
|
||||||
exit;
|
exit;
|
||||||
|
|
|
@ -51,15 +51,15 @@ if ($confirm=="y") {
|
||||||
$db->query("SELECT a.id, NOT ISNULL(m.id) AS islocal FROM address a LEFT JOIN mailbox m ON m.address_id=a.id WHERE a.id= ? ;", array($val));
|
$db->query("SELECT a.id, NOT ISNULL(m.id) AS islocal FROM address a LEFT JOIN mailbox m ON m.address_id=a.id WHERE a.id= ? ;", array($val));
|
||||||
|
|
||||||
if (!$db->next_record()) {
|
if (!$db->next_record()) {
|
||||||
$msg->raise('Error', "mail", _("The email %s does not exist, it can't be deleted"), $email);
|
$msg->raise("ERROR", "mail", _("The email %s does not exist, it can't be deleted"), $email);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($mail->delete($val)) {
|
if ($mail->delete($val)) {
|
||||||
if ($db->f("islocal")) {
|
if ($db->f("islocal")) {
|
||||||
$msg->raise('Ok', "mail", _("The email %s has been marked for deletion"), $email);
|
$msg->raise("INFO", "mail", _("The email %s has been marked for deletion"), $email);
|
||||||
} else {
|
} else {
|
||||||
$msg->raise('Ok', "mail", _("The email %s has been successfully deleted"), $email);
|
$msg->raise("INFO", "mail", _("The email %s has been successfully deleted"), $email);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@ if (!$res=$mail->get_details($mail_id)) {
|
||||||
* checking the password
|
* checking the password
|
||||||
*/
|
*/
|
||||||
if($pass != $passconf){
|
if($pass != $passconf){
|
||||||
$msg->raise("Error", "mail", _("Passwords do not match"));
|
$msg->raise("ERROR", "mail", _("Passwords do not match"));
|
||||||
include ("mail_edit.php");
|
include ("mail_edit.php");
|
||||||
exit();
|
exit();
|
||||||
} else {
|
} else {
|
||||||
|
@ -108,15 +108,15 @@ if (!$res=$mail->get_details($mail_id)) {
|
||||||
include ("mail_edit.php");
|
include ("mail_edit.php");
|
||||||
exit();
|
exit();
|
||||||
} else {
|
} else {
|
||||||
foreach($rh as $h) if ($h) $msg->raise("Error", "mail", $h);
|
foreach($rh as $h) if ($h) $msg->raise("ERROR", "mail", $h);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($new_account)
|
if ($new_account)
|
||||||
$msg->raise("Ok", "mail", _("Your email has been created successfully"));
|
$msg->raise("INFO", "mail", _("Your email has been created successfully"));
|
||||||
else
|
else
|
||||||
$msg->raise("Ok", "mail", _("Your email has been edited successfully"));
|
$msg->raise("INFO", "mail", _("Your email has been edited successfully"));
|
||||||
|
|
||||||
$_REQUEST["domain_id"]=$dom->get_domain_byname($res["domain"]);
|
$_REQUEST["domain_id"]=$dom->get_domain_byname($res["domain"]);
|
||||||
include("mail_list.php");
|
include("mail_list.php");
|
||||||
|
|
|
@ -59,7 +59,7 @@ if ($domain=$dom->get_domain_byid($domain_id)) {
|
||||||
echo '<h3>'._("Manage Catch-all")."</h3>";
|
echo '<h3>'._("Manage Catch-all")."</h3>";
|
||||||
}
|
}
|
||||||
|
|
||||||
echo $msg->msg_html_all("<li>", true, true);
|
echo $msg->msg_html_all(true, true);
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -85,7 +85,7 @@ echo $msg->msg_html_all("<li>", true, true);
|
||||||
<h3><?php printf(_("Email addresses of the domain %s"),$domain); ?> : </h3>
|
<h3><?php printf(_("Email addresses of the domain %s"),$domain); ?> : </h3>
|
||||||
<?php
|
<?php
|
||||||
if (empty($allmails_list) && empty($search)) {
|
if (empty($allmails_list) && empty($search)) {
|
||||||
$msg->raise('Error', 'mail', _("No mails for this domain."));
|
$msg->raise("ERROR", 'mail', _("No mails for this domain."));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ $fields = array (
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
|
|
||||||
if (is_null($domain_id)) {
|
if (is_null($domain_id)) {
|
||||||
$msg->raise("Error", "mail", _("Problem with the domain"));
|
$msg->raise("ERROR", "mail", _("Problem with the domain"));
|
||||||
include_once("mail_list.php");
|
include_once("mail_list.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -43,21 +43,21 @@ if (!is_null($target_type)) {
|
||||||
switch ($target_type) {
|
switch ($target_type) {
|
||||||
case "none":
|
case "none":
|
||||||
if ($mail->catchall_del($domain_id))
|
if ($mail->catchall_del($domain_id))
|
||||||
$msg->raise("Ok", "mail", _("Catchall successfully deleted"));
|
$msg->raise("INFO", "mail", _("Catchall successfully deleted"));
|
||||||
|
|
||||||
require_once("mail_list.php");
|
require_once("mail_list.php");
|
||||||
exit();
|
exit();
|
||||||
break;
|
break;
|
||||||
case "domain":
|
case "domain":
|
||||||
if ($mail->catchall_set($domain_id, $target_domain)) {
|
if ($mail->catchall_set($domain_id, $target_domain)) {
|
||||||
$msg->raise("Ok", "mail", _("Catchall successfully updated"));
|
$msg->raise("INFO", "mail", _("Catchall successfully updated"));
|
||||||
require_once("mail_list.php");
|
require_once("mail_list.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "mail":
|
case "mail":
|
||||||
if ($mail->catchall_set($domain_id, $target_mail)) {
|
if ($mail->catchall_set($domain_id, $target_mail)) {
|
||||||
$msg->raise("Ok", "mail", _("Catchall successfully updated"));
|
$msg->raise("INFO", "mail", _("Catchall successfully updated"));
|
||||||
require_once("mail_list.php");
|
require_once("mail_list.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ getFields($fields);
|
||||||
|
|
||||||
if ($mail->undelete($mail_id)) {
|
if ($mail->undelete($mail_id)) {
|
||||||
$email = $mail->is_it_my_mail($mail_id)
|
$email = $mail->is_it_my_mail($mail_id)
|
||||||
$msg->raise('Ok', "mail", _("The email %s has been undeleted"), $email);
|
$msg->raise("INFO", "mail", _("The email %s has been undeleted"), $email);
|
||||||
}
|
}
|
||||||
|
|
||||||
include("mail_list.php");
|
include("mail_list.php");
|
||||||
|
|
|
@ -32,7 +32,7 @@ $fields = array (
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
|
|
||||||
if ($mem->adminpref($admlist)) {
|
if ($mem->adminpref($admlist)) {
|
||||||
$msg->raise('Ok', "mem", _("Your administrator preferences has been successfully changed."));
|
$msg->raise("INFO", "mem", _("Your administrator preferences has been successfully changed."));
|
||||||
}
|
}
|
||||||
|
|
||||||
include_once("head.php");
|
include_once("head.php");
|
||||||
|
|
|
@ -35,7 +35,7 @@ $fields = array (
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
|
|
||||||
if ($cle=$mem->ChangeMail1($newmail)) {
|
if ($cle=$mem->ChangeMail1($newmail)) {
|
||||||
$msg->raise('Ok', "mem", _("The mail was successfully changed"));
|
$msg->raise("INFO", "mem", _("The mail was successfully changed"));
|
||||||
}
|
}
|
||||||
|
|
||||||
include_once("head.php");
|
include_once("head.php");
|
||||||
|
|
|
@ -38,7 +38,7 @@ $fields = array (
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
|
|
||||||
if ($mem->ChangeMail2($cookie,$cle,$usr)) {
|
if ($mem->ChangeMail2($cookie,$cle,$usr)) {
|
||||||
$msg->raise('Ok', "mem", _("The mailbox has been successfully changed."));
|
$msg->raise("INFO", "mem", _("The mailbox has been successfully changed."));
|
||||||
}
|
}
|
||||||
|
|
||||||
include_once("head.php");
|
include_once("head.php");
|
||||||
|
|
|
@ -40,7 +40,7 @@ getFields($fields);
|
||||||
|
|
||||||
if (!empty($help_setting)) {
|
if (!empty($help_setting)) {
|
||||||
$mem->set_help_param($showhelp);
|
$mem->set_help_param($showhelp);
|
||||||
$msg->raise('Ok', "mem", _("Your help setting has been updated."));
|
$msg->raise("INFO", "mem", _("Your help setting has been updated."));
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -39,7 +39,7 @@ getFields($fields);
|
||||||
|
|
||||||
|
|
||||||
if ($mem->passwd($oldpass,$newpass,$newpass2)) {
|
if ($mem->passwd($oldpass,$newpass,$newpass2)) {
|
||||||
$msg->raise('Ok', "mem", _("Your password has been successfully changed."));
|
$msg->raise("INFO", "mem", _("Your password has been successfully changed."));
|
||||||
}
|
}
|
||||||
|
|
||||||
include_once("head.php");
|
include_once("head.php");
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
require_once("head.php");
|
require_once("head.php");
|
||||||
$msg->raise('Info', "mail", _("There is currently no webmail configured. If you need one, contact your server administrator");
|
$msg->raise("INFO", "mail", _("There is currently no webmail configured. If you need one, contact your server administrator");
|
||||||
|
|
||||||
include("index.php");
|
include("index.php");
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ $userslist = $piwik->users_list();
|
||||||
$quotapiwik = $quota->getquota('piwik');
|
$quotapiwik = $quota->getquota('piwik');
|
||||||
|
|
||||||
if (!($quotapiwik['t'] > 0 && count($userslist) < 3)) {
|
if (!($quotapiwik['t'] > 0 && count($userslist) < 3)) {
|
||||||
$msg->raise('Error', "piwik", _("You cannot add any new Piwik account, your quota is over.")." ("._("Max. 3 accounts").")");
|
$msg->raise("ERROR", "piwik", _("You cannot add any new Piwik account, your quota is over.")." ("._("Max. 3 accounts").")");
|
||||||
}
|
}
|
||||||
|
|
||||||
$fields = array (
|
$fields = array (
|
||||||
|
@ -43,7 +43,7 @@ $fields = array (
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
|
|
||||||
if ($piwik->user_add($account_name, $account_mail) ) {
|
if ($piwik->user_add($account_name, $account_mail) ) {
|
||||||
$msg->raise('Ok', "piwik", _('Successfully added piwik account'));
|
$msg->raise("INFO", "piwik", _('Successfully added piwik account'));
|
||||||
}
|
}
|
||||||
include_once("piwik_userlist.php");
|
include_once("piwik_userlist.php");
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -39,9 +39,9 @@ getFields($fields);
|
||||||
if(empty($site_name)) $site_name=$site_urls;
|
if(empty($site_name)) $site_name=$site_urls;
|
||||||
|
|
||||||
if (empty($site_name)) {
|
if (empty($site_name)) {
|
||||||
$msg->raise('Error', "piwik", _("All fields are mandatory"));
|
$msg->raise("ERROR", "piwik", _("All fields are mandatory"));
|
||||||
} elseif ( $piwik->site_add($site_name, $site_urls) ) {
|
} elseif ( $piwik->site_add($site_name, $site_urls) ) {
|
||||||
$msg->raise('Ok', "piwik", _("Website added Successfully"));
|
$msg->raise("INFO", "piwik", _("Website added Successfully"));
|
||||||
}
|
}
|
||||||
include_once("piwik_sitelist.php");
|
include_once("piwik_sitelist.php");
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ $fields = array (
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
|
|
||||||
if ($siteid === -1) {
|
if ($siteid === -1) {
|
||||||
$msg->raise('Error', "piwik", _("Missing site parameters"));
|
$msg->raise("ERROR", "piwik", _("Missing site parameters"));
|
||||||
include('piwik_sitelist.php');
|
include('piwik_sitelist.php');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ if ($siteid === -1) {
|
||||||
if(!empty($confirm_del) ) {
|
if(!empty($confirm_del) ) {
|
||||||
|
|
||||||
if ($piwik->site_delete($siteid) ) {
|
if ($piwik->site_delete($siteid) ) {
|
||||||
$msg->raise('Ok', "piwik", _("Site successfully deleted"));
|
$msg->raise("INFO", "piwik", _("Site successfully deleted"));
|
||||||
}
|
}
|
||||||
|
|
||||||
include('piwik_sitelist.php');
|
include('piwik_sitelist.php');
|
||||||
|
|
|
@ -51,7 +51,7 @@ if ($quota->cancreate("piwik")) {
|
||||||
?>
|
?>
|
||||||
<h3><?php __("Add a new website");?></h3>
|
<h3><?php __("Add a new website");?></h3>
|
||||||
<?php
|
<?php
|
||||||
echo $msg->msg_html_all("<li>", true, true);
|
echo $msg->msg_html_all(true, true);
|
||||||
?>
|
?>
|
||||||
<form method="post" action="piwik_addsites.php" id="main" name="addsites" >
|
<form method="post" action="piwik_addsites.php" id="main" name="addsites" >
|
||||||
<?php csrf_get(); ?>
|
<?php csrf_get(); ?>
|
||||||
|
@ -64,7 +64,7 @@ echo $msg->msg_html_all("<li>", true, true);
|
||||||
<?php
|
<?php
|
||||||
} // quotapiwik > 0
|
} // quotapiwik > 0
|
||||||
} else {
|
} else {
|
||||||
$msg->raise('Info', "piwik", _("You cannot add any new Piwik sites, your quota is over."));
|
$msg->raise("INFO", "piwik", _("You cannot add any new Piwik sites, your quota is over."));
|
||||||
} // cancreate piwik
|
} // cancreate piwik
|
||||||
|
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ $infos_urls = $piwik->get_users_url_infos();
|
||||||
if ($right !== FALSE) {
|
if ($right !== FALSE) {
|
||||||
// Should this stay here, or in the API?
|
// Should this stay here, or in the API?
|
||||||
if (!in_array($site_id, $piwik_alternc_sites))
|
if (!in_array($site_id, $piwik_alternc_sites))
|
||||||
$msg->raise('Error', "piwik", _("You don't own this piwik site!"));
|
$msg->raise("ERROR", "piwik", _("You don't own this piwik site!"));
|
||||||
else {
|
else {
|
||||||
foreach ($sitelist as $site) {
|
foreach ($sitelist as $site) {
|
||||||
if ($site->id == $site_id)
|
if ($site->id == $site_id)
|
||||||
|
@ -100,7 +100,7 @@ if ($right !== FALSE) {
|
||||||
/* Ensures that the user is legitimate for that user */
|
/* Ensures that the user is legitimate for that user */
|
||||||
/* If not, we just break the loop, and set error message */
|
/* If not, we just break the loop, and set error message */
|
||||||
if (!in_array($user, $piwik_alternc_users)) {
|
if (!in_array($user, $piwik_alternc_users)) {
|
||||||
$msg->raise('Error', "piwik", _('You dont own user'), $user);
|
$msg->raise("ERROR", "piwik", _('You dont own user'), $user);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ if ($right !== FALSE) {
|
||||||
if (!$piwik->site_set_user_right($site_id, $user, $cred)) {
|
if (!$piwik->site_set_user_right($site_id, $user, $cred)) {
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
$msg->raise('Ok', "piwik", _("Account '%s' has been given '%s' rights on '%s'"), array($user, $cred, $domain));
|
$msg->raise("INFO", "piwik", _("Account '%s' has been given '%s' rights on '%s'"), array($user, $cred, $domain));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ $fields = array (
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
|
|
||||||
if (empty($login)) {
|
if (empty($login)) {
|
||||||
$msg->raise('Error', "piwik", _("Missing login parameters"));
|
$msg->raise("ERROR", "piwik", _("Missing login parameters"));
|
||||||
include('piwik_userlist.php');
|
include('piwik_userlist.php');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
@ -44,9 +44,9 @@ if (empty($login)) {
|
||||||
if(!empty($confirm_del)) {
|
if(!empty($confirm_del)) {
|
||||||
// contrôle si ce compte piwik a encore des sites associés avant d'accepter sa suppression
|
// contrôle si ce compte piwik a encore des sites associés avant d'accepter sa suppression
|
||||||
if ($piwik->user_has_sites()) {
|
if ($piwik->user_has_sites()) {
|
||||||
$msg->raise('Alert', "piwik", _("To be able to delete the last user account, you must first remove all the piwik sites"));
|
$msg->raise("ALERT", "piwik", _("To be able to delete the last user account, you must first remove all the piwik sites"));
|
||||||
} else if ($piwik->user_delete($login) ) {
|
} else if ($piwik->user_delete($login) ) {
|
||||||
$msg->raise('Ok', "piwik", _("Account %s is successfully deleted"), $login);
|
$msg->raise("INFO", "piwik", _("Account %s is successfully deleted"), $login);
|
||||||
}
|
}
|
||||||
|
|
||||||
include('piwik_userlist.php');
|
include('piwik_userlist.php');
|
||||||
|
|
|
@ -39,7 +39,7 @@ getFields($fields);
|
||||||
|
|
||||||
if ($user_name === FALSE)
|
if ($user_name === FALSE)
|
||||||
{
|
{
|
||||||
$msg->raise('Error', "piwik", _('No piwik user specified'));
|
$msg->raise("ERROR", "piwik", _('No piwik user specified'));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -49,7 +49,7 @@ else
|
||||||
$db->next_record();
|
$db->next_record();
|
||||||
if ($db->f('ok')!=1)
|
if ($db->f('ok')!=1)
|
||||||
{
|
{
|
||||||
$msg->raise('Error', "piwik", _("You don't own this piwik website"));
|
$msg->raise("ERROR", "piwik", _("You don't own this piwik website"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -57,7 +57,7 @@ else
|
||||||
$db->next_record();
|
$db->next_record();
|
||||||
if ($db->f('ok')!=1)
|
if ($db->f('ok')!=1)
|
||||||
{
|
{
|
||||||
$msg->raise('Error', "piwik", _("You don't own this piwik user"));
|
$msg->raise("ERROR", "piwik", _("You don't own this piwik user"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -66,13 +66,13 @@ else
|
||||||
{
|
{
|
||||||
$api_data = $piwik->site_set_user_right($site_id, $user_name, $right);
|
$api_data = $piwik->site_set_user_right($site_id, $user_name, $right);
|
||||||
if ($api_data === FALSE)
|
if ($api_data === FALSE)
|
||||||
$msg->raise('Error', "piwik", $api_data->message)
|
$msg->raise("ERROR", "piwik", $api_data->message)
|
||||||
else
|
else
|
||||||
$msg->raise('Ok', "piwik", _('success'));
|
$msg->raise("INFO", "piwik", _('success'));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$msg->raise('Error', "piwik", _("This right does not exist"));
|
$msg->raise("ERROR", "piwik", _("This right does not exist"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ if ($quotapiwik['t'] > 0 && count($userslist) < 3) {
|
||||||
?>
|
?>
|
||||||
<h3><?php __("Create a new piwik account");?></h3>
|
<h3><?php __("Create a new piwik account");?></h3>
|
||||||
<?php
|
<?php
|
||||||
echo $msg->msg_html_all("<li>", true, true);
|
echo $msg->msg_html_all(true, true);
|
||||||
?>
|
?>
|
||||||
<form method="post" action="piwik_addaccount.php" id="main" name="addaccount" >
|
<form method="post" action="piwik_addaccount.php" id="main" name="addaccount" >
|
||||||
<?php csrf_get(); ?>
|
<?php csrf_get(); ?>
|
||||||
|
@ -64,17 +64,17 @@ echo $msg->msg_html_all("<li>", true, true);
|
||||||
<hr/>
|
<hr/>
|
||||||
<?php
|
<?php
|
||||||
} else {
|
} else {
|
||||||
$msg->raise('Info', "piwik", _("You cannot add any new Piwik account, your quota is over."));
|
$msg->raise("INFO", "piwik", _("You cannot add any new Piwik account, your quota is over."));
|
||||||
} // cancreate piwik
|
} // cancreate piwik
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<h3><?php __("Existing Piwik accounts"); ?></h3>
|
<h3><?php __("Existing Piwik accounts"); ?></h3>
|
||||||
<?php
|
<?php
|
||||||
echo $msg->msg_html_all("<li>", true, true);
|
echo $msg->msg_html_all(true, true);
|
||||||
// printVar($piwik->dev());
|
// printVar($piwik->dev());
|
||||||
|
|
||||||
if (empty($userslist)){
|
if (empty($userslist)){
|
||||||
$msg->raise('Info', "piwik", _("No existing Piwik accounts"));
|
$msg->raise("INFO", "piwik", _("No existing Piwik accounts"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
} else {
|
} else {
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -37,7 +37,7 @@ include_once("head.php");
|
||||||
<?php
|
<?php
|
||||||
$q=$quota->getquota();
|
$q=$quota->getquota();
|
||||||
if (!is_array($q) || empty($q) ) {
|
if (!is_array($q) || empty($q) ) {
|
||||||
$msg->raise('Alert', "quota", _("No quotas for this account, or quotas currently unavailable!"));
|
$msg->raise("ALERT", "quota", _("No quotas for this account, or quotas currently unavailable!"));
|
||||||
include_once("main.php");
|
include_once("main.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ $fields = array (
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ if ($confirm=="y" ) {
|
||||||
// Effacement de la base $val
|
// Effacement de la base $val
|
||||||
$r=$mysql->del_db(substr($key,4));
|
$r=$mysql->del_db(substr($key,4));
|
||||||
if ($r) {
|
if ($r) {
|
||||||
$msg->raise("ok", "mysql", _("The database '%s' has been successfully deleted"), $val);
|
$msg->raise("INFO", "mysql", _("The database '%s' has been successfully deleted"), $val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ foreach($_POST as $key=>$val) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!$found) {
|
if (!$found) {
|
||||||
$msg->raise("alert", "mysql", _("Please check which databases you want to delete"));
|
$msg->raise("ALERT", "mysql", _("Please check which databases you want to delete"));
|
||||||
include("sql_list.php");
|
include("sql_list.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ $fields = array (
|
||||||
);
|
);
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
if (!$quota->cancreate("mysql")) {
|
if (!$quota->cancreate("mysql")) {
|
||||||
$msg->raise("alert", "mysql", _("Can't create a database: your quota is over"));
|
$msg->raise("ALERT", "mysql", _("Can't create a database: your quota is over"));
|
||||||
include("sql_list.php");
|
include("sql_list.php");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ if($q['u'] > 0){
|
||||||
}
|
}
|
||||||
|
|
||||||
if($mysql->add_db($dbname)) {
|
if($mysql->add_db($dbname)) {
|
||||||
$msg->raise("ok", "mysql", _("La base de données '%s' a bien été créé."),$dbname);
|
$msg->raise("INFO", "mysql", _("La base de données '%s' a bien été créé."),$dbname);
|
||||||
}
|
}
|
||||||
|
|
||||||
#header('Location: sql_getparam.php?dbname='.htmlentities($dbname));
|
#header('Location: sql_getparam.php?dbname='.htmlentities($dbname));
|
||||||
|
|
|
@ -54,7 +54,7 @@ if ($msg->has_msgs("Error")) {
|
||||||
include("sql_bck.php");
|
include("sql_bck.php");
|
||||||
exit();
|
exit();
|
||||||
} else {
|
} else {
|
||||||
$msg->raise("ok", "mysql", _("Your backup parameters has been successfully changed."));
|
$msg->raise("INFO", "mysql", _("Your backup parameters has been successfully changed."));
|
||||||
}
|
}
|
||||||
include("sql_list.php");
|
include("sql_list.php");
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -57,7 +57,7 @@ if (! $r["enabled"]) {
|
||||||
<p>
|
<p>
|
||||||
<?php
|
<?php
|
||||||
if ($mysql->restore($restfile,true,$id)) {
|
if ($mysql->restore($restfile,true,$id)) {
|
||||||
$msg->raise("ok", "mysql", _("Your database has been restored, check out the previous text for error messages."));
|
$msg->raise("INFO", "mysql", _("Your database has been restored, check out the previous text for error messages."));
|
||||||
} // if mysql->restore
|
} // if mysql->restore
|
||||||
|
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
|
|
|
@ -40,9 +40,9 @@ $r=$mysql->get_userslist();
|
||||||
<?php
|
<?php
|
||||||
// On regarde d'abord si on a une db existante. Sioui, on regarde si on a des utilisateurs existants
|
// On regarde d'abord si on a une db existante. Sioui, on regarde si on a des utilisateurs existants
|
||||||
if(!$rdb || empty($rdb)){
|
if(!$rdb || empty($rdb)){
|
||||||
$msg->raise("info", "mysql", _("You have no database at the moment."));
|
$msg->raise("INFO", "mysql", _("You have no database at the moment."));
|
||||||
} else if(!$r || empty($r)){
|
} else if(!$r || empty($r)){
|
||||||
$msg->raise("info", "mysql", _("You have no sql user at the moment."));
|
$msg->raise("INFO", "mysql", _("You have no sql user at the moment."));
|
||||||
}
|
}
|
||||||
|
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
|
|
|
@ -39,7 +39,7 @@ if (isset($confirm) && ($confirm=="y")) {
|
||||||
if (substr($key,0,4)=="del_") {
|
if (substr($key,0,4)=="del_") {
|
||||||
// Effacement de la base $val
|
// Effacement de la base $val
|
||||||
if($mysql->del_user($val)) {
|
if($mysql->del_user($val)) {
|
||||||
$msg->raise("ok", "mysql", _("The user '%s' has been successfully deleted"), $val);
|
$msg->raise("INFO", "mysql", _("The user '%s' has been successfully deleted"), $val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ if (!empty($usern)) {
|
||||||
exit;
|
exit;
|
||||||
} else {
|
} else {
|
||||||
$username=$mem->user["login"]."_".$usern;
|
$username=$mem->user["login"]."_".$usern;
|
||||||
$msg->raise("ok", "mysql", _("L'utilisateur '%s' a bien été créé."),$username);
|
$msg->raise("INFO", "mysql", _("L'utilisateur '%s' a bien été créé."),$username);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$usern=$mem->user["login"];
|
$usern=$mem->user["login"];
|
||||||
|
@ -51,7 +51,7 @@ if (!empty($usern)) {
|
||||||
exit;
|
exit;
|
||||||
} else {
|
} else {
|
||||||
$username=$mem->user["login"];
|
$username=$mem->user["login"];
|
||||||
$msg->raise("ok", "mysql", _("L'utilisateur '%s' a bien été créé."),$username);
|
$msg->raise("INFO", "mysql", _("L'utilisateur '%s' a bien été créé."),$username);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ $fields = array (
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
|
|
||||||
if ($mysql->change_user_password($id,$password,$passwordconf))
|
if ($mysql->change_user_password($id,$password,$passwordconf))
|
||||||
$msg->raise("ok", "mysql", _("Mot de passe changé pour l'utilisateur '%s'."), $id);
|
$msg->raise("INFO", "mysql", _("Mot de passe changé pour l'utilisateur '%s'."), $id);
|
||||||
|
|
||||||
include("sql_users_list.php");
|
include("sql_users_list.php");
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -51,7 +51,7 @@ foreach($mysql->get_dblist() as $d){
|
||||||
$mysql->set_user_rights($id,$d['db'],$rights);
|
$mysql->set_user_rights($id,$d['db'],$rights);
|
||||||
}
|
}
|
||||||
|
|
||||||
$msg->raise("ok", "mysql", _("The rights has been successfully applied to the user"));
|
$msg->raise("INFO", "mysql", _("The rights has been successfully applied to the user"));
|
||||||
|
|
||||||
include("sql_users_list.php");
|
include("sql_users_list.php");
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ $rdb=$mysql->get_dblist();
|
||||||
<hr id="topbar"/>
|
<hr id="topbar"/>
|
||||||
<br />
|
<br />
|
||||||
<?php
|
<?php
|
||||||
echo $msg->msg_html_all("<li>", true, true);
|
echo $msg->msg_html_all(true, true);
|
||||||
|
|
||||||
if($r){ // if there is some userlist
|
if($r){ // if there is some userlist
|
||||||
?>
|
?>
|
||||||
|
@ -75,7 +75,7 @@ for($i=0;$i<count($r);$i++) {
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
} else {
|
} else {
|
||||||
$msg->raise('Info', "mysql", _("You have no sql user at the moment."));
|
$msg->raise("INFO", "mysql", _("You have no sql user at the moment."));
|
||||||
echo $msg->msg_html_all();
|
echo $msg->msg_html_all();
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -348,7 +348,7 @@ class DB_Sql {
|
||||||
/* public: return table metadata */
|
/* public: return table metadata */
|
||||||
function metadata($table='',$full=false) {
|
function metadata($table='',$full=false) {
|
||||||
global $msg;
|
global $msg;
|
||||||
$msg->raise("Error", 'Mysql', 'function is no longer implemented (metadata())');
|
$msg->raise("ERROR", 'Mysql', 'function is no longer implemented (metadata())');
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1151,21 +1151,21 @@ function csrf_check($token=null) {
|
||||||
if (is_null($token)) $token=$_POST["csrf"];
|
if (is_null($token)) $token=$_POST["csrf"];
|
||||||
|
|
||||||
if (!isset($_SESSION["csrf"])) {
|
if (!isset($_SESSION["csrf"])) {
|
||||||
$msg->raise('Error', "functions", _("The posted form token is incorrect. Maybe you need to allow cookies"));
|
$msg->raise("ERROR", "functions", _("The posted form token is incorrect. Maybe you need to allow cookies"));
|
||||||
return 0; // no csrf cookie :/
|
return 0; // no csrf cookie :/
|
||||||
}
|
}
|
||||||
if (strlen($token)!=32 || strlen($_SESSION["csrf"])!=32) {
|
if (strlen($token)!=32 || strlen($_SESSION["csrf"])!=32) {
|
||||||
unset($_SESSION["csrf"]);
|
unset($_SESSION["csrf"]);
|
||||||
$msg->raise('Error', "functions", _("Your cookie or token is invalid"));
|
$msg->raise("ERROR", "functions", _("Your cookie or token is invalid"));
|
||||||
return 0; // invalid csrf cookie
|
return 0; // invalid csrf cookie
|
||||||
}
|
}
|
||||||
$db->query("SELECT used FROM csrf WHERE cookie=? AND token=?;",array($_SESSION["csrf"],$token));
|
$db->query("SELECT used FROM csrf WHERE cookie=? AND token=?;",array($_SESSION["csrf"],$token));
|
||||||
if (!$db->next_record()) {
|
if (!$db->next_record()) {
|
||||||
$msg->raise('Error', "functions", _("You can't post twice the same form, please retry."));
|
$msg->raise("ERROR", "functions", _("You can't post twice the same form, please retry."));
|
||||||
return 0; // invalid csrf cookie
|
return 0; // invalid csrf cookie
|
||||||
}
|
}
|
||||||
if ($db->f("used")) {
|
if ($db->f("used")) {
|
||||||
$msg->raise('Error', "functions", _("You can't post twice the same form, please retry."));
|
$msg->raise("ERROR", "functions", _("You can't post twice the same form, please retry."));
|
||||||
return -1; // expired
|
return -1; // expired
|
||||||
}
|
}
|
||||||
$db->query("UPDATE csrf SET used=1 WHERE cookie=? AND token=?;",array($_SESSION["csrf"],$token));
|
$db->query("UPDATE csrf SET used=1 WHERE cookie=? AND token=?;",array($_SESSION["csrf"],$token));
|
||||||
|
|
|
@ -170,7 +170,7 @@ class m_action {
|
||||||
$db->query("select login from membres where uid= ?;", array($cuid));
|
$db->query("select login from membres where uid= ?;", array($cuid));
|
||||||
$db->next_record();
|
$db->next_record();
|
||||||
if (!$db->Record["login"]) {
|
if (!$db->Record["login"]) {
|
||||||
$msg->raise('Error', "action", _("Login corresponding to $cuid not found"));
|
$msg->raise("ERROR", "action", _("Login corresponding to $cuid not found"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$uidlogin = $cuid . "-" . $db->Record["login"];
|
$uidlogin = $cuid . "-" . $db->Record["login"];
|
||||||
|
@ -212,7 +212,7 @@ class m_action {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$db->query($query)) {
|
if (!$db->query($query)) {
|
||||||
$msg->raise('Error', "action", _("Error setting actions"));
|
$msg->raise("ERROR", "action", _("Error setting actions"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return $this->do_action();
|
return $this->do_action();
|
||||||
|
@ -231,7 +231,7 @@ class m_action {
|
||||||
$purge = "select * from actions where TO_DAYS(curdate()) - TO_DAYS(creation) > 2;";
|
$purge = "select * from actions where TO_DAYS(curdate()) - TO_DAYS(creation) > 2;";
|
||||||
$result = $db->query($purge);
|
$result = $db->query($purge);
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
$msg->raise('Error', "action", _("Error selecting old actions"));
|
$msg->raise("ERROR", "action", _("Error selecting old actions"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return $db->num_rows($result);
|
return $db->num_rows($result);
|
||||||
|
@ -253,7 +253,7 @@ class m_action {
|
||||||
}
|
}
|
||||||
$result = $db->query($purge);
|
$result = $db->query($purge);
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
$msg->raise('Error', "action", _("Error purging old actions"));
|
$msg->raise("ERROR", "action", _("Error purging old actions"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return $db->num_rows($result);
|
return $db->num_rows($result);
|
||||||
|
@ -289,7 +289,7 @@ class m_action {
|
||||||
function begin($id) {
|
function begin($id) {
|
||||||
global $db, $msg;
|
global $db, $msg;
|
||||||
if (!$db->query("update actions set begin=now() where id= ? ;", array($id))) {
|
if (!$db->query("update actions set begin=now() where id= ? ;", array($id))) {
|
||||||
$msg->raise('Error', "action", _("Error locking the action : $id"));
|
$msg->raise("ERROR", "action", _("Error locking the action : $id"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -307,7 +307,7 @@ class m_action {
|
||||||
function finish($id, $return = 0) {
|
function finish($id, $return = 0) {
|
||||||
global $db, $msg;
|
global $db, $msg;
|
||||||
if (!$db->query("update actions set end=now(),status=? where id= ?;", array($return, $id))) {
|
if (!$db->query("update actions set end=now(),status=? where id= ?;", array($return, $id))) {
|
||||||
$msg->raise('Error', "action", _("Error unlocking the action : $id"));
|
$msg->raise("ERROR", "action", _("Error unlocking the action : $id"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -323,7 +323,7 @@ class m_action {
|
||||||
function reset_job($id) {
|
function reset_job($id) {
|
||||||
global $db, $msg;
|
global $db, $msg;
|
||||||
if (!$db->query("update actions set end=0,begin=0,status='' where id= ?;", array($id))) {
|
if (!$db->query("update actions set end=0,begin=0,status='' where id= ?;", array($id))) {
|
||||||
$msg->raise('Error', "action", _("Error unlocking the action : $id"));
|
$msg->raise("ERROR", "action", _("Error unlocking the action : $id"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -213,7 +213,7 @@ class m_admin {
|
||||||
global $msg, $db, $lst_users_properties;
|
global $msg, $db, $lst_users_properties;
|
||||||
// $msg->log("admin","get",$uid);
|
// $msg->log("admin","get",$uid);
|
||||||
if (!$this->enabled) {
|
if (!$this->enabled) {
|
||||||
$msg->raise('Error', "admin", _("-- Only administrators can access this page! --"));
|
$msg->raise("ERROR", "admin", _("-- Only administrators can access this page! --"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -247,7 +247,7 @@ class m_admin {
|
||||||
// don't exist, but is not a forced check. Do a forced check
|
// don't exist, but is not a forced check. Do a forced check
|
||||||
return $this->get($uid, true);
|
return $this->get($uid, true);
|
||||||
}
|
}
|
||||||
$msg->raise('Error', "admin", _("Account not found"));
|
$msg->raise("ERROR", "admin", _("Account not found"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -268,7 +268,7 @@ class m_admin {
|
||||||
global $msg, $db;
|
global $msg, $db;
|
||||||
// $msg->log("admin","get",$uid);
|
// $msg->log("admin","get",$uid);
|
||||||
if (!$this->enabled) {
|
if (!$this->enabled) {
|
||||||
$msg->raise('Error', "admin", _("-- Only administrators can access this page! --"));
|
$msg->raise("ERROR", "admin", _("-- Only administrators can access this page! --"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -278,7 +278,7 @@ class m_admin {
|
||||||
$db->next_record();
|
$db->next_record();
|
||||||
$c = $db->Record;
|
$c = $db->Record;
|
||||||
} else {
|
} else {
|
||||||
$msg->raise('Error', "admin", _("Account not found"));
|
$msg->raise("ERROR", "admin", _("Account not found"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -341,7 +341,7 @@ class m_admin {
|
||||||
global $msg, $mem, $cuid;
|
global $msg, $mem, $cuid;
|
||||||
$msg->log("admin", "get_list");
|
$msg->log("admin", "get_list");
|
||||||
if (!$this->enabled) {
|
if (!$this->enabled) {
|
||||||
$msg->raise('Error', "admin", _("-- Only administrators can access this page! --"));
|
$msg->raise("ERROR", "admin", _("-- Only administrators can access this page! --"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$db = new DB_System();
|
$db = new DB_System();
|
||||||
|
@ -379,7 +379,7 @@ class m_admin {
|
||||||
}
|
}
|
||||||
$request .= ' ORDER BY login;';
|
$request .= ' ORDER BY login;';
|
||||||
} else {
|
} else {
|
||||||
$msg->raise('Error', "admin", _("Invalid pattern type provided. Are you even performing a legitimate action?"));
|
$msg->raise("ERROR", "admin", _("Invalid pattern type provided. Are you even performing a legitimate action?"));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -422,7 +422,7 @@ class m_admin {
|
||||||
global $msg, $db;
|
global $msg, $db;
|
||||||
$msg->log("admin", "mailallmembers");
|
$msg->log("admin", "mailallmembers");
|
||||||
if (!$this->enabled) {
|
if (!$this->enabled) {
|
||||||
$msg->raise('Error', "admin", _("-- Only administrators can access this page! --"));
|
$msg->raise("ERROR", "admin", _("-- Only administrators can access this page! --"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$subject = trim($subject);
|
$subject = trim($subject);
|
||||||
|
@ -430,12 +430,12 @@ class m_admin {
|
||||||
$from = trim($from);
|
$from = trim($from);
|
||||||
|
|
||||||
if (empty($subject) || empty($message) || empty($from)) {
|
if (empty($subject) || empty($message) || empty($from)) {
|
||||||
$msg->raise('Error', "admin", _("Subject, message and sender are mandatory"));
|
$msg->raise("ERROR", "admin", _("Subject, message and sender are mandatory"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//@todo remove cf functions.php
|
//@todo remove cf functions.php
|
||||||
if (checkmail($from) != 0) {
|
if (checkmail($from) != 0) {
|
||||||
$msg->raise('Error', "admin", _("Sender is syntaxically incorrect"));
|
$msg->raise("ERROR", "admin", _("Sender is syntaxically incorrect"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -467,7 +467,7 @@ class m_admin {
|
||||||
|
|
||||||
$msg->log("admin", "get_reseller_list");
|
$msg->log("admin", "get_reseller_list");
|
||||||
if (!$this->enabled || $cuid != 2000) {
|
if (!$this->enabled || $cuid != 2000) {
|
||||||
$msg->raise('Error', "admin", _("-- Only administrators can access this page! --"));
|
$msg->raise("ERROR", "admin", _("-- Only administrators can access this page! --"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -503,7 +503,7 @@ class m_admin {
|
||||||
$db->query("SELECT creator FROM membres WHERE uid= ?;", array($uid));
|
$db->query("SELECT creator FROM membres WHERE uid= ?;", array($uid));
|
||||||
$db->next_record();
|
$db->next_record();
|
||||||
if ($db->Record["creator"] != $cuid) {
|
if ($db->Record["creator"] != $cuid) {
|
||||||
$msg->raise('Error', "admin", _("-- Only administrators can access this page! --"));
|
$msg->raise("ERROR", "admin", _("-- Only administrators can access this page! --"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -526,13 +526,13 @@ class m_admin {
|
||||||
$msg->log("admin", "add_shared_domain", $u . "/" . $domain_name);
|
$msg->log("admin", "add_shared_domain", $u . "/" . $domain_name);
|
||||||
|
|
||||||
if (!$mem->checkright()) {
|
if (!$mem->checkright()) {
|
||||||
$msg->raise('Error', "admin", _("-- Only administrators can do that! --"));
|
$msg->raise("ERROR", "admin", _("-- Only administrators can do that! --"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if this domain exist on this admin account
|
// Check if this domain exist on this admin account
|
||||||
if ((!in_array($domain_name, $dom->enum_domains()))&&($domaine_name!=variable_get("hosting_tld"))) {
|
if ((!in_array($domain_name, $dom->enum_domains()))&&($domaine_name!=variable_get("hosting_tld"))) {
|
||||||
$msg->raise('Error', "admin", _("You don't seem to be allowed to delegate this domain"));
|
$msg->raise("ERROR", "admin", _("You don't seem to be allowed to delegate this domain"));
|
||||||
$msg->log("admin", "add_shared_domain", "domain not allowed");
|
$msg->log("admin", "add_shared_domain", "domain not allowed");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -588,43 +588,43 @@ class m_admin {
|
||||||
global $msg, $cuid, $mem, $L_MYSQL_DATABASE, $L_MYSQL_LOGIN, $hooks, $action;
|
global $msg, $cuid, $mem, $L_MYSQL_DATABASE, $L_MYSQL_LOGIN, $hooks, $action;
|
||||||
$msg->log("admin", "add_mem", $login . "/" . $mail);
|
$msg->log("admin", "add_mem", $login . "/" . $mail);
|
||||||
if (!$this->enabled) {
|
if (!$this->enabled) {
|
||||||
$msg->raise('Error', "admin", _("-- Only administrators can access this page! --"));
|
$msg->raise("ERROR", "admin", _("-- Only administrators can access this page! --"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (empty($db_server_id)) {
|
if (empty($db_server_id)) {
|
||||||
$msg->raise('Error', "admin", _("Missing db_server field"));
|
$msg->raise("ERROR", "admin", _("Missing db_server field"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (($login == "") || ($pass == "")) {
|
if (($login == "") || ($pass == "")) {
|
||||||
$msg->raise('Error', "admin", _("Please fill all mandatory fields"));
|
$msg->raise("ERROR", "admin", _("Please fill all mandatory fields"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!$force) {
|
if (!$force) {
|
||||||
if ($mail == "") {
|
if ($mail == "") {
|
||||||
$msg->raise('Error', "admin", _("Please fill all mandatory fields"));
|
$msg->raise("ERROR", "admin", _("Please fill all mandatory fields"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//@todo remove cf functions.php
|
//@todo remove cf functions.php
|
||||||
if (checkmail($mail) != 0) {
|
if (checkmail($mail) != 0) {
|
||||||
$msg->raise('Error', "admin", _("Please enter a valid email address"));
|
$msg->raise("ERROR", "admin", _("Please enter a valid email address"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$login = strtolower($login);
|
$login = strtolower($login);
|
||||||
if (!preg_match("#^[a-z0-9]+$#", $login)) { //$
|
if (!preg_match("#^[a-z0-9]+$#", $login)) { //$
|
||||||
$msg->raise('Error', "admin", _("Login can only contains characters a-z and 0-9"));
|
$msg->raise("ERROR", "admin", _("Login can only contains characters a-z and 0-9"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (strlen($login) > 14) {
|
if (strlen($login) > 14) {
|
||||||
// Not an arbitrary value : MySQL user names can be up to 16 characters long
|
// Not an arbitrary value : MySQL user names can be up to 16 characters long
|
||||||
// If we want to allow people to create a few mysql_user (and we want to!)
|
// If we want to allow people to create a few mysql_user (and we want to!)
|
||||||
// we have to limit the login lenght
|
// we have to limit the login lenght
|
||||||
$msg->raise('Error', "admin", _("The login is too long (14 chars max)"));
|
$msg->raise("ERROR", "admin", _("The login is too long (14 chars max)"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Some login are not allowed...
|
// Some login are not allowed...
|
||||||
if ($login == $L_MYSQL_DATABASE || $login == $L_MYSQL_LOGIN || $login == "mysql" || $login == "root") {
|
if ($login == $L_MYSQL_DATABASE || $login == $L_MYSQL_LOGIN || $login == "mysql" || $login == "root") {
|
||||||
$msg->raise('Error', "admin", _("Login can only contains characters a-z, 0-9 and -"));
|
$msg->raise("ERROR", "admin", _("Login can only contains characters a-z, 0-9 and -"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$pass = _md5cr($pass);
|
$pass = _md5cr($pass);
|
||||||
|
@ -663,7 +663,7 @@ class m_admin {
|
||||||
|
|
||||||
return $uid;
|
return $uid;
|
||||||
} else {
|
} else {
|
||||||
$msg->raise('Error', "admin", _("This login already exists"));
|
$msg->raise("ERROR", "admin", _("This login already exists"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -686,7 +686,7 @@ class m_admin {
|
||||||
}
|
}
|
||||||
$db = new DB_System();
|
$db = new DB_System();
|
||||||
if (!$db->query("SELECT m.*, parent.login as parentlogin FROM membres m LEFT JOIN membres parent ON parent.uid=m.creator WHERE m.uid= ?", array($cuid))) {
|
if (!$db->query("SELECT m.*, parent.login as parentlogin FROM membres m LEFT JOIN membres parent ON parent.uid=m.creator WHERE m.uid= ?", array($cuid))) {
|
||||||
$msg->raise('Error', "admin", sprintf(_("query failed: %s "), $db->Error));
|
$msg->raise("ERROR", "admin", sprintf(_("query failed: %s "), $db->Error));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ($db->next_record()) {
|
if ($db->next_record()) {
|
||||||
|
@ -718,11 +718,11 @@ EOF;
|
||||||
//sprintf(_("Email successfully sent to %s"), $dest);
|
//sprintf(_("Email successfully sent to %s"), $dest);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
$msg->raise('Error', "admin", sprintf(_("Cannot send email to %s"), $dest));
|
$msg->raise("ERROR", "admin", sprintf(_("Cannot send email to %s"), $dest));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$msg->raise('Error', "admin", sprintf(_("Query failed: %s"), $db->Error));
|
$msg->raise("ERROR", "admin", sprintf(_("Query failed: %s"), $db->Error));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -757,7 +757,7 @@ EOF;
|
||||||
$msg->log("admin", "update_mem", $uid);
|
$msg->log("admin", "update_mem", $uid);
|
||||||
|
|
||||||
if (!$this->enabled) {
|
if (!$this->enabled) {
|
||||||
$msg->raise('Error', "admin", _("-- Only administrators can access this page! --"));
|
$msg->raise("ERROR", "admin", _("-- Only administrators can access this page! --"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$db = new DB_System();
|
$db = new DB_System();
|
||||||
|
@ -784,7 +784,7 @@ EOF;
|
||||||
$this->renew_update($uid, $duration);
|
$this->renew_update($uid, $duration);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
$msg->raise('Error', "admin", _("Account not found"));
|
$msg->raise("ERROR", "admin", _("Account not found"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -803,14 +803,14 @@ EOF;
|
||||||
global $msg, $db;
|
global $msg, $db;
|
||||||
$msg->log("admin", "lock_mem", $uid);
|
$msg->log("admin", "lock_mem", $uid);
|
||||||
if (!$this->enabled) {
|
if (!$this->enabled) {
|
||||||
$msg->raise('Error', "admin", _("-- Only administrators can access this page! --"));
|
$msg->raise("ERROR", "admin", _("-- Only administrators can access this page! --"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$db = new DB_System();
|
$db = new DB_System();
|
||||||
if ($db->query("UPDATE membres SET enabled='0' WHERE uid= ?;", array($uid))) {
|
if ($db->query("UPDATE membres SET enabled='0' WHERE uid= ?;", array($uid))) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
$msg->raise('Error', "admin", _("Account not found"));
|
$msg->raise("ERROR", "admin", _("Account not found"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -830,14 +830,14 @@ EOF;
|
||||||
global $msg, $db;
|
global $msg, $db;
|
||||||
$msg->log("admin", "unlock_mem", $uid);
|
$msg->log("admin", "unlock_mem", $uid);
|
||||||
if (!$this->enabled) {
|
if (!$this->enabled) {
|
||||||
$msg->raise('Error', "admin", _("-- Only administrators can access this page! --"));
|
$msg->raise("ERROR", "admin", _("-- Only administrators can access this page! --"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$db = new DB_System();
|
$db = new DB_System();
|
||||||
if ($db->query("UPDATE membres SET enabled='1' WHERE uid= ?;", array($uid))) {
|
if ($db->query("UPDATE membres SET enabled='1' WHERE uid= ?;", array($uid))) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
$msg->raise('Error', "admin", _("Account not found"));
|
$msg->raise("ERROR", "admin", _("Account not found"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -864,7 +864,7 @@ EOF;
|
||||||
$msg->log("admin", "del_mem", $uid);
|
$msg->log("admin", "del_mem", $uid);
|
||||||
|
|
||||||
if (!$this->enabled) {
|
if (!$this->enabled) {
|
||||||
$msg->raise('Error', "admin", _("-- Only administrators can access this page! --"));
|
$msg->raise("ERROR", "admin", _("-- Only administrators can access this page! --"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$db = new DB_System();
|
$db = new DB_System();
|
||||||
|
@ -890,7 +890,7 @@ EOF;
|
||||||
$db->query("UPDATE membres SET creator=2000 WHERE creator= ?;", array($uid));
|
$db->query("UPDATE membres SET creator=2000 WHERE creator= ?;", array($uid));
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
$msg->raise('Error', "admin", _("Account not found"));
|
$msg->raise("ERROR", "admin", _("Account not found"));
|
||||||
$mem->unsu();
|
$mem->unsu();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -917,7 +917,7 @@ EOF;
|
||||||
if ($db->query("UPDATE membres SET renewed = renewed + INTERVAL (duration * ?) MONTH WHERE uid= ?;", array($periods, $uid))) {
|
if ($db->query("UPDATE membres SET renewed = renewed + INTERVAL (duration * ?) MONTH WHERE uid= ?;", array($periods, $uid))) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
$msg->raise('Error', "admin", _("Account not found"));
|
$msg->raise("ERROR", "admin", _("Account not found"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -945,7 +945,7 @@ EOF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$msg->raise('Error', "admin", _("Account not found"));
|
$msg->raise("ERROR", "admin", _("Account not found"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1023,11 +1023,11 @@ EOF;
|
||||||
global $msg, $db;
|
global $msg, $db;
|
||||||
$db->query("SELECT su FROM membres WHERE uid= ?;", array($uid));
|
$db->query("SELECT su FROM membres WHERE uid= ?;", array($uid));
|
||||||
if (!$db->next_record()) {
|
if (!$db->next_record()) {
|
||||||
$msg->raise('Error', "admin", _("Account not found"));
|
$msg->raise("ERROR", "admin", _("Account not found"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ($db->Record["su"] != 0) {
|
if ($db->Record["su"] != 0) {
|
||||||
$msg->raise('Error', "admin", _("This account is ALREADY an administrator account"));
|
$msg->raise("ERROR", "admin", _("This account is ALREADY an administrator account"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$db->query("UPDATE membres SET su=1 WHERE uid= ?;", array($uid));
|
$db->query("UPDATE membres SET su=1 WHERE uid= ?;", array($uid));
|
||||||
|
@ -1046,11 +1046,11 @@ EOF;
|
||||||
global $msg, $db;
|
global $msg, $db;
|
||||||
$db->query("SELECT su FROM membres WHERE uid= ?;", array($uid));
|
$db->query("SELECT su FROM membres WHERE uid= ?;", array($uid));
|
||||||
if (!$db->next_record()) {
|
if (!$db->next_record()) {
|
||||||
$msg->raise('Error', "admin", _("Account not found"));
|
$msg->raise("ERROR", "admin", _("Account not found"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ($db->Record["su"] != 1) {
|
if ($db->Record["su"] != 1) {
|
||||||
$msg->raise('Error', "admin", _("This account is NOT an administrator account!"));
|
$msg->raise("ERROR", "admin", _("This account is NOT an administrator account!"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$db->query("UPDATE membres SET su=0 WHERE uid= ?;", array($uid));
|
$db->query("UPDATE membres SET su=0 WHERE uid= ?;", array($uid));
|
||||||
|
@ -1236,7 +1236,7 @@ EOF;
|
||||||
global $db, $msg;
|
global $db, $msg;
|
||||||
$db->query("SELECT compte FROM domaines WHERE domaine= ?;", array($domain));
|
$db->query("SELECT compte FROM domaines WHERE domaine= ?;", array($domain));
|
||||||
if (!$db->next_record()) {
|
if (!$db->next_record()) {
|
||||||
$msg->raise('Error', "dom", _("Domain '%s' not found."), $domain);
|
$msg->raise("ERROR", "dom", _("Domain '%s' not found."), $domain);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$db->query("UPDATE domaines SET noerase=1-noerase WHERE domaine= ?;", array($domain));
|
$db->query("UPDATE domaines SET noerase=1-noerase WHERE domaine= ?;", array($domain));
|
||||||
|
@ -1255,7 +1255,7 @@ EOF;
|
||||||
global $db, $msg;
|
global $db, $msg;
|
||||||
$db->query("SELECT mode FROM tld WHERE tld= ?;", array($tld));
|
$db->query("SELECT mode FROM tld WHERE tld= ?;", array($tld));
|
||||||
if (!$db->next_record()) {
|
if (!$db->next_record()) {
|
||||||
$msg->raise('Error', "admin", _("This TLD does not exist"));
|
$msg->raise("ERROR", "admin", _("This TLD does not exist"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return $db->Record["mode"];
|
return $db->Record["mode"];
|
||||||
|
@ -1291,7 +1291,7 @@ EOF;
|
||||||
global $db, $msg;
|
global $db, $msg;
|
||||||
$db->query("SELECT tld FROM tld WHERE tld= ?;", array($tld));
|
$db->query("SELECT tld FROM tld WHERE tld= ?;", array($tld));
|
||||||
if (!$db->next_record()) {
|
if (!$db->next_record()) {
|
||||||
$msg->raise('Error', "admin", _("This TLD does not exist"));
|
$msg->raise("ERROR", "admin", _("This TLD does not exist"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$db->query("DELETE FROM tld WHERE tld= ?;", array($tld));
|
$db->query("DELETE FROM tld WHERE tld= ?;", array($tld));
|
||||||
|
@ -1316,14 +1316,14 @@ EOF;
|
||||||
function addtld($tld, $mode) {
|
function addtld($tld, $mode) {
|
||||||
global $db, $msg;
|
global $db, $msg;
|
||||||
if (!$tld) {
|
if (!$tld) {
|
||||||
$msg->raise('Error', "admin", _("The TLD name is mandatory"));
|
$msg->raise("ERROR", "admin", _("The TLD name is mandatory"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$tld = trim($tld);
|
$tld = trim($tld);
|
||||||
|
|
||||||
$db->query("SELECT tld FROM tld WHERE tld= ?;", array($tld));
|
$db->query("SELECT tld FROM tld WHERE tld= ?;", array($tld));
|
||||||
if ($db->next_record()) {
|
if ($db->next_record()) {
|
||||||
$msg->raise('Error', "admin", _("This TLD already exist"));
|
$msg->raise("ERROR", "admin", _("This TLD already exist"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (substr($tld, 0, 1) == ".") {
|
if (substr($tld, 0, 1) == ".") {
|
||||||
|
@ -1352,7 +1352,7 @@ EOF;
|
||||||
global $db, $msg;
|
global $db, $msg;
|
||||||
$db->query("SELECT tld FROM tld WHERE tld= ?;", array($tld));
|
$db->query("SELECT tld FROM tld WHERE tld= ?;", array($tld));
|
||||||
if (!$db->next_record()) {
|
if (!$db->next_record()) {
|
||||||
$msg->raise('Error', "admin", _("This TLD does not exist"));
|
$msg->raise("ERROR", "admin", _("This TLD does not exist"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$mode = intval($mode);
|
$mode = intval($mode);
|
||||||
|
@ -1461,17 +1461,17 @@ EOF;
|
||||||
global $msg;
|
global $msg;
|
||||||
|
|
||||||
if (empty($login)) {
|
if (empty($login)) {
|
||||||
$msg->raise('alert', "admin", _("Please enter a login"));
|
$msg->raise("ALERT", "admin", _("Please enter a login"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (empty($password) && !$canbeempty) {
|
if (empty($password) && !$canbeempty) {
|
||||||
$msg->raise('alert', "admin", _("Please enter a password"));
|
$msg->raise("ALERT", "admin", _("Please enter a password"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$pol = $this->listPasswordPolicies();
|
$pol = $this->listPasswordPolicies();
|
||||||
if (!$pol[$policy]) {
|
if (!$pol[$policy]) {
|
||||||
$msg->raise('Error', "admin", _("-- Program error -- The requested password policy does not exist!"));
|
$msg->raise("ERROR", "admin", _("-- Program error -- The requested password policy does not exist!"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$pol = $pol[$policy];
|
$pol = $pol[$policy];
|
||||||
|
@ -1479,12 +1479,12 @@ EOF;
|
||||||
$plen = strlen($password);
|
$plen = strlen($password);
|
||||||
|
|
||||||
if ($plen < $pol["minsize"] && !($canbeempty && empty($password))) {
|
if ($plen < $pol["minsize"] && !($canbeempty && empty($password))) {
|
||||||
$msg->raise('Error', "admin", _("The password length is too short according to the password policy"));
|
$msg->raise("ERROR", "admin", _("The password length is too short according to the password policy"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($plen > $pol["maxsize"] && !($canbeempty && empty($password))) {
|
if ($plen > $pol["maxsize"] && !($canbeempty && empty($password))) {
|
||||||
$msg->raise('Error', "admin", _("The password is too long according to the password policy"));
|
$msg->raise("ERROR", "admin", _("The password is too long according to the password policy"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1497,7 +1497,7 @@ EOF;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (strpos($password, $l) !== false || strpos($l, $password) !== false) {
|
if (strpos($password, $l) !== false || strpos($l, $password) !== false) {
|
||||||
$msg->raise('Error', "admin", _("The password policy prevents you to use your login name inside your password or the other way around"));
|
$msg->raise("ERROR", "admin", _("The password policy prevents you to use your login name inside your password or the other way around"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1521,7 +1521,7 @@ EOF;
|
||||||
} // foreach
|
} // foreach
|
||||||
$clc = array_sum($cls);
|
$clc = array_sum($cls);
|
||||||
if ($clc < $pol["classcount"]) {
|
if ($clc < $pol["classcount"]) {
|
||||||
$msg->raise('Error', "admin", _("Your password contains not enough different classes of character, between low-case, up-case, figures and special characters."));
|
$msg->raise("ERROR", "admin", _("Your password contains not enough different classes of character, between low-case, up-case, figures and special characters."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,7 +110,7 @@ class m_authip {
|
||||||
$this->ip_affected_delete($db->f('id'));
|
$this->ip_affected_delete($db->f('id'));
|
||||||
}
|
}
|
||||||
if (!$db->query("delete from authorised_ip where id= ? and ( uid= ? or uid=0) limit 1;", array($id, $cuid))) {
|
if (!$db->query("delete from authorised_ip where id= ? and ( uid= ? or uid=0) limit 1;", array($id, $cuid))) {
|
||||||
$msg->raise('Error', 'authip', _("query failed: " . $db->Error));
|
$msg->raise("ERROR", 'authip', _("query failed: " . $db->Error));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -128,7 +128,7 @@ class m_authip {
|
||||||
function get_allowed($s) {
|
function get_allowed($s) {
|
||||||
global $db, $cuid, $msg;
|
global $db, $cuid, $msg;
|
||||||
if (!$db->query("select ai.ip, ai.subnet, ai.infos, aia.parameters from authorised_ip ai, authorised_ip_affected aia where aia.protocol= ? and aia.authorised_ip_id = ai.id and ai.uid= ?;", array($s, $cuid))) {
|
if (!$db->query("select ai.ip, ai.subnet, ai.infos, aia.parameters from authorised_ip ai, authorised_ip_affected aia where aia.protocol= ? and aia.authorised_ip_id = ai.id and ai.uid= ?;", array($s, $cuid))) {
|
||||||
$msg->raise('Error', 'authip', _("query failed: " . $db->Error));
|
$msg->raise("ERROR", 'authip', _("query failed: " . $db->Error));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$r = Array();
|
$r = Array();
|
||||||
|
@ -147,7 +147,7 @@ class m_authip {
|
||||||
function is_wl($ip) {
|
function is_wl($ip) {
|
||||||
global $db, $msg;
|
global $db, $msg;
|
||||||
if (!$db->query("select ai.ip, ai.subnet from authorised_ip ai where ai.uid='0';")) {
|
if (!$db->query("select ai.ip, ai.subnet from authorised_ip ai where ai.uid='0';")) {
|
||||||
$msg->raise('Error', 'authip', _("query failed: " . $db->Error));
|
$msg->raise("ERROR", 'authip', _("query failed: " . $db->Error));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
while ($db->next_record()) {
|
while ($db->next_record()) {
|
||||||
|
@ -224,7 +224,7 @@ class m_authip {
|
||||||
|
|
||||||
// Error if $ip not an IP
|
// Error if $ip not an IP
|
||||||
if (!checkip($ip) && !checkipv6($ip)) {
|
if (!checkip($ip) && !checkipv6($ip)) {
|
||||||
$msg->raise('Error', 'authip', _("Failed : not an IP address"));
|
$msg->raise("ERROR", 'authip', _("Failed : not an IP address"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,7 +250,7 @@ class m_authip {
|
||||||
$this->call_hooks("authip_on_delete", $k);
|
$this->call_hooks("authip_on_delete", $k);
|
||||||
}
|
}
|
||||||
if (!$db->query("update authorised_ip set ip= ?, subnet= ?, infos= ? where id= ? and uid=? ;", array($ip, $subnet, $infos, $id, $cuid))) {
|
if (!$db->query("update authorised_ip set ip= ?, subnet= ?, infos= ? where id= ? and uid=? ;", array($ip, $subnet, $infos, $id, $cuid))) {
|
||||||
$msg->raise('Error', 'authip', _("query failed: " . $db->Error));
|
$msg->raise("ERROR", 'authip', _("query failed: " . $db->Error));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
foreach ($list_affected as $k => $v) {
|
foreach ($list_affected as $k => $v) {
|
||||||
|
@ -258,7 +258,7 @@ class m_authip {
|
||||||
}
|
}
|
||||||
} else { // Insert
|
} else { // Insert
|
||||||
if (!$db->query("insert into authorised_ip (uid, ip, subnet, infos) values (?, ?, ?, ?);", array($cuid, $ip, $subnet, $infos))) {
|
if (!$db->query("insert into authorised_ip (uid, ip, subnet, infos) values (?, ?, ?, ?);", array($cuid, $ip, $subnet, $infos))) {
|
||||||
$msg->raise('Error', 'authip', _("query failed: " . $db->Error));
|
$msg->raise("ERROR", 'authip', _("query failed: " . $db->Error));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -320,13 +320,13 @@ class m_authip {
|
||||||
$id = intval($id);
|
$id = intval($id);
|
||||||
$this->call_hooks("authip_on_delete", $id);
|
$this->call_hooks("authip_on_delete", $id);
|
||||||
if (!$db->query("update authorised_ip_affected set authorised_ip_id= ?, protocol= ?, parameters= ? where id = ? limit 1;", array($authorised_ip_id, $protocol, $parameters, $id))) {
|
if (!$db->query("update authorised_ip_affected set authorised_ip_id= ?, protocol= ?, parameters= ? where id = ? limit 1;", array($authorised_ip_id, $protocol, $parameters, $id))) {
|
||||||
$msg->raise('Error', 'authip', _("query failed: " . $db->Error));
|
$msg->raise("ERROR", 'authip', _("query failed: " . $db->Error));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$this->call_hooks("authip_on_create", $id);
|
$this->call_hooks("authip_on_create", $id);
|
||||||
} else {
|
} else {
|
||||||
if (!$db->query("insert into authorised_ip_affected (authorised_ip_id, protocol, parameters) values (?, ?, ?);", array($authorised_ip_id, $protocol, $parameters))) {
|
if (!$db->query("insert into authorised_ip_affected (authorised_ip_id, protocol, parameters) values (?, ?, ?);", array($authorised_ip_id, $protocol, $parameters))) {
|
||||||
$msg->raise('Error', 'authip', _("query failed: " . $db->Error));
|
$msg->raise("ERROR", 'authip', _("query failed: " . $db->Error));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$this->call_hooks("authip_on_create", $db->lastid());
|
$this->call_hooks("authip_on_create", $db->lastid());
|
||||||
|
@ -351,7 +351,7 @@ class m_authip {
|
||||||
$this->call_hooks("authip_on_delete", $id);
|
$this->call_hooks("authip_on_delete", $id);
|
||||||
|
|
||||||
if (!$db->query("delete from authorised_ip_affected where id= ? limit 1;", array($id))) {
|
if (!$db->query("delete from authorised_ip_affected where id= ? limit 1;", array($id))) {
|
||||||
$msg->raise('Error', 'authip', _("query failed: " . $db->Error));
|
$msg->raise("ERROR", 'authip', _("query failed: " . $db->Error));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -373,7 +373,7 @@ class m_authip {
|
||||||
// On récure l'objet dont on parle
|
// On récure l'objet dont on parle
|
||||||
$d = $this->list_affected();
|
$d = $this->list_affected();
|
||||||
if (!isset($d[$affectation_id])) {
|
if (!isset($d[$affectation_id])) {
|
||||||
$msg->raise('Error', 'authip', _("Object not available"));
|
$msg->raise("ERROR", 'authip', _("Object not available"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -382,7 +382,7 @@ class m_authip {
|
||||||
// On en déduis la classe qui le concerne
|
// On en déduis la classe qui le concerne
|
||||||
$e = $this->get_auth_class();
|
$e = $this->get_auth_class();
|
||||||
if (!isset($e[$affectation['protocol']])) {
|
if (!isset($e[$affectation['protocol']])) {
|
||||||
$msg->raise('Error', 'authip', sprintf(_("Can't identified class for the protocole %s"), $affectation['protocol']));
|
$msg->raise("ERROR", 'authip', sprintf(_("Can't identified class for the protocole %s"), $affectation['protocol']));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$c = $e[$affectation['protocol']]['class'];
|
$c = $e[$affectation['protocol']]['class'];
|
||||||
|
|
|
@ -199,11 +199,11 @@ class m_bro {
|
||||||
$db->query("UPDATE browser SET lastdir= ? WHERE uid= ?;", array($dir, $cuid));
|
$db->query("UPDATE browser SET lastdir= ? WHERE uid= ?;", array($dir, $cuid));
|
||||||
$absolute = $this->convertabsolute($dir, false);
|
$absolute = $this->convertabsolute($dir, false);
|
||||||
if (!$absolute || !file_exists($absolute)) {
|
if (!$absolute || !file_exists($absolute)) {
|
||||||
$msg->raise('Error', 'bro', _("This directory does not exist."));
|
$msg->raise("ERROR", 'bro', _("This directory does not exist."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!is_readable($absolute)) {
|
if (!is_readable($absolute)) {
|
||||||
$msg->raise('Error', 'bro', _("This directory is not readable."));
|
$msg->raise("ERROR", 'bro', _("This directory is not readable."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
clearstatcache(true);
|
clearstatcache(true);
|
||||||
|
@ -399,13 +399,13 @@ class m_bro {
|
||||||
#echo "$absolute";
|
#echo "$absolute";
|
||||||
if ($absolute && (!file_exists($absolute))) {
|
if ($absolute && (!file_exists($absolute))) {
|
||||||
if (!mkdir($absolute, 00777, true)) {
|
if (!mkdir($absolute, 00777, true)) {
|
||||||
$msg->raise('Error', "bro", _("Cannot create the requested directory. Please check the permissions"));
|
$msg->raise("ERROR", "bro", _("Cannot create the requested directory. Please check the permissions"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$db->query("UPDATE browser SET crff=1 WHERE uid= ?;", array($cuid));
|
$db->query("UPDATE browser SET crff=1 WHERE uid= ?;", array($cuid));
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
$msg->raise('Error', "bro", _("File or folder name is incorrect"));
|
$msg->raise("ERROR", "bro", _("File or folder name is incorrect"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -425,12 +425,12 @@ class m_bro {
|
||||||
$file = ssla($file);
|
$file = ssla($file);
|
||||||
$absolute = $this->convertabsolute($dir . "/" . $file, false);
|
$absolute = $this->convertabsolute($dir . "/" . $file, false);
|
||||||
if (!$absolute || file_exists($absolute)) {
|
if (!$absolute || file_exists($absolute)) {
|
||||||
$msg->raise('Error', "bro", _("File or folder name is incorrect"));
|
$msg->raise("ERROR", "bro", _("File or folder name is incorrect"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!file_exists($absolute)) {
|
if (!file_exists($absolute)) {
|
||||||
if (!@touch($absolute)) {
|
if (!@touch($absolute)) {
|
||||||
$msg->raise('Error', "bro", _("Cannot create the requested file. Please check the permissions"));
|
$msg->raise("ERROR", "bro", _("Cannot create the requested file. Please check the permissions"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -452,7 +452,7 @@ class m_bro {
|
||||||
$root = realpath(getuserpath());
|
$root = realpath(getuserpath());
|
||||||
$absolute = $this->convertabsolute($R, false);
|
$absolute = $this->convertabsolute($R, false);
|
||||||
if (!$absolute && strpos($root, $absolute) === 0 && strlen($absolute) > (strlen($root) + 1)) {
|
if (!$absolute && strpos($root, $absolute) === 0 && strlen($absolute) > (strlen($root) + 1)) {
|
||||||
$msg->raise('Error', "bro", _("File or folder name is incorrect"));
|
$msg->raise("ERROR", "bro", _("File or folder name is incorrect"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
for ($i = 0; $i < count($file_list); $i++) {
|
for ($i = 0; $i < count($file_list); $i++) {
|
||||||
|
@ -477,7 +477,7 @@ class m_bro {
|
||||||
global $msg;
|
global $msg;
|
||||||
$absolute = $this->convertabsolute($R, false);
|
$absolute = $this->convertabsolute($R, false);
|
||||||
if (!$absolute) {
|
if (!$absolute) {
|
||||||
$msg->raise('Error', "bro", _("File or folder name is incorrect"));
|
$msg->raise("ERROR", "bro", _("File or folder name is incorrect"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$alea = "." . time() . mt_rand(1000, 9999);
|
$alea = "." . time() . mt_rand(1000, 9999);
|
||||||
|
@ -510,7 +510,7 @@ class m_bro {
|
||||||
global $msg;
|
global $msg;
|
||||||
$old = $this->convertabsolute($old, false);
|
$old = $this->convertabsolute($old, false);
|
||||||
if (!$old) {
|
if (!$old) {
|
||||||
$msg->raise('Error', "bro", _("File or folder name is incorrect"));
|
$msg->raise("ERROR", "bro", _("File or folder name is incorrect"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -520,18 +520,18 @@ class m_bro {
|
||||||
$new = $this->convertabsolute($new, false);
|
$new = $this->convertabsolute($new, false);
|
||||||
|
|
||||||
if (!$new) {
|
if (!$new) {
|
||||||
$msg->raise('Error', "bro", _("File or folder name is incorrect"));
|
$msg->raise("ERROR", "bro", _("File or folder name is incorrect"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ($old == $new) {
|
if ($old == $new) {
|
||||||
$msg->raise('Error', "bro", _("You cannot move or copy a file to the same folder"));
|
$msg->raise("ERROR", "bro", _("You cannot move or copy a file to the same folder"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
for ($i = 0; $i < count($d); $i++) {
|
for ($i = 0; $i < count($d); $i++) {
|
||||||
$d[$i] = ssla($d[$i]); // strip slashes if needed
|
$d[$i] = ssla($d[$i]); // strip slashes if needed
|
||||||
if (!strpos($d[$i], "/") && file_exists($old . "/" . $d[$i]) && !file_exists($new . "/" . $d[$i])) {
|
if (!strpos($d[$i], "/") && file_exists($old . "/" . $d[$i]) && !file_exists($new . "/" . $d[$i])) {
|
||||||
if (!rename($old . "/" . $d[$i], $new . "/" . $d[$i])) {
|
if (!rename($old . "/" . $d[$i], $new . "/" . $d[$i])) {
|
||||||
$msg->raise('Error', "bro", "error renaming $old/$d[$i] -> $new/$d[$i]");
|
$msg->raise("ERROR", "bro", "error renaming $old/$d[$i] -> $new/$d[$i]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -551,7 +551,7 @@ class m_bro {
|
||||||
global $msg, $action;
|
global $msg, $action;
|
||||||
$absolute = $this->convertabsolute($R, false);
|
$absolute = $this->convertabsolute($R, false);
|
||||||
if (!$absolute) {
|
if (!$absolute) {
|
||||||
$msg->raise('Error', "bro", _("File or folder name is incorrect"));
|
$msg->raise("ERROR", "bro", _("File or folder name is incorrect"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
for ($i = 0; $i < count($d); $i++) {
|
for ($i = 0; $i < count($d); $i++) {
|
||||||
|
@ -593,7 +593,7 @@ class m_bro {
|
||||||
global $_FILES, $msg, $cuid, $action;
|
global $_FILES, $msg, $cuid, $action;
|
||||||
$absolute = $this->convertabsolute($R, false);
|
$absolute = $this->convertabsolute($R, false);
|
||||||
if (!$absolute) {
|
if (!$absolute) {
|
||||||
$msg->raise('Error', "bro", _("File or folder name is incorrect"));
|
$msg->raise("ERROR", "bro", _("File or folder name is incorrect"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!strpos($_FILES['userfile']['name'], "/")) {
|
if (!strpos($_FILES['userfile']['name'], "/")) {
|
||||||
|
@ -605,7 +605,7 @@ class m_bro {
|
||||||
$action->fix_file($absolute . "/" . $_FILES['userfile']['name']);
|
$action->fix_file($absolute . "/" . $_FILES['userfile']['name']);
|
||||||
return $absolute . "/" . $_FILES['userfile']['name'];
|
return $absolute . "/" . $_FILES['userfile']['name'];
|
||||||
} else {
|
} else {
|
||||||
$msg->raise('Error', "bro", _("Cannot create the requested file. Please check the permissions"));
|
$msg->raise("ERROR", "bro", _("Cannot create the requested file. Please check the permissions"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -625,7 +625,7 @@ class m_bro {
|
||||||
$erstr = _("Undefined error ") . $_FILES['userfile']['error'];
|
$erstr = _("Undefined error ") . $_FILES['userfile']['error'];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$msg->raise('Error', "bro", _("Error during the upload of the file: ") . $erstr);
|
$msg->raise("ERROR", "bro", _("Error during the upload of the file: ") . $erstr);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -653,7 +653,7 @@ class m_bro {
|
||||||
$dest = $this->convertabsolute($dest, false);
|
$dest = $this->convertabsolute($dest, false);
|
||||||
}
|
}
|
||||||
if (!$file || !$dest || !is_readable($file)) {
|
if (!$file || !$dest || !is_readable($file)) {
|
||||||
$msg->raise('Error', "bro", _("File or folder name is incorrect"));
|
$msg->raise("ERROR", "bro", _("File or folder name is incorrect"));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
$lfile = strtolower($file);
|
$lfile = strtolower($file);
|
||||||
|
@ -685,7 +685,7 @@ class m_bro {
|
||||||
$action->fix_dir($dest);
|
$action->fix_dir($dest);
|
||||||
|
|
||||||
if ($ret) {
|
if ($ret) {
|
||||||
$msg->raise('Error', "bro", _("I cannot find a way to extract the file %s, it is an unsupported compressed format"), $file);
|
$msg->raise("ERROR", "bro", _("I cannot find a way to extract the file %s, it is an unsupported compressed format"), $file);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -704,16 +704,16 @@ class m_bro {
|
||||||
global $msg;
|
global $msg;
|
||||||
$old = $this->convertabsolute($old, false);
|
$old = $this->convertabsolute($old, false);
|
||||||
if (!$old) {
|
if (!$old) {
|
||||||
$msg->raise('Error', "bro", _("File or folder name is incorrect"));
|
$msg->raise("ERROR", "bro", _("File or folder name is incorrect"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$new = $this->convertabsolute($new, false);
|
$new = $this->convertabsolute($new, false);
|
||||||
if (!$new) {
|
if (!$new) {
|
||||||
$msg->raise('Error', "bro", _("File or folder name is incorrect"));
|
$msg->raise("ERROR", "bro", _("File or folder name is incorrect"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ($old == $new) {
|
if ($old == $new) {
|
||||||
$msg->raise('Error', "bro", _("You cannot move or copy a file to the same folder"));
|
$msg->raise("ERROR", "bro", _("You cannot move or copy a file to the same folder"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
for ($i = 0; $i < count($d); $i++) {
|
for ($i = 0; $i < count($d); $i++) {
|
||||||
|
@ -741,7 +741,7 @@ class m_bro {
|
||||||
global $msg;
|
global $msg;
|
||||||
exec("cp -Rpf " . escapeshellarg($src) . " " . escapeshellarg($dest), $void, $ret);
|
exec("cp -Rpf " . escapeshellarg($src) . " " . escapeshellarg($dest), $void, $ret);
|
||||||
if ($ret) {
|
if ($ret) {
|
||||||
$msg->raise('Error', "bro", "Errors happened while copying the source to destination. cp return value: %d", $ret);
|
$msg->raise("ERROR", "bro", "Errors happened while copying the source to destination. cp return value: %d", $ret);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -799,11 +799,11 @@ class m_bro {
|
||||||
$std = str_replace("<", "<", str_replace("&", "&", file_get_contents($absolute)));
|
$std = str_replace("<", "<", str_replace("&", "&", file_get_contents($absolute)));
|
||||||
return $std;
|
return $std;
|
||||||
} else {
|
} else {
|
||||||
$msg->raise('Error', "bro", _("Cannot read the requested file. Please check the permissions"));
|
$msg->raise("ERROR", "bro", _("Cannot read the requested file. Please check the permissions"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$msg->raise('Error', "bro", _("File or folder name is incorrect"));
|
$msg->raise("ERROR", "bro", _("File or folder name is incorrect"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -880,7 +880,7 @@ class m_bro {
|
||||||
$absolute = "$dir/$name";
|
$absolute = "$dir/$name";
|
||||||
$absolute = $this->convertabsolute($absolute, false);
|
$absolute = $this->convertabsolute($absolute, false);
|
||||||
if (!$absolute) {
|
if (!$absolute) {
|
||||||
$msg->raise('Error', 'bro', _("File not in authorized directory"));
|
$msg->raise("ERROR", 'bro', _("File not in authorized directory"));
|
||||||
include('foot.php');
|
include('foot.php');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
@ -974,7 +974,7 @@ class m_bro {
|
||||||
readfile($absolute);
|
readfile($absolute);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$msg->raise('Error', "bro", _("File or folder name is incorrect"));
|
$msg->raise("ERROR", "bro", _("File or folder name is incorrect"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -998,12 +998,12 @@ class m_bro {
|
||||||
$absolute.="/" . $file;
|
$absolute.="/" . $file;
|
||||||
if (file_exists($absolute)) {
|
if (file_exists($absolute)) {
|
||||||
if (!file_put_contents($absolute, $texte)) {
|
if (!file_put_contents($absolute, $texte)) {
|
||||||
$msg->raise('Error', "bro", _("Cannot edit the requested file. Please check the permissions"));
|
$msg->raise("ERROR", "bro", _("Cannot edit the requested file. Please check the permissions"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$msg->raise('Error', "bro", _("File or folder name is incorrect"));
|
$msg->raise("ERROR", "bro", _("File or folder name is incorrect"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -1170,7 +1170,7 @@ class m_bro {
|
||||||
$dir.="html/";
|
$dir.="html/";
|
||||||
if (!is_dir($dir)) {
|
if (!is_dir($dir)) {
|
||||||
if (!mkdir($dir))
|
if (!mkdir($dir))
|
||||||
$msg->raise('Error', "bro", _("Cannot create the requested directory. Please check the permissions"));
|
$msg->raise("ERROR", "bro", _("Cannot create the requested directory. Please check the permissions"));
|
||||||
}
|
}
|
||||||
$timestamp = date("H:i:s");
|
$timestamp = date("H:i:s");
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue