0
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2024-09-19 19:22:14 +02:00

Finally get rid of variables.inc.php

Initialize $error and $tMailbox where needed.

The other variables in variables.inc.php are already initialized
everywhere.
This commit is contained in:
Christian Boltz 2017-04-10 20:54:34 +02:00
parent 1ec2ec1199
commit 9df6de65af
No known key found for this signature in database
GPG Key ID: C6A682EA63C82F1C
7 changed files with 10 additions and 34 deletions

View File

@ -34,6 +34,8 @@ if ($CONF['sendmail'] != 'YES') {
exit;
}
$error = 0;
$smtp_from_email = smtp_get_admin_email();
if ($_SERVER['REQUEST_METHOD'] == "POST")

View File

@ -60,8 +60,6 @@ function postfixadmin_autoload($class) {
}
spl_autoload_register('postfixadmin_autoload');
require_once("$incpath/variables.inc.php");
if(!is_file("$incpath/config.inc.php")) {
die("config.inc.php is missing!");
}

View File

@ -212,17 +212,18 @@ $query = "$sql_select\n$mailbox_pagebrowser_query\n$sql_limit";
$result = db_query ($query);
$tMailbox = array();
if ($result['rows'] > 0) {
$delimiter = preg_quote($CONF['recipient_delimiter'], "/");
$goto_single_rec_del = "";
$tMailbox = array();
while ($row = db_array ($result['result'])) {
if ($display_mailbox_aliases) {
$goto_split = explode(",", $row['goto']);
$row['goto_mailbox'] = 0;
$row['goto_other'] = array();
foreach ($goto_split as $goto_single) {
if (!empty($CONF['recipient_delimiter'])) {
$goto_single_rec_del = preg_replace('/' .$delimiter. '[^' .$delimiter. '@]*@/', "@", $goto_single);

View File

@ -51,6 +51,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
$tBody = stripslashes($tBody); # TODO: check for get_magic_quotes_gpc inside safepost/safeget
}
$error = 0;
$email_check = check_email ($fTo);
if (empty ($fTo) or ($email_check != ''))
{

View File

@ -67,6 +67,8 @@ if($CONF['vacation'] == 'NO') {
date_default_timezone_set(@date_default_timezone_get()); # Suppress date.timezone warnings
$error = 0;
$vh = new VacationHandler($fUsername);
$choice_of_reply = Config::read('vacation_choice_of_reply');

View File

@ -1,30 +0,0 @@
<?php
/**
* Postfix Admin
*
* LICENSE
* This source file is subject to the GPL license that is bundled with
* this package in the file LICENSE.TXT.
*
* Further details on the project are available at http://postfixadmin.sf.net
*
* @version $Id$
* @license GNU GPL v2 or later.
*
* File: variables.inc.php
* Contains varoius pre-defined variables.
*
* XXX Probably a hack to save having to declare variables before using them in pages.
*
* TODO: get rid of the remaining variables declared here!
*/
$error = "";
$fPassword = "";
$fWhere = "";
$tAlias = "";
$tDescription = "";
$tMailbox = "";
/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */
?>

View File

@ -37,6 +37,8 @@ else {
}
$fDomain = '';
$error = 0;
if ($_SERVER['REQUEST_METHOD'] == "GET")
{
if ((is_array ($list_domains) and sizeof ($list_domains) > 0)) $fDomain = $list_domains[0];