diff --git a/admin/backup.php b/admin/backup.php index 4d0c5bb9..045995e7 100644 --- a/admin/backup.php +++ b/admin/backup.php @@ -1,22 +1,25 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: backup.php -// -// Template File: -none- -// -// Template Variables: -// -// -none- -// -// Form POST \ GET Variables: -// -// -none- -// +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: backup.php + * Used to save all settings - but only works for MySQL databases. + * Template File: -none- + * + * Template Variables: -none- + * + * Form POST \ GET Variables: -none- + */ require_once('../common.php'); diff --git a/admin/broadcast-message.php b/admin/broadcast-message.php index 46dc6ce2..5b9f8901 100644 --- a/admin/broadcast-message.php +++ b/admin/broadcast-message.php @@ -1,25 +1,30 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: broadcast-message.php -// -// Template File: broadcast-message.tpl -// -// Template Variables: -// -// -none- -// -// Form POST \ GET Variables: -// -// name -// subject -// message -// -// +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: broadcast-message.php + * Used to send a message to _ALL_ users with mailboxes on this server. + * + * Template File: broadcast-message.tpl + * + * Template Variables: -none- + * + * Form POST \ GET Variables: + * + * name + * subject + * message + */ require_once('../common.php'); diff --git a/admin/create-admin.php b/admin/create-admin.php index 54671d59..011252c1 100644 --- a/admin/create-admin.php +++ b/admin/create-admin.php @@ -1,28 +1,35 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: create-admin.php -// -// Template File: admin_create-admin.tpl -// -// -// Template Variables: -// -// tMessage -// tUsername -// tDomains -// -// Form POST \ GET Variables: -// -// fUsername -// fPassword -// fPassword2 -// fDomains -// +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: create-admin.php + * Used to create new administrators. + * Template File: admin_create-admin.tpl + * + * + * Template Variables: + * + * tMessage + * tUsername + * tDomains + * + * Form POST \ GET Variables: + * + * fUsername + * fPassword + * fPassword2 + * fDomains + */ require_once('../common.php'); diff --git a/admin/create-alias.php b/admin/create-alias.php index 74db0dca..a510c78d 100644 --- a/admin/create-alias.php +++ b/admin/create-alias.php @@ -1,28 +1,3 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: create-alias.php -// -// Template File: create-alias.tpl -// -// Template Variables: -// -// tMessage -// tAddress -// tGoto -// tDomain -// -// Form POST \ GET Variables: -// -// fAddress -// fGoto -// fDomain -// - require ("../create-alias.php"); - ?> diff --git a/admin/create-domain.php b/admin/create-domain.php index f54d3a7a..cb2ebfbf 100644 --- a/admin/create-domain.php +++ b/admin/create-domain.php @@ -1,33 +1,40 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: create-domain.php -// -// Template File: admin_create-domain.tpl -// -// Template Variables: -// -// tMessage -// tDomain -// tDescription -// tAliases -// tMailboxes -// tMaxquota -// tDefaultaliases -// -// Form POST \ GET Variables: -// -// fDomain -// fDescription -// fAliases -// fMailboxes -// fMaxquota -// fDefaultaliases -// +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: create-domain.php + * Allows administrators to create new domains. + * Template File: admin_create-domain.tpl + * + * Template Variables: + * + * tMessage + * tDomain + * tDescription + * tAliases + * tMailboxes + * tMaxquota + * tDefaultaliases + * + * Form POST \ GET Variables: + * + * fDomain + * fDescription + * fAliases + * fMailboxes + * fMaxquota + * fDefaultaliases + */ require_once('../common.php'); diff --git a/admin/create-mailbox.php b/admin/create-mailbox.php index d5ac78bd..4335a1e3 100644 --- a/admin/create-mailbox.php +++ b/admin/create-mailbox.php @@ -1,35 +1,3 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: create-mailbox.php -// -// Template File: create-mailbox.tpl -// -// Template Variables: -// -// tMessage -// tUsername -// tName -// tQuota -// tDomain -// -// Form POST \ GET Variables: -// -// fUsername -// fPassword -// fPassword2 -// fName -// fQuota -// fDomain -// fActive -// fMail -// - require ("../create-mailbox.php"); - -/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/admin/delete.php b/admin/delete.php index 2b539db0..dee87115 100644 --- a/admin/delete.php +++ b/admin/delete.php @@ -1,25 +1,33 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: delete.php -// -// Template File: message.tpl -// -// Template Variables: -// -// tMessage -// -// Form POST \ GET Variables: -// -// fTable -// fWhere -// fDelete -// fDomain -// +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: delete.php + * Used to delete a domain, mailbox or alias. + * + * Template File: message.tpl + * + * Template Variables: + * + * tMessage + * + * Form POST \ GET Variables: + * + * fTable + * fWhere + * fDelete + * fDomain + */ require_once('../common.php'); diff --git a/admin/edit-active-admin.php b/admin/edit-active-admin.php index ecb9cbac..bb71b5a4 100644 --- a/admin/edit-active-admin.php +++ b/admin/edit-active-admin.php @@ -1,22 +1,30 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: edit-active.php -// -// Template File: message.tpl -// -// Template Variables: -// -// tMessage -// -// Form POST \ GET Variables: -// -// fUsername -// +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: edit-active-admin.php + * Edit an active administrator. This is used as a 'toggle' page from list-admin. + * + * Template File: message.tpl + * + * Template Variables: + * + * tMessage + * + * Form POST \ GET Variables: + * + * fUsername + */ require_once('../common.php'); diff --git a/admin/edit-active-domain.php b/admin/edit-active-domain.php index 479167ff..90183d0e 100644 --- a/admin/edit-active-domain.php +++ b/admin/edit-active-domain.php @@ -1,22 +1,29 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: edit-active.php -// -// Template File: message.tpl -// -// Template Variables: -// -// tMessage -// -// Form POST \ GET Variables: -// -// fDomain -// +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: edit-active-domain.php + * Responsible for toggling the status of a domain + * Template File: message.tpl + * + * Template Variables: + * + * tMessage + * + * Form POST \ GET Variables: + * + * fDomain + */ require_once('../common.php'); diff --git a/admin/edit-active.php b/admin/edit-active.php index 8804f0fa..7a340316 100644 --- a/admin/edit-active.php +++ b/admin/edit-active.php @@ -1,25 +1,3 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: edit-active.php -// -// Template File: message.tpl -// -// Template Variables: -// -// tMessage -// -// Form POST \ GET Variables: -// -// fUsername -// fDomain -// - require("../edit-active.php"); - -/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/admin/edit-admin.php b/admin/edit-admin.php index f8c2ef84..aea99816 100644 --- a/admin/edit-admin.php +++ b/admin/edit-admin.php @@ -1,29 +1,37 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: edit-admin.php -// -// Template File: admin_edit-admin.tpl -// -// Template Variables: -// -// tAllDomains -// tDomains -// tActive -// tSadmin -// -// Form POST \ GET Variables: -// -// fDescription -// fAliases -// fMailboxes -// fMaxquota -// fActive -// +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: edit-admin.php + * Edits a normal administrator's details. + * + * Template File: admin_edit-admin.tpl + * + * Template Variables: + * + * tAllDomains + * tDomains + * tActive + * tSadmin + * + * Form POST \ GET Variables: + * + * fDescription + * fAliases + * fMailboxes + * fMaxquota + * fActive + */ require_once('../common.php'); diff --git a/admin/edit-alias.php b/admin/edit-alias.php index 156c04b7..0dc99975 100644 --- a/admin/edit-alias.php +++ b/admin/edit-alias.php @@ -1,26 +1,3 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: edit-alias.php -// -// Template File: edit-alias.tpl -// -// Template Variables: -// -// tMessage -// tGoto -// -// Form POST \ GET Variables: -// -// fAddress -// fDomain -// fGoto -// - require("../edit-alias.php"); - ?> diff --git a/admin/edit-domain.php b/admin/edit-domain.php index 30c32679..5b418018 100644 --- a/admin/edit-domain.php +++ b/admin/edit-domain.php @@ -1,30 +1,37 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: edit-domain.php -// -// Template File: admin_edit-domain.tpl -// -// Template Variables: -// -// tDescription -// tAliases -// tMailboxes -// tMaxquota -// tActive -// -// Form POST \ GET Variables: -// -// fDescription -// fAliases -// fMailboxes -// fMaxquota -// fActive -// +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: edit-domain.php + * Updates the properties of a domain. + * Template File: admin_edit-domain.tpl + * + * Template Variables: + * + * tDescription + * tAliases + * tMailboxes + * tMaxquota + * tActive + * + * Form POST \ GET Variables: + * + * fDescription + * fAliases + * fMailboxes + * fMaxquota + * fActive + */ require_once('../common.php'); diff --git a/admin/edit-mailbox.php b/admin/edit-mailbox.php index 84a4b3dc..34d83661 100644 --- a/admin/edit-mailbox.php +++ b/admin/edit-mailbox.php @@ -1,32 +1,3 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: edit-mailbox.php -// -// Template File: edit-mailbox.tpl -// -// Template Variables: -// -// tMessage -// tName -// tQuota -// -// Form POST \ GET Variables: -// -// fUsername -// fDomain -// fPassword -// fPassword2 -// fName -// fQuota -// fActive -// - require("../edit-mailbox.php"); - -/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/admin/edit-vacation.php b/admin/edit-vacation.php index 2ac56bb8..a83ebe3a 100644 --- a/admin/edit-vacation.php +++ b/admin/edit-vacation.php @@ -1,32 +1,3 @@ -// Copyright (c) 2002 - 2007 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: edit-vacation.php -// -// Template File: edit-vacation.tpl -// -// Template Variables: -// -// tMessage -// tSubject -// tBody -// -// Form POST \ GET Variables: -// -// fUsername -// fDomain -// fCanceltarget -// fChange -// fBack -// fQuota -// fActive -// -// - require ("../edit-vacation.php"); - ?> diff --git a/admin/index.php b/admin/index.php index 51a108ea..ec873602 100644 --- a/admin/index.php +++ b/admin/index.php @@ -1,22 +1,4 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: index.php -// -// Template File: -none- -// -// Template Variables: -// -// -none- -// -// Form POST \ GET Variables: -// -// -none- -// header ("Location: list-admin.php"); exit(0); ?> diff --git a/admin/list-admin.php b/admin/list-admin.php index abce095f..ae70e9ff 100644 --- a/admin/list-admin.php +++ b/admin/list-admin.php @@ -1,22 +1,25 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: list-admin.php -// -// Template File: list-admin.tpl -// -// Template Variables: -// -// -none- -// -// Form POST \ GET Variables: -// -// -none- -// +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: list-admin.php + * Lists all administrators + * Template File: list-admin.tpl + * + * Template Variables: -none- + * + * Form POST \ GET Variables: -none- + */ require_once("../common.php"); diff --git a/admin/list-domain.php b/admin/list-domain.php index 39040364..0a63f5b1 100644 --- a/admin/list-domain.php +++ b/admin/list-domain.php @@ -1,22 +1,29 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: list-domain.php -// -// Template File: admin_list-domain.tpl -// -// Template Variables: -// -// -none- -// -// Form POST \ GET Variables: -// -// fUsername -// +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: list-domain.php + * List all domains as a quick overview. + * Template File: admin_list-domain.tpl + * + * Template Variables: + * + * -none- + * + * Form POST \ GET Variables: + * + * fUsername + */ require_once('../common.php'); diff --git a/admin/list-virtual.php b/admin/list-virtual.php index d5f74e72..cae8676f 100644 --- a/admin/list-virtual.php +++ b/admin/list-virtual.php @@ -1,25 +1,33 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: list-virtual.php -// -// Template File: admin_list-virtual.tpl -// -// Template Variables: -// -// tMessage -// tAlias -// tMailbox -// -// Form POST \ GET Variables: -// -// fDomain -// fDisplay -// +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: list-virtual.php + * List virtual users for a domain. + * + * Template File: admin_list-virtual.tpl + * + * Template Variables: + * + * tMessage + * tAlias + * tMailbox + * + * Form POST \ GET Variables: + * + * fDomain + * fDisplay + */ require_once('../common.php'); diff --git a/admin/main.php b/admin/main.php index f5991be5..83a8e75a 100644 --- a/admin/main.php +++ b/admin/main.php @@ -1,22 +1,4 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: main.php -// -// Template File: -none- -// -// Template Variables: -// -// -none- -// -// Form POST \ GET Variables: -// -// -none- -// header ("Location: list-admin.php"); exit; ?> diff --git a/admin/search.php b/admin/search.php index 3e775375..f9b43dc2 100644 --- a/admin/search.php +++ b/admin/search.php @@ -1,25 +1,32 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: search.php -// -// Template File: search.tpl -// -// Template Variables: -// -// tAlias -// tMailbox -// -// Form POST \ GET Variables: -// -// search -// fDomain -// fGo -// +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: search.php + * Allows for search by e.g. name, mailbox name etc. + * Template File: search.tpl + * + * Template Variables: + * + * tAlias + * tMailbox + * + * Form POST \ GET Variables: + * + * search + * fDomain + * fGo + */ require_once('../common.php'); diff --git a/admin/viewlog.php b/admin/viewlog.php index 8b53b71b..6d8ebc2c 100644 --- a/admin/viewlog.php +++ b/admin/viewlog.php @@ -1,25 +1,3 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: viewlog.php -// -// Template File: viewlog.tpl -// -// Template Variables: -// -// tMessage -// tLog -// -// Form POST \ GET Variables: -// -// fDomain -// - require("../viewlog.php"); - -/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */ ?> diff --git a/common.php b/common.php index 33a10f8c..fcc0a480 100644 --- a/common.php +++ b/common.php @@ -1,18 +1,21 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: common.php.php -// -// Template File: -none- -// -// Template Variables: -none- -// -// Form POST \ GET Variables: -none- -// - +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: common.php + * All pages should include this file - which itself sets up the necessary + * environment and ensures other functions are loaded. + */ $incpath = dirname(__FILE__); (ini_get('magic_quotes_gpc') ? ini_set('magic_quotes_runtime', '0') : '1'); (ini_get('magic_quotes_gpc') ? ini_set('magic_quotes_sybase', '0') : '1'); diff --git a/config.inc.php.sample b/config.inc.php.sample index 9874d1a3..e0426578 100644 --- a/config.inc.php.sample +++ b/config.inc.php.sample @@ -1,12 +1,21 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: config.inc.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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: config.inc.php + * Contains configuration options. + */ + if (ereg ("config.inc.php", $_SERVER['PHP_SELF'])) { header ("Location: login.php"); diff --git a/create-alias.php b/create-alias.php index 7220b6ab..837f35f6 100644 --- a/create-alias.php +++ b/create-alias.php @@ -1,27 +1,36 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: create-alias.php -// -// Template File: create-alias.tpl -// -// Template Variables: -// -// tMessage -// tAddress -// tGoto -// tDomain -// -// Form POST \ GET Variables: -// -// fAddress -// fGoto -// fDomain -// +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * File: create-alias.php + * Template File: create-alias.tpl + * Responsible for allowing for the creation of mail aliases. + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * Template Variables: + * + * tMessage + * tAddress + * tGoto + * tDomain + * + * Form POST \ GET Variables: + * + * fAddress + * fGoto + * fDomain + * + */ require_once('common.php'); @@ -39,110 +48,116 @@ $pCreate_alias_goto_text = $PALANG['pCreate_alias_goto_text']; if ($_SERVER['REQUEST_METHOD'] == "GET") { - - if (isset ($_GET['domain'])) $tDomain = escape_string ($_GET['domain']); - + if (isset ($_GET['domain'])) { + $tDomain = escape_string ($_GET['domain']); + } } if ($_SERVER['REQUEST_METHOD'] == "POST") { - - if (isset ($_POST['fAddress']) && isset ($_POST['fDomain'])) $fAddress = escape_string ($_POST['fAddress']) . "@" . escape_string ($_POST['fDomain']); - $fAddress = strtolower ($fAddress); - if (isset ($_POST['fGoto'])) $fGoto = escape_string ($_POST['fGoto']); - $fGoto = strtolower ($fGoto); - isset ($_POST['fActive']) ? $fActive = escape_string ($_POST['fActive']) : $fActive = "1"; - if (isset ($_POST['fDomain'])) $fDomain = escape_string ($_POST['fDomain']); - - if (!preg_match ('/@/',$fGoto)) - { - $fGoto = $fGoto . "@" . escape_string ($_POST['fDomain']); - } - - if (! (authentication_has_role('global-admin') || check_owner ($SESSID_USERNAME, $fDomain) )) - { - $error = 1; - $tAddress = escape_string ($_POST['fAddress']); - $tGoto = $fGoto; - $tDomain = $fDomain; - $pCreate_alias_address_text = $PALANG['pCreate_alias_address_text_error1']; - } - - if (!check_alias ($fDomain)) - { - $error = 1; - $tAddress = escape_string ($_POST['fAddress']); - $tGoto = $fGoto; - $tDomain = $fDomain; - $pCreate_alias_address_text = $PALANG['pCreate_alias_address_text_error3']; - } - - if (empty ($fAddress) or !check_email ($fAddress)) - { - $error = 1; - $tAddress = escape_string ($_POST['fAddress']); - $tGoto = $fGoto; - $tDomain = $fDomain; - $pCreate_alias_address_text = $PALANG['pCreate_alias_address_text_error1']; - } - - if (empty ($fGoto) or !check_email ($fGoto)) - { - $error = 1; - $tAddress = escape_string ($_POST['fAddress']); - $tGoto = $fGoto; - $tDomain = $fDomain; - $pCreate_alias_goto_text = $PALANG['pCreate_alias_goto_text_error']; - } - - if (escape_string ($_POST['fAddress']) == "*") $fAddress = "@" . escape_string ($_POST['fDomain']); - - $result = db_query ("SELECT * FROM $table_alias WHERE address='$fAddress'"); - if ($result['rows'] == 1) - { - $error = 1; - $tAddress = escape_string ($_POST['fAddress']); - $tGoto = $fGoto; - $tDomain = $fDomain; - $pCreate_alias_address_text = $PALANG['pCreate_alias_address_text_error2']; - } - - if ($fActive == "on") - { - $sqlActive = db_get_boolean(True); - } - else - { - $sqlActive = db_get_boolean(False); - } - - if ($error != 1) - { - if (preg_match ('/^\*@(.*)$/', $fGoto, $match)) $fGoto = "@" . $match[1]; - - $result = db_query ("INSERT INTO $table_alias (address,goto,domain,created,modified,active) VALUES ('$fAddress','$fGoto','$fDomain',NOW(),NOW(),'$sqlActive')"); - if ($result['rows'] != 1) - { - $tDomain = $fDomain; - $tMessage = $PALANG['pCreate_alias_result_error'] . "
($fAddress -> $fGoto)
\n"; - } - else - { - db_log ($SESSID_USERNAME, $fDomain, 'create_alias', "$fAddress -> $fGoto"); - - $tDomain = $fDomain; - $tMessage = $PALANG['pCreate_alias_result_success'] . "
($fAddress -> $fGoto)
\n"; - } - } - + if (isset ($_POST['fAddress']) && isset ($_POST['fDomain'])) { + $fAddress = escape_string($_POST['fAddress']) . "@" . escape_string ($_POST['fDomain']); + $fAddress = strtolower ($fAddress); + } + + if (isset ($_POST['fGoto'])) { + $fGoto = escape_string ($_POST['fGoto']); + $fGoto = strtolower ($fGoto); + } + if(isset($_POST['fActive'])) { + $fActive = escape_string ($_POST['fActive']) + } + else { + $fActive = "1"; + } + + if(isset($_POST['fDomain'])) { + $fDomain = escape_string ($_POST['fDomain']); + } + + if(!preg_match ('/@/',$fGoto)) { + $fGoto = $fGoto . "@" . escape_string ($_POST['fDomain']); + } + + if(!(authentication_has_role('global-admin') || + check_owner ($SESSID_USERNAME, $fDomain) )) + { + $error = 1; + $tAddress = escape_string ($_POST['fAddress']); + $tGoto = $fGoto; + $tDomain = $fDomain; + $pCreate_alias_address_text = $PALANG['pCreate_alias_address_text_error1']; + } + + if(!check_alias($fDomain)) { + $error = 1; + $tAddress = escape_string ($_POST['fAddress']); + $tGoto = $fGoto; + $tDomain = $fDomain; + $pCreate_alias_address_text = $PALANG['pCreate_alias_address_text_error3']; + } + + if(empty ($fAddress) || !check_email ($fAddress)) { + $error = 1; + $tAddress = escape_string ($_POST['fAddress']); + $tGoto = $fGoto; + $tDomain = $fDomain; + $pCreate_alias_address_text = $PALANG['pCreate_alias_address_text_error1']; + } + + if (empty($fGoto) || !check_email ($fGoto)) { + $error = 1; + $tAddress = escape_string ($_POST['fAddress']); + $tGoto = $fGoto; + $tDomain = $fDomain; + $pCreate_alias_goto_text = $PALANG['pCreate_alias_goto_text_error']; + } + + if (escape_string($_POST['fAddress']) == "*") { + $fAddress = "@" . escape_string ($_POST['fDomain']); + } + + $result = db_query ("SELECT * FROM $table_alias WHERE address='$fAddress'"); + if ($result['rows'] == 1) { + $error = 1; + $tAddress = escape_string ($_POST['fAddress']); + $tGoto = $fGoto; + $tDomain = $fDomain; + $pCreate_alias_address_text = $PALANG['pCreate_alias_address_text_error2']; + } + + if ($fActive == "on") { + $sqlActive = db_get_boolean(True); + } + else { + $sqlActive = db_get_boolean(False); + } + + if ($error != 1) { + if (preg_match('/^\*@(.*)$/', $fGoto, $match)) { + $fGoto = "@" . $match[1]; + } + + $result = db_query ("INSERT INTO $table_alias (address,goto,domain,created,modified,active) VALUES ('$fAddress','$fGoto','$fDomain',NOW(),NOW(),'$sqlActive')"); + if ($result['rows'] != 1) { + $tDomain = $fDomain; + $tMessage = $PALANG['pCreate_alias_result_error'] . "
($fAddress -> $fGoto)
\n"; + } + else { + db_log ($SESSID_USERNAME, $fDomain, 'create_alias', "$fAddress -> $fGoto"); + + $tDomain = $fDomain; + $tMessage = $PALANG['pCreate_alias_result_success'] . "
($fAddress -> $fGoto)
\n"; + } + } } include ("$incpath/templates/header.tpl"); if (authentication_has_role('global-admin')) { - include ("$incpath/templates/admin_menu.tpl"); + include ("$incpath/templates/admin_menu.tpl"); } else { - include ("$incpath/templates/menu.tpl"); + include ("$incpath/templates/menu.tpl"); } include ("$incpath/templates/create-alias.tpl"); diff --git a/create-mailbox.php b/create-mailbox.php index f29e71cd..51a4d465 100644 --- a/create-mailbox.php +++ b/create-mailbox.php @@ -1,33 +1,42 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: create-mailbox.php -// -// Template File: create-mailbox.tpl -// -// Template Variables: -// -// tMessage -// tUsername -// tName -// tQuota -// tDomain -// -// Form POST \ GET Variables: -// -// fUsername -// fPassword -// fPassword2 -// fName -// fQuota -// fDomain -// fActive -// fMail -// +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: create-mailbox.php + * Responsible for allowing for the creation of mail boxes + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * Template Variables: + * + * tMessage + * tUsername + * tName + * tQuota + * tDomain + * + * Form POST \ GET Variables: + * + * fUsername + * fPassword + * fPassword2 + * fName + * fQuota + * fDomain + * fActive + * fMail + */ require_once('common.php'); diff --git a/delete.php b/delete.php index 65915ce8..a669a807 100644 --- a/delete.php +++ b/delete.php @@ -1,23 +1,38 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: delete.php -// -// Template File: message.tpl -// -// Template Variables: -// -// tMessage -// -// Form POST \ GET Variables: -// -// fDelete -// fDomain -// +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: delete.php + * Responsible for allowing for the deletion of domains; note if + * a domain is deleted, all mailboxes and aliases belonging to the + * domain are also removed. + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * Template Variables: + * + * Template File: message.tpl + * + * Template Variables: + * + * tMessage + * + * Form POST \ GET Variables: + * + * fDelete + * fDomain + */ require_once('common.php'); diff --git a/edit-active.php b/edit-active.php index 645de72e..70e6e16a 100644 --- a/edit-active.php +++ b/edit-active.php @@ -1,25 +1,32 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: edit-active.php -// -// Template File: message.tpl -// -// Template Variables: -// -// tMessage -// -// Form POST \ GET Variables: -// -// fUsername -// fDomain -// fReturn -// - +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: edit-active.php + * Responsible for toggling the active status of a mailbox. + * + * Template File: message.tpl + * + * Template Variables: + * + * tMessage + * + * Form POST \ GET Variables: + * + * fUsername + * fDomain + * fReturn + */ require_once('common.php'); authentication_require_role('admin'); diff --git a/edit-alias.php b/edit-alias.php index d206070b..f060665e 100644 --- a/edit-alias.php +++ b/edit-alias.php @@ -1,25 +1,33 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: edit-alias.php -// -// Template File: edit-alias.tpl -// -// Template Variables: -// -// tMessage -// tGoto -// -// Form POST \ GET Variables: -// -// fAddress -// fDomain -// fGoto -// +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: edit-alias.php + * Used to update an alias. + * + * Template File: edit-alias.tpl + * + * Template Variables: + * + * tMessage + * tGoto + * + * Form POST \ GET Variables: + * + * fAddress + * fDomain + * fGoto + */ require_once('common.php'); diff --git a/edit-mailbox.php b/edit-mailbox.php index fdfc00b1..fca2e315 100644 --- a/edit-mailbox.php +++ b/edit-mailbox.php @@ -1,30 +1,37 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: edit-mailbox.php -// -// Template File: edit-mailbox.tpl -// -// Template Variables: -// -// tMessage -// tName -// tQuota -// -// Form POST \ GET Variables: -// -// fUsername -// fDomain -// fPassword -// fPassword2 -// fName -// fQuota -// fActive -// +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: edit-mailbox.php + * Used to update an existing mailboxes settings. + * Template File: edit-mailbox.tpl + * + * Template Variables: + * + * tMessage + * tName + * tQuota + * + * Form POST \ GET Variables: + * + * fUsername + * fDomain + * fPassword + * fPassword2 + * fName + * fQuota + * fActive + */ require_once('common.php'); diff --git a/edit-vacation.php b/edit-vacation.php index c08c4359..d694cfcd 100644 --- a/edit-vacation.php +++ b/edit-vacation.php @@ -1,33 +1,39 @@ -// Copyright (c) 2002 - 2007 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: edit-vacation.php -// -// Template File: edit-vacation.tpl -// -// Template Variables: -// -// tUseremail -// tMessage -// tSubject -// tBody -// -// Form POST \ GET Variables: -// -// fUsername -// fDomain -// fCanceltarget -// fChange -// fBack -// fQuota -// fActive -// +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: edit-vacation.php + * Responsible for allowing users to update their vacation status. + * + * Template File: edit-vacation.tpl + * + * Template Variables: + * + * tUseremail + * tMessage + * tSubject + * tBody + * + * Form POST \ GET Variables: + * + * fUsername + * fDomain + * fCanceltarget + * fChange + * fBack + * fQuota + * fActive + */ require_once('common.php'); diff --git a/functions.inc.php b/functions.inc.php index 4890ba30..c628956f 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -1,13 +1,20 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: functions.inc.php -// -//error_reporting (E_NOTICE | E_ERROR | E_WARNING | E_PARSE); +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: functions.inc.php + * Contains re-usable code. + */ if (ereg ("functions.inc.php", $_SERVER['PHP_SELF'])) { diff --git a/index.php b/index.php index 4dde4b64..ec729da5 100644 --- a/index.php +++ b/index.php @@ -1,22 +1,26 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: index.php -// -// Template File: -none- -// -// Template Variables: -// -// -none- -// -// Form POST \ GET Variables: -// -// -none- -// +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: index.php + * Shows a sort-of welcome page. + * Template File: -none- + * + * Template Variables: -none- + * + * Form POST \ GET Variables: -none- + */ + if (!file_exists (realpath ("./setup.php"))) { header ("Location: login.php"); diff --git a/login.php b/login.php index bd3d74e1..9f8d84be 100644 --- a/login.php +++ b/login.php @@ -1,24 +1,31 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: login.php -// -// Template File: login.tpl -// -// Template Variables: -// -// tMessage -// tUsername -// -// Form POST \ GET Variables: -// -// fUsername -// fPassword -// +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: login.php + * Authenticates a user, and populates their $_SESSION as appropriate. + * Template File: login.tpl + * + * Template Variables: + * + * tMessage + * tUsername + * + * Form POST \ GET Variables: + * + * fUsername + * fPassword + */ require_once('common.php'); if ($_SERVER['REQUEST_METHOD'] == "GET") diff --git a/logout.php b/logout.php index 73d81583..d6c3e847 100644 --- a/logout.php +++ b/logout.php @@ -1,22 +1,25 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: logout.php -// -// Template File: -none- -// -// Template Variables: -// -// -none- -// -// Form POST \ GET Variables: -// -// -none- -// +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: logout.php + * De-authenticates a user. + * Template File: -none- + * + * Template Variables: -none- + * + * Form POST \ GET Variables: -none- + */ require_once('common.php'); diff --git a/main.php b/main.php index acba53c2..a364fd13 100644 --- a/main.php +++ b/main.php @@ -1,22 +1,25 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: main.php -// -// Template File: main.tpl -// -// Template Variables: -// -// -none- -// -// Form POST \ GET Variables: -// -// -none- -// +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: main.php + * Displays a menu/home page. + * Template File: main.tpl + * + * Template Variables: -none- + * + * Form POST \ GET Variables: -none- + */ require_once('common.php'); @@ -24,19 +27,8 @@ $SESSID_USERNAME = authentication_get_username(); authentication_require_role('admin'); -if ($_SERVER["REQUEST_METHOD"] == "GET") -{ - include ("./templates/header.tpl"); - include ("./templates/menu.tpl"); - include ("./templates/main.tpl"); - include ("./templates/footer.tpl"); -} - -if ($_SERVER["REQUEST_METHOD"] == "POST") -{ - include ("./templates/header.tpl"); - include ("./templates/menu.tpl"); - include ("./templates/main.tpl"); - include ("./templates/footer.tpl"); -} +include ("./templates/header.tpl"); +include ("./templates/menu.tpl"); +include ("./templates/main.tpl"); +include ("./templates/footer.tpl"); ?> diff --git a/overview.php b/overview.php index dd8b14f9..38b1d63d 100644 --- a/overview.php +++ b/overview.php @@ -1,28 +1,36 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: overview.php -// -// Template File: overview.tpl -// -// Template Variables: -// -// tAlias -// tDomain -// tMailbox -// tDisplay_back -// tDisplay_next -// -// Form POST \ GET Variables: -// -// domain -// fDomain -// limit -// +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: overview.php + * Shows an overview for admins. + * + * Template File: overview.tpl + * + * Template Variables: + * + * tAlias + * tDomain + * tMailbox + * tDisplay_back + * tDisplay_next + * + * Form POST \ GET Variables: + * + * domain + * fDomain + * limit + */ require_once('common.php'); diff --git a/password.php b/password.php index 47f1b612..013197f6 100644 --- a/password.php +++ b/password.php @@ -1,24 +1,31 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: password.php -// -// Template File: password.tpl -// -// Template Variables: -// -// tMessage -// -// Form POST \ GET Variables: -// -// fPassword_current -// fPassword -// fPassword2 -// +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: password.php + * Allows admins to change their own password. + * Template File: password.tpl + * + * Template Variables: + * + * tMessage + * + * Form POST \ GET Variables: + * + * fPassword_current + * fPassword + * fPassword2 + */ require_once('common.php'); diff --git a/search.php b/search.php index bf0aa1cf..d0a758db 100644 --- a/search.php +++ b/search.php @@ -1,35 +1,42 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: search.php -// -// Template File: search.tpl -// -// Template Variables: -// -// tAlias -// tMailbox -// -// Form POST \ GET Variables: -// -// fSearch -// fGo -// fDomain -// +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: search.php + * Provides a method for searching for a user/mailbox + * Template File: search.tpl + * + * Template Variables: + * + * tAlias + * tMailbox + * + * Form POST \ GET Variables: + * + * fSearch + * fGo + * fDomain + */ require_once('common.php'); authentication_require_role('admin'); $SESSID_USERNAME = authentication_get_username(); if(authentication_has_role('global-admin')) { - $list_domains = list_domains (); + $list_domains = list_domains (); } else { - $list_domains = list_domains_for_admin ($SESSID_USERNAME); + $list_domains = list_domains_for_admin ($SESSID_USERNAME); } @@ -38,140 +45,140 @@ $tMailbox = array(); if ($_SERVER['REQUEST_METHOD'] == "GET") { - if (isset ($_GET['search'])) $fSearch = escape_string ($_GET['search']); - - if ($CONF['alias_control_admin'] == "YES") - { - $query = "SELECT $table_alias.address,$table_alias.goto,$table_alias.modified,$table_alias.domain,$table_alias.active FROM $table_alias WHERE $table_alias.address LIKE '%$fSearch%' OR $table_alias.goto LIKE '%$fSearch%' ORDER BY $table_alias.address"; - } - else - { - $query = "SELECT $table_alias.address,$table_alias.goto,$table_alias.modified,$table_alias.domain,$table_alias.active FROM $table_alias LEFT JOIN $table_mailbox ON $table_alias.address=$table_mailbox.username WHERE $table_alias.address LIKE '%$fSearch%' AND $table_mailbox.maildir IS NULL ORDER BY $table_alias.address"; - } - - $result = db_query ($query); - if ($result['rows'] > 0) - { - while ($row = db_array ($result['result'])) - { - if (check_owner ($SESSID_USERNAME, $row['domain'])) - { - if ('pgsql'==$CONF['database_type']) + if (isset ($_GET['search'])) $fSearch = escape_string ($_GET['search']); + + if ($CONF['alias_control_admin'] == "YES") + { + $query = "SELECT $table_alias.address,$table_alias.goto,$table_alias.modified,$table_alias.domain,$table_alias.active FROM $table_alias WHERE $table_alias.address LIKE '%$fSearch%' OR $table_alias.goto LIKE '%$fSearch%' ORDER BY $table_alias.address"; + } + else + { + $query = "SELECT $table_alias.address,$table_alias.goto,$table_alias.modified,$table_alias.domain,$table_alias.active FROM $table_alias LEFT JOIN $table_mailbox ON $table_alias.address=$table_mailbox.username WHERE $table_alias.address LIKE '%$fSearch%' AND $table_mailbox.maildir IS NULL ORDER BY $table_alias.address"; + } + + $result = db_query ($query); + if ($result['rows'] > 0) + { + while ($row = db_array ($result['result'])) + { + if (check_owner ($SESSID_USERNAME, $row['domain'])) { - $row['modified']=gmstrftime('%c %Z',$row['modified']); - $row['active']=('t'==$row['active']) ? 1 : 0; - } - $tAlias[] = $row; - } - } - } - - if ($CONF['vacation_control_admin'] == 'YES') - { - $query = ("SELECT $table_mailbox.*, $table_vacation.active AS v_active FROM $table_mailbox LEFT JOIN $table_vacation ON $table_mailbox.username=$table_vacation.email WHERE $table_mailbox.username LIKE '%$fSearch%' OR $table_mailbox.name LIKE '%$fSearch%' ORDER BY $table_mailbox.username"); - } - else - { - $query = "SELECT * FROM $table_mailbox WHERE username LIKE '%$fSearch%' OR name LIKE '%$fSearch%' ORDER BY username"; - } - - $result = db_query ($query); - if ($result['rows'] > 0) - { - while ($row = db_array ($result['result'])) - { - if (check_owner ($SESSID_USERNAME, $row['domain'])) - { - if ('pgsql'==$CONF['database_type']) + if ('pgsql'==$CONF['database_type']) + { + $row['modified']=gmstrftime('%c %Z',$row['modified']); + $row['active']=('t'==$row['active']) ? 1 : 0; + } + $tAlias[] = $row; + } + } + } + + if ($CONF['vacation_control_admin'] == 'YES') + { + $query = ("SELECT $table_mailbox.*, $table_vacation.active AS v_active FROM $table_mailbox LEFT JOIN $table_vacation ON $table_mailbox.username=$table_vacation.email WHERE $table_mailbox.username LIKE '%$fSearch%' OR $table_mailbox.name LIKE '%$fSearch%' ORDER BY $table_mailbox.username"); + } + else + { + $query = "SELECT * FROM $table_mailbox WHERE username LIKE '%$fSearch%' OR name LIKE '%$fSearch%' ORDER BY username"; + } + + $result = db_query ($query); + if ($result['rows'] > 0) + { + while ($row = db_array ($result['result'])) + { + if (check_owner ($SESSID_USERNAME, $row['domain'])) { - $row['modified']=gmstrftime('%c %Z',$row['modified']); - $row['active']=('t'==$row['active']) ? 1 : 0; - } - $tMailbox[] = $row; - } - } - } - - include ("./templates/header.tpl"); - include ("./templates/menu.tpl"); - include ("./templates/search.tpl"); - include ("./templates/footer.tpl"); + if ('pgsql'==$CONF['database_type']) + { + $row['modified']=gmstrftime('%c %Z',$row['modified']); + $row['active']=('t'==$row['active']) ? 1 : 0; + } + $tMailbox[] = $row; + } + } + } + + include ("./templates/header.tpl"); + include ("./templates/menu.tpl"); + include ("./templates/search.tpl"); + include ("./templates/footer.tpl"); } if ($_SERVER['REQUEST_METHOD'] == "POST") { - if (isset ($_POST['search'])) $fSearch = escape_string ($_POST['search']); - if (isset ($_POST['fGo'])) $fGo = escape_string ($_POST['fGo']); - if (isset ($_POST['fDomain'])) $fDomain = escape_string ($_POST['fDomain']); - - if (empty ($fSearch) && !empty ($fGo)) - { - if (authentication_has_role('global-admin')) - { - header("Location: list-virtual.php?domain=" . $fDomain ) && exit; - } - else - { - header("Location: overview.php?domain=" . $fDomain ) && exit; - } - } - - - if ($CONF['alias_control_admin'] == "YES") - { - $query = "SELECT $table_alias.address,$table_alias.goto,$table_alias.modified,$table_alias.domain,$table_alias.active FROM $table_alias WHERE $table_alias.address LIKE '%$fSearch%' OR $table_alias.goto LIKE '%$fSearch%' ORDER BY $table_alias.address"; - } - else - { - $query = "SELECT $table_alias.address,$table_alias.goto,$table_alias.modified,$table_alias.domain,$table_alias.active FROM $table_alias LEFT JOIN $table_mailbox ON $table_alias.address=$table_mailbox.username WHERE $table_alias.address LIKE '%$fSearch%' AND $table_mailbox.maildir IS NULL ORDER BY $table_alias.address"; - } - - $result = db_query ($query); - if ($result['rows'] > 0) - { - while ($row = db_array ($result['result'])) - { - if (check_owner ($SESSID_USERNAME, $row['domain'])) - { - if ('pgsql'==$CONF['database_type']) + if (isset ($_POST['search'])) $fSearch = escape_string ($_POST['search']); + if (isset ($_POST['fGo'])) $fGo = escape_string ($_POST['fGo']); + if (isset ($_POST['fDomain'])) $fDomain = escape_string ($_POST['fDomain']); + + if (empty ($fSearch) && !empty ($fGo)) + { + if (authentication_has_role('global-admin')) + { + header("Location: list-virtual.php?domain=" . $fDomain ) && exit; + } + else + { + header("Location: overview.php?domain=" . $fDomain ) && exit; + } + } + + + if ($CONF['alias_control_admin'] == "YES") + { + $query = "SELECT $table_alias.address,$table_alias.goto,$table_alias.modified,$table_alias.domain,$table_alias.active FROM $table_alias WHERE $table_alias.address LIKE '%$fSearch%' OR $table_alias.goto LIKE '%$fSearch%' ORDER BY $table_alias.address"; + } + else + { + $query = "SELECT $table_alias.address,$table_alias.goto,$table_alias.modified,$table_alias.domain,$table_alias.active FROM $table_alias LEFT JOIN $table_mailbox ON $table_alias.address=$table_mailbox.username WHERE $table_alias.address LIKE '%$fSearch%' AND $table_mailbox.maildir IS NULL ORDER BY $table_alias.address"; + } + + $result = db_query ($query); + if ($result['rows'] > 0) + { + while ($row = db_array ($result['result'])) + { + if (check_owner ($SESSID_USERNAME, $row['domain'])) { - $row['modified']=gmstrftime('%c %Z',$row['modified']); - $row['active']=('t'==$row['active']) ? 1 : 0; + if ('pgsql'==$CONF['database_type']) + { + $row['modified']=gmstrftime('%c %Z',$row['modified']); + $row['active']=('t'==$row['active']) ? 1 : 0; + } + $tAlias[] = $row; } - $tAlias[] = $row; - } - } - } - - if ($CONF['vacation_control_admin'] == 'YES') - { - $query = ("SELECT $table_mailbox.*, $table_vacation.active AS v_active FROM $table_mailbox LEFT JOIN $table_vacation ON $table_mailbox.username=$table_vacation.email WHERE $table_mailbox.username LIKE '%$fSearch%' OR $table_mailbox.name LIKE '%$fSearch%' ORDER BY $table_mailbox.username"); - } - else - { - $query = "SELECT * FROM $table_mailbox WHERE username LIKE '%$fSearch%' OR name LIKE '%$fSearch%' ORDER BY username"; - } - - $result = db_query ("$query"); - if ($result['rows'] > 0) - { - while ($row = db_array ($result['result'])) - { - if (check_owner ($SESSID_USERNAME, $row['domain'])) - { - if ('pgsql'==$CONF['database_type']) + } + } + + if ($CONF['vacation_control_admin'] == 'YES') + { + $query = ("SELECT $table_mailbox.*, $table_vacation.active AS v_active FROM $table_mailbox LEFT JOIN $table_vacation ON $table_mailbox.username=$table_vacation.email WHERE $table_mailbox.username LIKE '%$fSearch%' OR $table_mailbox.name LIKE '%$fSearch%' ORDER BY $table_mailbox.username"); + } + else + { + $query = "SELECT * FROM $table_mailbox WHERE username LIKE '%$fSearch%' OR name LIKE '%$fSearch%' ORDER BY username"; + } + + $result = db_query ("$query"); + if ($result['rows'] > 0) + { + while ($row = db_array ($result['result'])) + { + if (check_owner ($SESSID_USERNAME, $row['domain'])) { - $row['modified']=gmstrftime('%c %Z',$row['modified']); - $row['active']=('t'==$row['active']) ? 1 : 0; - } - $tMailbox[] = $row; - } - } - } - - include ("./templates/header.tpl"); - include ("./templates/menu.tpl"); - include ("./templates/search.tpl"); - include ("./templates/footer.tpl"); + if ('pgsql'==$CONF['database_type']) + { + $row['modified']=gmstrftime('%c %Z',$row['modified']); + $row['active']=('t'==$row['active']) ? 1 : 0; + } + $tMailbox[] = $row; + } + } + } + + include ("./templates/header.tpl"); + include ("./templates/menu.tpl"); + include ("./templates/search.tpl"); + include ("./templates/footer.tpl"); } ?> diff --git a/sendmail.php b/sendmail.php index d53da0be..9265dbee 100644 --- a/sendmail.php +++ b/sendmail.php @@ -1,27 +1,34 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: sendmail.php -// -// Template File: sendmail.tpl -// -// Template Variables: -// -// tMessage -// tFrom -// tSubject -// tBody -// -// Form POST \ GET Variables: -// -// fTo -// fSubject -// fBody -// +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: sendmail.php + * Used to send an email to a user. + * Template File: sendmail.tpl + * + * Template Variables: + * + * tMessage + * tFrom + * tSubject + * tBody + * + * Form POST \ GET Variables: + * + * fTo + * fSubject + * fBody + */ require_once('common.php'); diff --git a/setup.php b/setup.php index 58f8c8bf..ef4dac63 100644 --- a/setup.php +++ b/setup.php @@ -1,22 +1,27 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: index.php -// -// Template File: -none- -// -// Template Variables: -// -// -none- -// -// Form POST \ GET Variables: -// -// -none- -// +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: setup.php + * Used to help ensure a server is setup appropriately during installation/setup. + * After setup, it should be renamed or removed. + * + * Template File: -none- + * + * Template Variables: -none- + * + * Form POST \ GET Variables: -none- + */ ?> diff --git a/users/edit-alias.php b/users/edit-alias.php index ed97bbd1..0c58859e 100644 --- a/users/edit-alias.php +++ b/users/edit-alias.php @@ -1,25 +1,33 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: edit-alias.php -// -// Template File: users_edit-alias.tpl -// -// Template Variables: -// -// tMessage -// tGoto -// -// Form POST \ GET Variables: -// -// fAddress -// fDomain -// fGoto -// +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: edit-alias.php + * Users can use this to set forwards etc for their mailbox. + * + * Template File: users_edit-alias.tpl + * + * Template Variables: + * + * tMessage + * tGoto + * + * Form POST \ GET Variables: + * + * fAddress + * fDomain + * fGoto + */ require_once('../common.php'); diff --git a/users/index.php b/users/index.php index 56b046ff..9b815840 100644 --- a/users/index.php +++ b/users/index.php @@ -1,22 +1,29 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: index.php -// -// Template File: -none- -// -// Template Variables: -// -// -none- -// -// Form POST \ GET Variables: -// -// -none- -// +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: index.php + * Redirects potential users to login.php + * Template File: -none- + * + * Template Variables: + * + * -none- + * + * Form POST \ GET Variables: + * + * -none- + */ header ("Location: login.php"); exit; ?> diff --git a/users/login.php b/users/login.php index 16989adc..b22091e2 100644 --- a/users/login.php +++ b/users/login.php @@ -1,24 +1,31 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: login.php -// -// Template File: login.tpl -// -// Template Variables: -// -// tMessage -// tUsername -// -// Form POST \ GET Variables: -// -// fUsername -// fPassword -// +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: login.php + * Used to authenticate want-to-be users. + * Template File: login.tpl + * + * Template Variables: + * + * tMessage + * tUsername + * + * Form POST \ GET Variables: + * + * fUsername + * fPassword + */ require_once("../common.php"); @@ -70,7 +77,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") header("Location: main.php"); exit; } - + include ("../templates/header.tpl"); include ("../templates/users_login.tpl"); include ("../templates/footer.tpl"); diff --git a/users/logout.php b/users/logout.php index a7827b79..924a63b4 100644 --- a/users/logout.php +++ b/users/logout.php @@ -1,22 +1,26 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: logout.php -// -// Template File: -none- -// -// Template Variables: -// -// -none- -// -// Form POST \ GET Variables: -// -// -none- -// +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: logout.php + * De-authenticates a user. + * + * Template File: -none- + * + * Template Variables: -none- + * + * Form POST \ GET Variables: -none- + */ require_once('../common.php'); diff --git a/users/main.php b/users/main.php index 28a29070..1cd1ae3a 100644 --- a/users/main.php +++ b/users/main.php @@ -1,22 +1,27 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: main.php -// -// Template File: main.tpl -// -// Template Variables: -// -// tummVacationtext -// -// Form POST \ GET Variables: -// -// -none- -// +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: main.php + * 'Home page' for logged in users. + * Template File: main.tpl + * + * Template Variables: + * + * tummVacationtext + * + * Form POST \ GET Variables: -none- + */ require_once('../common.php'); authentication_require_role('user'); diff --git a/users/password.php b/users/password.php index 94104990..e0d66b88 100644 --- a/users/password.php +++ b/users/password.php @@ -1,24 +1,31 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: password.php -// -// Template File: users_password.tpl -// -// Template Variables: -// -// tMessage -// -// Form POST \ GET Variables: -// -// fPassword_current -// fPassword -// fPassword2 -// +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: password.php + * Used by users to change their mailbox (and login) password. + * Template File: users_password.tpl + * + * Template Variables: + * + * tMessage + * + * Form POST \ GET Variables: + * + * fPassword_current + * fPassword + * fPassword2 + */ require_once('../common.php'); diff --git a/users/vacation.php b/users/vacation.php index b9d5ca6a..67b3090d 100644 --- a/users/vacation.php +++ b/users/vacation.php @@ -1,27 +1,35 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: vacation.php -// -// Template File: users_vacation.tpl -// -// Template Variables: -// -// tMessage -// tSubject -// tBody -// -// Form POST \ GET Variables: -// -// fSubject -// fBody -// fAway -// fBack -// +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: vacation.php + * Used by users to set/change their vacation settings. + * + * Template File: users_vacation.tpl + * + * Template Variables: + * + * tMessage + * tSubject + * tBody + * + * Form POST \ GET Variables: + * + * fSubject + * fBody + * fAway + * fBack + */ require_once('../common.php'); diff --git a/variables.inc.php b/variables.inc.php index 14bcd00a..828e55c2 100644 --- a/variables.inc.php +++ b/variables.inc.php @@ -1,12 +1,22 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: variables.inc.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://www.postfixadmin.com or 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. + */ if (ereg ("variables.inc.php", $_SERVER['PHP_SELF'])) { header ("Location: login.php"); diff --git a/viewlog.php b/viewlog.php index b64a80de..da6dea7e 100644 --- a/viewlog.php +++ b/viewlog.php @@ -1,24 +1,31 @@ -// Copyright (c) 2002 - 2005 High5! -// Licensed under GPL for more info check GPL-LICENSE.TXT -// -// File: viewlog.php -// -// Template File: viewlog.tpl -// -// Template Variables: -// -// tMessage -// tLog -// -// Form POST \ GET Variables: -// -// fDomain -// - +/** + * 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://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: viewlog.php + * Shows entries from the log table to users. + * + * Template File: viewlog.tpl + * + * Template Variables: + * + * tMessage + * tLog + * + * Form POST \ GET Variables: + * + * fDomain + */ require_once('common.php');