diff --git a/create-alias-domain.php b/create-alias-domain.php
index fdc52dac..5096ee39 100644
--- a/create-alias-domain.php
+++ b/create-alias-domain.php
@@ -19,7 +19,7 @@
*
* Template Variables:
*
- * tMessage
+ * none
*
* Form POST \ GET Variables:
*
@@ -66,9 +66,10 @@ foreach ($list_domains as $dom) {
if (isset($list_aliases[$dom]) || in_array($dom,$list_aliases)) continue;
$alias_domains[] = $dom;
}
+
if (count($alias_domains) == 0) {
$error = 1;
- $tMessage = $PALANG['pCreate_alias_domain_error4'];
+ flash_error($PALANG['pCreate_alias_domain_error4']);
}
# filter available target domains
@@ -102,7 +103,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
check_owner ($SESSID_USERNAME, $fTargetDomain)))
{
$error = 1;
- $tMessage = $PALANG['pCreate_alias_domain_error1'];
+ flash_error($PALANG['pCreate_alias_domain_error1']);
}
if (isset($list_aliases[$fAliasDomain]) || // alias_domain is unique (primary key, a domain can't be an alias for multiple others)
@@ -112,7 +113,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
empty($fAliasDomain) || empty($fTargetDomain)) // explain this, do i?
{
$error = 1;
- $tMessage = $PALANG['pCreate_alias_domain_error2'];
+ flash_error($PALANG['pCreate_alias_domain_error2']);
}
$sqlActive = db_get_boolean($fActive);
@@ -121,7 +122,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
$result = db_query ("INSERT INTO $table_alias_domain (alias_domain,target_domain,created,modified,active) VALUES ('$fAliasDomain','$fTargetDomain',NOW(),NOW(),'$sqlActive')");
if ($result['rows'] != 1) {
$error = 1;
- $tMessage = $PALANG['pCreate_alias_domain_error3'];
+ flash_error($PALANG['pCreate_alias_domain_error3']);
}
else {
db_log ($fAliasDomain, 'create_alias_domain', "$fAliasDomain -> $fTargetDomain");
@@ -133,14 +134,14 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
}
}
- $tMessage .= "
($fAliasDomain -> $fTargetDomain)
\n";
+ flash_info("
($fAliasDomain -> $fTargetDomain)
\n");
}
+
+
$smarty->assign ('alias_domains', (count($alias_domains) > 0));
$smarty->assign ('select_options_alias', select_options ($alias_domains, array ($fAliasDomain)), false);
$smarty->assign ('select_options_target', select_options ($target_domains, array ($fTargetDomain)), false);
if ($fActive) $smarty->assign ('fActive', ' checked="checked"');
-if ($error == 1) $tMessage = ''.$tMessage.'';
-$smarty->assign ('tMessage', $tMessage, false);
$smarty->assign ('smarty_template', 'create-alias-domain');
$smarty->display ('index.tpl');
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
diff --git a/edit-alias.php b/edit-alias.php
index 74715ba1..ea28ec64 100644
--- a/edit-alias.php
+++ b/edit-alias.php
@@ -19,7 +19,6 @@
*
* Template Variables:
*
- * tMessage
* tGoto
*
* Form POST \ GET Variables:
@@ -99,7 +98,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
{
$error = 1;
$tGoto = $fGoto;
- $tMessage = $PALANG['pEdit_alias_result_error'];
+ flash_error($PALANG['pEdit_alias_result_error']);
}
$goto = preg_replace ('/\\\r\\\n/', ',', $fGoto);
@@ -113,7 +112,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
{
$error = 1;
$tGoto = $_POST['fGoto'];
- $tMessage = $PALANG['pEdit_alias_goto_text_error1'];
+ flash_error($PALANG['pEdit_alias_goto_text_error1']);
}
$new_aliases = array();
@@ -130,8 +129,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
{
$error = 1;
$tGoto = $goto;
- if (!empty($tMessage)) $tMessage .= "
";
- $tMessage .= $PALANG['pEdit_alias_goto_text_error2'] . "$address";
+ flash_error($PALANG['pEdit_alias_goto_text_error2'] . "$address");
}
}
@@ -157,7 +155,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
$result = db_query ("UPDATE $table_alias SET goto='$goto',modified=NOW() WHERE address='$fAddress' AND domain='$fDomain'");
if ($result['rows'] != 1)
{
- $tMessage = $PALANG['pEdit_alias_result_error'];
+ flash_error($PALANG['pEdit_alias_result_error']);
}
else
{
@@ -174,7 +172,6 @@ $array = preg_split ('/,/', $tGoto);
$smarty->assign ('fAddress', $fAddress);
$smarty->assign ('tGoto', $tGoto);
$smarty->assign ('array', $array, false);
-$smarty->assign ('tMessage', $tMessage, false);
$smarty->assign ('smarty_template', 'edit-alias');
$smarty->display ('index.tpl');
diff --git a/edit-domain.php b/edit-domain.php
index 388f2232..bbd933e2 100644
--- a/edit-domain.php
+++ b/edit-domain.php
@@ -115,7 +115,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
header ("Location: list-domain.php");
exit;
} else {
- $tMessage = $PALANG['pAdminEdit_domain_result_error'];
+ flash_error($PALANG['pAdminEdit_domain_result_error']);
}
}
@@ -128,7 +128,6 @@ $smarty->assign ('tDomainquota', $tDomainquota);
$smarty->assign ('select_options', select_options($CONF['transport_options'], array($tTransport)), false);
if ($tBackupmx) $smarty->assign ('tBackupmx', ' checked="checked"');
if ($tActive) $smarty->assign ('tActive', ' checked="checked"');
-$smarty->assign ('tMessage', $tMessage,false);
$smarty->assign ('smarty_template', 'admin_edit-domain');
$smarty->display ('index.tpl');
diff --git a/edit-vacation.php b/edit-vacation.php
index a35f4210..5a1cebc1 100644
--- a/edit-vacation.php
+++ b/edit-vacation.php
@@ -20,7 +20,6 @@
* Template Variables:
*
* tUseremail
- * tMessage
* tSubject
* tBody
*
@@ -72,7 +71,6 @@ if ($_SERVER['REQUEST_METHOD'] == "GET")
if ($result['rows'] == 1)
{
$row = db_array($result['result']);
- $tMessage = '';
$tSubject = $row['subject'];
$tBody = $row['body'];
$tActiveFrom = $row['activefrom'];
@@ -137,14 +135,14 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
if($error == 0) {
if(!empty ($fBack)) {
- $tMessage = $PALANG['pVacation_result_removed'];
+ flash_info($PALANG['pVacation_result_removed']);
}
if(!empty($fChange)) {
- $tMessage= $PALANG['pVacation_result_added'];
+ flash_info($PALANG['pVacation_result_added']);
}
}
else {
- $tMessage = $PALANG['pVacation_result_error'];
+ flash_error($PALANG['pVacation_result_error']);
}
if (empty ($tActiveFrom))
$tActiveFrom = date ("Y-m-d");
@@ -154,7 +152,6 @@ if (empty ($tActiveUntil))
$smarty->assign ('tUseremail', $tUseremail);
$smarty->assign ('tSubject', $tSubject);
$smarty->assign ('tBody', $tBody ,false);
-$smarty->assign ('tMessage', $tMessage, false);
$smarty->assign ('tActiveFrom', date ("d.m.Y", strtotime ($tActiveFrom)));
$smarty->assign ('tActiveUntil', date ("d.m.Y", strtotime ($tActiveUntil)));
$smarty->assign ('fCanceltarget', $fCanceltarget);
diff --git a/password.php b/password.php
index 03eab9a0..8358456c 100644
--- a/password.php
+++ b/password.php
@@ -18,7 +18,7 @@
*
* Template Variables:
*
- * tMessage
+ * none
*
* Form POST \ GET Variables:
*
@@ -83,17 +83,16 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
$result = db_query ("UPDATE $table_admin SET password='$password',modified=NOW() WHERE username='$username'");
if ($result['rows'] == 1)
{
- $tMessage = $PALANG['pPassword_result_success'];
+ flash_info($PALANG['pPassword_result_success']);
}
else
{
- $tMessage = $PALANG['pPassword_result_error'];
+ flash_error($PALANG['pPassword_result_error']);
}
}
$smarty->assign ('pPassword_password_current_text', $pPassword_password_current_text);
$smarty->assign ('pPassword_password_text', $pPassword_password_text);
- $smarty->assign ('tMessage', $tMessage,false);
$smarty->display ('index.tpl');
}
diff --git a/viewlog.php b/viewlog.php
index e14406fe..09ac0b8b 100644
--- a/viewlog.php
+++ b/viewlog.php
@@ -19,7 +19,6 @@
*
* Template Variables:
*
- * tMessage
* tLog
*
* Form POST \ GET Variables:
@@ -50,7 +49,7 @@ if ($_SERVER['REQUEST_METHOD'] == "GET")
if (! (check_owner ($SESSID_USERNAME, $fDomain) || authentication_has_role('global-admin')))
{
$error = 1;
- $tMessage = $PALANG['pViewlog_result_error'];
+ flash_error($PALANG['pViewlog_result_error']);
}
// we need to initialize $tLog as an array!