From 33f8e7888578bc928cdae73974991ef7f2ebd559 Mon Sep 17 00:00:00 2001 From: Benjamin Sonntag Date: Fri, 6 Oct 2017 18:04:36 +0200 Subject: [PATCH] [fix] class m_messages fixed to use 'level' instead of 'type' or 'cat' + force CAP on levels + merge OK and INFO --- bureau/admin/adm_add.php | 2 +- bureau/admin/adm_authip_whitelist.php | 4 +- bureau/admin/adm_db_servers.php | 2 +- bureau/admin/adm_deactivate.php | 13 +-- bureau/admin/adm_defquotas.php | 2 +- bureau/admin/adm_dnsweberror.php | 2 +- bureau/admin/adm_doadd.php | 6 +- bureau/admin/adm_dodefquotas.php | 14 +-- bureau/admin/adm_dodel.php | 10 +- bureau/admin/adm_doedit.php | 8 +- bureau/admin/adm_domlock.php | 2 +- bureau/admin/adm_doms.php | 2 +- bureau/admin/adm_doms_def_type.php | 6 +- bureau/admin/adm_domstype.php | 2 +- bureau/admin/adm_domstypedoedit.php | 4 +- bureau/admin/adm_domstypeedit.php | 2 +- bureau/admin/adm_domstyperegenerate.php | 4 +- bureau/admin/adm_donosu.php | 4 +- bureau/admin/adm_dorenew.php | 6 +- bureau/admin/adm_dosu.php | 4 +- bureau/admin/adm_edit.php | 4 +- bureau/admin/adm_email.php | 6 +- bureau/admin/adm_list.php | 6 +- bureau/admin/adm_lockpanel.php | 2 +- bureau/admin/adm_login.php | 8 +- bureau/admin/adm_mxaccount.php | 6 +- bureau/admin/adm_panel.php | 2 +- bureau/admin/adm_passpolicy.php | 12 +-- bureau/admin/adm_quotadoedit.php | 4 +- bureau/admin/adm_quotaedit.php | 2 +- bureau/admin/adm_slavedns.php | 10 +- bureau/admin/adm_tld.php | 6 +- bureau/admin/adm_tldadd.php | 2 +- bureau/admin/adm_tlddoadd.php | 4 +- bureau/admin/adm_tlddoedit.php | 4 +- bureau/admin/adm_tldedit.php | 2 +- bureau/admin/adm_update_domains.php | 4 +- bureau/admin/adm_variables.php | 2 +- bureau/admin/bro_editor.php | 4 +- bureau/admin/bro_main.php | 32 +++--- bureau/admin/bro_pref.php | 2 +- bureau/admin/cron.php | 2 +- bureau/admin/dom_add.php | 2 +- bureau/admin/dom_doadd.php | 2 +- bureau/admin/dom_dodel.php | 4 +- bureau/admin/dom_editdns.php | 6 +- bureau/admin/dom_import.php | 2 +- bureau/admin/dom_subdel.php | 2 +- bureau/admin/dom_subdodel.php | 4 +- bureau/admin/dom_subdoedit.php | 4 +- bureau/admin/dom_subedit.php | 2 +- bureau/admin/dom_substatus.php | 2 +- bureau/admin/ftp_del.php | 2 +- bureau/admin/ftp_doedit.php | 6 +- bureau/admin/ftp_edit.php | 2 +- bureau/admin/ftp_switch_enable.php | 4 +- bureau/admin/hta_del.php | 2 +- bureau/admin/hta_doadd.php | 4 +- bureau/admin/hta_doadduser.php | 4 +- bureau/admin/hta_dodeluser.php | 2 +- bureau/admin/hta_doedituser.php | 4 +- bureau/admin/hta_edit.php | 2 +- bureau/admin/ip_main.php | 8 +- bureau/admin/logs_list.php | 2 +- bureau/admin/mail_del.php | 6 +- bureau/admin/mail_doedit.php | 8 +- bureau/admin/mail_list.php | 4 +- bureau/admin/mail_manage_catchall.php | 8 +- bureau/admin/mail_undelete.php | 2 +- bureau/admin/mem_admin.php | 2 +- bureau/admin/mem_chgmail.php | 2 +- bureau/admin/mem_cm2.php | 2 +- bureau/admin/mem_param.php | 2 +- bureau/admin/mem_passwd.php | 2 +- bureau/admin/nowebmail.php | 2 +- bureau/admin/piwik_addaccount.php | 4 +- bureau/admin/piwik_addsites.php | 4 +- bureau/admin/piwik_site_dodel.php | 4 +- bureau/admin/piwik_sitelist.php | 10 +- bureau/admin/piwik_user_dodel.php | 6 +- bureau/admin/piwik_useradmin.php | 12 +-- bureau/admin/piwik_userlist.php | 8 +- bureau/admin/quota_show.php | 2 +- bureau/admin/quotas_users.php | 2 +- bureau/admin/sql_del.php | 4 +- bureau/admin/sql_doadd.php | 4 +- bureau/admin/sql_dobck.php | 2 +- bureau/admin/sql_dorestore.php | 2 +- bureau/admin/sql_list.php | 4 +- bureau/admin/sql_users_del.php | 2 +- bureau/admin/sql_users_doadd.php | 4 +- bureau/admin/sql_users_dopassword.php | 2 +- bureau/admin/sql_users_dorights.php | 2 +- bureau/admin/sql_users_list.php | 4 +- bureau/class/db_mysql.php | 2 +- bureau/class/functions.php | 8 +- bureau/class/m_action.php | 14 +-- bureau/class/m_admin.php | 104 ++++++++++---------- bureau/class/m_authip.php | 22 ++--- bureau/class/m_bro.php | 58 +++++------ bureau/class/m_cron.php | 8 +- bureau/class/m_dom.php | 120 +++++++++++------------ bureau/class/m_ftp.php | 32 +++--- bureau/class/m_hta.php | 44 ++++----- bureau/class/m_lxc.php | 4 +- bureau/class/m_mail.php | 44 ++++----- bureau/class/m_mem.php | 44 ++++----- bureau/class/m_messages.php | 125 ++++++++++++------------ bureau/class/m_mysql.php | 90 ++++++++--------- bureau/class/m_piwik.php | 22 ++--- bureau/class/m_quota.php | 4 +- 111 files changed, 584 insertions(+), 580 deletions(-) diff --git a/bureau/admin/adm_add.php b/bureau/admin/adm_add.php index 64db13b9..d427cfa5 100755 --- a/bureau/admin/adm_add.php +++ b/bureau/admin/adm_add.php @@ -28,7 +28,7 @@ require_once("../class/config.php"); include_once("head.php"); 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(); exit(); } diff --git a/bureau/admin/adm_authip_whitelist.php b/bureau/admin/adm_authip_whitelist.php index 70ed44f6..9411048d 100755 --- a/bureau/admin/adm_authip_whitelist.php +++ b/bureau/admin/adm_authip_whitelist.php @@ -15,13 +15,13 @@ getFields($fields); if (!empty($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 (! $authip->ip_save_whitelist($id, $ipsub, $infos)) { - $msg->raise('Error', "admin", _("Error during recording")); + $msg->raise("ERROR", "admin", _("Error during recording")); } } diff --git a/bureau/admin/adm_db_servers.php b/bureau/admin/adm_db_servers.php index 1f25c70b..f49d6879 100644 --- a/bureau/admin/adm_db_servers.php +++ b/bureau/admin/adm_db_servers.php @@ -27,7 +27,7 @@ require_once("../class/config.php"); include("head.php"); 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(); exit(); } diff --git a/bureau/admin/adm_deactivate.php b/bureau/admin/adm_deactivate.php index 0b8d0cfc..01da441e 100755 --- a/bureau/admin/adm_deactivate.php +++ b/bureau/admin/adm_deactivate.php @@ -32,7 +32,7 @@ require_once("../class/config.php"); include_once("head.php"); 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(); exit; } @@ -44,21 +44,21 @@ $fields = array ( getFields($fields); if (!$uid) { - $msg->raise('Error', "admin", _("Account not found")); + $msg->raise("ERROR", "admin", _("Account not found")); echo $msg->msg_html_all(); include_once("foot.php"); exit(); } 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(); include_once("foot.php"); exit(); } 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(); include_once("foot.php"); exit(); @@ -83,7 +83,7 @@ if (! ($confirmed ) ) { print "

" . _("Domains of user: ") . $r["login"] . "

"; } else { if (empty($redirect)) { - $msg->raise('Error', "admin", _("Missing redirect url.")); + $msg->raise("ERROR", "admin", _("Missing redirect url.")); echo $msg->msg_html_all(); include_once("foot.php"); exit(); @@ -135,7 +135,8 @@ foreach ($domains as $key => $domain) { # 2.2 change the subdomain to redirect to http://spam.koumbit.org/ $dom->lock(); 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(); } diff --git a/bureau/admin/adm_defquotas.php b/bureau/admin/adm_defquotas.php index fc4f3ac9..74f2d18f 100755 --- a/bureau/admin/adm_defquotas.php +++ b/bureau/admin/adm_defquotas.php @@ -32,7 +32,7 @@ require_once("../class/config.php"); 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(); exit(); } diff --git a/bureau/admin/adm_dnsweberror.php b/bureau/admin/adm_dnsweberror.php index 7e6669e8..1e2395e4 100644 --- a/bureau/admin/adm_dnsweberror.php +++ b/bureau/admin/adm_dnsweberror.php @@ -30,7 +30,7 @@ require_once("../class/config.php"); 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(); exit(); } diff --git a/bureau/admin/adm_doadd.php b/bureau/admin/adm_doadd.php index e5585a9a..35409a7a 100644 --- a/bureau/admin/adm_doadd.php +++ b/bureau/admin/adm_doadd.php @@ -27,7 +27,7 @@ require_once("../class/config.php"); 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(); exit; } @@ -55,7 +55,7 @@ if ($create_dom && !empty($create_dom_list) ) { } if ($pass != $passconf) { - $msg->raise("Error", "admin", _("Passwords do not match")); + $msg->raise("ERROR", "admin", _("Passwords do not match")); include("adm_add.php"); exit(); } @@ -66,7 +66,7 @@ if (!($u=$admin->add_mem($login, $pass, $nom, $prenom, $nmail, $canpass, $type, 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"); exit; diff --git a/bureau/admin/adm_dodefquotas.php b/bureau/admin/adm_dodefquotas.php index aa6f6455..881c45a5 100755 --- a/bureau/admin/adm_dodefquotas.php +++ b/bureau/admin/adm_dodefquotas.php @@ -32,7 +32,7 @@ require_once("../class/config.php"); 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(); exit(); } @@ -46,18 +46,18 @@ getFields($fields); if($action == "add") { if($quota->addtype($type)) { - $msg->raise('Ok', "admin", _("Account type"). " \"".htmlentities($type)."\" "._("added")); + $msg->raise("INFO", "admin", _("Account type"). " \"".htmlentities($type)."\" "._("added")); } 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"); } else if($action == "delete") { if($del_confirm == "y"){ if(!empty($type)) { if($quota->deltype($type)) { - $msg->raise('Ok', "admin", _("Account type"). " \"".htmlentities($type)."\" "._("deleted")); + $msg->raise("INFO", "admin", _("Account type"). " \"".htmlentities($type)."\" "._("deleted")); } 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"); @@ -93,9 +93,9 @@ if($action == "add") { } if($quota->setdefaults($c)) { - $msg->raise('Ok', "admin", _("Default quotas successfully changed")); + $msg->raise("INFO", "admin", _("Default quotas successfully changed")); } 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"); } diff --git a/bureau/admin/adm_dodel.php b/bureau/admin/adm_dodel.php index 8c7db7cb..bdb8fdbe 100755 --- a/bureau/admin/adm_dodel.php +++ b/bureau/admin/adm_dodel.php @@ -30,7 +30,7 @@ require_once("../class/config.php"); 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(); exit(); } @@ -44,21 +44,21 @@ getFields($fields); if($del_confirm == "y"){ foreach ($accountList as $key => $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(); exit(); } 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 { - $msg->raise("Ok", "admin", _("Member %s successfully deleted"),$u["login"]); + $msg->raise("INFO", "admin", _("Member %s successfully deleted"),$u["login"]); } } include("adm_list.php"); exit(); } else { 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"); exit(); } diff --git a/bureau/admin/adm_doedit.php b/bureau/admin/adm_doedit.php index fa1c9920..bea0b0bf 100644 --- a/bureau/admin/adm_doedit.php +++ b/bureau/admin/adm_doedit.php @@ -32,7 +32,7 @@ require_once("../class/config.php"); 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(); exit(); } @@ -57,13 +57,13 @@ getFields($fields); 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(); exit(); } if ($pass != $passconf) { - $msg->raise("Error", "admin", _("Passwords do not match")); + $msg->raise("ERROR", "admin", _("Passwords do not match")); include("adm_edit.php"); 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)){ include("adm_edit.php"); } 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"); } diff --git a/bureau/admin/adm_domlock.php b/bureau/admin/adm_domlock.php index 5627ce77..b3de275b 100644 --- a/bureau/admin/adm_domlock.php +++ b/bureau/admin/adm_domlock.php @@ -30,7 +30,7 @@ require_once("../class/config.php"); 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(); exit(); } diff --git a/bureau/admin/adm_doms.php b/bureau/admin/adm_doms.php index 873140c2..960f14d0 100755 --- a/bureau/admin/adm_doms.php +++ b/bureau/admin/adm_doms.php @@ -30,7 +30,7 @@ require_once("../class/config.php"); 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(); exit(); } diff --git a/bureau/admin/adm_doms_def_type.php b/bureau/admin/adm_doms_def_type.php index 126eb78a..541187ac 100755 --- a/bureau/admin/adm_doms_def_type.php +++ b/bureau/admin/adm_doms_def_type.php @@ -2,7 +2,7 @@ require_once("../class/config.php"); 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(); exit(); } @@ -30,9 +30,9 @@ getFields($fields); if (!empty($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 { - $msg->raise('Ok', "admin", _("Save done.")); + $msg->raise("INFO", "admin", _("Save done.")); } } echo $msg->msg_html_all(); diff --git a/bureau/admin/adm_domstype.php b/bureau/admin/adm_domstype.php index ffc417fc..4de3aa13 100644 --- a/bureau/admin/adm_domstype.php +++ b/bureau/admin/adm_domstype.php @@ -30,7 +30,7 @@ require_once("../class/config.php"); 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(); exit(); } diff --git a/bureau/admin/adm_domstypedoedit.php b/bureau/admin/adm_domstypedoedit.php index 826caca5..94a29288 100644 --- a/bureau/admin/adm_domstypedoedit.php +++ b/bureau/admin/adm_domstypedoedit.php @@ -1,7 +1,7 @@ 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(); 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) ) { include("adm_domstypedoedit.php"); } else { - $msg->raise('Ok', "admin", _("Domain type is updated")); + $msg->raise("INFO", "admin", _("Domain type is updated")); include("adm_domstype.php"); } ?> diff --git a/bureau/admin/adm_domstypeedit.php b/bureau/admin/adm_domstypeedit.php index 308e53a4..c34b2d7f 100755 --- a/bureau/admin/adm_domstypeedit.php +++ b/bureau/admin/adm_domstypeedit.php @@ -29,7 +29,7 @@ */ require_once("../class/config.php"); 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(); exit(); } diff --git a/bureau/admin/adm_domstyperegenerate.php b/bureau/admin/adm_domstyperegenerate.php index 434b0efb..78bec7d4 100644 --- a/bureau/admin/adm_domstyperegenerate.php +++ b/bureau/admin/adm_domstyperegenerate.php @@ -1,7 +1,7 @@ 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(); exit(); } @@ -13,7 +13,7 @@ getFields($fields); if (! empty($name) || ($dom->domains_type_regenerate($name)) ) { - $msg->raise('Ok', "admin", _("Regenerate pending")); + $msg->raise("INFO", "admin", _("Regenerate pending")); } include("adm_domstype.php"); diff --git a/bureau/admin/adm_donosu.php b/bureau/admin/adm_donosu.php index 71b4ce30..3a71c700 100644 --- a/bureau/admin/adm_donosu.php +++ b/bureau/admin/adm_donosu.php @@ -30,7 +30,7 @@ require_once("../class/config.php"); 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(); exit(); } @@ -41,7 +41,7 @@ $fields = array ( getFields($fields); 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"); diff --git a/bureau/admin/adm_dorenew.php b/bureau/admin/adm_dorenew.php index eab71ff8..07c4fb7b 100644 --- a/bureau/admin/adm_dorenew.php +++ b/bureau/admin/adm_dorenew.php @@ -31,7 +31,7 @@ require_once("../class/config.php"); 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(); exit(); } @@ -43,7 +43,7 @@ $fields = array ( getFields($fields); 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(); exit(); } @@ -51,7 +51,7 @@ if (!$admin->checkcreator($uid)) { if (!$admin->renew_mem($uid, $periods)){ include("adm_edit.php"); } 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"); } ?> diff --git a/bureau/admin/adm_dosu.php b/bureau/admin/adm_dosu.php index 9e81c58a..80f4a049 100644 --- a/bureau/admin/adm_dosu.php +++ b/bureau/admin/adm_dosu.php @@ -30,7 +30,7 @@ require_once("../class/config.php"); 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(); exit(); } @@ -41,7 +41,7 @@ $fields = array ( getFields($fields); 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"); diff --git a/bureau/admin/adm_edit.php b/bureau/admin/adm_edit.php index fae01896..af24901f 100755 --- a/bureau/admin/adm_edit.php +++ b/bureau/admin/adm_edit.php @@ -33,7 +33,7 @@ require_once("../class/config.php"); include_once("head.php"); 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(); exit(); } @@ -46,7 +46,7 @@ getFields($fields); $subadmin=variable_get("subadmin_restriction"); 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(); exit(); } diff --git a/bureau/admin/adm_email.php b/bureau/admin/adm_email.php index 3ac4eab9..eda7d174 100755 --- a/bureau/admin/adm_email.php +++ b/bureau/admin/adm_email.php @@ -27,7 +27,7 @@ require_once("../class/config.php"); include("head.php"); 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(); exit(); } @@ -46,9 +46,9 @@ getFields($fields); if ( !empty($submit) ) { 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 { - $msg->raise("Ok", "admin", _("There was an error")); + $msg->raise("INFO", "admin", _("There was an error")); } } diff --git a/bureau/admin/adm_list.php b/bureau/admin/adm_list.php index 22e5b832..89bcdd22 100755 --- a/bureau/admin/adm_list.php +++ b/bureau/admin/adm_list.php @@ -28,7 +28,7 @@ require_once("../class/config.php"); include_once("head.php"); 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(); include_once('foot.php'); exit(); @@ -55,7 +55,7 @@ $subadmin = variable_get("subadmin_restriction", 0); // If we ask for all account but we aren't "admin" and // subadmin var is not 1 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(); include('foot.php'); exit(); @@ -143,7 +143,7 @@ echo $msg->msg_html_all(); raise('Error', "admin", _("No account defined for now")); + $msg->raise("ERROR", "admin", _("No account defined for now")); echo $msg->msg_html_all(); include('foot.php'); } diff --git a/bureau/admin/adm_lockpanel.php b/bureau/admin/adm_lockpanel.php index bd72ca60..e3b21076 100644 --- a/bureau/admin/adm_lockpanel.php +++ b/bureau/admin/adm_lockpanel.php @@ -30,7 +30,7 @@ require_once("../class/config.php"); 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(); die(); } diff --git a/bureau/admin/adm_login.php b/bureau/admin/adm_login.php index 2854c8e6..cee4c0a8 100644 --- a/bureau/admin/adm_login.php +++ b/bureau/admin/adm_login.php @@ -46,14 +46,14 @@ if ( empty($id) && isset($_COOKIE["oldid"]) && !empty($_COOKIE["oldid"])) { list($newuid,$passcheck)=explode("/",$_COOKIE["oldid"]); $newuid=intval($newuid); if (!$newuid) { - $msg->raise("Error", "admin", _("Your authentication information are incorrect")); + $msg->raise("ERROR", "admin", _("Your authentication information are incorrect")); include("index.php"); exit(); } $admin->enabled=true; $r=$admin->get($newuid); 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"); 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) 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(); exit(); } @@ -83,7 +83,7 @@ if (!$admin->enabled) { // Depending on subadmin_restriction, a subadmin can (or cannot) connect to account he didn't create $subadmin=variable_get("subadmin_restriction"); 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(); exit(); } diff --git a/bureau/admin/adm_mxaccount.php b/bureau/admin/adm_mxaccount.php index 66d05db1..5bf1b7a1 100755 --- a/bureau/admin/adm_mxaccount.php +++ b/bureau/admin/adm_mxaccount.php @@ -30,7 +30,7 @@ require_once("../class/config.php"); 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(); exit(); } @@ -45,13 +45,13 @@ getFields($fields); if ($delaccount) { // Delete an account 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) { // Add an account 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=''; } } diff --git a/bureau/admin/adm_panel.php b/bureau/admin/adm_panel.php index 8dd2098e..ae048ec4 100644 --- a/bureau/admin/adm_panel.php +++ b/bureau/admin/adm_panel.php @@ -30,7 +30,7 @@ require_once("../class/config.php"); 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(); exit(); } diff --git a/bureau/admin/adm_passpolicy.php b/bureau/admin/adm_passpolicy.php index 5224d099..20e5646e 100755 --- a/bureau/admin/adm_passpolicy.php +++ b/bureau/admin/adm_passpolicy.php @@ -27,7 +27,7 @@ require_once("../class/config.php"); 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(); exit(); } @@ -55,23 +55,23 @@ $c=$admin->listPasswordPolicies(); if (isset($doedit) && $doedit) { if (!$c[$doedit]) { - $msg->raise('Error', "admin", _("Policy not found")); + $msg->raise("ERROR", "admin", _("Policy not found")); } else { // Change it ;) if ($admin->editPolicy($doedit,$minsize,$maxsize,$classcount,$allowlogin)) { - $msg->raise('Ok', "admin", _("Policy changed")); + $msg->raise("INFO", "admin", _("Policy changed")); unset($edit); $c=$admin->listPasswordPolicies(); } 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("
  • ", true, true); +echo $msg->msg_html_all(true, true); if (!empty($edit)) { if (!$c[$edit]) { - $msg->raise('Error', "admin", _("Policy not found")); + $msg->raise("ERROR", "admin", _("Policy not found")); echo $msg->msg_html_all(); } else { ?> diff --git a/bureau/admin/adm_quotadoedit.php b/bureau/admin/adm_quotadoedit.php index bd5c764c..3c56e596 100644 --- a/bureau/admin/adm_quotadoedit.php +++ b/bureau/admin/adm_quotadoedit.php @@ -30,7 +30,7 @@ require_once("../class/config.php"); 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(); exit(); } @@ -52,7 +52,7 @@ while (list($key,$val)=each($qlist)) { $mem->unsu(); 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"); exit; diff --git a/bureau/admin/adm_quotaedit.php b/bureau/admin/adm_quotaedit.php index 40d2a9f3..aea60efa 100755 --- a/bureau/admin/adm_quotaedit.php +++ b/bureau/admin/adm_quotaedit.php @@ -31,7 +31,7 @@ require_once("../class/config.php"); include_once("head.php"); 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(); include_once("foot.php"); exit(); diff --git a/bureau/admin/adm_slavedns.php b/bureau/admin/adm_slavedns.php index 1a36866f..beea1005 100755 --- a/bureau/admin/adm_slavedns.php +++ b/bureau/admin/adm_slavedns.php @@ -30,7 +30,7 @@ require_once("../class/config.php"); 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(); exit(); } @@ -49,13 +49,13 @@ getFields($fields); if ($delaccount) { // Delete an account 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) { // Add an account 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); } } @@ -63,13 +63,13 @@ if ($newlogin) { if ($delip) { // Delete an ip address/class 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) { // Add an ip address/class 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); } } diff --git a/bureau/admin/adm_tld.php b/bureau/admin/adm_tld.php index d7be5651..cc0fa380 100755 --- a/bureau/admin/adm_tld.php +++ b/bureau/admin/adm_tld.php @@ -30,7 +30,7 @@ require_once("../class/config.php"); 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(); exit(); } @@ -44,11 +44,11 @@ getFields($fields); if (is_array($sel)) { for($i=0;$ideltld($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")) - $msg->raise("Ok", "admin", _("The requested TLD has been deleted")); + $msg->raise("INFO", "admin", _("The requested TLD has been deleted")); } include_once("head.php"); diff --git a/bureau/admin/adm_tldadd.php b/bureau/admin/adm_tldadd.php index 79ca165f..10fbb40a 100755 --- a/bureau/admin/adm_tldadd.php +++ b/bureau/admin/adm_tldadd.php @@ -30,7 +30,7 @@ require_once("../class/config.php"); 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(); exit(); } diff --git a/bureau/admin/adm_tlddoadd.php b/bureau/admin/adm_tlddoadd.php index c624c86b..bca99777 100644 --- a/bureau/admin/adm_tlddoadd.php +++ b/bureau/admin/adm_tlddoadd.php @@ -30,7 +30,7 @@ require_once("../class/config.php"); 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(); exit(); } @@ -46,7 +46,7 @@ if (!$admin->addtld($tld,$mode)) { include("adm_tldadd.php"); exit(); } 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"); exit(); } diff --git a/bureau/admin/adm_tlddoedit.php b/bureau/admin/adm_tlddoedit.php index 53176a56..d699fc34 100644 --- a/bureau/admin/adm_tlddoedit.php +++ b/bureau/admin/adm_tlddoedit.php @@ -36,7 +36,7 @@ getFields($fields); 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(); exit(); } @@ -45,7 +45,7 @@ if (!$admin->edittld($tld,$mode)) { include("adm_tldedit.php"); exit(); } 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"); exit(); } diff --git a/bureau/admin/adm_tldedit.php b/bureau/admin/adm_tldedit.php index 2644659d..981ca5f0 100755 --- a/bureau/admin/adm_tldedit.php +++ b/bureau/admin/adm_tldedit.php @@ -30,7 +30,7 @@ require_once("../class/config.php"); 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(); exit(); } diff --git a/bureau/admin/adm_update_domains.php b/bureau/admin/adm_update_domains.php index b4cf4885..84871ab2 100644 --- a/bureau/admin/adm_update_domains.php +++ b/bureau/admin/adm_update_domains.php @@ -31,14 +31,14 @@ require_once("../class/config.php"); if (!$admin->enabled) { 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(); exit(); } } 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(); die(); } diff --git a/bureau/admin/adm_variables.php b/bureau/admin/adm_variables.php index eacef624..4ad8ba7e 100755 --- a/bureau/admin/adm_variables.php +++ b/bureau/admin/adm_variables.php @@ -30,7 +30,7 @@ require_once("../class/config.php"); 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(); exit(); } diff --git a/bureau/admin/bro_editor.php b/bureau/admin/bro_editor.php index 9a7a4155..74412398 100755 --- a/bureau/admin/bro_editor.php +++ b/bureau/admin/bro_editor.php @@ -68,14 +68,14 @@ if (isset($saveret) && $saveret) { }*/ 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"); exit(); } } if (isset($save) && $save) { 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); } } diff --git a/bureau/admin/bro_main.php b/bureau/admin/bro_main.php index 80b61dde..beb33052 100755 --- a/bureau/admin/bro_main.php +++ b/bureau/admin/bro_main.php @@ -71,13 +71,13 @@ if (!empty($formu) && $formu) { switch ($formu) { case 1: // Create the folder $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(); break; case 6: // Create the file $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(); if ($p["createfile"]==1) { @@ -92,9 +92,9 @@ if (!empty($formu) && $formu) { if ($bro->DeleteFile($d,$R)) { foreach ($d as $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 - $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)) { @@ -128,22 +128,22 @@ if (!empty($formu) && $formu) { if ($bro->CopyFile($d,$R,$actmoveto)) { if (count($d) == 1) { 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 - $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 - $msg->raise("Ok", "bro", _("The files / folders were successfully copied")); + $msg->raise("INFO", "bro", _("The files / folders were successfully copied")); } } if ($actmove) { if ($bro->MoveFile($d,$R,$actmoveto)) { if (count($d) == 1) { 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 - $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 - $msg->raise("Ok", "bro", _("The files / folders were successfully moved")); + $msg->raise("INFO", "bro", _("The files / folders were successfully moved")); } } break; @@ -151,21 +151,21 @@ if (!empty($formu) && $formu) { if ($bro->RenameFile($R,$o,$d)) { // Rename $R (directory) $o (old) $d (new) names if (count($d) == 1) { 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 - $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 - $msg->raise("Ok", "bro", _("The files / folders were successfully renamed")); + $msg->raise("INFO", "bro", _("The files / folders were successfully renamed")); } break; case 3: // Upload de fichier... 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; case 7: // Changement de permissions [ML] if ($bro->ChangePermissions($R, $d)) { - $msg->raise("Ok", "bro", _("The permissions were successfully set")); + $msg->raise("INFO", "bro", _("The permissions were successfully set")); } break; } @@ -173,7 +173,7 @@ if (!empty($formu) && $formu) { if (isset($actextract) && $actextract) { 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); } } diff --git a/bureau/admin/bro_pref.php b/bureau/admin/bro_pref.php index 6dd28c25..1d03e93b 100755 --- a/bureau/admin/bro_pref.php +++ b/bureau/admin/bro_pref.php @@ -46,7 +46,7 @@ getFields($fields); if (!empty($submit)) { $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"); exit; } diff --git a/bureau/admin/cron.php b/bureau/admin/cron.php index e1912153..29dfdbea 100755 --- a/bureau/admin/cron.php +++ b/bureau/admin/cron.php @@ -9,7 +9,7 @@ getFields($fields); if (!empty($cronupdate)) { if ($cron->update($cronupdate)) { - $msg->raise("ok", "mysql", _("Save done.")); + $msg->raise("INFO", "mysql", _("Save done.")); } } diff --git a/bureau/admin/dom_add.php b/bureau/admin/dom_add.php index b2da7afc..5dfa3b21 100755 --- a/bureau/admin/dom_add.php +++ b/bureau/admin/dom_add.php @@ -46,7 +46,7 @@ if (!isset($dns)) $dns="1";
    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(); exit(); } diff --git a/bureau/admin/dom_doadd.php b/bureau/admin/dom_doadd.php index 0be7b429..e418985a 100644 --- a/bureau/admin/dom_doadd.php +++ b/bureau/admin/dom_doadd.php @@ -44,7 +44,7 @@ if (!$dom->add_domain($newdomain,$dns,0,0,$newisslave,$slavedom)) { include("dom_add.php"); exit(); } 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(); diff --git a/bureau/admin/dom_dodel.php b/bureau/admin/dom_dodel.php index 2cdff615..5c1c54e8 100755 --- a/bureau/admin/dom_dodel.php +++ b/bureau/admin/dom_dodel.php @@ -50,7 +50,7 @@ if (! empty($del_cancel)) { $dom->unlock(); // 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(); ?>

    @@ -84,7 +84,7 @@ if ($del_confirm!="y") {



    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(); ?>

    diff --git a/bureau/admin/dom_editdns.php b/bureau/admin/dom_editdns.php index 0035ba89..f6a06d5e 100644 --- a/bureau/admin/dom_editdns.php +++ b/bureau/admin/dom_editdns.php @@ -42,12 +42,12 @@ $dom->lock(); $r = $dom->get_domain_all($domain); 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)) { - $msg->raise('Ok', "dom", _("The domain %s has been changed."),$domain); + $msg->raise("INFO", "dom", _("The domain %s has been changed."),$domain); $t = time(); // 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(); diff --git a/bureau/admin/dom_import.php b/bureau/admin/dom_import.php index 01571c27..c1c79db6 100755 --- a/bureau/admin/dom_import.php +++ b/bureau/admin/dom_import.php @@ -46,7 +46,7 @@ $domain=trim($domain); 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(); diff --git a/bureau/admin/dom_subdel.php b/bureau/admin/dom_subdel.php index 445ceb72..391ba648 100755 --- a/bureau/admin/dom_subdel.php +++ b/bureau/admin/dom_subdel.php @@ -41,7 +41,7 @@ $dom->unlock(); $dt=$dom->domains_type_lst(); 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(); exit(); } diff --git a/bureau/admin/dom_subdodel.php b/bureau/admin/dom_subdodel.php index f6cdb92d..ce1ed383 100644 --- a/bureau/admin/dom_subdodel.php +++ b/bureau/admin/dom_subdodel.php @@ -41,7 +41,7 @@ $dt=$dom->domains_type_lst(); $dom->unlock(); 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(); exit(); } @@ -64,7 +64,7 @@ $dom->unlock(); } else { $t = time(); // 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(); } ?> diff --git a/bureau/admin/dom_subdoedit.php b/bureau/admin/dom_subdoedit.php index fb2aa4cd..cee02a39 100644 --- a/bureau/admin/dom_subdoedit.php +++ b/bureau/admin/dom_subdoedit.php @@ -50,7 +50,7 @@ $dom->lock(); $dt=$dom->domains_type_lst(); 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"); exit(); } @@ -68,7 +68,7 @@ if (!$r) { $t = time(); // XXX: we assume the cron job is at every 5 minutes $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); } include("dom_edit.php"); diff --git a/bureau/admin/dom_subedit.php b/bureau/admin/dom_subedit.php index c3707b13..bedbbb97 100644 --- a/bureau/admin/dom_subedit.php +++ b/bureau/admin/dom_subedit.php @@ -55,7 +55,7 @@ if (!$r) { $dt=$dom->domains_type_lst(); 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"); exit(); } diff --git a/bureau/admin/dom_substatus.php b/bureau/admin/dom_substatus.php index 860c9bee..7ef5e57c 100644 --- a/bureau/admin/dom_substatus.php +++ b/bureau/admin/dom_substatus.php @@ -25,7 +25,7 @@ if (!$r) { } else { $t = time(); // 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); } include("dom_edit.php"); diff --git a/bureau/admin/ftp_del.php b/bureau/admin/ftp_del.php index 2e5fce43..9600e456 100755 --- a/bureau/admin/ftp_del.php +++ b/bureau/admin/ftp_del.php @@ -54,7 +54,7 @@ if(!empty($confirm_del)) { foreach($lst_todel as $v) { $r=$ftp->delete_ftp($v); 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"); diff --git a/bureau/admin/ftp_doedit.php b/bureau/admin/ftp_doedit.php index 2c270484..44dbaadb 100755 --- a/bureau/admin/ftp_doedit.php +++ b/bureau/admin/ftp_doedit.php @@ -40,7 +40,7 @@ $fields = array ( getFields($fields); 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"); exit(); } @@ -60,9 +60,9 @@ if (!$r) { exit(); } else { 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 - $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"); exit(); diff --git a/bureau/admin/ftp_edit.php b/bureau/admin/ftp_edit.php index d5999827..0ba8263f 100755 --- a/bureau/admin/ftp_edit.php +++ b/bureau/admin/ftp_edit.php @@ -40,7 +40,7 @@ if ( !isset($is_include) ) { } if (!$id && !$create) { - $msg->raise("Error", "ftp", _("Neither a creation nor a edition")); + $msg->raise("ERROR", "ftp", _("Neither a creation nor a edition")); echo "

    "._("Create a FTP account")."

    "; echo $msg->msg_html_all(); include_once("foot.php"); diff --git a/bureau/admin/ftp_switch_enable.php b/bureau/admin/ftp_switch_enable.php index 5b77d1a0..16376928 100644 --- a/bureau/admin/ftp_switch_enable.php +++ b/bureau/admin/ftp_switch_enable.php @@ -33,9 +33,9 @@ getFields($fields); if ($ftp->switch_enabled($id,$status)) { if ($status) - $msg->raise("Ok", "ftp", _("The ftp account is enabled")); + $msg->raise("INFO", "ftp", _("The ftp account is enabled")); else - $msg->raise("Ok", "ftp", _("The ftp account is disabled")); + $msg->raise("INFO", "ftp", _("The ftp account is disabled")); } require_once('ftp_list.php'); diff --git a/bureau/admin/hta_del.php b/bureau/admin/hta_del.php index b5124f02..a48d932e 100644 --- a/bureau/admin/hta_del.php +++ b/bureau/admin/hta_del.php @@ -36,7 +36,7 @@ while (list($key,$val)=each($_POST)) { // Effacement du dossier $val $return = $hta->DelDir($val); 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); } } } diff --git a/bureau/admin/hta_doadd.php b/bureau/admin/hta_doadd.php index 7b773fb4..3b2fea23 100644 --- a/bureau/admin/hta_doadd.php +++ b/bureau/admin/hta_doadd.php @@ -36,13 +36,13 @@ $fields = array ( getFields($fields); if(empty($dir)) { - $msg->raise("Error", "hta", _("No directory specified")); + $msg->raise("ERROR", "hta", _("No directory specified")); include("hta_list.php"); } else if(!$hta->CreateDir($dir)) { $is_include=true; include("hta_add.php"); } else { - $msg->raise("Ok", "hta", _("Folder %s is protected"), $dir); + $msg->raise("INFO", "hta", _("Folder %s is protected"), $dir); include("hta_list.php"); } ?> diff --git a/bureau/admin/hta_doadduser.php b/bureau/admin/hta_doadduser.php index f3d75f1d..b8d82390 100644 --- a/bureau/admin/hta_doadduser.php +++ b/bureau/admin/hta_doadduser.php @@ -38,7 +38,7 @@ getFields($fields); if ($password != $passwordconf) { - $msg->raise("Error", "hta", _("Passwords do not match")); + $msg->raise("ERROR", "hta", _("Passwords do not match")); include("hta_adduser.php"); exit(); } @@ -46,7 +46,7 @@ if ($password != $passwordconf) { if (!$hta->add_user($user, $password, $dir)) { include ("hta_adduser.php"); } 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"); } ?> diff --git a/bureau/admin/hta_dodeluser.php b/bureau/admin/hta_dodeluser.php index a4fcd5e6..0cc36495 100755 --- a/bureau/admin/hta_dodeluser.php +++ b/bureau/admin/hta_dodeluser.php @@ -40,7 +40,7 @@ if (!empty($confirm_del)) { reset($d); if ($hta->del_user($d,$dir)) { 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; diff --git a/bureau/admin/hta_doedituser.php b/bureau/admin/hta_doedituser.php index 2fd4a383..3dd7b96e 100644 --- a/bureau/admin/hta_doedituser.php +++ b/bureau/admin/hta_doedituser.php @@ -39,13 +39,13 @@ $fields = array ( getFields($fields); if ($newpass != $newpassconf) { - $msg->raise("Error", "hta", _("Passwords do not match")); + $msg->raise("ERROR", "hta", _("Passwords do not match")); include("hta_edituser.php"); exit(); } 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; include_once("hta_edit.php"); } else { diff --git a/bureau/admin/hta_edit.php b/bureau/admin/hta_edit.php index 8e1ea12b..ed9ccecb 100755 --- a/bureau/admin/hta_edit.php +++ b/bureau/admin/hta_edit.php @@ -54,7 +54,7 @@ $passwd_classcount = $c['hta']['classcount'];
    raise("Info", "hta", _("No authorized user in %s"),$dir); + $msg->raise("INFO", "hta", _("No authorized user in %s"),$dir); echo $msg->msg_html_all(); } else { reset($r); diff --git a/bureau/admin/ip_main.php b/bureau/admin/ip_main.php index d8f87f89..a445e103 100755 --- a/bureau/admin/ip_main.php +++ b/bureau/admin/ip_main.php @@ -20,25 +20,25 @@ if (!empty($s_protocol)) { getFields($fields); 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 (! $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 (! $authip->ip_delete($delete_id)) { - $msg->raise('Error', "ftp", _("Error during deletion")); + $msg->raise("ERROR", "ftp", _("Error during deletion")); } } if (!empty($ipsub)) { if (! $authip->ip_save($id, $ipsub, $infos)) { - $msg->raise('Error', "ftp", _("Error during recording")); + $msg->raise("ERROR", "ftp", _("Error during recording")); } } diff --git a/bureau/admin/logs_list.php b/bureau/admin/logs_list.php index cc260922..1f427daf 100644 --- a/bureau/admin/logs_list.php +++ b/bureau/admin/logs_list.php @@ -39,7 +39,7 @@ $list=$log->list_logs_directory_all($log->get_logs_directory()); echo $msg->msg_html_all(); 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(); include_once('foot.php'); exit; diff --git a/bureau/admin/mail_del.php b/bureau/admin/mail_del.php index cd404262..7260b2d2 100755 --- a/bureau/admin/mail_del.php +++ b/bureau/admin/mail_del.php @@ -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)); 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; } if ($mail->delete($val)) { 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 { - $msg->raise('Ok', "mail", _("The email %s has been successfully deleted"), $email); + $msg->raise("INFO", "mail", _("The email %s has been successfully deleted"), $email); } } } diff --git a/bureau/admin/mail_doedit.php b/bureau/admin/mail_doedit.php index 46561e0a..32956009 100644 --- a/bureau/admin/mail_doedit.php +++ b/bureau/admin/mail_doedit.php @@ -52,7 +52,7 @@ if (!$res=$mail->get_details($mail_id)) { * checking the password */ if($pass != $passconf){ - $msg->raise("Error", "mail", _("Passwords do not match")); + $msg->raise("ERROR", "mail", _("Passwords do not match")); include ("mail_edit.php"); exit(); } else { @@ -108,15 +108,15 @@ if (!$res=$mail->get_details($mail_id)) { include ("mail_edit.php"); exit(); } 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) - $msg->raise("Ok", "mail", _("Your email has been created successfully")); + $msg->raise("INFO", "mail", _("Your email has been created successfully")); 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"]); include("mail_list.php"); diff --git a/bureau/admin/mail_list.php b/bureau/admin/mail_list.php index 64ae4939..225bbf56 100755 --- a/bureau/admin/mail_list.php +++ b/bureau/admin/mail_list.php @@ -59,7 +59,7 @@ if ($domain=$dom->get_domain_byid($domain_id)) { echo '

    '._("Manage Catch-all")."

    "; } -echo $msg->msg_html_all("
  • ", true, true); +echo $msg->msg_html_all(true, true); ?> @@ -85,7 +85,7 @@ echo $msg->msg_html_all("
  • ", true, true);

    :

    raise('Error', 'mail', _("No mails for this domain.")); + $msg->raise("ERROR", 'mail', _("No mails for this domain.")); echo $msg->msg_html_all(); } else { diff --git a/bureau/admin/mail_manage_catchall.php b/bureau/admin/mail_manage_catchall.php index c6d3410a..969c88ab 100644 --- a/bureau/admin/mail_manage_catchall.php +++ b/bureau/admin/mail_manage_catchall.php @@ -34,7 +34,7 @@ $fields = array ( getFields($fields); 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"); exit(); } @@ -43,21 +43,21 @@ if (!is_null($target_type)) { switch ($target_type) { case "none": 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"); exit(); break; case "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"); exit(); } break; case "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"); exit(); } diff --git a/bureau/admin/mail_undelete.php b/bureau/admin/mail_undelete.php index edd483d1..69fff209 100644 --- a/bureau/admin/mail_undelete.php +++ b/bureau/admin/mail_undelete.php @@ -31,7 +31,7 @@ getFields($fields); if ($mail->undelete($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"); diff --git a/bureau/admin/mem_admin.php b/bureau/admin/mem_admin.php index df15205b..c9ce0525 100644 --- a/bureau/admin/mem_admin.php +++ b/bureau/admin/mem_admin.php @@ -32,7 +32,7 @@ $fields = array ( getFields($fields); 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"); diff --git a/bureau/admin/mem_chgmail.php b/bureau/admin/mem_chgmail.php index 3fc9a909..4c46a559 100644 --- a/bureau/admin/mem_chgmail.php +++ b/bureau/admin/mem_chgmail.php @@ -35,7 +35,7 @@ $fields = array ( getFields($fields); 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"); diff --git a/bureau/admin/mem_cm2.php b/bureau/admin/mem_cm2.php index 17e509e3..d4f44ed5 100644 --- a/bureau/admin/mem_cm2.php +++ b/bureau/admin/mem_cm2.php @@ -38,7 +38,7 @@ $fields = array ( getFields($fields); 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"); diff --git a/bureau/admin/mem_param.php b/bureau/admin/mem_param.php index 80b2d61f..f9403a5d 100755 --- a/bureau/admin/mem_param.php +++ b/bureau/admin/mem_param.php @@ -40,7 +40,7 @@ getFields($fields); if (!empty($help_setting)) { $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.")); } ?> diff --git a/bureau/admin/mem_passwd.php b/bureau/admin/mem_passwd.php index adb171e3..0dc960b2 100644 --- a/bureau/admin/mem_passwd.php +++ b/bureau/admin/mem_passwd.php @@ -39,7 +39,7 @@ getFields($fields); 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"); diff --git a/bureau/admin/nowebmail.php b/bureau/admin/nowebmail.php index e20bfe56..3d66821d 100644 --- a/bureau/admin/nowebmail.php +++ b/bureau/admin/nowebmail.php @@ -25,7 +25,7 @@ require_once("../class/config.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"); diff --git a/bureau/admin/piwik_addaccount.php b/bureau/admin/piwik_addaccount.php index ae899c33..381b1961 100644 --- a/bureau/admin/piwik_addaccount.php +++ b/bureau/admin/piwik_addaccount.php @@ -33,7 +33,7 @@ $userslist = $piwik->users_list(); $quotapiwik = $quota->getquota('piwik'); 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 ( @@ -43,7 +43,7 @@ $fields = array ( getFields($fields); 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"); ?> diff --git a/bureau/admin/piwik_addsites.php b/bureau/admin/piwik_addsites.php index e62ca431..2cd7ee6f 100644 --- a/bureau/admin/piwik_addsites.php +++ b/bureau/admin/piwik_addsites.php @@ -39,9 +39,9 @@ getFields($fields); if(empty($site_name)) $site_name=$site_urls; 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) ) { - $msg->raise('Ok', "piwik", _("Website added Successfully")); + $msg->raise("INFO", "piwik", _("Website added Successfully")); } include_once("piwik_sitelist.php"); diff --git a/bureau/admin/piwik_site_dodel.php b/bureau/admin/piwik_site_dodel.php index 2dda7e67..22f63c93 100755 --- a/bureau/admin/piwik_site_dodel.php +++ b/bureau/admin/piwik_site_dodel.php @@ -36,7 +36,7 @@ $fields = array ( getFields($fields); if ($siteid === -1) { - $msg->raise('Error', "piwik", _("Missing site parameters")); + $msg->raise("ERROR", "piwik", _("Missing site parameters")); include('piwik_sitelist.php'); exit; } @@ -44,7 +44,7 @@ if ($siteid === -1) { if(!empty($confirm_del) ) { if ($piwik->site_delete($siteid) ) { - $msg->raise('Ok', "piwik", _("Site successfully deleted")); + $msg->raise("INFO", "piwik", _("Site successfully deleted")); } include('piwik_sitelist.php'); diff --git a/bureau/admin/piwik_sitelist.php b/bureau/admin/piwik_sitelist.php index 20e38ee4..26c485c3 100755 --- a/bureau/admin/piwik_sitelist.php +++ b/bureau/admin/piwik_sitelist.php @@ -51,7 +51,7 @@ if ($quota->cancreate("piwik")) { ?>

    msg_html_all("
  • ", true, true); +echo $msg->msg_html_all(true, true); ?>
    @@ -64,7 +64,7 @@ echo $msg->msg_html_all("
  • ", true, true); 0 } 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 @@ -88,7 +88,7 @@ $infos_urls = $piwik->get_users_url_infos(); if ($right !== FALSE) { // Should this stay here, or in the API? 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 { foreach ($sitelist as $site) { if ($site->id == $site_id) @@ -100,7 +100,7 @@ if ($right !== FALSE) { /* Ensures that the user is legitimate for that user */ /* If not, we just break the loop, and set error message */ 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; } @@ -110,7 +110,7 @@ if ($right !== FALSE) { if (!$piwik->site_set_user_right($site_id, $user, $cred)) { break; } 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)); } } } diff --git a/bureau/admin/piwik_user_dodel.php b/bureau/admin/piwik_user_dodel.php index ea3ae827..cb13bf83 100755 --- a/bureau/admin/piwik_user_dodel.php +++ b/bureau/admin/piwik_user_dodel.php @@ -36,7 +36,7 @@ $fields = array ( getFields($fields); if (empty($login)) { - $msg->raise('Error', "piwik", _("Missing login parameters")); + $msg->raise("ERROR", "piwik", _("Missing login parameters")); include('piwik_userlist.php'); exit; } @@ -44,9 +44,9 @@ if (empty($login)) { if(!empty($confirm_del)) { // contrôle si ce compte piwik a encore des sites associés avant d'accepter sa suppression 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) ) { - $msg->raise('Ok', "piwik", _("Account %s is successfully deleted"), $login); + $msg->raise("INFO", "piwik", _("Account %s is successfully deleted"), $login); } include('piwik_userlist.php'); diff --git a/bureau/admin/piwik_useradmin.php b/bureau/admin/piwik_useradmin.php index b28a4264..44c3e965 100755 --- a/bureau/admin/piwik_useradmin.php +++ b/bureau/admin/piwik_useradmin.php @@ -39,7 +39,7 @@ getFields($fields); if ($user_name === FALSE) { - $msg->raise('Error', "piwik", _('No piwik user specified')); + $msg->raise("ERROR", "piwik", _('No piwik user specified')); } else { @@ -49,7 +49,7 @@ else $db->next_record(); 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 { @@ -57,7 +57,7 @@ else $db->next_record(); 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 { @@ -66,13 +66,13 @@ else { $api_data = $piwik->site_set_user_right($site_id, $user_name, $right); if ($api_data === FALSE) - $msg->raise('Error', "piwik", $api_data->message) + $msg->raise("ERROR", "piwik", $api_data->message) else - $msg->raise('Ok', "piwik", _('success')); + $msg->raise("INFO", "piwik", _('success')); } else { - $msg->raise('Error', "piwik", _("This right does not exist")); + $msg->raise("ERROR", "piwik", _("This right does not exist")); } } } diff --git a/bureau/admin/piwik_userlist.php b/bureau/admin/piwik_userlist.php index b1a5a645..578c0f7d 100755 --- a/bureau/admin/piwik_userlist.php +++ b/bureau/admin/piwik_userlist.php @@ -38,7 +38,7 @@ if ($quotapiwik['t'] > 0 && count($userslist) < 3) { ?>

    msg_html_all("
  • ", true, true); +echo $msg->msg_html_all(true, true); ?> @@ -64,17 +64,17 @@ echo $msg->msg_html_all("
  • ", true, true);
    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 ?>

    msg_html_all("
  • ", true, true); +echo $msg->msg_html_all(true, true); // printVar($piwik->dev()); if (empty($userslist)){ - $msg->raise('Info', "piwik", _("No existing Piwik accounts")); + $msg->raise("INFO", "piwik", _("No existing Piwik accounts")); echo $msg->msg_html_all(); } else { ?> diff --git a/bureau/admin/quota_show.php b/bureau/admin/quota_show.php index ea747ddc..d0f7a716 100644 --- a/bureau/admin/quota_show.php +++ b/bureau/admin/quota_show.php @@ -37,7 +37,7 @@ include_once("head.php"); getquota(); 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"); exit(); } diff --git a/bureau/admin/quotas_users.php b/bureau/admin/quotas_users.php index 1a6764e9..c0b9fccc 100644 --- a/bureau/admin/quotas_users.php +++ b/bureau/admin/quotas_users.php @@ -11,7 +11,7 @@ $fields = array ( getFields($fields); 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(); exit(); } diff --git a/bureau/admin/sql_del.php b/bureau/admin/sql_del.php index 5dce21d7..721f423d 100755 --- a/bureau/admin/sql_del.php +++ b/bureau/admin/sql_del.php @@ -42,7 +42,7 @@ if ($confirm=="y" ) { // Effacement de la base $val $r=$mysql->del_db(substr($key,4)); 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) { - $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"); exit(); } diff --git a/bureau/admin/sql_doadd.php b/bureau/admin/sql_doadd.php index 3d644bc1..3667dc5d 100644 --- a/bureau/admin/sql_doadd.php +++ b/bureau/admin/sql_doadd.php @@ -34,7 +34,7 @@ $fields = array ( ); getFields($fields); 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"); exit; } @@ -47,7 +47,7 @@ if($q['u'] > 0){ } 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)); diff --git a/bureau/admin/sql_dobck.php b/bureau/admin/sql_dobck.php index fa22391c..4cbbe102 100644 --- a/bureau/admin/sql_dobck.php +++ b/bureau/admin/sql_dobck.php @@ -54,7 +54,7 @@ if ($msg->has_msgs("Error")) { include("sql_bck.php"); exit(); } 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"); ?> diff --git a/bureau/admin/sql_dorestore.php b/bureau/admin/sql_dorestore.php index a2e2691b..938c6e54 100644 --- a/bureau/admin/sql_dorestore.php +++ b/bureau/admin/sql_dorestore.php @@ -57,7 +57,7 @@ if (! $r["enabled"]) {

    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 echo $msg->msg_html_all(); diff --git a/bureau/admin/sql_list.php b/bureau/admin/sql_list.php index 7e028572..eec81a41 100755 --- a/bureau/admin/sql_list.php +++ b/bureau/admin/sql_list.php @@ -40,9 +40,9 @@ $r=$mysql->get_userslist(); 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)){ - $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(); diff --git a/bureau/admin/sql_users_del.php b/bureau/admin/sql_users_del.php index 7318d339..e55ebf42 100755 --- a/bureau/admin/sql_users_del.php +++ b/bureau/admin/sql_users_del.php @@ -39,7 +39,7 @@ if (isset($confirm) && ($confirm=="y")) { if (substr($key,0,4)=="del_") { // Effacement de la base $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); } } } diff --git a/bureau/admin/sql_users_doadd.php b/bureau/admin/sql_users_doadd.php index b6ed53c0..43281af3 100755 --- a/bureau/admin/sql_users_doadd.php +++ b/bureau/admin/sql_users_doadd.php @@ -42,7 +42,7 @@ if (!empty($usern)) { exit; } else { $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 { $usern=$mem->user["login"]; @@ -51,7 +51,7 @@ if (!empty($usern)) { exit; } else { $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); } } diff --git a/bureau/admin/sql_users_dopassword.php b/bureau/admin/sql_users_dopassword.php index 7a9daa0f..2f15f877 100644 --- a/bureau/admin/sql_users_dopassword.php +++ b/bureau/admin/sql_users_dopassword.php @@ -36,7 +36,7 @@ $fields = array ( getFields($fields); 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"); ?> diff --git a/bureau/admin/sql_users_dorights.php b/bureau/admin/sql_users_dorights.php index 8069da32..4350caac 100644 --- a/bureau/admin/sql_users_dorights.php +++ b/bureau/admin/sql_users_dorights.php @@ -51,7 +51,7 @@ foreach($mysql->get_dblist() as $d){ $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"); diff --git a/bureau/admin/sql_users_list.php b/bureau/admin/sql_users_list.php index 1f36d9b7..fc8542a5 100755 --- a/bureau/admin/sql_users_list.php +++ b/bureau/admin/sql_users_list.php @@ -38,7 +38,7 @@ $rdb=$mysql->get_dblist();



    msg_html_all("
  • ", true, true); +echo $msg->msg_html_all(true, true); if($r){ // if there is some userlist ?> @@ -75,7 +75,7 @@ for($i=0;$iraise('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(); } ?> diff --git a/bureau/class/db_mysql.php b/bureau/class/db_mysql.php index 3d6b0a64..a54f8f2f 100644 --- a/bureau/class/db_mysql.php +++ b/bureau/class/db_mysql.php @@ -348,7 +348,7 @@ class DB_Sql { /* public: return table metadata */ function metadata($table='',$full=false) { global $msg; - $msg->raise("Error", 'Mysql', 'function is no longer implemented (metadata())'); + $msg->raise("ERROR", 'Mysql', 'function is no longer implemented (metadata())'); return FALSE; } diff --git a/bureau/class/functions.php b/bureau/class/functions.php index bbc00e58..64143010 100755 --- a/bureau/class/functions.php +++ b/bureau/class/functions.php @@ -1151,21 +1151,21 @@ function csrf_check($token=null) { if (is_null($token)) $token=$_POST["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 :/ } if (strlen($token)!=32 || strlen($_SESSION["csrf"])!=32) { 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 } $db->query("SELECT used FROM csrf WHERE cookie=? AND token=?;",array($_SESSION["csrf"],$token)); 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 } 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 } $db->query("UPDATE csrf SET used=1 WHERE cookie=? AND token=?;",array($_SESSION["csrf"],$token)); diff --git a/bureau/class/m_action.php b/bureau/class/m_action.php index 15a9ad2f..6052d9c7 100644 --- a/bureau/class/m_action.php +++ b/bureau/class/m_action.php @@ -170,7 +170,7 @@ class m_action { $db->query("select login from membres where uid= ?;", array($cuid)); $db->next_record(); 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; } $uidlogin = $cuid . "-" . $db->Record["login"]; @@ -212,7 +212,7 @@ class m_action { } if (!$db->query($query)) { - $msg->raise('Error', "action", _("Error setting actions")); + $msg->raise("ERROR", "action", _("Error setting actions")); return false; } return $this->do_action(); @@ -231,7 +231,7 @@ class m_action { $purge = "select * from actions where TO_DAYS(curdate()) - TO_DAYS(creation) > 2;"; $result = $db->query($purge); if (!$result) { - $msg->raise('Error', "action", _("Error selecting old actions")); + $msg->raise("ERROR", "action", _("Error selecting old actions")); return false; } return $db->num_rows($result); @@ -253,7 +253,7 @@ class m_action { } $result = $db->query($purge); if (!$result) { - $msg->raise('Error', "action", _("Error purging old actions")); + $msg->raise("ERROR", "action", _("Error purging old actions")); return false; } return $db->num_rows($result); @@ -289,7 +289,7 @@ class m_action { function begin($id) { global $db, $msg; 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 true; @@ -307,7 +307,7 @@ class m_action { function finish($id, $return = 0) { global $db, $msg; 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 true; @@ -323,7 +323,7 @@ class m_action { function reset_job($id) { global $db, $msg; 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 true; diff --git a/bureau/class/m_admin.php b/bureau/class/m_admin.php index 24bbdac6..a0326687 100644 --- a/bureau/class/m_admin.php +++ b/bureau/class/m_admin.php @@ -213,7 +213,7 @@ class m_admin { global $msg, $db, $lst_users_properties; // $msg->log("admin","get",$uid); 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; } @@ -247,7 +247,7 @@ class m_admin { // don't exist, but is not a forced check. Do a forced check return $this->get($uid, true); } - $msg->raise('Error', "admin", _("Account not found")); + $msg->raise("ERROR", "admin", _("Account not found")); return false; } @@ -268,7 +268,7 @@ class m_admin { global $msg, $db; // $msg->log("admin","get",$uid); 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; } @@ -278,7 +278,7 @@ class m_admin { $db->next_record(); $c = $db->Record; } else { - $msg->raise('Error', "admin", _("Account not found")); + $msg->raise("ERROR", "admin", _("Account not found")); return false; } @@ -341,7 +341,7 @@ class m_admin { global $msg, $mem, $cuid; $msg->log("admin", "get_list"); 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; } $db = new DB_System(); @@ -379,7 +379,7 @@ class m_admin { } $request .= ' ORDER BY login;'; } 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; } } else { @@ -422,7 +422,7 @@ class m_admin { global $msg, $db; $msg->log("admin", "mailallmembers"); 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; } $subject = trim($subject); @@ -430,12 +430,12 @@ class m_admin { $from = trim($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; } //@todo remove cf functions.php if (checkmail($from) != 0) { - $msg->raise('Error', "admin", _("Sender is syntaxically incorrect")); + $msg->raise("ERROR", "admin", _("Sender is syntaxically incorrect")); return false; } @@ -467,7 +467,7 @@ class m_admin { $msg->log("admin", "get_reseller_list"); 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; } @@ -503,7 +503,7 @@ class m_admin { $db->query("SELECT creator FROM membres WHERE uid= ?;", array($uid)); $db->next_record(); 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 true; @@ -526,13 +526,13 @@ class m_admin { $msg->log("admin", "add_shared_domain", $u . "/" . $domain_name); if (!$mem->checkright()) { - $msg->raise('Error', "admin", _("-- Only administrators can do that! --")); + $msg->raise("ERROR", "admin", _("-- Only administrators can do that! --")); return false; } // Check if this domain exist on this admin account 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"); return false; } @@ -588,43 +588,43 @@ class m_admin { global $msg, $cuid, $mem, $L_MYSQL_DATABASE, $L_MYSQL_LOGIN, $hooks, $action; $msg->log("admin", "add_mem", $login . "/" . $mail); 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; } if (empty($db_server_id)) { - $msg->raise('Error', "admin", _("Missing db_server field")); + $msg->raise("ERROR", "admin", _("Missing db_server field")); return false; } if (($login == "") || ($pass == "")) { - $msg->raise('Error', "admin", _("Please fill all mandatory fields")); + $msg->raise("ERROR", "admin", _("Please fill all mandatory fields")); return false; } if (!$force) { if ($mail == "") { - $msg->raise('Error', "admin", _("Please fill all mandatory fields")); + $msg->raise("ERROR", "admin", _("Please fill all mandatory fields")); return false; } //@todo remove cf functions.php 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; } } $login = strtolower($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; } if (strlen($login) > 14) { // 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!) // 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; } // Some login are not allowed... 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; } $pass = _md5cr($pass); @@ -663,7 +663,7 @@ class m_admin { return $uid; } else { - $msg->raise('Error', "admin", _("This login already exists")); + $msg->raise("ERROR", "admin", _("This login already exists")); return false; } } @@ -686,7 +686,7 @@ class m_admin { } $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))) { - $msg->raise('Error', "admin", sprintf(_("query failed: %s "), $db->Error)); + $msg->raise("ERROR", "admin", sprintf(_("query failed: %s "), $db->Error)); return false; } if ($db->next_record()) { @@ -718,11 +718,11 @@ EOF; //sprintf(_("Email successfully sent to %s"), $dest); return true; } 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; } } else { - $msg->raise('Error', "admin", sprintf(_("Query failed: %s"), $db->Error)); + $msg->raise("ERROR", "admin", sprintf(_("Query failed: %s"), $db->Error)); return false; } } @@ -757,7 +757,7 @@ EOF; $msg->log("admin", "update_mem", $uid); 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; } $db = new DB_System(); @@ -784,7 +784,7 @@ EOF; $this->renew_update($uid, $duration); return true; } else { - $msg->raise('Error', "admin", _("Account not found")); + $msg->raise("ERROR", "admin", _("Account not found")); return false; } } @@ -803,14 +803,14 @@ EOF; global $msg, $db; $msg->log("admin", "lock_mem", $uid); 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; } $db = new DB_System(); if ($db->query("UPDATE membres SET enabled='0' WHERE uid= ?;", array($uid))) { return true; } else { - $msg->raise('Error', "admin", _("Account not found")); + $msg->raise("ERROR", "admin", _("Account not found")); return false; } } @@ -830,14 +830,14 @@ EOF; global $msg, $db; $msg->log("admin", "unlock_mem", $uid); 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; } $db = new DB_System(); if ($db->query("UPDATE membres SET enabled='1' WHERE uid= ?;", array($uid))) { return true; } else { - $msg->raise('Error', "admin", _("Account not found")); + $msg->raise("ERROR", "admin", _("Account not found")); return false; } } @@ -864,7 +864,7 @@ EOF; $msg->log("admin", "del_mem", $uid); 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; } $db = new DB_System(); @@ -890,7 +890,7 @@ EOF; $db->query("UPDATE membres SET creator=2000 WHERE creator= ?;", array($uid)); return true; } else { - $msg->raise('Error', "admin", _("Account not found")); + $msg->raise("ERROR", "admin", _("Account not found")); $mem->unsu(); return false; } @@ -917,7 +917,7 @@ EOF; if ($db->query("UPDATE membres SET renewed = renewed + INTERVAL (duration * ?) MONTH WHERE uid= ?;", array($periods, $uid))) { return true; } else { - $msg->raise('Error', "admin", _("Account not found")); + $msg->raise("ERROR", "admin", _("Account not found")); return false; } } @@ -945,7 +945,7 @@ EOF; } } - $msg->raise('Error', "admin", _("Account not found")); + $msg->raise("ERROR", "admin", _("Account not found")); return false; } @@ -1023,11 +1023,11 @@ EOF; global $msg, $db; $db->query("SELECT su FROM membres WHERE uid= ?;", array($uid)); if (!$db->next_record()) { - $msg->raise('Error', "admin", _("Account not found")); + $msg->raise("ERROR", "admin", _("Account not found")); return false; } 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; } $db->query("UPDATE membres SET su=1 WHERE uid= ?;", array($uid)); @@ -1046,11 +1046,11 @@ EOF; global $msg, $db; $db->query("SELECT su FROM membres WHERE uid= ?;", array($uid)); if (!$db->next_record()) { - $msg->raise('Error', "admin", _("Account not found")); + $msg->raise("ERROR", "admin", _("Account not found")); return false; } 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; } $db->query("UPDATE membres SET su=0 WHERE uid= ?;", array($uid)); @@ -1236,7 +1236,7 @@ EOF; global $db, $msg; $db->query("SELECT compte FROM domaines WHERE domaine= ?;", array($domain)); if (!$db->next_record()) { - $msg->raise('Error', "dom", _("Domain '%s' not found."), $domain); + $msg->raise("ERROR", "dom", _("Domain '%s' not found."), $domain); return false; } $db->query("UPDATE domaines SET noerase=1-noerase WHERE domaine= ?;", array($domain)); @@ -1255,7 +1255,7 @@ EOF; global $db, $msg; $db->query("SELECT mode FROM tld WHERE tld= ?;", array($tld)); 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 $db->Record["mode"]; @@ -1291,7 +1291,7 @@ EOF; global $db, $msg; $db->query("SELECT tld FROM tld WHERE tld= ?;", array($tld)); if (!$db->next_record()) { - $msg->raise('Error', "admin", _("This TLD does not exist")); + $msg->raise("ERROR", "admin", _("This TLD does not exist")); return false; } $db->query("DELETE FROM tld WHERE tld= ?;", array($tld)); @@ -1316,14 +1316,14 @@ EOF; function addtld($tld, $mode) { global $db, $msg; if (!$tld) { - $msg->raise('Error', "admin", _("The TLD name is mandatory")); + $msg->raise("ERROR", "admin", _("The TLD name is mandatory")); return false; } $tld = trim($tld); $db->query("SELECT tld FROM tld WHERE tld= ?;", array($tld)); if ($db->next_record()) { - $msg->raise('Error', "admin", _("This TLD already exist")); + $msg->raise("ERROR", "admin", _("This TLD already exist")); return false; } if (substr($tld, 0, 1) == ".") { @@ -1352,7 +1352,7 @@ EOF; global $db, $msg; $db->query("SELECT tld FROM tld WHERE tld= ?;", array($tld)); if (!$db->next_record()) { - $msg->raise('Error', "admin", _("This TLD does not exist")); + $msg->raise("ERROR", "admin", _("This TLD does not exist")); return false; } $mode = intval($mode); @@ -1461,17 +1461,17 @@ EOF; global $msg; if (empty($login)) { - $msg->raise('alert', "admin", _("Please enter a login")); + $msg->raise("ALERT", "admin", _("Please enter a login")); return false; } if (empty($password) && !$canbeempty) { - $msg->raise('alert', "admin", _("Please enter a password")); + $msg->raise("ALERT", "admin", _("Please enter a password")); return false; } $pol = $this->listPasswordPolicies(); 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; } $pol = $pol[$policy]; @@ -1479,12 +1479,12 @@ EOF; $plen = strlen($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; } 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; } @@ -1497,7 +1497,7 @@ EOF; continue; } 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; } } @@ -1521,7 +1521,7 @@ EOF; } // foreach $clc = array_sum($cls); 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; } } diff --git a/bureau/class/m_authip.php b/bureau/class/m_authip.php index 2d07723e..76bec299 100644 --- a/bureau/class/m_authip.php +++ b/bureau/class/m_authip.php @@ -110,7 +110,7 @@ class m_authip { $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))) { - $msg->raise('Error', 'authip', _("query failed: " . $db->Error)); + $msg->raise("ERROR", 'authip', _("query failed: " . $db->Error)); return false; } return true; @@ -128,7 +128,7 @@ class m_authip { function get_allowed($s) { 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))) { - $msg->raise('Error', 'authip', _("query failed: " . $db->Error)); + $msg->raise("ERROR", 'authip', _("query failed: " . $db->Error)); return false; } $r = Array(); @@ -147,7 +147,7 @@ class m_authip { function is_wl($ip) { global $db, $msg; 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; } while ($db->next_record()) { @@ -224,7 +224,7 @@ class m_authip { // Error if $ip not an 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; } @@ -250,7 +250,7 @@ class m_authip { $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))) { - $msg->raise('Error', 'authip', _("query failed: " . $db->Error)); + $msg->raise("ERROR", 'authip', _("query failed: " . $db->Error)); return false; } foreach ($list_affected as $k => $v) { @@ -258,7 +258,7 @@ class m_authip { } } else { // Insert 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; } } @@ -320,13 +320,13 @@ class m_authip { $id = intval($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))) { - $msg->raise('Error', 'authip', _("query failed: " . $db->Error)); + $msg->raise("ERROR", 'authip', _("query failed: " . $db->Error)); return false; } $this->call_hooks("authip_on_create", $id); } else { 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; } $this->call_hooks("authip_on_create", $db->lastid()); @@ -351,7 +351,7 @@ class m_authip { $this->call_hooks("authip_on_delete", $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 true; @@ -373,7 +373,7 @@ class m_authip { // On récure l'objet dont on parle $d = $this->list_affected(); if (!isset($d[$affectation_id])) { - $msg->raise('Error', 'authip', _("Object not available")); + $msg->raise("ERROR", 'authip', _("Object not available")); return false; } @@ -382,7 +382,7 @@ class m_authip { // On en déduis la classe qui le concerne $e = $this->get_auth_class(); 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; } $c = $e[$affectation['protocol']]['class']; diff --git a/bureau/class/m_bro.php b/bureau/class/m_bro.php index 489e3107..343f0d7e 100644 --- a/bureau/class/m_bro.php +++ b/bureau/class/m_bro.php @@ -199,11 +199,11 @@ class m_bro { $db->query("UPDATE browser SET lastdir= ? WHERE uid= ?;", array($dir, $cuid)); $absolute = $this->convertabsolute($dir, false); 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; } if (!is_readable($absolute)) { - $msg->raise('Error', 'bro', _("This directory is not readable.")); + $msg->raise("ERROR", 'bro', _("This directory is not readable.")); return false; } clearstatcache(true); @@ -399,13 +399,13 @@ class m_bro { #echo "$absolute"; if ($absolute && (!file_exists($absolute))) { 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; } $db->query("UPDATE browser SET crff=1 WHERE uid= ?;", array($cuid)); return true; } else { - $msg->raise('Error', "bro", _("File or folder name is incorrect")); + $msg->raise("ERROR", "bro", _("File or folder name is incorrect")); return false; } } @@ -425,12 +425,12 @@ class m_bro { $file = ssla($file); $absolute = $this->convertabsolute($dir . "/" . $file, false); 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; } if (!file_exists($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; } } @@ -452,7 +452,7 @@ class m_bro { $root = realpath(getuserpath()); $absolute = $this->convertabsolute($R, false); 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; } for ($i = 0; $i < count($file_list); $i++) { @@ -477,7 +477,7 @@ class m_bro { global $msg; $absolute = $this->convertabsolute($R, false); if (!$absolute) { - $msg->raise('Error', "bro", _("File or folder name is incorrect")); + $msg->raise("ERROR", "bro", _("File or folder name is incorrect")); return false; } $alea = "." . time() . mt_rand(1000, 9999); @@ -510,7 +510,7 @@ class m_bro { global $msg; $old = $this->convertabsolute($old, false); if (!$old) { - $msg->raise('Error', "bro", _("File or folder name is incorrect")); + $msg->raise("ERROR", "bro", _("File or folder name is incorrect")); return false; } @@ -520,18 +520,18 @@ class m_bro { $new = $this->convertabsolute($new, false); if (!$new) { - $msg->raise('Error', "bro", _("File or folder name is incorrect")); + $msg->raise("ERROR", "bro", _("File or folder name is incorrect")); return false; } 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; } for ($i = 0; $i < count($d); $i++) { $d[$i] = ssla($d[$i]); // strip slashes if needed if (!strpos($d[$i], "/") && file_exists($old . "/" . $d[$i]) && !file_exists($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; $absolute = $this->convertabsolute($R, false); if (!$absolute) { - $msg->raise('Error', "bro", _("File or folder name is incorrect")); + $msg->raise("ERROR", "bro", _("File or folder name is incorrect")); return false; } for ($i = 0; $i < count($d); $i++) { @@ -593,7 +593,7 @@ class m_bro { global $_FILES, $msg, $cuid, $action; $absolute = $this->convertabsolute($R, false); if (!$absolute) { - $msg->raise('Error', "bro", _("File or folder name is incorrect")); + $msg->raise("ERROR", "bro", _("File or folder name is incorrect")); return false; } if (!strpos($_FILES['userfile']['name'], "/")) { @@ -605,7 +605,7 @@ class m_bro { $action->fix_file($absolute . "/" . $_FILES['userfile']['name']); return $absolute . "/" . $_FILES['userfile']['name']; } 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; } } else { @@ -625,7 +625,7 @@ class m_bro { $erstr = _("Undefined error ") . $_FILES['userfile']['error']; 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; } } @@ -653,7 +653,7 @@ class m_bro { $dest = $this->convertabsolute($dest, false); } 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; } $lfile = strtolower($file); @@ -685,7 +685,7 @@ class m_bro { $action->fix_dir($dest); 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 true; @@ -704,16 +704,16 @@ class m_bro { global $msg; $old = $this->convertabsolute($old, false); if (!$old) { - $msg->raise('Error', "bro", _("File or folder name is incorrect")); + $msg->raise("ERROR", "bro", _("File or folder name is incorrect")); return false; } $new = $this->convertabsolute($new, false); if (!$new) { - $msg->raise('Error', "bro", _("File or folder name is incorrect")); + $msg->raise("ERROR", "bro", _("File or folder name is incorrect")); return false; } 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; } for ($i = 0; $i < count($d); $i++) { @@ -741,7 +741,7 @@ class m_bro { global $msg; exec("cp -Rpf " . escapeshellarg($src) . " " . escapeshellarg($dest), $void, $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 true; @@ -799,11 +799,11 @@ class m_bro { $std = str_replace("<", "<", str_replace("&", "&", file_get_contents($absolute))); return $std; } 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; } } else { - $msg->raise('Error', "bro", _("File or folder name is incorrect")); + $msg->raise("ERROR", "bro", _("File or folder name is incorrect")); return false; } } @@ -880,7 +880,7 @@ class m_bro { $absolute = "$dir/$name"; $absolute = $this->convertabsolute($absolute, false); if (!$absolute) { - $msg->raise('Error', 'bro', _("File not in authorized directory")); + $msg->raise("ERROR", 'bro', _("File not in authorized directory")); include('foot.php'); exit; } @@ -974,7 +974,7 @@ class m_bro { readfile($absolute); } } else { - $msg->raise('Error', "bro", _("File or folder name is incorrect")); + $msg->raise("ERROR", "bro", _("File or folder name is incorrect")); return false; } } @@ -998,12 +998,12 @@ class m_bro { $absolute.="/" . $file; if (file_exists($absolute)) { 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; } } } else { - $msg->raise('Error', "bro", _("File or folder name is incorrect")); + $msg->raise("ERROR", "bro", _("File or folder name is incorrect")); return false; } return true; @@ -1170,7 +1170,7 @@ class m_bro { $dir.="html/"; if (!is_dir($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"); diff --git a/bureau/class/m_cron.php b/bureau/class/m_cron.php index ef0b1242..721581f2 100644 --- a/bureau/class/m_cron.php +++ b/bureau/class/m_cron.php @@ -132,7 +132,7 @@ class m_cron { if (filter_var($url, FILTER_VALIDATE_URL) === false) { - $msg->raise('Error', "cron", _("URL not valid")); + $msg->raise("ERROR", "cron", _("URL not valid")); return false; } $url = urlencode($url); @@ -144,7 +144,7 @@ class m_cron { //@todo remove checkmail cf functions.php if (!empty($email) && !checkmail($email) == 0) { - $msg->raise('Error', "cron", _("Email address is not valid")); + $msg->raise("ERROR", "cron", _("Email address is not valid")); return false; } $email = urlencode($email); @@ -155,7 +155,7 @@ class m_cron { if (is_null($id)) { // if a new insert, quotacheck $q = $quota->getquota("cron"); if ($q["u"] >= $q["t"]) { - $msg->raise('Error', "cron", _("You quota of cron entries is over. You cannot create more cron entries")); + $msg->raise("ERROR", "cron", _("You quota of cron entries is over. You cannot create more cron entries")); return false; } } else { // if not a new insert, check the $cuid @@ -164,7 +164,7 @@ class m_cron { return "false"; } // return false if pb if ($db->f('uid') != $cuid) { - $msg->raise('Error', "cron", _("Identity problem")); + $msg->raise("ERROR", "cron", _("Identity problem")); return false; } } diff --git a/bureau/class/m_dom.php b/bureau/class/m_dom.php index 879361cc..3a47e717 100644 --- a/bureau/class/m_dom.php +++ b/bureau/class/m_dom.php @@ -210,7 +210,7 @@ class m_dom { global $msg; if ($save) { if (!$this->import_manual_dns_prep_zone($domain)) { - $msg->raise('Error', 'dom', _("Err: failed to prepare the zone")); + $msg->raise("ERROR", 'dom', _("Err: failed to prepare the zone")); return false; } } @@ -239,7 +239,7 @@ class m_dom { $domain = trim($domain); if (empty($domain)) { - $msg->raise('Error', "dom", _("Missing domain name")); + $msg->raise("ERROR", "dom", _("Missing domain name")); return false; } @@ -455,7 +455,7 @@ class m_dom { // function add_domain($domain,$dns,$noerase=0,$force=0,$isslave=0,$slavedom="") if (!$this->add_domain($domain, true, false, true)) { - $msg->raise('Error', 'dom', "Error adding domain"); + $msg->raise("ERROR", 'dom', "Error adding domain"); return false; } @@ -542,7 +542,7 @@ class m_dom { global $msg, $db; // The name MUST contain only letter and digits, it's an identifier after all ... if (!preg_match("#^[a-z0-9]+$#", $name)) { - $msg->raise('Error', "dom", _("The name MUST contain only letter and digits")); + $msg->raise("ERROR", "dom", _("The name MUST contain only letter and digits")); return false; } $only_dns = intval($only_dns); @@ -566,7 +566,7 @@ class m_dom { $jh = $this->get_sub_domain_all($sub_id); if ($status == 'ENABLE') { // check compatibility with existing sub_domains if (!$this->can_create_subdomain($jh['domain'], $jh['name'], $jh['type'], $sub_id)) { - $msg->raise('Error', "dom", _("The parameters for this subdomain and domain type are invalid. Please check for subdomain entries incompatibility")); + $msg->raise("ERROR", "dom", _("The parameters for this subdomain and domain type are invalid. Please check for subdomain entries incompatibility")); return false; } } @@ -683,49 +683,49 @@ class m_dom { // Locked ? if (!$this->islocked) { - $msg->raise('Error', "dom", _("--- Program error --- No lock on the domains!")); + $msg->raise("ERROR", "dom", _("--- Program error --- No lock on the domains!")); return false; } // Verifie que le domaine est rfc-compliant $domain = strtolower($domain); $t = checkfqdn($domain); if ($t) { - $msg->raise('Error', "dom", _("The domain name is syntaxically incorrect")); + $msg->raise("ERROR", "dom", _("The domain name is syntaxically incorrect")); return false; } // Interdit les domaines clés (table forbidden_domains) sauf en cas FORCE $db->query("SELECT domain FROM forbidden_domains WHERE domain= ? ;", array($domain)); if ($db->num_rows() && !$force) { - $msg->raise('Error', "dom", _("The requested domain is forbidden in this server, please contact the administrator")); + $msg->raise("ERROR", "dom", _("The requested domain is forbidden in this server, please contact the administrator")); return false; } if ($domain == $L_FQDN || $domain == "www.$L_FQDN") { - $msg->raise('Error', "dom", _("This domain is the server's domain! You cannot host it on your account!")); + $msg->raise("ERROR", "dom", _("This domain is the server's domain! You cannot host it on your account!")); return false; } $db->query("SELECT compte FROM domaines WHERE domaine= ?;", array($domain)); if ($db->num_rows()) { - $msg->raise('Error', "dom", _("The domain already exist")); + $msg->raise("ERROR", "dom", _("The domain already exist")); return false; } $db->query("SELECT compte FROM `sub_domaines` WHERE sub != \"\" AND concat( sub, \".\", domaine )= ? OR domaine= ?;", array($domain, $domain)); if ($db->num_rows()) { - $msg->raise('Error', "dom", _("The domain already exist")); + $msg->raise("ERROR", "dom", _("The domain already exist")); return false; } $this->dns = $this->whois($domain); if (!$force) { $v = checkhostallow($domain, $this->dns); if ($v == -1) { - $msg->raise('Error', "dom", _("The last member of the domain name is incorrect or cannot be hosted in that server")); + $msg->raise("ERROR", "dom", _("The last member of the domain name is incorrect or cannot be hosted in that server")); return false; } if ($dns && $v == -2) { - $msg->raise('Alert', "dom", _("The domain cannot be found in the whois database")); + $msg->raise("ALERT", "dom", _("The domain cannot be found in the whois database")); return false; } if ($dns && $v == -3) { - $msg->raise('Alert', "dom", _("The domain cannot be found in the whois database")); + $msg->raise("ALERT", "dom", _("The domain cannot be found in the whois database")); return false; } @@ -742,14 +742,14 @@ class m_dom { if (!$dns) { $v = checkhostallow_nodns($domain); if ($v) { - $msg->raise('Error', "dom", _("The requested domain is forbidden in this server, please contact the administrator")); + $msg->raise("ERROR", "dom", _("The requested domain is forbidden in this server, please contact the administrator")); return false; } } } // Check the quota : if (!$quota->cancreate("dom")) { - $msg->raise('Aler', "dom", _("Your domain quota is over, you cannot create more domain names")); + $msg->raise("ALERT", "dom", _("Your domain quota is over, you cannot create more domain names")); return false; } if ($noerase) { @@ -764,7 +764,7 @@ class m_dom { } $db->query("INSERT INTO domaines (compte,domaine,gesdns,gesmx,noerase,dns_action) VALUES (?, ?, ?, ?, ?, 'UPDATE');", array($cuid,$domain,$dns,$gesmx,$noerase)); if (!($id = $db->lastid())) { - $msg->raise('Error', "dom", _("An unexpected error occured when creating the domain")); + $msg->raise("ERROR", "dom", _("An unexpected error occured when creating the domain")); return false; } @@ -773,7 +773,7 @@ class m_dom { $db->query("SELECT domaine FROM domaines WHERE compte= ? AND domaine= ?;", array($cuid, $slavedom)); $db->next_record(); if (!$db->Record["domaine"]) { - $msg->raise('Error', "dom", _("Domain '%s' not found"), $slavedom); + $msg->raise("ERROR", "dom", _("Domain '%s' not found"), $slavedom); $isslave = false; } // Point to the master domain : @@ -894,7 +894,7 @@ class m_dom { $msg->log("dom", "del_default_type"); if (!$db->query("delete from default_subdomains where id= ?;", array($id))) { - $msg->raise('Error', "dom", _("Could not delete default type")); + $msg->raise("ERROR", "dom", _("Could not delete default type")); return false; } @@ -1065,14 +1065,14 @@ class m_dom { } // while fclose($fp); } else { - $msg->raise('Alert', "dom", _("The Whois database is unavailable, please try again later")); + $msg->raise("ALERT", "dom", _("The Whois database is unavailable, please try again later")); return false; } if ($found) { return $serveurList; } else { - $msg->raise('Alert', "dom", _("The domain cannot be found in the Whois database")); + $msg->raise("ALERT", "dom", _("The domain cannot be found in the Whois database")); return false; } } @@ -1153,19 +1153,19 @@ class m_dom { $msg->log("dom", "get_domain_all", $dom); // Locked ? if (!$this->islocked) { - $msg->raise('Error', "dom", _("--- Program error --- No lock on the domains!")); + $msg->raise("ERROR", "dom", _("--- Program error --- No lock on the domains!")); return false; } $t = checkfqdn($dom); if ($t) { - $msg->raise('Error', "dom", _("The domain name is syntaxically incorrect")); + $msg->raise("ERROR", "dom", _("The domain name is syntaxically incorrect")); return false; } $r = array(); $r["name"] = $dom; $db->query("SELECT * FROM domaines WHERE compte= ? AND domaine= ?;", array($cuid, $dom)); if ($db->num_rows() == 0) { - $msg->raise('Error', "dom", sprintf(_("Domain '%s' not found"), $dom)); + $msg->raise("ERROR", "dom", sprintf(_("Domain '%s' not found"), $dom)); return false; } $db->next_record(); @@ -1225,12 +1225,12 @@ class m_dom { $msg->log("dom", "get_sub_domain_all", $sub_domain_id); // Locked ? if (!$this->islocked) { - $msg->raise('Error', "dom", _("--- Program error --- No lock on the domains!")); + $msg->raise("ERROR", "dom", _("--- Program error --- No lock on the domains!")); return false; } $db->query("select sd.*, dt.description as type_desc, dt.only_dns, dt.advanced from sub_domaines sd, domaines_type dt where compte= ? and sd.id= ? and upper(dt.name)=upper(sd.type) ORDER BY dt.advanced, sd.sub;", array($cuid, $sub_domain_id)); if ($db->num_rows() == 0) { - $msg->raise('Error', "dom", _("The sub-domain does not exist")); + $msg->raise("ERROR", "dom", _("The sub-domain does not exist")); return false; } $db->next_record(); @@ -1269,7 +1269,7 @@ class m_dom { if (filter_var($value, FILTER_VALIDATE_URL)) { return true; } else { - $msg->raise('Error', "dom", _("invalid url")); + $msg->raise("ERROR", "dom", _("invalid url")); return false; } } @@ -1279,7 +1279,7 @@ class m_dom { $value = "/" . $value; } if (!checkuserpath($value)) { - $msg->raise('Error', "dom", _("The folder you entered is incorrect or does not exist")); + $msg->raise("ERROR", "dom", _("The folder you entered is incorrect or does not exist")); return false; } return true; @@ -1287,7 +1287,7 @@ class m_dom { if (checkip($value)) { return true; } else { - $msg->raise('Error', "dom", _("The ip address is invalid")); + $msg->raise("ERROR", "dom", _("The ip address is invalid")); return false; } break; @@ -1295,7 +1295,7 @@ class m_dom { if (checkipv6($value)) { return true; } else { - $msg->raise('Error', "dom", _("The ip address is invalid")); + $msg->raise("ERROR", "dom", _("The ip address is invalid")); return false; } break; @@ -1303,7 +1303,7 @@ class m_dom { if (checkcname($value)) { return true; } else { - $msg->raise('Error', "dom", _("The name you entered is incorrect or not fully qualified (it must end with a DOT, like example.com.)")); + $msg->raise("ERROR", "dom", _("The name you entered is incorrect or not fully qualified (it must end with a DOT, like example.com.)")); return false; } break; @@ -1311,12 +1311,12 @@ class m_dom { if ($value == strval($value)) { return true; } else { - $msg->raise('Error', "dom", _("The TXT value you entered is incorrect")); + $msg->raise("ERROR", "dom", _("The TXT value you entered is incorrect")); return false; } break; default: - $msg->raise('Error', "dom", _("Invalid domain type selected, please check")); + $msg->raise("ERROR", "dom", _("Invalid domain type selected, please check")); return false; } return false; @@ -1381,7 +1381,7 @@ class m_dom { $msg->log("dom", "set_sub_domain", $dom . "/" . $sub . "/" . $type . "/" . $dest); // Locked ? if (!$this->islocked) { - $msg->raise('Error', "dom", _("--- Program error --- No lock on the domains!")); + $msg->raise("ERROR", "dom", _("--- Program error --- No lock on the domains!")); return false; } $dest = trim($dest); @@ -1393,7 +1393,7 @@ class m_dom { $fqdn = checkfqdn($sub); // Special cases : * (all subdomains at once) and '' empty subdomain are allowed. if (($sub != '*' && $sub != '') && !($fqdn == 0 || $fqdn == 4)) { - $msg->raise('Alert', "dom", _("There is some forbidden characters in the sub domain (only A-Z 0-9 and - are allowed)")); + $msg->raise("ALERT", "dom", _("There is some forbidden characters in the sub domain (only A-Z 0-9 and - are allowed)")); return false; } @@ -1405,12 +1405,12 @@ class m_dom { // On a épuré $dir des problémes eventuels ... On est en DESSOUS du dossier de l'utilisateur. if (($t = checkfqdn($dom))) { - $msg->raise('Error', "dom", _("The domain name is syntaxically incorrect")); + $msg->raise("ERROR", "dom", _("The domain name is syntaxically incorrect")); return false; } if (!$this->can_create_subdomain($dom, $sub, $type, $sub_domain_id)) { - $msg->raise('Error', "dom", _("The parameters for this subdomain and domain type are invalid. Please check for subdomain entries incompatibility")); + $msg->raise("ERROR", "dom", _("The parameters for this subdomain and domain type are invalid. Please check for subdomain entries incompatibility")); return false; } @@ -1432,7 +1432,7 @@ class m_dom { if ($db->f('create_tmpdir')) { if (!is_dir($dest_root . "/tmp")) { if (!@mkdir($dest_root . "/tmp", 0777, true)) { - $msg->raise('Error', "dom", _("Cannot write to the destination folder")); + $msg->raise("ERROR", "dom", _("Cannot write to the destination folder")); } } } @@ -1443,7 +1443,7 @@ class m_dom { if (!is_dir($dirr)) { $old = umask(0); if (!@mkdir($dirr, 0770, true)) { - $msg->raise('Error', "dom", _("Cannot write to the destination folder")); + $msg->raise("ERROR", "dom", _("Cannot write to the destination folder")); } umask($old); } @@ -1468,11 +1468,11 @@ class m_dom { $msg->log("dom", "del_sub_domain", $sub_domain_id); // Locked ? if (!$this->islocked) { - $msg->raise('Error', "dom", _("--- Program error --- No lock on the domains!")); + $msg->raise("ERROR", "dom", _("--- Program error --- No lock on the domains!")); return false; } if (!$r = $this->get_sub_domain_all($sub_domain_id)) { - $msg->raise('Error', "dom", _("The sub-domain does not exist")); + $msg->raise("ERROR", "dom", _("The sub-domain does not exist")); return false; } else { $db->query("update sub_domaines set web_action='DELETE' where id= ?; ", array($sub_domain_id)); @@ -1515,22 +1515,22 @@ class m_dom { $msg->log("dom", "edit_domain", $dom . "/" . $dns . "/" . $gesmx); // Locked ? if (!$this->islocked && !$force) { - $msg->raise('Error', "dom", _("--- Program error --- No lock on the domains!")); + $msg->raise("ERROR", "dom", _("--- Program error --- No lock on the domains!")); return false; } if ($dns == true && !$force) { $this->dns = $this->whois($dom); $v = checkhostallow($dom, $this->dns); if ($v == -1) { - $msg->raise('Error', "dom", _("The last member of the domain name is incorrect or cannot be hosted in that server")); + $msg->raise("ERROR", "dom", _("The last member of the domain name is incorrect or cannot be hosted in that server")); return false; } if ($dns && $v == -2) { - $msg->raise('Alert', "dom", _("The domain cannot be found in the Whois database")); + $msg->raise("ALERT", "dom", _("The domain cannot be found in the Whois database")); return false; } if ($dns && $v == -3) { - $msg->raise('Alert', "dom", _("The DNS of this domain do not match the server's DNS. Please change your domain's DNS before you install it again")); + $msg->raise("ALERT", "dom", _("The DNS of this domain do not match the server's DNS. Please change your domain's DNS before you install it again")); return false; } } @@ -1542,12 +1542,12 @@ class m_dom { $t = checkfqdn($dom); if ($t) { - $msg->raise('Error', "dom", _("The domain name is syntaxically incorrect")); + $msg->raise("ERROR", "dom", _("The domain name is syntaxically incorrect")); return false; } if (!$r = $this->get_domain_all($dom)) { // Le domaine n'existe pas, Failure - $msg->raise('Error', "dom", _("The domain name %s does not exist"), $dom); + $msg->raise("ERROR", "dom", _("The domain name %s does not exist"), $dom); return false; } if ($dns != "1") { @@ -1555,7 +1555,7 @@ class m_dom { } // On vérifie que des modifications ont bien eu lieu :) if ($r["dns"] == $dns && $r["mail"] == $gesmx && $r["zonettl"] == $ttl) { - $msg->raise('Info', "dom", _("No change has been requested...")); + $msg->raise("INFO", "dom", _("No change has been requested...")); return true; } @@ -1563,12 +1563,12 @@ class m_dom { if ($dns == "0" && $gesmx == "1" && !$force) { $vmx = $this->checkmx($dom); if ($vmx == 1) { - $msg->raise('Alert', "dom", _("There is no MX record pointing to this server, and you are asking us to host the mail here. Make sure to update your MX entries or no mail will be received")); + $msg->raise("ALERT", "dom", _("There is no MX record pointing to this server, and you are asking us to host the mail here. Make sure to update your MX entries or no mail will be received")); } if ($vmx == 2) { // Serveur non spécifié parmi les champx mx - $msg->raise('Alert', "dom", _("There is no MX record pointing to this server, and you are asking us to host the mail here. Make sure to update your MX entries or no mail will be received")); + $msg->raise("ALERT", "dom", _("There is no MX record pointing to this server, and you are asking us to host the mail here. Make sure to update your MX entries or no mail will be received")); } } @@ -1615,7 +1615,7 @@ class m_dom { function add_slave_ip($ip, $class = "32") { global $db, $msg; if (!checkip($ip)) { - $msg->raise('Error', "dom", _("The IP address you entered is incorrect")); + $msg->raise("ERROR", "dom", _("The IP address you entered is incorrect")); return false; } $class = intval($class); @@ -1624,7 +1624,7 @@ class m_dom { } $db->query("SELECT * FROM slaveip WHERE ip= ? AND class= ?;", array($ip, $class)); if ($db->next_record()) { - $msg->raise('Error', "err", _("The requested domain is forbidden in this server, please contact the administrator")); + $msg->raise("ERROR", "err", _("The requested domain is forbidden in this server, please contact the administrator")); return false; } $db->query("INSERT INTO slaveip (ip,class) VALUES (?, ?);", array($ip, $class)); @@ -1641,7 +1641,7 @@ class m_dom { function del_slave_ip($ip) { global $db, $msg; if (!checkip($ip)) { - $msg->raise('Error', "dom", _("The IP address you entered is incorrect")); + $msg->raise("ERROR", "dom", _("The IP address you entered is incorrect")); return false; } $db->query("DELETE FROM slaveip WHERE ip= ?;", array($ip)); @@ -1739,13 +1739,13 @@ class m_dom { if ($db->next_record()) { $domain = $db->f("domaine"); if (!$domain) { - $msg->raise('Error', "dom", _("This domain is not installed in your account")); + $msg->raise("ERROR", "dom", _("This domain is not installed in your account")); return false; } else { return $domain; } } else { - $msg->raise('Error', "dom", _("This domain is not installed in your account")); + $msg->raise("ERROR", "dom", _("This domain is not installed in your account")); return false; } } @@ -1763,13 +1763,13 @@ class m_dom { if ($db->next_record()) { $id = $db->f("id"); if (!$id) { - $msg->raise('Error', "dom", _("This domain is not installed in your account")); + $msg->raise("ERROR", "dom", _("This domain is not installed in your account")); return false; } else { return $id; } } else { - $msg->raise('Error', "dom", _("This domain is not installed in your account")); + $msg->raise("ERROR", "dom", _("This domain is not installed in your account")); return false; } } @@ -1813,7 +1813,7 @@ class m_dom { global $db, $msg; $db->query("SELECT * FROM slaveaccount WHERE login= ?", array($login)); if ($db->next_record()) { - $msg->raise('Error', "dom", _("The specified slave account already exists")); + $msg->raise("ERROR", "dom", _("The specified slave account already exists")); return false; } $db->query("INSERT INTO slaveaccount (login,pass) VALUES (?, ?)", array($login, $pass)); @@ -1844,7 +1844,7 @@ class m_dom { global $msg; $msg->log("dom", "lock"); if ($this->islocked) { - $msg->raise('Error', "dom", _("--- Program error --- Lock already obtained!")); + $msg->raise("ERROR", "dom", _("--- Program error --- Lock already obtained!")); } while (file_exists($this->fic_lock_cron)) { sleep(2); @@ -1863,7 +1863,7 @@ class m_dom { global $msg; $msg->log("dom", "unlock"); if (!$this->islocked) { - $msg->raise('Error', "dom", _("--- Program error --- No lock on the domains!")); + $msg->raise("ERROR", "dom", _("--- Program error --- No lock on the domains!")); } $this->islocked = false; return true; diff --git a/bureau/class/m_ftp.php b/bureau/class/m_ftp.php index 5425ff6f..ca72416d 100644 --- a/bureau/class/m_ftp.php +++ b/bureau/class/m_ftp.php @@ -104,7 +104,7 @@ class m_ftp { function switch_enabled($id, $status = null) { global $cuid, $db, $msg; if (!$jj = $this->get_ftp_details($id)) { - $msg->raise('Error', 'ftp', _("This account do not exist or is not of this account")); + $msg->raise("ERROR", 'ftp', _("This account do not exist or is not of this account")); return false; } if ($status == null) { @@ -119,7 +119,7 @@ class m_ftp { $status = ($status ? 1 : 0); if (!$db->query("UPDATE ftpusers SET enabled = ? WHERE uid = ? AND id = ? ;", array($status, $cuid, $id))) { - $msg->raise('Error', 'ftp', _("Error during update")); + $msg->raise("ERROR", 'ftp', _("Error during update")); return false; } else { return true; @@ -153,7 +153,7 @@ class m_ftp { } return $r; } else { - $msg->raise('Info', "ftp", _("No FTP account found")); + $msg->raise("INFO", "ftp", _("No FTP account found")); return array(); } } @@ -191,7 +191,7 @@ class m_ftp { ); return $r; } else { - $msg->raise('Error', "ftp", _("This FTP account does not exist")); + $msg->raise("ERROR", "ftp", _("This FTP account does not exist")); return false; } } @@ -226,14 +226,14 @@ class m_ftp { $vv = array('_' => '1', ' ' => 0); foreach ($vv as $k => $n) { if (substr_count($l, $k) > $n) { // if there is more than $n $k - $msg->raise('Error', 'ftp', sprintf(_("FTP login is incorrect: too many '%s'"), $k)); + $msg->raise("ERROR", 'ftp', sprintf(_("FTP login is incorrect: too many '%s'"), $k)); return false; } } // Explicitly look for only allowed chars if (!preg_match("/^[A-Za-z0-9]+[A-Za-z0-9_\.\-]*$/", $l)) { - $msg->raise('Error', 'ftp', _("FTP login is incorrect")); + $msg->raise("ERROR", 'ftp', _("FTP login is incorrect")); return false; } return true; @@ -277,7 +277,7 @@ class m_ftp { $db->query("SELECT count(*) AS cnt FROM ftpusers WHERE id= ? and uid= ?;", array($id, $cuid)); $db->next_record(); if (!$db->f("cnt")) { - $msg->raise('Error', "ftp", _("This FTP account does not exist")); + $msg->raise("ERROR", "ftp", _("This FTP account does not exist")); return false; } $dir = $bro->convertabsolute($dir); @@ -286,7 +286,7 @@ class m_ftp { } $r = $this->prefix_list(); if (!in_array($prefixe, $r)) { - $msg->raise('Error', "ftp", _("The chosen prefix is not allowed")); + $msg->raise("ERROR", "ftp", _("The chosen prefix is not allowed")); return false; } @@ -300,7 +300,7 @@ class m_ftp { $db->query("SELECT COUNT(*) AS cnt FROM ftpusers WHERE id!= ? AND name= ?;", array($id, $full_login)); $db->next_record(); if ($db->f("cnt")) { - $msg->raise('Error', "ftp", _("This FTP account already exists")); + $msg->raise("ERROR", "ftp", _("This FTP account already exists")); return false; } $absolute = getuserpath() . "/$dir"; @@ -308,7 +308,7 @@ class m_ftp { system("/bin/mkdir -p $absolute"); } if (!is_dir($absolute)) { - $msg->raise('Error', "ftp", _("The directory cannot be created")); + $msg->raise("ERROR", "ftp", _("The directory cannot be created")); return false; } if (trim($pass)) { @@ -340,7 +340,7 @@ class m_ftp { $db->next_record(); $name = $db->f("name"); if (!$name) { - $msg->raise('Error', "ftp", _("This FTP account does not exist")); + $msg->raise("ERROR", "ftp", _("This FTP account does not exist")); return false; } $db->query("DELETE FROM ftpusers WHERE id= ? ;", array($id)); @@ -366,11 +366,11 @@ class m_ftp { } $r = $this->prefix_list(); if (empty($pass)) { - $msg->raise('Error', "ftp", _("Password can't be empty")); + $msg->raise("ERROR", "ftp", _("Password can't be empty")); return false; } if (!in_array($prefixe, $r) || $prefixe == "") { - $msg->raise('Error', "ftp", _("The chosen prefix is not allowed")); + $msg->raise("ERROR", "ftp", _("The chosen prefix is not allowed")); return false; } $full_login = $prefixe; @@ -383,7 +383,7 @@ class m_ftp { $db->query("SELECT count(*) AS cnt FROM ftpusers WHERE name= ? ;", array($full_login)); $db->next_record(); if ($db->f("cnt")) { - $msg->raise('Error', "ftp", _("This FTP account already exists")); + $msg->raise("ERROR", "ftp", _("This FTP account already exists")); return false; } $db->query("SELECT login FROM membres WHERE uid= ? ;", array($cuid)); @@ -393,7 +393,7 @@ class m_ftp { system("/bin/mkdir -p $absolute"); // FIXME replace with action } if (!is_dir($absolute)) { - $msg->raise('Error', "ftp", _("The directory cannot be created")); + $msg->raise("ERROR", "ftp", _("The directory cannot be created")); return false; } @@ -409,7 +409,7 @@ class m_ftp { $db->query("INSERT INTO ftpusers (name,password, encrypted_password,homedir,uid) VALUES ( ?, '', ?, ?, ?)", array($full_login, $encrypted_password, $absolute, $cuid)); return true; } else { - $msg->raise('Error', "ftp", _("Your FTP account quota is over. You cannot create more ftp accounts")); + $msg->raise("ERROR", "ftp", _("Your FTP account quota is over. You cannot create more ftp accounts")); return false; } } diff --git a/bureau/class/m_hta.php b/bureau/class/m_hta.php index 0397b56c..20ff9e5e 100644 --- a/bureau/class/m_hta.php +++ b/bureau/class/m_hta.php @@ -87,17 +87,17 @@ class m_hta { $msg->log("hta", "createdir", $dir); $absolute = $bro->convertabsolute($dir, 0); if (!is_dir($absolute)) { - $msg->raise('Error', "hta", _("The folder '%s' does not exist"), $dir); + $msg->raise("ERROR", "hta", _("The folder '%s' does not exist"), $dir); return false; } if (!file_exists("$absolute/.htaccess")) { if (!@touch("$absolute/.htaccess")) { - $msg->raise('Error', "hta", _("File already exist")); + $msg->raise("ERROR", "hta", _("File already exist")); return false; } $file = @fopen("$absolute/.htaccess", "r+"); if (!$file) { - $msg->raise('Error', "hta", _("File already exist")); + $msg->raise("ERROR", "hta", _("File already exist")); return false; } fseek($file, 0); @@ -107,7 +107,7 @@ class m_hta { } if (!file_exists("$absolute/.htpasswd")) { if (!touch("$absolute/.htpasswd")) { - $msg->raise('Error', "hta", _("File already exist")); + $msg->raise("ERROR", "hta", _("File already exist")); return false; } return true; @@ -129,7 +129,7 @@ class m_hta { $absolute = ALTERNC_HTML . "/" . substr($mem->user["login"], 0, 1) . "/" . $mem->user["login"]; exec("find " . escapeshellarg($absolute) . " -name .htpasswd|sort", $sortie); if (!count($sortie)) { - $msg->raise('Info', "hta", _("No protected folder")); + $msg->raise("INFO", "hta", _("No protected folder")); return false; } $pattern = "/^" . preg_quote(ALTERNC_HTML, "/") . "\/.\/[^\/]*\/(.*)\/\.htpasswd/"; @@ -215,12 +215,12 @@ class m_hta { $msg->log("hta", "deldir", $dir); $dir = $bro->convertabsolute($dir, $skip); if (!$dir) { - $msg->raise('Error', "hta", ("The folder '%s' does not exist"), $dir); + $msg->raise("ERROR", "hta", ("The folder '%s' does not exist"), $dir); return false; } $htaccess_file = "$dir/.htaccess"; if (!is_readable($htaccess_file)) { - $msg->raise('Error', "hta", _("I cannot read the file '%s'"), $htaccess_file); + $msg->raise("ERROR", "hta", _("I cannot read the file '%s'"), $htaccess_file); } $fileLines = file($htaccess_file); $patternList = array( @@ -240,21 +240,21 @@ class m_hta { } // If no changes if (!$count_lines) { - $msg->raise('Alert', "hta", _("Unexpected: No changes made to '%s'"), $htaccess_file); + $msg->raise("ALERT", "hta", _("Unexpected: No changes made to '%s'"), $htaccess_file); } // If file is empty, remove it if (!count($fileLines)) { if (!unlink($htaccess_file)) { - $msg->raise('Error', "hta", _("I could not delete the file '%s'"), $htaccess_file); + $msg->raise("ERROR", "hta", _("I could not delete the file '%s'"), $htaccess_file); } } else { file_put_contents($htaccess_file, implode("\n", $fileLines)); } $htpasswd_file = "$dir/.htpasswd"; if (!is_writable($htpasswd_file)) { - $msg->raise('Error', "hta", _("I cannot read the file '%s'"), $htpasswd_file); + $msg->raise("ERROR", "hta", _("I cannot read the file '%s'"), $htpasswd_file); } else if (!unlink($htpasswd_file)) { - $msg->raise('Error', "hta", _("I cannot delete the file '%s/.htpasswd'"), $dir); + $msg->raise("ERROR", "hta", _("I cannot delete the file '%s/.htpasswd'"), $dir); return false; } @@ -278,16 +278,16 @@ class m_hta { global $msg, $bro, $admin; $msg->log("hta", "add_user", $user . "/" . $dir); if (empty($user)) { - $msg->raise('Error', 'hta', _("Please enter a user")); + $msg->raise("ERROR", 'hta', _("Please enter a user")); return false; } if (empty($password)) { - $msg->raise('Error', 'hta', _("Please enter a password")); + $msg->raise("ERROR", 'hta', _("Please enter a password")); return false; } $absolute = $bro->convertabsolute($dir, 0); if (!file_exists($absolute)) { - $msg->raise('Error', "hta", _("The folder '%s' does not exist"), $dir); + $msg->raise("ERROR", "hta", _("The folder '%s' does not exist"), $dir); return false; } // @todo delete cf!. functions.php checkloginemail definition @@ -301,7 +301,7 @@ class m_hta { $file = @fopen("$absolute/.htpasswd", "a+"); if (!$file) { - $msg->raise('Error', "hta", _("File already exist")); + $msg->raise("ERROR", "hta", _("File already exist")); return false; } fseek($file, 0); @@ -309,7 +309,7 @@ class m_hta { $s = fgets($file, 1024); $t = explode(":", $s); if ($t[0] == $user) { - $msg->raise('Error', "hta", _("The user '%s' already exist for this folder"), $user); + $msg->raise("ERROR", "hta", _("The user '%s' already exist for this folder"), $user); return false; } } @@ -321,7 +321,7 @@ class m_hta { fclose($file); return true; } else { - $msg->raise('Error', "hta", _("Please enter a valid username")); + $msg->raise("ERROR", "hta", _("Please enter a valid username")); return false; } } @@ -340,14 +340,14 @@ class m_hta { $msg->log("hta", "del_user", $lst . "/" . $dir); $absolute = $bro->convertabsolute($dir, 0); if (!file_exists($absolute)) { - $msg->raise('Error', "hta", _("The folder '%s' does not exist"), $dir); + $msg->raise("ERROR", "hta", _("The folder '%s' does not exist"), $dir); return false; } touch("$absolute/.htpasswd.new"); $file = fopen("$absolute/.htpasswd", "r"); $newf = fopen("$absolute/.htpasswd.new", "a"); if (!$file || !$newf) { - $msg->raise('Error', "hta", _("File already exist")); + $msg->raise("ERROR", "hta", _("File already exist")); return false; } reset($lst); @@ -379,7 +379,7 @@ class m_hta { $msg->log("hta", "change_pass", $user . "/" . $dir); $absolute = $bro->convertabsolute($dir, 0); if (!file_exists($absolute)) { - $msg->raise('Error', "hta", _("The folder '%s' does not exist"), $dir); + $msg->raise("ERROR", "hta", _("The folder '%s' does not exist"), $dir); return false; } @@ -394,7 +394,7 @@ class m_hta { $file = fopen("$absolute/.htpasswd", "r"); $newf = fopen("$absolute/.htpasswd.new", "a"); if (!$file || !$newf) { - $msg->raise('Error', "hta", _("File already exist")); + $msg->raise("ERROR", "hta", _("File already exist")); return false; } while (!feof($file)) { @@ -449,7 +449,7 @@ class m_hta { } // Reading config file fclose($file); if ($errr || in_array(0, $lignes)) { - $msg->raise('Error', "hta", _("An incompatible .htaccess file exists in this folder")); + $msg->raise("ERROR", "hta", _("An incompatible .htaccess file exists in this folder")); return false; } return true; diff --git a/bureau/class/m_lxc.php b/bureau/class/m_lxc.php index ef97c0cf..21651b07 100644 --- a/bureau/class/m_lxc.php +++ b/bureau/class/m_lxc.php @@ -126,7 +126,7 @@ class m_lxc implements vm { global $mem, $db, $msg, $mysql; if ($this->getvm() !== FALSE) { - $msg->raise('Error', 'lxc', _('VM already started')); + $msg->raise("ERROR", 'lxc', _('VM already started')); return FALSE; } unset($this->error); @@ -150,7 +150,7 @@ class m_lxc implements vm { $uid = $mem->user['uid']; if ($error != 0) { - $msg->raise('Error', 'lxc', _($msg)); + $msg->raise("ERROR", 'lxc', _($msg)); return FALSE; } $db->query("INSERT INTO vm_history (ip,date_start,uid,serialized_object) VALUES (?, ?, ?, ?);", array($hostname, $date_start, $uid, $res)); diff --git a/bureau/class/m_mail.php b/bureau/class/m_mail.php index b5bfe530..0115fb4d 100644 --- a/bureau/class/m_mail.php +++ b/bureau/class/m_mail.php @@ -183,7 +183,7 @@ class m_mail { // FIXME validate domain } else { // ca doit être un mail if (!filter_var($target, FILTER_VALIDATE_EMAIL)) { - $msg->raise('Error', "mail", _("The email you entered is syntaxically incorrect")); + $msg->raise("ERROR", "mail", _("The email you entered is syntaxically incorrect")); return false; } } @@ -271,7 +271,7 @@ ORDER BY } // Validate the email syntax: if (!filter_var($mail, FILTER_VALIDATE_EMAIL)) { - $msg->raise('Error', "mail", _("The email you entered is syntaxically incorrect")); + $msg->raise("ERROR", "mail", _("The email you entered is syntaxically incorrect")); return false; } // Check the availability @@ -321,7 +321,7 @@ ORDER BY FROM ((domaines d, address a LEFT JOIN mailbox m ON m.address_id=a.id) LEFT JOIN dovecot_quota q ON CONCAT(a.address,'@',d.domaine) = q.user) LEFT JOIN recipient r ON r.address_id=a.id WHERE " . $where . " AND d.id=a.domain_id " . $limit . " ;", $query_args); if (!$db->next_record()) { - $msg->raise('Error', "mail", _("No email found for this query")); + $msg->raise("ERROR", "mail", _("No email found for this query")); return array(); } $res = array(); @@ -369,7 +369,7 @@ ORDER BY // Validate the email syntax: $m = $mail . "@" . $domain; if (!filter_var($m, FILTER_VALIDATE_EMAIL) && !$dontcheck) { - $msg->raise('Error', "mail", _("The email you entered is syntaxically incorrect")); + $msg->raise("ERROR", "mail", _("The email you entered is syntaxically incorrect")); return false; } @@ -381,23 +381,23 @@ ORDER BY // Check the quota: if (($type=="")&&!$quota->cancreate("mail")) { - $msg->raise('Alert', "mail", _("You cannot create email addresses: your quota is over")); + $msg->raise("ALERT", "mail", _("You cannot create email addresses: your quota is over")); return false; } // Already exists? $db->query("SELECT * FROM address WHERE domain_id= ? AND address= ? ;", array($dom_id, $mail)); if ($db->next_record()) { if ($db->f("type") == "mailman") - $msg->raise('Error', "mail", _("This email address already exists in mailman")); + $msg->raise("ERROR", "mail", _("This email address already exists in mailman")); else - $msg->raise('Error', "mail", _("This email address already exists")); + $msg->raise("ERROR", "mail", _("This email address already exists")); return false; } // Create it now $db->query("INSERT INTO address (domain_id, address,type) VALUES (?, ?, ?);", array($dom_id, $mail, $type)); if (!($id = $db->lastid())) { - $msg->raise('Error', "mail", _("An unexpected error occured when creating the email")); + $msg->raise("ERROR", "mail", _("An unexpected error occured when creating the email")); return false; } return $id; @@ -454,7 +454,7 @@ ORDER BY if ($db->next_record()) { return $this->isitmy_cache[$mail_id] = $db->f("email"); } else { - $msg->raise('Error', "mail", _("This email is not yours, you can't change anything on it")); + $msg->raise("ERROR", "mail", _("This email is not yours, you can't change anything on it")); return $this->isitmy_cache[$mail_id] = false; } } @@ -511,7 +511,7 @@ ORDER BY $mail_id = intval($mail_id); if (!$mail_id) { - $msg->raise('Error', "mail", _("The email you entered is syntaxically incorrect")); + $msg->raise("ERROR", "mail", _("The email you entered is syntaxically incorrect")); return false; } // Validate that this email is owned by me... @@ -525,11 +525,11 @@ ORDER BY // Search for that address: $db->query("SELECT a.id, a.type, a.mail_action, m.mail_action AS mailbox_action, NOT ISNULL(m.id) AS islocal FROM address a LEFT JOIN mailbox m ON m.address_id=a.id WHERE a.id= ? ;", array($mail_id)); if (!$db->next_record()) { - $msg->raise('Error', "mail", _("The email %s does not exist, it can't be deleted"), $mail); + $msg->raise("ERROR", "mail", _("The email %s does not exist, it can't be deleted"), $mail); return false; } if ($db->f("mail_action") != "OK" || ($db->f("islocal") && $db->f("mailbox_action") != "OK")) { // will be deleted soon ... - $msg->raise('Error', "mail", _("The email %s is already marked for deletion, it can't be deleted"), $mail); + $msg->raise("ERROR", "mail", _("The email %s is already marked for deletion, it can't be deleted"), $mail); return false; } $mail_id = $db->f("id"); @@ -563,7 +563,7 @@ ORDER BY $mail_id = intval($mail_id); if (!$mail_id) { - $msg->raise('Error', "mail", _("The email you entered does not exist")); + $msg->raise("ERROR", "mail", _("The email you entered does not exist")); return false; } // Validate that this email is owned by me... @@ -574,15 +574,15 @@ ORDER BY // Search for that address: $db->query("SELECT a.id, a.type, a.mail_action, m.mail_action AS mailbox_action, NOT ISNULL(m.id) AS islocal FROM address a LEFT JOIN mailbox m ON m.address_id=a.id WHERE a.id= ? ;", array($mail_id)); if (!$db->next_record()) { - $msg->raise('Error', "mail", _("The email %s does not exist, it can't be undeleted"), $mail); + $msg->raise("ERROR", "mail", _("The email %s does not exist, it can't be undeleted"), $mail); return false; } if ($db->f("type") != "") { // Technically special : mailman, sympa ... - $msg->raise('Error', "mail", _("The email %s is special, it can't be undeleted"), $mail); + $msg->raise("ERROR", "mail", _("The email %s is special, it can't be undeleted"), $mail); return false; } if ($db->f("mailbox_action") != "DELETE" || $db->f("mail_action") != "DELETE") { // will be deleted soon ... - $msg->raise('Alert', "mail", _("Sorry, deletion of email %s is already in progress, or not marked for deletion, it can't be undeleted"), $mail); + $msg->raise("ALERT", "mail", _("Sorry, deletion of email %s is already in progress, or not marked for deletion, it can't be undeleted"), $mail); return false; } $mail_id = $db->f("id"); @@ -593,7 +593,7 @@ ORDER BY $db->query("UPDATE mailbox SET mail_action='OK' WHERE address_id= ? ;", array($mail_id)); return true; } else { - $msg->raise('Error', "mail", _("-- Program Error -- The email %s can't be undeleted"), $mail); + $msg->raise("ERROR", "mail", _("-- Program Error -- The email %s can't be undeleted"), $mail); return false; } } @@ -689,7 +689,7 @@ ORDER BY } foreach ($this->forbiddenchars as $str) { if (strpos($me["address"], $str) !== false) { - $msg->raise('Error', "mail", _("There is forbidden characters in your email address. You can't make it a POP/IMAP account, you can only use it as redirection to other emails")); + $msg->raise("ERROR", "mail", _("There is forbidden characters in your email address. You can't make it a POP/IMAP account, you can only use it as redirection to other emails")); return false; } } @@ -708,7 +708,7 @@ ORDER BY if ($islocal) { if ($quotamb != 0 && $quotamb < (intval($me["used"] / 1024 / 1024) + 1)) { $quotamb = intval($me["used"] / 1024 / 1024) + 1; - $msg->raise('Alert', "mail", _("You set a quota smaller than the current mailbox size. Since it's not allowed, we set the quota to the current mailbox size")); + $msg->raise("ALERT", "mail", _("You set a quota smaller than the current mailbox size. Since it's not allowed, we set the quota to the current mailbox size")); } $db->query("UPDATE mailbox SET quota= ? WHERE address_id= ? ;", array($quotamb, $mail_id)); } @@ -728,7 +728,7 @@ ORDER BY $db->query("INSERT INTO recipient SET address_id= ?, recipients= ? ;", array($mail_id, $red)); } if (!$islocal && !$red) { - $msg->raise('Alert', "mail", _("Warning: you created an email which is not an alias, and not a POP/IMAP mailbox. This is certainly NOT what you want to do. To fix this, edit the email address and check 'Yes' in POP/IMAP account, or set some recipients in the redirection field.")); + $msg->raise("ALERT", "mail", _("Warning: you created an email which is not an alias, and not a POP/IMAP mailbox. This is certainly NOT what you want to do. To fix this, edit the email address and check 'Yes' in POP/IMAP account, or set some recipients in the redirection field.")); } return true; } @@ -901,7 +901,7 @@ ORDER BY global $db, $msg; $db->query("SELECT * FROM mxaccount WHERE login= ? ;", array($login)); if ($db->next_record()) { - $msg->raise('Error', "mail", _("The slave MX account was not found")); + $msg->raise("ERROR", "mail", _("The slave MX account was not found")); return false; } $db->query("INSERT INTO mxaccount (login,pass) VALUES (?, ?);", array($login, $pass)); @@ -951,7 +951,7 @@ ORDER BY $db->query("SELECT value FROM variable where name='mailname_bounce';"); if (!$db->next_record()) { - $msg->raise('Error', "mail", _("Problem: can't create default bounce mail")); + $msg->raise("ERROR", "mail", _("Problem: can't create default bounce mail")); return false; } $mailname = $db->f("value"); diff --git a/bureau/class/m_mem.php b/bureau/class/m_mem.php index bd9ab07e..31a3c55c 100644 --- a/bureau/class/m_mem.php +++ b/bureau/class/m_mem.php @@ -100,24 +100,24 @@ class m_mem { // $password=addslashes($password); $db->query("select * from membres where login= ? ;", array($username)); if ($db->num_rows() == 0) { - $msg->raise('Error', "mem", _("User or password incorrect")); + $msg->raise("ERROR", "mem", _("User or password incorrect")); return false; } $db->next_record(); if (_md5cr($password, $db->f("pass")) != $db->f("pass")) { $db->query("UPDATE membres SET lastfail=lastfail+1 WHERE uid= ? ;", array($db->f("uid"))); - $msg->raise('Error', "mem", _("User or password incorrect")); + $msg->raise("ERROR", "mem", _("User or password incorrect")); return false; } if (!$db->f("enabled")) { - $msg->raise('Error', "mem", _("This account is locked, contact the administrator.")); + $msg->raise("ERROR", "mem", _("This account is locked, contact the administrator.")); return false; } $this->user = $db->Record; $cuid = $db->f("uid"); if (panel_islocked() && $cuid != 2000) { - $msg->raise('Alert', "mem", _("This website is currently under maintenance, login is currently disabled.")); + $msg->raise("ALERT", "mem", _("This website is currently under maintenance, login is currently disabled.")); return false; } @@ -136,7 +136,7 @@ class m_mem { // Error if there is rules, the IP is not allowed and it's not in the whitelisted IP if (sizeof($aga) > 1 && !$allowed_ip && !$authip->is_wl(get_remote_ip())) { - $msg->raise('Error', "mem", _("Your IP isn't allowed to connect")); + $msg->raise("ERROR", "mem", _("Your IP isn't allowed to connect")); return false; } // End AuthIP @@ -183,7 +183,7 @@ class m_mem { $msg->log("mem", "setid", $id); $db->query("select * from membres where uid= ? ;", array($id)); if ($db->num_rows() == 0) { - $msg->raise('Error', "mem", _("User or password incorrect")); + $msg->raise("ERROR", "mem", _("User or password incorrect")); return false; } $db->next_record(); @@ -266,7 +266,7 @@ class m_mem { global $db, $msg, $cuid; if (isset($_REQUEST["username"])) { if (empty($_REQUEST['password'])) { - $msg->raise('Error', "mem", _("Missing password")); + $msg->raise("ERROR", "mem", _("Missing password")); return false; } if ($_REQUEST["username"] && $_REQUEST["password"]) { @@ -276,21 +276,21 @@ class m_mem { $_COOKIE["session"] = isset($_COOKIE["session"]) ? $_COOKIE["session"] : ""; if (strlen($_COOKIE["session"]) != 32) { if ($show_msg) - $msg->raise('Error', "mem", _("Identity lost or unknown, please login")); + $msg->raise("ERROR", "mem", _("Identity lost or unknown, please login")); return false; } $ip = get_remote_ip(); $db->query("select uid, ? as me,ip from sessions where sid= ?;", array($ip, $_COOKIE["session"])); if ($db->num_rows() == 0) { if ($show_msg) - $msg->raise('Error', "mem", _("Identity lost or unknown, please login")); + $msg->raise("ERROR", "mem", _("Identity lost or unknown, please login")); return false; } $db->next_record(); $cuid = $db->f("uid"); if (panel_islocked() && $cuid != 2000) { - $msg->raise('Alert', "mem", _("This website is currently under maintenance, login is currently disabled.")); + $msg->raise("ALERT", "mem", _("This website is currently under maintenance, login is currently disabled.")); return false; } @@ -320,7 +320,7 @@ class m_mem { } $db->query("select * from membres where uid= ? ;", array($uid)); if ($db->num_rows() == 0) { - $msg->raise('Error', "mem", _("User or password incorrect")); + $msg->raise("ERROR", "mem", _("User or password incorrect")); return false; } $db->next_record(); @@ -364,18 +364,18 @@ class m_mem { return true; } if (strlen($_COOKIE["session"]) != 32) { - $msg->raise('Error', "mem", _("Cookie incorrect, please accept the session cookie")); + $msg->raise("ERROR", "mem", _("Cookie incorrect, please accept the session cookie")); return false; } $ip = get_remote_ip(); $db->query("select uid, ? as me,ip from sessions where sid= ? ;", array($ip, $_COOKIE["session"])); if ($db->num_rows() == 0) { - $msg->raise('Error', "mem", _("Session unknown, contact the administrator")); + $msg->raise("ERROR", "mem", _("Session unknown, contact the administrator")); return false; } $db->next_record(); if ($db->f("me") != $db->f("ip")) { - $msg->raise('Error', "mem", _("IP address incorrect, please contact the administrator")); + $msg->raise("ERROR", "mem", _("IP address incorrect, please contact the administrator")); return false; } $cuid = $db->f("uid"); @@ -409,15 +409,15 @@ class m_mem { global $db, $msg, $cuid, $admin; $msg->log("mem", "passwd"); if (!$this->user["canpass"]) { - $msg->raise('Error', "mem", _("You are not allowed to change your password.")); + $msg->raise("ERROR", "mem", _("You are not allowed to change your password.")); return false; } if ($this->user["pass"] != _md5cr($oldpass, $this->user["pass"])) { - $msg->raise('Error', "mem", _("The old password is incorrect")); + $msg->raise("ERROR", "mem", _("The old password is incorrect")); return false; } if ($newpass != $newpass2) { - $msg->raise('Error', "mem", _("The new passwords are differents, please retry")); + $msg->raise("ERROR", "mem", _("The new passwords are differents, please retry")); return false; } $db->query("SELECT login FROM membres WHERE uid= ? ;", array($cuid)); @@ -442,7 +442,7 @@ class m_mem { global $db, $msg, $cuid; $msg->log("mem", "admlist"); if (!$this->user["su"]) { - $msg->raise('Error', "mem", _("You must be a system administrator to do this.")); + $msg->raise("ERROR", "mem", _("You must be a system administrator to do this.")); return false; } $db->query("UPDATE membres SET admlist= ? WHERE uid= ?;", array($admlist, $cuid)); @@ -463,12 +463,12 @@ class m_mem { $msg->log("mem", "send_pass"); $db->query("SELECT * FROM membres WHERE login= ? ;", array($login)); if (!$db->num_rows()) { - $msg->raise('Error', "mem", _("This account is locked, contact the administrator.")); + $msg->raise("ERROR", "mem", _("This account is locked, contact the administrator.")); return false; } $db->next_record(); if (time() - $db->f("lastaskpass") < 86400) { - $msg->raise('Error', "mem", _("The new passwords are differents, please retry")); + $msg->raise("ERROR", "mem", _("The new passwords are differents, please retry")); return false; } $txt = sprintf(_("Hello, @@ -507,7 +507,7 @@ Cordially. $msg->log("mem", "changemail1", $newmail); $db->query("SELECT * FROM membres WHERE uid= ? ;", array($cuid)); if (!$db->num_rows()) { - $msg->raise('Error', "mem", _("This account is locked, contact the administrator.")); + $msg->raise("ERROR", "mem", _("This account is locked, contact the administrator.")); return false; } $db->next_record(); @@ -559,7 +559,7 @@ Cordially. $msg->log("mem", "changemail2", $uid); $db->query("SELECT * FROM chgmail WHERE cookie= ? and ckey= ? and uid= ?;", array($COOKIE, $KEY, $uid)); if (!$db->num_rows()) { - $msg->raise('Error', "mem", _("The information you entered is incorrect.")); + $msg->raise("ERROR", "mem", _("The information you entered is incorrect.")); return false; } $db->next_record(); diff --git a/bureau/class/m_messages.php b/bureau/class/m_messages.php index 2b770306..10f43eb4 100644 --- a/bureau/class/m_messages.php +++ b/bureau/class/m_messages.php @@ -37,15 +37,15 @@ class m_messages { var $logfile = "/var/log/alternc/bureau.log"; - /** List of possible message types */ - var $ARRTYPES = array("ERROR", "ALERT", "INFO", "OK"); + /** List of possible message level */ + var $ARRLEVEL = array("ERROR", "ALERT", "INFO"); - /** CSS classes for each type */ + /** CSS classes for each level */ var $ARRCSS = array( + // emergency critical warning notice debug : currently not used (from PSR-3) "ERROR" => "alert-danger", "ALERT" => "alert-warning", - "INFO" => "alert-info", - "OK" => "alert-success" + "INFO" => "alert-success", ); public function __construct() { @@ -61,25 +61,25 @@ class m_messages { * @param string $cat The category of the msg array to work with * @param integer $clsid Which class raises this message * @param mixed $msg The message - * @param string $param Non-mandatory string parameter for this message + * @param array $param Non-mandatory array of string parameter for this message * @return boolean TRUE if the message got recorded, FALSE if not. * */ - function raise($cat = "Error", $clsid, $msg, $param = "") { + function raise($level = "ERROR", $clsid, $msg, $param = "") { $arrInfos = array(); - $type = strtoupper($cat); - if (! in_array($type, $this->ARRTYPES)) { - return false; + $level = strtoupper($level); + if (! in_array($level, $this->ARRLEVEL)) { + throw new Exception('Missing or unknown level in a raise() call'); } $arrInfos['clsid'] = $clsid; $arrInfos['msg'] = $msg; $arrInfos['param'] = is_array($param)?$param:(empty($param)?"":array($param)); - $this->arrMessages[$type][] = $arrInfos; + $this->arrMessages[$level][] = $arrInfos; - $this->logAlternC($cat); + $this->logAlternC($level,$arrInfos); return true; } @@ -87,7 +87,7 @@ class m_messages { * Reset the stored messages array */ function init_msgs() { - foreach ($this->ARRTYPES as $v) { + foreach ($this->ARRLEVEL as $v) { $this->arrMessages[$v] = array(); } } @@ -96,14 +96,14 @@ class m_messages { * Tell if there are stored messages for a specific level * or for all levels (if level is empty) * - * @param string $cat The level of the msg array to work with + * @param string $level The level of the msg array to work with (if empty or not set, use all levels) * @return boolean TRUE if there is/are msg recorded. * */ - function has_msgs($cat) { - $type = strtoupper($cat); - if (in_array($type, $this->ARRTYPES)) { - return (count($this->arrMessages[$type]) > 0); + function has_msgs($level="") { + $level = strtoupper($level); + if (in_array($level, $this->ARRLEVEL)) { + return (count($this->arrMessages[$level]) > 0); } else { foreach ($this->arrMessages as $v) { if (count($v) > 0) @@ -117,48 +117,39 @@ class m_messages { * Return a string of concateneted messages of all recorded messages * or only the last message * - * @param string $cat The level of the msg array to work with - * @param string $sep The separator used to concatenate msgs + * @param string $level The level of the msg array to work with * @param boolean $all show all the messages or only the last one - * + * + * @access private * @return string Message. * */ - function msg_str($cat = "Error", $sep = "
  • ", $all = true) { + function msg_str($level = "ERROR", $all = true) { $str = ""; - $type = strtoupper($cat); - if (! in_array($type, $this->ARRTYPES)) { - return false; + $level = strtoupper($level); + if (! in_array($level, $this->ARRLEVEL)) { + throw new Exception('Missing or unknown level in a raise() call'); } - if (! $this->has_msgs($cat)) + if (! $this->has_msgs($level)) return ""; if ($all) { - foreach ($this->arrMessages[$type] as $k => $arrMsg) { + foreach ($this->arrMessages[$level] as $k => $arrMsg) { $args = $arrMsg['param']; if (is_array($args) && count($args) > 0) { array_unshift($args, $arrMsg['msg']); - if ($sep == "
  • ") - $str .= "
  • " . call_user_func_array("sprintf", $args) . "
  • "; - else - $str .= call_user_func_array("sprintf", $args) . $sep; + $str .= call_user_func_array("sprintf", $args) . "\n"; } else - if ($sep == "
  • ") - $str .= "
  • " . $arrMsg['msg'] . "
  • "; - else - $str .= $arrMsg['msg'] . $sep; + $str .= $arrMsg['msg'] . "\n"; } - if ($sep == "
  • ") - $str = "
      ".$str."
    "; - } else { - $i = count($this->arrMessages[$type]) - 1; + $i = count($this->arrMessages[$level]) - 1; if ($i > 0) { - $arr_msg=$this->arrMessages[$type][$i]; + $arr_msg=$this->arrMessages[$level][$i]; $args = $arr_msg['param']; if (is_array($args) && count($args) > 0) { array_unshift($args, $arr_msg['msg']); @@ -174,23 +165,23 @@ class m_messages { /** * Return a message in HTML form with associated CSS * - * @param string $cat The level of the msg array to work with + * @param string $level The level of the msg array to work with * @param string $sep The separator used to concatenate msgs * @param boolean $all show all the messages or only the last one * * @return string HTML message */ - function msg_html($cat = "Error", $sep = "
  • ", $all = true) { - $type = strtoupper($cat); - if (! in_array($type, $this->ARRTYPES)) { - return false; + function msg_html($level = "ERROR", $all = true) { + $level = strtoupper($level); + if (! in_array($level, $this->ARRLEVEL)) { + throw new Exception('Missing or unknown level in a raise() call'); } - if (count($this->arrMessages[$type]) == 0) + if (count($this->arrMessages[$level]) == 0) return ""; - $str = $this->msg_str($cat, $sep, $all); - $str = "
    " . $str . "
    "; + $str = $this->msg_str($level, $all); + $str = "
    " . nl2br($str) . "
    "; return $str; } @@ -203,13 +194,12 @@ class m_messages { * * @return string HTML message */ - function msg_html_all($sep = "
  • ", $all = true, $init = false) { + function msg_html_all($all = true, $init = false) { $msg=""; - $msg.=$this->msg_html("Error", $sep, $all); - $msg.=$this->msg_html("Ok", $sep, $all); - $msg.=$this->msg_html("Info", $sep, $all); - $msg.=$this->msg_html("Alert", $sep, $all); + $msg.=$this->msg_html("ERROR", $all); + $msg.=$this->msg_html("INFO", $all); + $msg.=$this->msg_html("ALERT", $all); if ($init) $this->init_msgs(); @@ -223,17 +213,26 @@ class m_messages { * This function logs the last message in the /var/log/alternc folder * allowing sysadmins to know what's happened. * automatically called by raise() + * @param string $level the error level + * @param array $arrMsg the array containing message info. * @access private */ - function logAlternC($cat = "Error") { + function logAlternC($level = "ERROR", $arrMsg) { global $mem; + + $args = $arrMsg['param']; + + if (is_array($args) && count($args) > 0) { + array_unshift($args, $arrMsg['msg']); + $str = call_user_func_array("sprintf", $args); + } else + $str = $arrMsg['msg']; - $type = strtoupper($cat); - if (! in_array($type, $this->ARRTYPES)) { - return false; - } - - @file_put_contents($this->logfile, date("d/m/Y H:i:s") . " - " . get_remote_ip() . " - $type - " . $mem->user["login"] . " - " . $this->msg_str($cat, "", false), FILE_APPEND); + @file_put_contents( + $this->logfile, + date("d/m/Y H:i:s") . " - " . get_remote_ip() . " - $level - " . $mem->user["login"] . " - " . $str, + FILE_APPEND + ); } /** @@ -249,7 +248,11 @@ class m_messages { */ function log($clsid, $function, $param = "") { global $mem; - return @file_put_contents($this->logfile, date("d/m/Y H:i:s") . " - " . get_remote_ip() . " - CALL - " . $mem->user["login"] . " - $clsid - $function - $param\n", FILE_APPEND); + return @file_put_contents( + $this->logfile, + date("d/m/Y H:i:s") . " - " . get_remote_ip() . " - CALL - " . $mem->user["login"] . " - $clsid - $function - $param\n", + FILE_APPEND + ); } } diff --git a/bureau/class/m_mysql.php b/bureau/class/m_mysql.php index cd5687d8..6b7a6d7c 100644 --- a/bureau/class/m_mysql.php +++ b/bureau/class/m_mysql.php @@ -47,7 +47,7 @@ class DB_users extends DB_Sql { $db->query("select db_servers.* from db_servers, membres where membres.uid= ? and membres.db_server_id=db_servers.id;", array($cuid)); if (!$db->next_record()) { - $msg->raise('Error', 'db_user', _("There are no databases in db_servers for this user. Please contact your administrator.")); + $msg->raise("ERROR", 'db_user', _("There are no databases in db_servers for this user. Please contact your administrator.")); die(); } @@ -167,7 +167,7 @@ class m_mysql { $msg->log("mysql", "php_myadmin_connect"); $db->query("SELECT dbu.name,dbu.password, dbs.host FROM dbusers dbu, db_servers dbs, membres m WHERE dbu.uid= ? and enable='ADMIN' and dbs.id=m.db_server_id and m.uid= ? ;", array($cuid, $cuid)); if (!$db->num_rows()) { - $msg->raise('Error', "mysql", _("Cannot connect to PhpMyAdmin")); + $msg->raise("ERROR", "mysql", _("Cannot connect to PhpMyAdmin")); return false; } $db->next_record(); @@ -208,7 +208,7 @@ class m_mysql { $size = $this->get_db_size($dbname); $db->query("SELECT login,pass,db, bck_mode, bck_gzip, bck_dir, bck_history FROM db WHERE uid= ? AND db= ?;", array($cuid, $dbname)); if (!$db->num_rows()) { - $msg->raise('Error', "mysql", _("Database %s not found"), $dbn); + $msg->raise("ERROR", "mysql", _("Database %s not found"), $dbn); return array("enabled" => false); } $db->next_record(); @@ -228,7 +228,7 @@ class m_mysql { $msg->log("mysql", "add_db", $dbn); $password_user = ""; if (!$quota->cancreate("mysql")) { - $msg->raise('Error', "mysql", _("Your databases quota is over. You cannot create more databases")); + $msg->raise("ERROR", "mysql", _("Your databases quota is over. You cannot create more databases")); return false; } $pos = strpos($dbn, '_'); @@ -239,23 +239,23 @@ class m_mysql { $dbname = $dbn; $dbn = $dbncomp[1]; if (empty($dbn)) { // If nothing after the '_' - $msg->raise('Error', "mysql", _("Database can't have empty suffix")); + $msg->raise("ERROR", "mysql", _("Database can't have empty suffix")); return false; } } if (!preg_match("#^[0-9a-z]*$#", $dbn)) { - $msg->raise('Error', "mysql", _("Database name can contain only letters and numbers")); + $msg->raise("ERROR", "mysql", _("Database name can contain only letters and numbers")); return false; } $len=variable_get("sql_max_database_length", 64); if (strlen($dbname) > $len) { - $msg->raise('Error', "mysql", _("Database name cannot exceed %d characters"), $len); + $msg->raise("ERROR", "mysql", _("Database name cannot exceed %d characters"), $len); return false; } $db->query("SELECT * FROM db WHERE db= ? ;", array($dbname)); if ($db->num_rows()) { - $msg->raise('Error', "mysql", _("Database %s already exists"), $dbn); + $msg->raise("ERROR", "mysql", _("Database %s already exists"), $dbn); return false; } @@ -270,13 +270,13 @@ class m_mysql { $password_user = create_pass(10, $passwd_classcount); if ($this->add_user($dbn, $password_user, $password_user)) { - $msg->raise('Info', "mysql", "L'utilisateur '$dbname' a été créé et les droits sur cette base de données lui ont été attribué."); + $msg->raise("INFO", "mysql", "L'utilisateur '$dbname' a été créé et les droits sur cette base de données lui ont été attribué."); } else { - $msg->raise('Alert', "mysql", "L'utilisateur '$dbname' n'a pas pu être créé.
    Allez à la page 'Utilisateurs Mysql' pour en créer manuellement.
    Et n'oubliez pas de lui donner les droits sur la base de données."); + $msg->raise("ALERT", "mysql", "L'utilisateur '$dbname' n'a pas pu être créé.
    Allez à la page 'Utilisateurs Mysql' pour en créer manuellement.
    Et n'oubliez pas de lui donner les droits sur la base de données."); } } } else { - $msg->raise('Alert', "mysql", "L'utilisateur '$dbname' n'a pas été automatiquement créé car il dépasse la limite de taille pour les utilisateurs qui est à $len
    Allez à la page 'Utilisateurs Mysql' pour en créer un avec le nom que vous voulez.
    Et n'oubliez pas de lui donner les droits sur la base de données."); + $msg->raise("ALERT", "mysql", "L'utilisateur '$dbname' n'a pas été automatiquement créé car il dépasse la limite de taille pour les utilisateurs qui est à $len
    Allez à la page 'Utilisateurs Mysql' pour en créer un avec le nom que vous voulez.
    Et n'oubliez pas de lui donner les droits sur la base de données."); } //checking for the phpmyadmin user @@ -286,7 +286,7 @@ class m_mysql { $myadm = $db->f("name"); $password = $db->f("password"); } else { - $msg->raise('Error', "mysql", _("There is a problem with the special PhpMyAdmin user. Contact the administrator")); + $msg->raise("ERROR", "mysql", _("There is a problem with the special PhpMyAdmin user. Contact the administrator")); return false; } @@ -305,7 +305,7 @@ class m_mysql { return true; } else { $msg->log("mysql", "add_db", $dbn); - $msg->raise('Error', "mysql", _("An error occured. The database could not be created")); + $msg->raise("ERROR", "mysql", _("An error occured. The database could not be created")); return false; } } @@ -322,7 +322,7 @@ class m_mysql { $msg->log("mysql", "del_db", $dbname); $db->query("SELECT uid FROM db WHERE db= ?;", array($dbname)); if (!$db->next_record()) { - $msg->raise('Error', "mysql", _("The database was not found. I can't delete it")); + $msg->raise("ERROR", "mysql", _("The database was not found. I can't delete it")); return false; } @@ -358,7 +358,7 @@ class m_mysql { $msg->log("mysql", "put_mysql_backup"); if (!variable_get('sql_allow_users_backups')) { - $msg->raise('Error', "mysql", _("User aren't allowed to configure their backups")); + $msg->raise("ERROR", "mysql", _("User aren't allowed to configure their backups")); return false; } @@ -371,12 +371,12 @@ class m_mysql { $dbn = $dbncomp[1]; } if (!preg_match("#^[0-9a-z]*$#", $dbn)) { - $msg->raise('Error', "mysql", _("Database name can contain only letters and numbers")); + $msg->raise("ERROR", "mysql", _("Database name can contain only letters and numbers")); return false; } $db->query("SELECT * FROM db WHERE uid= ? AND db= ? ;", array($cuid, $dbname)); if (!$db->num_rows()) { - $msg->raise('Error', "mysql", _("Database %s not found"), $dbn); + $msg->raise("ERROR", "mysql", _("Database %s not found"), $dbn); return false; } $db->next_record(); @@ -391,11 +391,11 @@ class m_mysql { $bck_mode = "0"; } if (!$bck_history) { - $msg->raise('Alert', "mysql", _("You have to choose how many backups you want to keep")); + $msg->raise("ALERT", "mysql", _("You have to choose how many backups you want to keep")); return false; } if (($bck_dir = $bro->convertabsolute($bck_dir, 0)) === false) { // return a full path or FALSE - $msg->raise('Error', "mysql", _("Directory does not exist")); + $msg->raise("ERROR", "mysql", _("Directory does not exist")); return false; } $db->query("UPDATE db SET bck_mode= ? , bck_history= ?, bck_gzip= ?, bck_dir= ? WHERE uid= ? AND db= ? ;", array($bck_mode, $bck_history, $bck_gzip, $bck_dir, $cuid, $dbname)); @@ -413,20 +413,20 @@ class m_mysql { $msg->log("mysql", "put_mysql_details"); $db->query("SELECT * FROM db WHERE uid= ?;", array($cuid)); if (!$db->num_rows()) { - $msg->raise('Error', "mysql", _("Database not found")); + $msg->raise("ERROR", "mysql", _("Database not found")); return false; } $db->next_record(); $login = $db->f("login"); if (!$password) { - $msg->raise('Error', "mysql", _("The password is mandatory")); + $msg->raise("ERROR", "mysql", _("The password is mandatory")); return false; } $len=variable_get("sql_max_username_length", 16); if (strlen($password) > $len) { - $msg->raise('Error', "mysql", _("MySQL password cannot exceed %d characters"), $len); + $msg->raise("ERROR", "mysql", _("MySQL password cannot exceed %d characters"), $len); return false; } @@ -456,28 +456,28 @@ class m_mysql { $msg->log("mysql", "grant", $base . "-" . $rights . "-" . $user); if (!preg_match("#^[0-9a-z_\\*\\\\]*$#", $base)) { - $msg->raise('Error', "mysql", _("Database name can contain only letters and numbers")); + $msg->raise("ERROR", "mysql", _("Database name can contain only letters and numbers")); return false; } elseif (!$this->dbus->query("select db from db where db= ?;", array($base))) { - $msg->raise('Error', "mysql", _("Database not found")); + $msg->raise("ERROR", "mysql", _("Database not found")); return false; } if ($rights == null) { $rights = 'ALL PRIVILEGES'; } elseif (!preg_match("#^[a-zA-Z,\s]*$#", $rights)) { - $msg->raise('Error', "mysql", _("Databases rights are not correct")); + $msg->raise("ERROR", "mysql", _("Databases rights are not correct")); return false; } if (!preg_match("#^[0-9a-z]#", $user)) { - $msg->raise('Error', "mysql", _("The username can contain only letters and numbers.")); + $msg->raise("ERROR", "mysql", _("The username can contain only letters and numbers.")); return false; } $db->query("select name from dbusers where name= ? ;", array($user)); if (!$db->num_rows()) { - $msg->raise('Error', "mysql", _("Database user not found")); + $msg->raise("ERROR", "mysql", _("Database user not found")); return false; } @@ -490,7 +490,7 @@ class m_mysql { } if (!$this->dbus->query($grant)) { - $msg->raise('Error', "mysql", _("Could not grant rights")); + $msg->raise("ERROR", "mysql", _("Could not grant rights")); return false; } return true; @@ -507,18 +507,18 @@ class m_mysql { function restore($file, $stdout, $id) { global $msg, $bro; if (empty($file)) { - $msg->raise('Error', "mysql", _("No file specified")); + $msg->raise("ERROR", "mysql", _("No file specified")); return false; } if (!$r = $this->get_mysql_details($id)) { return false; } if (!($fi = $bro->convertabsolute($file, 0))) { - $msg->raise('Error', "mysql", _("File not found")); + $msg->raise("ERROR", "mysql", _("File not found")); return false; } if (!file_exists($fi)) { - $msg->raise('Error', "mysql", _("File not found")); + $msg->raise("ERROR", "mysql", _("File not found")); return false; } @@ -602,7 +602,7 @@ class m_mysql { $this->dbus->query("Select * from mysql.db where Db= ? and User!= ? ;", array($dbn, $cuid."_myadm")); if (!$this->dbus->num_rows()) { - $msg->raise('Error', "mysql",_("Database not found")); + $msg->raise("ERROR", "mysql",_("Database not found")); return false; } @@ -626,12 +626,12 @@ class m_mysql { } if (!$db->query("SELECT name,password from dbusers where name= ? ;", array($dbu))) { - $msg->raise('Error', "mysql",_("Database not found")." (3)"); + $msg->raise("ERROR", "mysql",_("Database not found")." (3)"); return false; } if (!$db->num_rows()) { - $msg->raise('Error', "mysql",_("Database not found")." (4)"); + $msg->raise("ERROR", "mysql",_("Database not found")." (4)"); return false; } @@ -666,31 +666,31 @@ class m_mysql { $user = $usern; } if (!$usern) { - $msg->raise('Alert', "mysql", _("The username is mandatory")); + $msg->raise("ALERT", "mysql", _("The username is mandatory")); return false; } if (!$password) { - $msg->raise('Alert', "mysql", _("The password is mandatory")); + $msg->raise("ALERT", "mysql", _("The password is mandatory")); return false; } if (!preg_match("#^[0-9a-z]#", $usern)) { - $msg->raise('Error', "mysql", _("The username can contain only letters and numbers")); + $msg->raise("ERROR", "mysql", _("The username can contain only letters and numbers")); return false; } // We check the length of the COMPLETE username, not only the part after _ $len=variable_get("sql_max_username_length", 16); if (strlen($user) > $len) { - $msg->raise('Error', "mysql", _("MySQL username cannot exceed %d characters"), $len); + $msg->raise("ERROR", "mysql", _("MySQL username cannot exceed %d characters"), $len); return false; } $db->query("SELECT * FROM dbusers WHERE name= ? ;", array($user)); if ($db->num_rows()) { - $msg->raise('Error', "mysql", _("The database user already exists")); + $msg->raise("ERROR", "mysql", _("The database user already exists")); return false; } if ($password != $passconf || !$password) { - $msg->raise('Error', "mysql", _("The passwords do not match")); + $msg->raise("ERROR", "mysql", _("The passwords do not match")); return false; } @@ -723,7 +723,7 @@ class m_mysql { $usern = trim($usern); if ($password != $passconf || !$password) { - $msg->raise('Error', "mysql", _("The passwords do not match")); + $msg->raise("ERROR", "mysql", _("The passwords do not match")); return false; } @@ -750,7 +750,7 @@ class m_mysql { global $db, $msg, $cuid; $msg->log("mysql", "del_user", $user); if (!preg_match("#^[0-9a-z]#", $user)) { - $msg->raise('Error', "mysql", _("The username can contain only letters and numbers")); + $msg->raise("ERROR", "mysql", _("The username can contain only letters and numbers")); return false; } if (!$all) { @@ -762,7 +762,7 @@ class m_mysql { $backtrace = debug_backtrace(); if (!$db->num_rows()) { if ($backtrace[1]["function"] != "del_db") - $msg->raise('Error', "mysql", _("The username was not found")); + $msg->raise("ERROR", "mysql", _("The username was not found")); return false; } @@ -795,7 +795,7 @@ class m_mysql { $this->dbus->query("SELECT * FROM mysql.user WHERE User= ? AND Host= ? ;", array($user, $this->dbus->Client)); if (!$this->dbus->next_record()) { - $msg->raise('Error', 'mysql', _("This user does not exist in the MySQL/User database")); + $msg->raise("ERROR", 'mysql', _("This user does not exist in the MySQL/User database")); return false; } @@ -1060,7 +1060,7 @@ class m_mysql { $dir.="sql/"; if (!is_dir($dir)) { if (!mkdir($dir)) { - $msg->raise('Error', 'mysql', _("The directory could not be created")); + $msg->raise("ERROR", 'mysql', _("The directory could not be created")); } } // on exporte toutes les bases utilisateur. diff --git a/bureau/class/m_piwik.php b/bureau/class/m_piwik.php index 4e5e5809..cb116f2f 100644 --- a/bureau/class/m_piwik.php +++ b/bureau/class/m_piwik.php @@ -102,13 +102,13 @@ class m_piwik { $msg->log("piwik","user_add"); if (empty($user_login) || is_null($user_login) || empty($user_mail) || is_null($user_mail)) { - $msg->raise('Error', "piwik", _("All fields are mandatory")); + $msg->raise("ERROR", "piwik", _("All fields are mandatory")); return false; } // Validate the email syntax: if (!filter_var($user_mail, FILTER_VALIDATE_EMAIL)) { - $msg->raise('Error', "piwik", _("The email you entered is syntaxically incorrect")); + $msg->raise("ERROR", "piwik", _("The email you entered is syntaxically incorrect")); return false; } @@ -124,7 +124,7 @@ class m_piwik { $ret_value = $db->query("INSERT INTO piwik_users (uid, passwd, login, created_date) VALUES ( ?, ?, ?, ?);", array($cuid, md5('$user_pass'), $user_login, $user_creation_date)); return $ret_value; } else { - $msg->raise('Error', "piwik", $api_data->message); + $msg->raise("ERROR", "piwik", $api_data->message); return FALSE; } } else { // api_data = false -> error is already filled @@ -149,11 +149,11 @@ class m_piwik { $msg->log("piwik","get_users_access_from_site"); if (!is_numeric($site_id)) { - $msg->raise('Error', 'piwik', 'site_id must be numeric'); + $msg->raise("ERROR", 'piwik', 'site_id must be numeric'); return FALSE; } if (!in_array($site_id, $this->alternc_sites)) { - $msg->raise('Error', 'piwik', "you don't own this piwik website"); + $msg->raise("ERROR", 'piwik', "you don't own this piwik website"); return FALSE; } @@ -256,7 +256,7 @@ class m_piwik { return FALSE; } } else { - $msg->raise('Error', "piwik", _("You are not allowed to delete the statistics of this website")); + $msg->raise("ERROR", "piwik", _("You are not allowed to delete the statistics of this website")); return FALSE; } } @@ -410,7 +410,7 @@ class m_piwik { return FALSE; } } else { - $msg->raise('Error', "piwik", _("You are not allowed to delete the statistics of this website")); + $msg->raise("ERROR", "piwik", _("You are not allowed to delete the statistics of this website")); return FALSE; } @@ -430,7 +430,7 @@ class m_piwik { if ($api_data->result == 'success') { return TRUE; } else { - $msg->raise('Error', 'piwik', $api_data->messsage); + $msg->raise("ERROR", 'piwik', $api_data->messsage); return FALSE; } } @@ -472,20 +472,20 @@ class m_piwik { $page_content = file_get_contents($url); if ($page_content === FALSE) { - $msg->raise('Error', "piwik", _("Unable to reach the API")); + $msg->raise("ERROR", "piwik", _("Unable to reach the API")); return FALSE; } if ($output == 'JSON') { $api_data = json_decode($page_content); if ($api_data === FALSE) { - $msg->raise('Error', "piwik", _("Error while decoding response from the API")); + $msg->raise("ERROR", "piwik", _("Error while decoding response from the API")); return FALSE; } return $api_data; } else { - $msg->raise('Error', "piwik", _("Other format than JSON is not implemented yet")); + $msg->raise("ERROR", "piwik", _("Other format than JSON is not implemented yet")); return FALSE; } } diff --git a/bureau/class/m_quota.php b/bureau/class/m_quota.php index 8a925993..c0eb8ea6 100644 --- a/bureau/class/m_quota.php +++ b/bureau/class/m_quota.php @@ -266,7 +266,7 @@ class m_quota { $a = array(); exec("sudo /usr/lib/alternc/quota_get " . intval($cuid) . " &> /dev/null &", $a); if (!isset($a[1]) || $size != $a[1]) { - $msg->raise('Error', "quota", _("Error writing the quota entry!")); + $msg->raise("ERROR", "quota", _("Error writing the quota entry!")); return false; } } @@ -348,7 +348,7 @@ class m_quota { } $type = strtolower($type); if (!preg_match("#^[a-z0-9]*$#", $type)) { - $msg->raise('Error', "quota", _("Type can only contains characters a-z and 0-9")); + $msg->raise("ERROR", "quota", _("Type can only contains characters a-z and 0-9")); return false; } while (list($key, $val) = each($qlist)) {