postfixadmin-svn Mailing List for PostfixAdmin (Page 116)
Brought to you by:
christian_boltz,
gingerdog
You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(13) |
Oct
(63) |
Nov
(79) |
Dec
(34) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(15) |
Feb
(8) |
Mar
(8) |
Apr
(44) |
May
(18) |
Jun
(20) |
Jul
(35) |
Aug
(21) |
Sep
(8) |
Oct
(9) |
Nov
(21) |
Dec
(14) |
| 2009 |
Jan
(53) |
Feb
(13) |
Mar
(36) |
Apr
(40) |
May
(22) |
Jun
(10) |
Jul
(18) |
Aug
(18) |
Sep
(7) |
Oct
(26) |
Nov
(32) |
Dec
(13) |
| 2010 |
Jan
(6) |
Feb
(7) |
Mar
(12) |
Apr
(2) |
May
(12) |
Jun
(8) |
Jul
(9) |
Aug
(12) |
Sep
(12) |
Oct
(7) |
Nov
(9) |
Dec
(42) |
| 2011 |
Jan
(10) |
Feb
(35) |
Mar
(43) |
Apr
(39) |
May
(8) |
Jun
(8) |
Jul
(83) |
Aug
(20) |
Sep
(20) |
Oct
(63) |
Nov
(33) |
Dec
(20) |
| 2012 |
Jan
(28) |
Feb
(3) |
Mar
(1) |
Apr
(37) |
May
(16) |
Jun
(7) |
Jul
(3) |
Aug
|
Sep
|
Oct
(3) |
Nov
(1) |
Dec
(4) |
| 2013 |
Jan
(6) |
Feb
(16) |
Mar
(9) |
Apr
(11) |
May
(9) |
Jun
(30) |
Jul
(17) |
Aug
(6) |
Sep
(2) |
Oct
(30) |
Nov
(41) |
Dec
(26) |
| 2014 |
Jan
(16) |
Feb
(20) |
Mar
(5) |
Apr
(4) |
May
(14) |
Jun
(4) |
Jul
(1) |
Aug
|
Sep
(8) |
Oct
(18) |
Nov
(26) |
Dec
|
| 2015 |
Jan
(4) |
Feb
(9) |
Mar
(12) |
Apr
(26) |
May
(3) |
Jun
(3) |
Jul
(2) |
Aug
|
Sep
(15) |
Oct
(13) |
Nov
|
Dec
(1) |
| 2016 |
Jan
(1) |
Feb
(5) |
Mar
(4) |
Apr
(3) |
May
(19) |
Jun
|
Jul
|
Aug
(3) |
Sep
(16) |
Oct
(4) |
Nov
(5) |
Dec
(5) |
| 2017 |
Jan
(1) |
Feb
(8) |
Mar
|
Apr
(7) |
May
(3) |
Jun
(16) |
Jul
(13) |
Aug
(16) |
Sep
(6) |
Oct
(4) |
Nov
(10) |
Dec
(7) |
| 2018 |
Jan
(16) |
Feb
(17) |
Mar
(11) |
Apr
(13) |
May
(20) |
Jun
(3) |
Jul
(10) |
Aug
|
Sep
(3) |
Oct
(1) |
Nov
(6) |
Dec
(18) |
| 2019 |
Jan
(18) |
Feb
(31) |
Mar
(4) |
Apr
(4) |
May
(1) |
Jun
(8) |
Jul
(7) |
Aug
(10) |
Sep
(23) |
Oct
(6) |
Nov
(3) |
Dec
(5) |
| 2020 |
Jan
(10) |
Feb
(18) |
Mar
(34) |
Apr
(19) |
May
(6) |
Jun
(9) |
Jul
|
Aug
(10) |
Sep
(16) |
Oct
(6) |
Nov
(3) |
Dec
(11) |
| 2021 |
Jan
(118) |
Feb
(22) |
Mar
(13) |
Apr
(12) |
May
(48) |
Jun
(21) |
Jul
(17) |
Aug
(12) |
Sep
(19) |
Oct
(25) |
Nov
(16) |
Dec
(7) |
| 2022 |
Jan
(6) |
Feb
(7) |
Mar
(14) |
Apr
(4) |
May
|
Jun
(16) |
Jul
(18) |
Aug
(5) |
Sep
(12) |
Oct
(8) |
Nov
(10) |
Dec
(13) |
| 2023 |
Jan
|
Feb
(3) |
Mar
(2) |
Apr
(1) |
May
(2) |
Jun
(6) |
Jul
(3) |
Aug
(3) |
Sep
(3) |
Oct
(2) |
Nov
(7) |
Dec
(13) |
| 2024 |
Jan
(8) |
Feb
(6) |
Mar
(5) |
Apr
(10) |
May
(8) |
Jun
(6) |
Jul
(2) |
Aug
(1) |
Sep
(2) |
Oct
(4) |
Nov
(15) |
Dec
(10) |
| 2025 |
Jan
(3) |
Feb
(12) |
Mar
(3) |
Apr
(7) |
May
(18) |
Jun
(10) |
Jul
(10) |
Aug
(6) |
Sep
(16) |
Oct
(6) |
Nov
(1) |
Dec
|
|
From: <Gin...@us...> - 2007-10-04 14:58:34
|
Revision: 132
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=132&view=rev
Author: GingerDog
Date: 2007-10-04 07:58:38 -0700 (Thu, 04 Oct 2007)
Log Message:
-----------
languages/en.lang: pPasswordTooShort added
Modified Paths:
--------------
trunk/languages/en.lang
Modified: trunk/languages/en.lang
===================================================================
--- trunk/languages/en.lang 2007-10-04 14:58:11 UTC (rev 131)
+++ trunk/languages/en.lang 2007-10-04 14:58:38 UTC (rev 132)
@@ -352,4 +352,6 @@
$PALANG['pStatus_undeliverable'] = 'maybe UNDELIVERABLE ';
$PALANG['pStatus_custom'] = 'Delivers to ';
$PALANG['pStatus_popimap'] = 'POP/IMAP ';
+
+$PALANG['pPasswordTooShort'] = "Password is too short - requires %s characters";
?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Gin...@us...> - 2007-10-04 14:58:10
|
Revision: 131
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=131&view=rev
Author: GingerDog
Date: 2007-10-04 07:58:11 -0700 (Thu, 04 Oct 2007)
Log Message:
-----------
try and stop ff from autocompleting the field; put the encrypted password in the field...
Modified Paths:
--------------
trunk/templates/admin_edit-admin.tpl
Modified: trunk/templates/admin_edit-admin.tpl
===================================================================
--- trunk/templates/admin_edit-admin.tpl 2007-10-04 14:57:39 UTC (rev 130)
+++ trunk/templates/admin_edit-admin.tpl 2007-10-04 14:58:11 UTC (rev 131)
@@ -10,7 +10,7 @@
</tr>
<tr>
<td><?php print $PALANG['pAdminEdit_admin_password'] . ":"; ?></td>
- <td><input class="flat" type="password" name="fPassword" value="<?= $fPassword; ?>"/></td>
+ <td><input class="flat" type="password" autocomplete="off" name="fPassword" value="<?php echo $tPassword; ?>"/></td>
<td><?php print $pAdminEdit_admin_password_text; ?></td>
</tr>
<tr>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Gin...@us...> - 2007-10-04 14:57:35
|
Revision: 130
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=130&view=rev
Author: GingerDog
Date: 2007-10-04 07:57:39 -0700 (Thu, 04 Oct 2007)
Log Message:
-----------
common.php: ensure $CONF["configured"] is not false
Modified Paths:
--------------
trunk/common.php
Modified: trunk/common.php
===================================================================
--- trunk/common.php 2007-10-04 14:57:04 UTC (rev 129)
+++ trunk/common.php 2007-10-04 14:57:39 UTC (rev 130)
@@ -26,6 +26,12 @@
header("Location: setup.php");
exit(0);
}
+if(isset($CONF['configured'])) {
+ if($CONF['configured'] == FALSE) {
+ headeR("Location: setup.php");
+ exit(0);
+ }
+}
require_once("$incpath/config.inc.php");
require_once("$incpath/functions.inc.php");
require_once("$incpath/languages/" . check_language () . ".lang");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Gin...@us...> - 2007-10-04 14:57:05
|
Revision: 129
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=129&view=rev
Author: GingerDog
Date: 2007-10-04 07:57:04 -0700 (Thu, 04 Oct 2007)
Log Message:
-----------
edit-admin.php: i think this fixes the outstanding problems, but I get horrible problems if firefox is allowed to remember passwords etc - is there a good way of disabling this behaviour beyond autocomplete="off" ?
Modified Paths:
--------------
trunk/admin/edit-admin.php
Modified: trunk/admin/edit-admin.php
===================================================================
--- trunk/admin/edit-admin.php 2007-10-04 13:53:45 UTC (rev 128)
+++ trunk/admin/edit-admin.php 2007-10-04 14:57:04 UTC (rev 129)
@@ -37,103 +37,115 @@
authentication_require_role('global-admin');
+$error = 1;
+if(isset($_GET['username'])) {
+ $username = escape_string ($_GET['username']);
+ $result = db_query("SELECT * FROM $table_admin WHERE username = '$username'");
+ if($result['rows'] == 1) {
+ $admin_details = db_array($result['result']);
+ $error = 0;
+ }
+}
+if($error == 1){
+ flash_error($PALANG['pAdminEdit_admin_result_error']);
+ header("Location: list-admin.php");
+ exit(0);
+}
+// we aren't ensuring the password is longer than x characters, should we?
if ($_SERVER['REQUEST_METHOD'] == "POST")
{
- $fPassword = '';
- $fPassword2 = '';
- if(isset ($_GET['username'])) $username = escape_string ($_GET['username']);
+ $fPassword = '';
+ $fPassword2 = '';
+ if(isset ($_POST['fPassword'])) $fPassword = escape_string ($_POST['fPassword']);
+ if(isset ($_POST['fPassword2'])) $fPassword2 = escape_string ($_POST['fPassword2']);
- if(isset ($_POST['fPassword'])) $fPassword = escape_string ($_POST['fPassword']);
- if(isset ($_POST['fPassword2'])) $fPassword2 = escape_string ($_POST['fPassword2']);
- if ($fPassword != $fPassword2)
- {
- $error = 1;
- $pAdminEdit_admin_password_text = $PALANG['pAdminEdit_admin_password_text_error'];
- }
+ $fActive=(isset($_POST['fActive'])) ? escape_string ($_POST['fActive']) : FALSE;
+ $fSadmin=(isset($_POST['fSadmin'])) ? escape_string ($_POST['fSadmin']) : FALSE;
- $fActive=(isset($_POST['fActive'])) ? escape_string ($_POST['fActive']) : FALSE;
- $fSadmin=(isset($_POST['fSadmin'])) ? escape_string ($_POST['fSadmin']) : FALSE;
+ $fDomains = false;
+ if (isset ($_POST['fDomains'])) $fDomains = $_POST['fDomains'];
- $fDomains = false;
- if (isset ($_POST['fDomains'])) $fDomains = $_POST['fDomains'];
+ $tAllDomains = list_domains ();
- $tAllDomains = list_domains ();
+ // has the password changed?
+ $originalPassword = $admin_details['password'];
+ if($fPassword != $originalPassword) {
+ // if it has, ensure both fields are the same...
+ if ($fPassword == $fPassword2)
+ {
+ if(strlen($fPassword) >= $CONF['min_password_length']) {
+ $fPassword = pacrypt($fPassword);
+ }
+ else {
+ $error = 1;
+ flash_error(sprintf($PALANG['pPasswordTooShort'], $CONF['min_password_length']));
+ }
+ }
+ else {
+ $error = 1;
+ $pAdminEdit_admin_password_text = $PALANG['pAdminEdit_admin_password_text_error'];
+ }
+ }
- $result = db_query("SELECT * FROM $table_admin WHERE username = '$username'");
- if($result['rows'] != 1) {
- die("Invalid username for admin user");
- }
- $admin_details = db_array($result['result']);
- $originalPassword = $admin_details['password'];
- // has the password changed?
- if($fPassword != $originalPassword) {
- if(!empty($_POST['fPassword2'])) {
- $fPassword = pacrypt($fPassword);
- }
- }
+ $fDomains = array();
+ if (array_key_exists('fDomains', $_POST)) $fDomains = escape_string ($_POST['fDomains']);
+ if ($error != 1)
+ {
+ if ($fActive == "on") {
+ $sqlActive = db_get_boolean(True);
+ }
+ else {
+ $sqlActive = db_get_boolean(False);
+ }
- $tActive = $fActive;
- $fDomains = array();
- if (array_key_exists('fDomains', $_POST)) $tDomains = escape_string ($_POST['fDomains']);
- if ($error != 1)
- {
- if ($fActive == "on") {
- $sqlActive = db_get_boolean(True);
- }
- else {
- $sqlActive = db_get_boolean(False);
- }
+ $result = db_query ("UPDATE $table_admin SET modified=NOW(),active='$sqlActive',password='$fPassword' WHERE username='$username'");
- $password_query = '';
- if ($fPassword != '') { # do not change password to empty one
- $password_query = ", password='$fPassword'";
- }
- $result = db_query ("UPDATE $table_admin SET modified=NOW(),active='$sqlActive' $password_query WHERE username='$username'");
+ if ($fSadmin == "on") $fSadmin = 'ALL';
- if ($fSadmin == "on") $fSadmin = 'ALL';
+ // delete everything, and put it back later on..
+ db_query("DELETE FROM $table_domain_admins WHERE username = '$username'");
+ if($fSadmin == 'ALL') {
+ $fDomains = array('ALL');
+ }
- // delete everything, and put it back later on..
- db_query("DELETE FROM $table_domain_admins WHERE username = '$username'");
- if($fSadmin == 'ALL') {
- $fDomains = array('ALL');
- }
-
- foreach($fDomains as $domain)
- {
- $result = db_query ("INSERT INTO $table_domain_admins (username,domain,created) VALUES ('$username','$domain',NOW())");
- }
- flash_info($PALANG['pAdminEdit_admin_result_success']);
- }
- else {
- flash_error($PALANG['pAdminEdit_admin_result_error']);
- }
- header("Location: list-admin.php");
+ foreach($fDomains as $domain)
+ {
+ $result = db_query ("INSERT INTO $table_domain_admins (username,domain,created) VALUES ('$username','$domain',NOW())");
+ }
+ flash_info($PALANG['pAdminEdit_admin_result_success']);
+ header("Location: list-admin.php");
+ exit(0);
+ }
+ else {
+ flash_error($PALANG['pAdminEdit_admin_result_error']);
+ }
}
-else { // GET request.
- if (isset($_GET['username'])) $username = escape_string ($_GET['username']);
+if (isset($_GET['username'])) $username = escape_string ($_GET['username']);
- # TODO: read "active" state from database and tick on the checkbox for active admins
+$tAllDomains = list_domains();
+$tDomains = list_domains_for_admin ($username);
+$tActive = '';
+$tPassword = $admin_details['password'];
- $tAllDomains = list_domains();
- $tDomains = list_domains_for_admin ($username);
+if($admin_details['active'] == 't' || $admin_details['active'] == 1) {
+ $tActive = $admin_details['active'];
+}
+$tSadmin = '0';
+$result = db_query ("SELECT * FROM $table_domain_admins WHERE username='$username'");
+// could/should be multiple matches to query;
+if ($result['rows'] >= 1) {
+ $result = $result['result'];
+ while($row = db_array($result)) {
+ if ($row['domain'] == 'ALL') {
+ $tSadmin = '1';
+ $tDomains = array(); /* empty the list, they're an admin */
+ }
+ }
+}
- $tSadmin = '0';
- $result = db_query ("SELECT * FROM $table_domain_admins WHERE username='$username'");
- // could/should be multiple matches to query;
- if ($result['rows'] >= 1) {
- $result = $result['result'];
- while($row = db_array($result)) {
- if ($row['domain'] == 'ALL') {
- $tSadmin = '1';
- $tDomains = array(); /* empty the list, they're an admin */
- }
- }
- }
-
- include ("../templates/header.tpl");
- include ("../templates/admin_menu.tpl");
- include ("../templates/admin_edit-admin.tpl");
- include ("../templates/footer.tpl");
-}
+include ("../templates/header.tpl");
+include ("../templates/admin_menu.tpl");
+include ("../templates/admin_edit-admin.tpl");
+include ("../templates/footer.tpl");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Gin...@us...> - 2007-10-04 13:53:43
|
Revision: 128
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=128&view=rev
Author: GingerDog
Date: 2007-10-04 06:53:45 -0700 (Thu, 04 Oct 2007)
Log Message:
-----------
config.inc.php: renamed from config.inc.php.sample; added variable that needs disabling for site to work
Added Paths:
-----------
trunk/config.inc.php
Removed Paths:
-------------
trunk/config.inc.php.sample
Copied: trunk/config.inc.php (from rev 127, trunk/config.inc.php.sample)
===================================================================
--- trunk/config.inc.php (rev 0)
+++ trunk/config.inc.php 2007-10-04 13:53:45 UTC (rev 128)
@@ -0,0 +1,305 @@
+<?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");
+ exit;
+}
+
+/*****************************************************************
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ * The following line needs commenting out or removing before the
+ * application will run!
+ * Doing this implies you have changed this file as required.
+ */
+$CONF['configured'] = false;
+
+
+// Postfix Admin Path
+// Set the location of your Postfix Admin installation here.
+// You must enter complete url (http://domain.tld/) and full path (/var/www/postfixadmin)
+$CONF['postfix_admin_url'] = '';
+$CONF['postfix_admin_path'] = dirname(__FILE__);
+
+// Language config
+// Language files are located in './languages'.
+$CONF['default_language'] = 'en';
+
+// Database Config
+// mysql = MySQL 3.23 and 4.0
+// mysqli = MySQL 4.1
+// pgsql = PostgreSQL
+$CONF['database_type'] = 'mysql';
+$CONF['database_host'] = 'localhost';
+$CONF['database_user'] = 'postfixadmin';
+$CONF['database_password'] = 'postfixadmin';
+$CONF['database_name'] = 'postfix';
+$CONF['database_prefix'] = '';
+
+// Here, if you need, you can customize table names.
+$CONF['database_prefix'] = '';
+$CONF['database_tables'] = array (
+ 'admin' => 'admin',
+ 'alias' => 'alias',
+ 'domain' => 'domain',
+ 'domain_admins' => 'domain_admins',
+ 'log' => 'log',
+ 'mailbox' => 'mailbox',
+ 'vacation' => 'vacation',
+ 'vacation_notification' => 'vacation_notification',
+);
+
+// Site Admin
+// Define the Site Admins email address below.
+// This will be used to send emails from to create mailboxes.
+$CONF['admin_email'] = 'pos...@ch...';
+
+// Mail Server
+// Hostname (FQDN) of your mail server.
+// This is used to send email to Postfix in order to create mailboxes.
+$CONF['smtp_server'] = 'localhost';
+$CONF['smtp_port'] = '25';
+
+// Encrypt
+// In what way do you want the passwords to be crypted?
+// md5crypt = internal postfix admin md5
+// system = whatever you have set as your PHP system default
+// cleartext = clear text passwords (ouch!)
+$CONF['encrypt'] = 'md5crypt';
+
+// Minimum length required for passwords. Postfixadmin will not
+// allow users to set passwords which are shorter than this value.
+$CONF['min_password_length'] = 5;
+
+// Generate Password
+// Generate a random password for a mailbox or admin and display it.
+// If you want to automagically generate paswords set this to 'YES'.
+$CONF['generate_password'] = 'NO';
+
+// Show Password
+// Always show password after adding a mailbox or admin.
+// If you want to always see what password was set set this to 'YES'.
+$CONF['show_password'] = 'NO';
+
+// Page Size
+// Set the number of entries that you would like to see
+// in one page.
+$CONF['page_size'] = '10';
+
+// Default Aliases
+// The default aliases that need to be created for all domains.
+$CONF['default_aliases'] = array (
+ 'abuse' => 'ab...@ch...',
+ 'hostmaster' => 'hos...@ch...',
+ 'postmaster' => 'pos...@ch...',
+ 'webmaster' => 'web...@ch...'
+);
+
+// Mailboxes
+// If you want to store the mailboxes per domain set this to 'YES'.
+// Example: /usr/local/virtual/domain.tld/use...@do...
+$CONF['domain_path'] = 'NO';
+// If you don't want to have the domain in your mailbox set this to 'NO'.
+// Example: /usr/local/virtual/domain.tld/username
+$CONF['domain_in_mailbox'] = 'YES';
+
+// Default Domain Values
+// Specify your default values below. Quota in MB.
+$CONF['aliases'] = '10';
+$CONF['mailboxes'] = '10';
+$CONF['maxquota'] = '10';
+
+// Quota
+// When you want to enforce quota for your mailbox users set this to 'YES'.
+$CONF['quota'] = 'NO';
+// You can either use '1024000' or '1048576'
+$CONF['quota_multiplier'] = '1024000';
+
+// Transport
+// If you want to define additional transport options for a domain set this to 'YES'.
+// Read the transport file of the Postfix documentation.
+$CONF['transport'] = 'NO';
+// Transport options
+// If you want to define additional transport options put them in array below.
+$CONF['transport_options'] = array (
+ 'virtual', // for virtual accounts
+ 'local', // for system accounts
+ 'relay' // for backup mx
+);
+// Transport default
+// You should define default transport. It must be in array above.
+$CONF['transport_default'] = 'virtual';
+
+// Virtual Vacation
+// If you want to use virtual vacation for you mailbox users set this to 'YES'.
+// NOTE: Make sure that you install the vacation module. http://high5.net/postfixadmin/
+$CONF['vacation'] = 'NO';
+// This is the autoreply domain that you will need to set in your Postfix
+// transport maps to handle virtual vacations. It does not need to be a
+// real domain (i.e. you don't need to setup DNS for it).
+$CONF['vacation_domain'] = 'autoreply.change-this-to-your.domain.tld';
+
+// Vacation Control
+// If you want users to take control of vacation set this to 'YES'.
+// TODO: not implemented
+$CONF['vacation_control'] ='YES';
+
+// Vacation Control for admins
+// Set to 'YES' if your domain admins should be able to edit user vacation.
+$CONF['vacation_control_admin'] = 'YES';
+
+// Alias Control
+// Postfix Admin inserts an alias in the alias table for every mailbox it creates.
+// The reason for this is that when you want catch-all and normal mailboxes
+// to work you need to have the mailbox replicated in the alias table.
+// If you want to take control of these aliases as well set this to 'YES'.
+$CONF['alias_control'] = 'NO';
+
+// Alias Control for admins
+// Set to 'NO' if your domain admins shouldn't be able to edit user aliases.
+$CONF['alias_control_admin'] = 'NO';
+
+// Special Alias Control
+// Set to 'NO' if your domain admins shouldn't be able to edit default aliases.
+$CONF['special_alias_control'] = 'NO';
+
+// Alias Goto Field Limit
+// Set the max number of entries that you would like to see
+// in one 'goto' field in overview, the rest will be hidden and "[and X more...]" will be added.
+// '0' means no limits.
+$CONF['alias_goto_limit'] = '0';
+
+// Backup
+// If you don't want backup tab set this to 'NO';
+$CONF['backup'] = 'YES';
+
+// Send Mail
+// If you don't want sendmail tab set this to 'NO';
+$CONF['sendmail'] = 'YES';
+
+// Logging
+// If you don't want logging set this to 'NO';
+$CONF['logging'] = 'YES';
+
+// Header
+$CONF['show_header_text'] = 'NO';
+$CONF['header_text'] = ':: Postfix Admin ::';
+
+// link to display under 'Main' menu when logged in as a user.
+$CONF['user_footer_link'] = "http://change-this-to-your.domain.tld/main";
+
+// Footer
+// Below information will be on all pages.
+// If you don't want the footer information to appear set this to 'NO'.
+$CONF['show_footer_text'] = 'YES';
+$CONF['footer_text'] = 'Return to change-this-to-your.domain.tld';
+$CONF['footer_link'] = 'http://change-this-to-your.domain.tld';
+
+// Welcome Message
+// This message is send to every newly created mailbox.
+// Change the text between EOM.
+$CONF['welcome_text'] = <<<EOM
+Hi,
+
+Welcome to your new account.
+EOM;
+
+// When creating mailboxes, check that the domain-part of the
+// address is legal by performing a name server look-up.
+$CONF['emailcheck_resolve_domain']='YES';
+
+
+// Optional:
+// Analyze alias gotos and display a colored block in the first column
+// indicating if an alias or mailbox appears to deliver to a non-existent
+// account. Also, display indications, for POP/IMAP mailboxes and
+// for custom destinations (such as mailboxes that forward to a UNIX shell
+// account or mail that is sent to a MS exchange server, or any other
+// domain or subdomain you use)
+// See http://www.w3schools.com/html/html_colornames.asp for a list of
+// color names available on most browsers
+
+//set to YES to enable this feature
+$CONF['show_status']='NO';
+//display a guide to what these colors mean
+$CONF['show_status_key']='NO';
+// 'show_status_text' will be displayed with the background colors
+// associated with each status, you can customize it here
+$CONF['show_status_text']=' ';
+// show_undeliverable is useful if most accounts are delivered to this
+// postfix system. If many aliases and mailboxes are forwarded
+// elsewhere, you will probably want to disable this.
+$CONF['show_undeliverable']='NO';
+$CONF['show_undeliverable_color']='tomato';
+$CONF['show_undeliverable_exceptions']=array("unixmail.domain.ext","exchangeserver.domain.ext","gmail.com");
+$CONF['show_popimap']='NO';
+$CONF['show_popimap_color']='darkgrey';
+// set 'show_custom_count' to 0 to disable custom indicators
+$CONF['show_custom_count']=2;
+$CONF['show_custom_domains']=array("subdomain.domain.ext","domain2.ext");
+$CONF['show_custom_colors']=array("lightgreen","lightblue");
+
+
+// Optional:
+// Script to run after creation of mailboxes.
+// Note that this may fail if PHP is run in "safe mode", or if
+// operating system features (such as SELinux) or limitations
+// prevent the web-server from executing external scripts.
+// $CONF['mailbox_postcreation_script']='sudo -u courier /usr/local/bin/postfixadmin-mailbox-postcreation.sh';
+
+// Optional:
+// Script to run after deletion of mailboxes.
+// Note that this may fail if PHP is run in "safe mode", or if
+// operating system features (such as SELinux) or limitations
+// prevent the web-server from executing external scripts.
+// $CONF['mailbox_postdeletion_script']='sudo -u courier /usr/local/bin/postfixadmin-mailbox-postdeletion.sh';
+
+// Optional:
+// Script to run after deletion of domains.
+// Note that this may fail if PHP is run in "safe mode", or if
+// operating system features (such as SELinux) or limitations
+// prevent the web-server from executing external scripts.
+// $CONF['domain_postdeletion_script']='sudo -u courier /usr/local/bin/postfixadmin-domain-postdeletion.sh';
+
+// Optional:
+// Sub-folders which should automatically be created for new users.
+// The sub-folders will also be subscribed to automatically.
+// Will only work with IMAP server which implement sub-folders.
+// Will not work with POP3.
+// If you define create_mailbox_subdirs, then the
+// create_mailbox_subdirs_host must also be defined.
+//
+// $CONF['create_mailbox_subdirs']=array('Spam');
+// $CONF['create_mailbox_subdirs_host']='localhost';
+//
+// Normally, the TCP port number does not have to be specified.
+// $CONF['create_mailbox_subdirs_hostport']=143;
+//
+// If you have trouble connecting to the IMAP-server, then specify
+// a value for $CONF['create_mailbox_subdirs_hostoptions']. These
+// are some examples to experiment with:
+// $CONF['create_mailbox_subdirs_hostoptions']=array('notls');
+// $CONF['create_mailbox_subdirs_hostoptions']=array('novalidate-cert','norsh');
+// See also the "Optional flags for names" table at
+// http://www.php.net/manual/en/function.imap-open.php
+
+//
+// END OF CONFIG FILE
+//
+?>
Deleted: trunk/config.inc.php.sample
===================================================================
--- trunk/config.inc.php.sample 2007-10-04 07:34:10 UTC (rev 127)
+++ trunk/config.inc.php.sample 2007-10-04 13:53:45 UTC (rev 128)
@@ -1,292 +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://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");
- exit;
-}
-
-// Postfix Admin Path
-// Set the location of your Postfix Admin installation here.
-// You must enter complete url (http://domain.tld/) and full path (/var/www/postfixadmin)
-$CONF['postfix_admin_url'] = '';
-$CONF['postfix_admin_path'] = dirname(__FILE__);
-
-// Language config
-// Language files are located in './languages'.
-$CONF['default_language'] = 'en';
-
-// Database Config
-// mysql = MySQL 3.23 and 4.0
-// mysqli = MySQL 4.1
-// pgsql = PostgreSQL
-$CONF['database_type'] = 'mysql';
-$CONF['database_host'] = 'localhost';
-$CONF['database_user'] = 'postfixadmin';
-$CONF['database_password'] = 'postfixadmin';
-$CONF['database_name'] = 'postfix';
-$CONF['database_prefix'] = '';
-
-// Here, if you need, you can customize table names.
-$CONF['database_prefix'] = '';
-$CONF['database_tables'] = array (
- 'admin' => 'admin',
- 'alias' => 'alias',
- 'domain' => 'domain',
- 'domain_admins' => 'domain_admins',
- 'log' => 'log',
- 'mailbox' => 'mailbox',
- 'vacation' => 'vacation',
- 'vacation_notification' => 'vacation_notification',
-);
-
-// Site Admin
-// Define the Site Admins email address below.
-// This will be used to send emails from to create mailboxes.
-$CONF['admin_email'] = 'pos...@ch...';
-
-// Mail Server
-// Hostname (FQDN) of your mail server.
-// This is used to send email to Postfix in order to create mailboxes.
-$CONF['smtp_server'] = 'localhost';
-$CONF['smtp_port'] = '25';
-
-// Encrypt
-// In what way do you want the passwords to be crypted?
-// md5crypt = internal postfix admin md5
-// system = whatever you have set as your PHP system default
-// cleartext = clear text passwords (ouch!)
-$CONF['encrypt'] = 'md5crypt';
-
-// Generate Password
-// Generate a random password for a mailbox or admin and display it.
-// If you want to automagically generate paswords set this to 'YES'.
-$CONF['generate_password'] = 'NO';
-
-// Show Password
-// Always show password after adding a mailbox or admin.
-// If you want to always see what password was set set this to 'YES'.
-$CONF['show_password'] = 'NO';
-
-// Page Size
-// Set the number of entries that you would like to see
-// in one page.
-$CONF['page_size'] = '10';
-
-// Default Aliases
-// The default aliases that need to be created for all domains.
-$CONF['default_aliases'] = array (
- 'abuse' => 'ab...@ch...',
- 'hostmaster' => 'hos...@ch...',
- 'postmaster' => 'pos...@ch...',
- 'webmaster' => 'web...@ch...'
-);
-
-// Mailboxes
-// If you want to store the mailboxes per domain set this to 'YES'.
-// Example: /usr/local/virtual/domain.tld/use...@do...
-$CONF['domain_path'] = 'NO';
-// If you don't want to have the domain in your mailbox set this to 'NO'.
-// Example: /usr/local/virtual/domain.tld/username
-$CONF['domain_in_mailbox'] = 'YES';
-
-// Default Domain Values
-// Specify your default values below. Quota in MB.
-$CONF['aliases'] = '10';
-$CONF['mailboxes'] = '10';
-$CONF['maxquota'] = '10';
-
-// Quota
-// When you want to enforce quota for your mailbox users set this to 'YES'.
-$CONF['quota'] = 'NO';
-// You can either use '1024000' or '1048576'
-$CONF['quota_multiplier'] = '1024000';
-
-// Transport
-// If you want to define additional transport options for a domain set this to 'YES'.
-// Read the transport file of the Postfix documentation.
-$CONF['transport'] = 'NO';
-// Transport options
-// If you want to define additional transport options put them in array below.
-$CONF['transport_options'] = array (
- 'virtual', // for virtual accounts
- 'local', // for system accounts
- 'relay' // for backup mx
-);
-// Transport default
-// You should define default transport. It must be in array above.
-$CONF['transport_default'] = 'virtual';
-
-// Virtual Vacation
-// If you want to use virtual vacation for you mailbox users set this to 'YES'.
-// NOTE: Make sure that you install the vacation module. http://high5.net/postfixadmin/
-$CONF['vacation'] = 'NO';
-// This is the autoreply domain that you will need to set in your Postfix
-// transport maps to handle virtual vacations. It does not need to be a
-// real domain (i.e. you don't need to setup DNS for it).
-$CONF['vacation_domain'] = 'autoreply.change-this-to-your.domain.tld';
-
-// Vacation Control
-// If you want users to take control of vacation set this to 'YES'.
-// TODO: not implemented
-$CONF['vacation_control'] ='YES';
-
-// Vacation Control for admins
-// Set to 'YES' if your domain admins should be able to edit user vacation.
-$CONF['vacation_control_admin'] = 'YES';
-
-// Alias Control
-// Postfix Admin inserts an alias in the alias table for every mailbox it creates.
-// The reason for this is that when you want catch-all and normal mailboxes
-// to work you need to have the mailbox replicated in the alias table.
-// If you want to take control of these aliases as well set this to 'YES'.
-$CONF['alias_control'] = 'NO';
-
-// Alias Control for admins
-// Set to 'NO' if your domain admins shouldn't be able to edit user aliases.
-$CONF['alias_control_admin'] = 'NO';
-
-// Special Alias Control
-// Set to 'NO' if your domain admins shouldn't be able to edit default aliases.
-$CONF['special_alias_control'] = 'NO';
-
-// Alias Goto Field Limit
-// Set the max number of entries that you would like to see
-// in one 'goto' field in overview, the rest will be hidden and "[and X more...]" will be added.
-// '0' means no limits.
-$CONF['alias_goto_limit'] = '0';
-
-// Backup
-// If you don't want backup tab set this to 'NO';
-$CONF['backup'] = 'YES';
-
-// Send Mail
-// If you don't want sendmail tab set this to 'NO';
-$CONF['sendmail'] = 'YES';
-
-// Logging
-// If you don't want logging set this to 'NO';
-$CONF['logging'] = 'YES';
-
-// Header
-$CONF['show_header_text'] = 'NO';
-$CONF['header_text'] = ':: Postfix Admin ::';
-
-// link to display under 'Main' menu when logged in as a user.
-$CONF['user_footer_link'] = "http://change-this-to-your.domain.tld/main";
-
-// Footer
-// Below information will be on all pages.
-// If you don't want the footer information to appear set this to 'NO'.
-$CONF['show_footer_text'] = 'YES';
-$CONF['footer_text'] = 'Return to change-this-to-your.domain.tld';
-$CONF['footer_link'] = 'http://change-this-to-your.domain.tld';
-
-// Welcome Message
-// This message is send to every newly created mailbox.
-// Change the text between EOM.
-$CONF['welcome_text'] = <<<EOM
-Hi,
-
-Welcome to your new account.
-EOM;
-
-// When creating mailboxes, check that the domain-part of the
-// address is legal by performing a name server look-up.
-$CONF['emailcheck_resolve_domain']='YES';
-
-
-// Optional:
-// Analyze alias gotos and display a colored block in the first column
-// indicating if an alias or mailbox appears to deliver to a non-existent
-// account. Also, display indications, for POP/IMAP mailboxes and
-// for custom destinations (such as mailboxes that forward to a UNIX shell
-// account or mail that is sent to a MS exchange server, or any other
-// domain or subdomain you use)
-// See http://www.w3schools.com/html/html_colornames.asp for a list of
-// color names available on most browsers
-
-//set to YES to enable this feature
-$CONF['show_status']='NO';
-//display a guide to what these colors mean
-$CONF['show_status_key']='NO';
-// 'show_status_text' will be displayed with the background colors
-// associated with each status, you can customize it here
-$CONF['show_status_text']=' ';
-// show_undeliverable is useful if most accounts are delivered to this
-// postfix system. If many aliases and mailboxes are forwarded
-// elsewhere, you will probably want to disable this.
-$CONF['show_undeliverable']='NO';
-$CONF['show_undeliverable_color']='tomato';
-$CONF['show_undeliverable_exceptions']=array("unixmail.domain.ext","exchangeserver.domain.ext","gmail.com");
-$CONF['show_popimap']='NO';
-$CONF['show_popimap_color']='darkgrey';
-// set 'show_custom_count' to 0 to disable custom indicators
-$CONF['show_custom_count']=2;
-$CONF['show_custom_domains']=array("subdomain.domain.ext","domain2.ext");
-$CONF['show_custom_colors']=array("lightgreen","lightblue");
-
-
-// Optional:
-// Script to run after creation of mailboxes.
-// Note that this may fail if PHP is run in "safe mode", or if
-// operating system features (such as SELinux) or limitations
-// prevent the web-server from executing external scripts.
-// $CONF['mailbox_postcreation_script']='sudo -u courier /usr/local/bin/postfixadmin-mailbox-postcreation.sh';
-
-// Optional:
-// Script to run after deletion of mailboxes.
-// Note that this may fail if PHP is run in "safe mode", or if
-// operating system features (such as SELinux) or limitations
-// prevent the web-server from executing external scripts.
-// $CONF['mailbox_postdeletion_script']='sudo -u courier /usr/local/bin/postfixadmin-mailbox-postdeletion.sh';
-
-// Optional:
-// Script to run after deletion of domains.
-// Note that this may fail if PHP is run in "safe mode", or if
-// operating system features (such as SELinux) or limitations
-// prevent the web-server from executing external scripts.
-// $CONF['domain_postdeletion_script']='sudo -u courier /usr/local/bin/postfixadmin-domain-postdeletion.sh';
-
-// Optional:
-// Sub-folders which should automatically be created for new users.
-// The sub-folders will also be subscribed to automatically.
-// Will only work with IMAP server which implement sub-folders.
-// Will not work with POP3.
-// If you define create_mailbox_subdirs, then the
-// create_mailbox_subdirs_host must also be defined.
-//
-// $CONF['create_mailbox_subdirs']=array('Spam');
-// $CONF['create_mailbox_subdirs_host']='localhost';
-//
-// Normally, the TCP port number does not have to be specified.
-// $CONF['create_mailbox_subdirs_hostport']=143;
-//
-// If you have trouble connecting to the IMAP-server, then specify
-// a value for $CONF['create_mailbox_subdirs_hostoptions']. These
-// are some examples to experiment with:
-// $CONF['create_mailbox_subdirs_hostoptions']=array('notls');
-// $CONF['create_mailbox_subdirs_hostoptions']=array('novalidate-cert','norsh');
-// See also the "Optional flags for names" table at
-// http://www.php.net/manual/en/function.imap-open.php
-
-//
-// END OF CONFIG FILE
-//
-?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Gin...@us...> - 2007-10-04 07:34:07
|
Revision: 127
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=127&view=rev
Author: GingerDog
Date: 2007-10-04 00:34:10 -0700 (Thu, 04 Oct 2007)
Log Message:
-----------
vacation.pl: patch from kope (via forum post at http://sourceforge.net/forum/forum.php?thread_id=1837942&forum_id=676076) - Thankyou
Modified Paths:
--------------
trunk/VIRTUAL_VACATION/vacation.pl
Modified: trunk/VIRTUAL_VACATION/vacation.pl
===================================================================
--- trunk/VIRTUAL_VACATION/vacation.pl 2007-10-04 00:01:07 UTC (rev 126)
+++ trunk/VIRTUAL_VACATION/vacation.pl 2007-10-04 07:34:10 UTC (rev 127)
@@ -315,13 +315,15 @@
# Take headers apart
while (<STDIN>) {
last if (/^$/);
- if (/^\s+(.*)/ and $lastheader) { $$lastheader .= " $1"; }
- if (/^from:\s+(.*)\n$/i) { $from = $1; $lastheader = \$from; }
- if (/^to:\s+(.*)\n$/i) { $to = $1; $lastheader = \$to; }
- if (/^cc:\s+(.*)\n$/i) { $cc = $1; $lastheader = \$cc; }
- if (/^message-id:\s+(.*)\n$/i) { $messageid = $1; $lastheader = \$messageid; }
- if (/^precedence:\s+(bulk|list|junk)/i) { exit (0); }
- if (/^x-loop:\s+postfix\ admin\ virtual\ vacation/i) { exit (0); }
+ if (/^\s+(.*)/ and $lastheader) { $$lastheader .= " $1"; }
+ elsif (/^from:\s+(.*)\n$/i) { $from = $1; $lastheader = \$from; }
+ elsif (/^to:\s+(.*)\n$/i) { $to = $1; $lastheader = \$to; }
+ elsif (/^cc:\s+(.*)\n$/i) { $cc = $1; $lastheader = \$cc; }
+ elsif (/^subject:\s+(.*)\n$/i) { $subject = $1; $lastheader = \$subject; }
+ elsif (/^message-id:\s+(.*)\n$/i) { $messageid = $1; $lastheader = \$messageid; }
+ elsif (/^precedence:\s+(bulk|list|junk)/i) { exit (0); }
+ elsif (/^x-loop:\s+postfix\ admin\ virtual\ vacation/i) { exit (0); }
+ else {$lastheader = "" ; }
}
# If either From: or To: are not set, exit
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2007-10-04 00:01:17
|
Revision: 126
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=126&view=rev
Author: christian_boltz
Date: 2007-10-03 17:01:07 -0700 (Wed, 03 Oct 2007)
Log Message:
-----------
- merge admin/search.php into search.php
- merge GET and POST code
- admin/search.php still has the old code commented out
@pgsql users: please test the search - I can't promise that everything works.
There are several TODOs / open questions regarding pgsql in search.php currently...
Modified Paths:
--------------
trunk/admin/search.php
trunk/search.php
Modified: trunk/admin/search.php
===================================================================
--- trunk/admin/search.php 2007-10-03 22:55:01 UTC (rev 125)
+++ trunk/admin/search.php 2007-10-04 00:01:07 UTC (rev 126)
@@ -30,6 +30,9 @@
require_once('../common.php');
+require_once('../search.php');
+
+/*
authentication_require_role('global-admin');
$tAlias = array();
@@ -97,7 +100,7 @@
include ("../templates/header.tpl");
include ("../templates/admin_menu.tpl");
- include ("../templates/admin_search.tpl");
+ include ("../templates/search.tpl");
include ("../templates/footer.tpl");
}
@@ -169,8 +172,9 @@
include ("../templates/header.tpl");
include ("../templates/admin_menu.tpl");
- include ("../templates/admin_search.tpl");
+ include ("../templates/search.tpl");
include ("../templates/footer.tpl");
}
+*/
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/search.php
===================================================================
--- trunk/search.php 2007-10-03 22:55:01 UTC (rev 125)
+++ trunk/search.php 2007-10-04 00:01:07 UTC (rev 126)
@@ -46,63 +46,8 @@
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'])
- {
- $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'])
- {
- $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 (isset ($_GET['fGo'])) $fGo = escape_string ($_GET['fGo']);
+ if (isset ($_GET['fDomain'])) $fDomain = escape_string ($_GET['domain']);
}
if ($_SERVER['REQUEST_METHOD'] == "POST")
@@ -110,8 +55,9 @@
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 (empty ($fSearch) /* && !empty ($fGo) */)
{
if (authentication_has_role('global-admin'))
{
@@ -123,7 +69,6 @@
}
}
-
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";
@@ -138,47 +83,71 @@
{
while ($row = db_array ($result['result']))
{
- if (check_owner ($SESSID_USERNAME, $row['domain']))
+ if (check_owner ($SESSID_USERNAME, $row['domain']) || authentication_has_role('global-admin'))
{
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");
+ # TODO: special query for pgsql needed?
}
else
{
$query = "SELECT * FROM $table_mailbox WHERE username LIKE '%$fSearch%' OR name LIKE '%$fSearch%' ORDER BY username";
+ /* TODO: special query for pgsql really needed?
+ if ('pgsql'==$CONF['database_type'])
+ {
+ $query = "SELECT *,extract(epoch from created) as uts_created,extract(epoch from modified) as uts_modified FROM $table_mailbox WHERE username LIKE '%$fSearch%' OR name LIKE '%$fSearch%' ORDER BY username";
+ }
+ */
}
- $result = db_query ("$query");
+ $result = db_query ($query);
if ($result['rows'] > 0)
{
while ($row = db_array ($result['result']))
{
- if (check_owner ($SESSID_USERNAME, $row['domain']))
+ if (check_owner ($SESSID_USERNAME, $row['domain']) || authentication_has_role('global-admin'))
{
if ('pgsql'==$CONF['database_type'])
{
+ $row['created']=gmstrftime('%c %Z',$row['created']);
$row['modified']=gmstrftime('%c %Z',$row['modified']);
+ # TODO: code from admin/search.php
+ # $row['created']=gmstrftime('%c %Z',$row['uts_created']);
+ # $row['modified']=gmstrftime('%c %Z',$row['uts_modified']);
$row['active']=('t'==$row['active']) ? 1 : 0;
- }
+ # TODO: code from admin/search.php
+ # unset($row['uts_created']);
+ # unset($row['uts_modified']);
+ }
$tMailbox[] = $row;
}
}
}
- include ("./templates/header.tpl");
- include ("./templates/menu.tpl");
- include ("./templates/search.tpl");
- include ("./templates/footer.tpl");
+include ("$incpath/templates/header.tpl");
+
+if (authentication_has_role('global-admin')) {
+ include ("$incpath/templates/admin_menu.tpl");
+} else {
+ include ("$incpath/templates/menu.tpl");
}
+
+include ("$incpath/templates/search.tpl");
+include ("$incpath/templates/footer.tpl");
+
?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2007-10-03 22:54:57
|
Revision: 125
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=125&view=rev
Author: christian_boltz
Date: 2007-10-03 15:55:01 -0700 (Wed, 03 Oct 2007)
Log Message:
-----------
- added 'create admin' link
Modified Paths:
--------------
trunk/templates/admin_list-admin.tpl
Modified: trunk/templates/admin_list-admin.tpl
===================================================================
--- trunk/templates/admin_list-admin.tpl 2007-10-03 22:49:19 UTC (rev 124)
+++ trunk/templates/admin_list-admin.tpl 2007-10-03 22:55:01 UTC (rev 125)
@@ -28,5 +28,8 @@
}
print "</table>\n";
+ print "<p><a href=\"create-admin.php\">" . $PALANG['pAdminMenu_create_admin'] . "</a>\n";
}
+
+/* vim: set ft=php expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2007-10-03 22:49:17
|
Revision: 124
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=124&view=rev
Author: christian_boltz
Date: 2007-10-03 15:49:19 -0700 (Wed, 03 Oct 2007)
Log Message:
-----------
- fix: unlimited is 0, not -1
- remove debugging code
Modified Paths:
--------------
trunk/admin/list-virtual.php
Modified: trunk/admin/list-virtual.php
===================================================================
--- trunk/admin/list-virtual.php 2007-10-03 22:41:01 UTC (rev 123)
+++ trunk/admin/list-virtual.php 2007-10-03 22:49:19 UTC (rev 124)
@@ -138,20 +138,17 @@
if($active == 't' || $active == 1) {
$backup_mx = $limit['backupmx'];
if($backup_mx == 'f' || $backup_mx == 0) {
- if($limit['aliases'] == -1) {
+ if($limit['aliases'] == 0) {
$tCanAddAlias = true;
}
elseif($limit['alias_count'] < $limit['aliases']) {
$tCanAddAlias = true;
- echo 'xxx2';
}
- if($limit['mailboxes'] == -1) {
+ if($limit['mailboxes'] == 0) {
$tCanAddMailbox = true;
- echo 'xxx3';
}
elseif($limit['mailbox_count'] < $limit['mailboxes']) {
$tCanAddMailbox = true;
- echo 'xxx4';
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2007-10-03 22:40:58
|
Revision: 123
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=123&view=rev
Author: christian_boltz
Date: 2007-10-03 15:41:01 -0700 (Wed, 03 Oct 2007)
Log Message:
-----------
fix password handling:
- always check if password == password2 (even if password2 is empty)
- skip changing password if new password is empty. Reasons:
- empty passwords are insecure
- editing an admin does not always mean to edit the password. One might
edit the allowed domains without even knowing the password of the
edited admin.
Modified Paths:
--------------
trunk/admin/edit-admin.php
Modified: trunk/admin/edit-admin.php
===================================================================
--- trunk/admin/edit-admin.php 2007-10-03 00:55:55 UTC (rev 122)
+++ trunk/admin/edit-admin.php 2007-10-03 22:41:01 UTC (rev 123)
@@ -40,13 +40,19 @@
if ($_SERVER['REQUEST_METHOD'] == "POST")
{
- $fPassword = 'x';
- $fPassword = 'y';
+ $fPassword = '';
+ $fPassword2 = '';
if(isset ($_GET['username'])) $username = escape_string ($_GET['username']);
if(isset ($_POST['fPassword'])) $fPassword = escape_string ($_POST['fPassword']);
if(isset ($_POST['fPassword2'])) $fPassword2 = escape_string ($_POST['fPassword2']);
+ if ($fPassword != $fPassword2)
+ {
+ $error = 1;
+ $pAdminEdit_admin_password_text = $PALANG['pAdminEdit_admin_password_text_error'];
+ }
+
$fActive=(isset($_POST['fActive'])) ? escape_string ($_POST['fActive']) : FALSE;
$fSadmin=(isset($_POST['fSadmin'])) ? escape_string ($_POST['fSadmin']) : FALSE;
@@ -64,19 +70,13 @@
// has the password changed?
if($fPassword != $originalPassword) {
if(!empty($_POST['fPassword2'])) {
- if ($fPassword != $fPassword2)
- {
- $error = 1;
- $pAdminEdit_admin_password_text = $PALANG['pAdminEdit_admin_password_text_error'];
- }
- else {
- $fPassword = pacrypt($fPassword);
- }
+ $fPassword = pacrypt($fPassword);
}
}
$tActive = $fActive;
- $tDomains = escape_string ($_POST['fDomains']);
+ $fDomains = array();
+ if (array_key_exists('fDomains', $_POST)) $tDomains = escape_string ($_POST['fDomains']);
if ($error != 1)
{
if ($fActive == "on") {
@@ -86,9 +86,12 @@
$sqlActive = db_get_boolean(False);
}
+ $password_query = '';
+ if ($fPassword != '') { # do not change password to empty one
+ $password_query = ", password='$fPassword'";
+ }
+ $result = db_query ("UPDATE $table_admin SET modified=NOW(),active='$sqlActive' $password_query WHERE username='$username'");
- $result = db_query ("UPDATE $table_admin SET modified=NOW(),active='$sqlActive', password='$fPassword' WHERE username='$username'");
-
if ($fSadmin == "on") $fSadmin = 'ALL';
// delete everything, and put it back later on..
@@ -111,6 +114,8 @@
else { // GET request.
if (isset($_GET['username'])) $username = escape_string ($_GET['username']);
+ # TODO: read "active" state from database and tick on the checkbox for active admins
+
$tAllDomains = list_domains();
$tDomains = list_domains_for_admin ($username);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2007-10-03 00:55:51
|
Revision: 122
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=122&view=rev
Author: christian_boltz
Date: 2007-10-02 17:55:55 -0700 (Tue, 02 Oct 2007)
Log Message:
-----------
- workaround for undefined variables (needed after template merge)
Modified Paths:
--------------
trunk/overview.php
Modified: trunk/overview.php
===================================================================
--- trunk/overview.php 2007-10-03 00:51:47 UTC (rev 121)
+++ trunk/overview.php 2007-10-03 00:55:55 UTC (rev 122)
@@ -62,6 +62,9 @@
if (check_owner ($SESSID_USERNAME, $fDomain))
{
+ $tCanAddAlias = 1; # TODO: workaround for undefined variable
+ $tCanAddMailbox = 1; # TODO: workaround for undefined variable
+
$query = "SELECT $table_alias.address,$table_alias.goto,$table_alias.modified,$table_alias.active FROM $table_alias LEFT JOIN $table_mailbox ON $table_alias.address=$table_mailbox.username WHERE $table_alias.domain='$fDomain' AND $table_mailbox.maildir IS NULL ORDER BY $table_alias.address LIMIT $limitSql";
if ('pgsql'==$CONF['database_type'])
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2007-10-03 00:51:44
|
Revision: 121
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=121&view=rev
Author: christian_boltz
Date: 2007-10-02 17:51:47 -0700 (Tue, 02 Oct 2007)
Log Message:
-----------
- merge admin_list-virtual.tpl into overview.tpl
- deleted admin_list-virtual.tpl
- admin/list-virtual.php now uses overview.tpl template
Modified Paths:
--------------
trunk/admin/list-virtual.php
trunk/templates/overview.tpl
Removed Paths:
-------------
trunk/templates/admin_list-virtual.tpl
Modified: trunk/admin/list-virtual.php
===================================================================
--- trunk/admin/list-virtual.php 2007-10-02 23:31:47 UTC (rev 120)
+++ trunk/admin/list-virtual.php 2007-10-03 00:51:47 UTC (rev 121)
@@ -15,7 +15,7 @@
* File: list-virtual.php
* List virtual users for a domain.
*
- * Template File: admin_list-virtual.tpl
+ * Template File: overview.tpl
*
* Template Variables:
*
@@ -160,7 +160,7 @@
include ("../templates/header.tpl");
include ("../templates/admin_menu.tpl");
-include ("../templates/admin_list-virtual.tpl");
+include ("../templates/overview.tpl");
include ("../templates/footer.tpl");
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
Deleted: trunk/templates/admin_list-virtual.tpl
===================================================================
--- trunk/templates/admin_list-virtual.tpl 2007-10-02 23:31:47 UTC (rev 120)
+++ trunk/templates/admin_list-virtual.tpl 2007-10-03 00:51:47 UTC (rev 121)
@@ -1,259 +0,0 @@
-<div id="admin_virtual">
-<form name="overview" method="post">
-<select name="fDomain" onChange="this.form.submit();">
-<?php
-for ($i = 0; $i < sizeof ($list_domains); $i++)
-{
- if ($fDomain == $list_domains[$i])
- {
- print "<option value=\"$list_domains[$i]\" selected>$list_domains[$i]</option>\n";
- }
- else
- {
- print "<option value=\"$list_domains[$i]\">$list_domains[$i]</option>\n";
- }
-}
-?>
-</select>
-<input type="hidden" name="limit" value="0" />
-<input type="submit" name="go" value="<?php print $PALANG['pAdminList_virtual_button']; ?>" />
-</form>
-<h4><?php print $PALANG['pAdminList_virtual_welcome'] . $fDomain; ?></h4>
-<p><?php print $PALANG['pAdminList_virtual_alias_alias_count'] . ": " . $limit['alias_count'] . " / " . $limit['aliases']; ?></p>
-<p><?php print $PALANG['pAdminList_virtual_alias_mailbox_count'] . ": " . $limit['mailbox_count'] . " / " . $limit['mailboxes']; ?></p>
-<form name="search" method="post" action="search.php"><?php print $PALANG['pSearch']; ?>:
-<input type="textbox" name="search" size="10" />
-</form>
-</div>
-
-<div id="nav_bar">
- <table width=730><colgroup span="1"><col width="550"></col></colgroup>
- <tr><td align=left >
-<?php
-if ($limit['alias_pgindex_count'] ) print "<b>".$PALANG['pOverview_alias_title']."</b>  ";
-($tDisplay_back_show == 1) ? $highlight_at = $tDisplay_back / $CONF['page_size'] + 1 : $highlight_at = 0;
-$current_limit=$highlight_at * $CONF['page_size'];
-for ($i = 0; $i < $limit['alias_pgindex_count']; $i++)
-{
- if ( $i == $highlight_at )
- {
- print "<a href=\"list-virtual.php?domain=$fDomain&limit=" . $i * $CONF['page_size'] . "\"><b>" . $limit['alias_pgindex'][$i] . "</b></a>\n";
- }
- else
- {
- print "<a href=\"list-virtual.php?domain=$fDomain&limit=" . $i * $CONF['page_size'] . "\">" . $limit['alias_pgindex'][$i] . "</a>\n";
- }
-}
-print "</td><td valign=middle align=right>";
-
-if ($tDisplay_back_show == 1)
-{
- print "<a href=\"list-virtual.php?domain=$fDomain&limit=$tDisplay_back\"><img border=\"0\" src=\"../images/arrow-l.png\" title=\"" . $PALANG['pOverview_left_arrow'] . "\" alt=\"" . $PALANG['pOverview_left_arrow'] . "\" /></a>\n";
-}
-if ($tDisplay_up_show == 1)
-{
- print "<a href=\"list-virtual.php?domain=$fDomain&limit=0\"><img border=\"0\" src=\"../images/arrow-u.png\" title=\"" . $PALANG['pOverview_up_arrow'] . "\" alt=\"" . $PALANG['pOverview_up_arrow'] . "\" /></a>\n";
-}
-if ($tDisplay_next_show == 1)
-{
- print "<a href=\"list-virtual.php?domain=$fDomain&limit=$tDisplay_next\"><img border=\"0\" src=\"../images/arrow-r.png\" title=\"" . $PALANG['pOverview_right_arrow'] . "\" alt=\"" . $PALANG['pOverview_right_arrow'] . "\" /></a>\n";
-}
-print "</td></tr></table></div>\n";
-
-
-if (sizeof ($tAlias) > 0)
-{
- print "<table id=\"alias_table\">\n";
- print " <tr>\n";
- print " <td colspan=\"6\"><h3>" . $PALANG['pOverview_alias_title'] . "</h3></td>";
- print " </tr>";
- print " <tr class=\"header\">\n";
- if ($CONF['show_status'] == 'YES') { print "<td></td>\n"; }
- print " <td>" . $PALANG['pAdminList_virtual_alias_address'] . "</td>\n";
- print " <td>" . $PALANG['pAdminList_virtual_alias_goto'] . "</td>\n";
- print " <td>" . $PALANG['pAdminList_virtual_alias_modified'] . "</td>\n";
- print " <td>" . $PALANG['pAdminList_virtual_alias_active'] . "</td>\n";
- print " <td colspan=\"2\"> </td>\n";
- print " </tr>\n";
-
- for ($i = 0; $i < sizeof ($tAlias); $i++)
- {
- if ((is_array ($tAlias) and sizeof ($tAlias) > 0))
- {
- print " <tr class=\"hilightoff\" onMouseOver=\"className='hilighton';\" onMouseOut=\"className='hilightoff';\">\n";
- if ($CONF['show_status'] == 'YES')
- {
- print " <td>" . gen_show_status($tAlias[$i]['address']) . "</td>\n";
- }
-
- print " <td>" . $tAlias[$i]['address'] . "</td>\n";
- if ($CONF['alias_goto_limit'] > 0) {
- print " <td>" . ereg_replace (",", "<br>", preg_replace('/^(([^,]+,){'.$CONF['alias_goto_limit'].'})[^,]+,.*/','$1[and '. (substr_count ($tAlias[$i]['goto'], ',') - $CONF['alias_goto_limit'] + 1) .' more...]',$tAlias[$i]['goto'])) . "</td>\n";
- } else {
- print " <td>" . ereg_replace (",", "<br>", $tAlias[$i]['goto']) . "</td>\n";
- }
- print " <td>" . $tAlias[$i]['modified'] . "</td>\n";
- $active = ($tAlias[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO'];
- print " <td><a href=\"edit-active.php?alias=" . urlencode ($tAlias[$i]['address']) . "&domain=$fDomain&return=list-virtual.php?domain=$fDomain" . urlencode ("&limit=" . $current_limit) . "\">" . $active . "</a></td>\n";
- print " <td><a href=\"edit-alias.php?address=" . urlencode ($tAlias[$i]['address']) . "&domain=$fDomain" . "\">" . $PALANG['edit'] . "</a></td>\n";
- print " <td><a href=\"delete.php?table=alias" . "&delete=" . urlencode ($tAlias[$i]['address']) . "&domain=$fDomain" . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_aliases'] . ": ". $tAlias[$i]['address'] . "')\">" . $PALANG['del'] . "</a></td>\n";
- print " </tr>\n";
- }
- }
- print "</table>\n";
-}
-if($tCanAddAlias) {
- print "<p><a href=\"create-alias.php?domain=$fDomain\">" . $PALANG['pMenu_create_alias'] . "</a>\n";
-}
-
- print "<div id=\"nav_bar\"><a name=\"MidArrow\" /a>\n<table width=730><colgroup span=\"1\"> <col width=\"550\"></col></colgroup> <tr><td align=left >";
- if ( $limit['mbox_pgindex_count'] ) print "<b>".$PALANG['pOverview_mailbox_title']."</b>  ";
- ($tDisplay_back_show == 1) ? $highlight_at = $tDisplay_back / $CONF['page_size'] + 1 : $highlight_at = 0;
- for ($i = 0; $i < $limit['mbox_pgindex_count']; $i++)
- {
- if ( $i == $highlight_at )
- {
- print "<a href=\"list-virtual.php?domain=$fDomain&limit=" . $i * $CONF['page_size'] . "#MidArrow\"><b>" . $limit['mbox_pgindex'][$i] . "</b></a>\n";
- }
- else
- {
- print "<a href=\"list-virtual.php?domain=$fDomain&limit=" . $i * $CONF['page_size'] . "#MidArrow\">" . $limit['mbox_pgindex'][$i] . "</a>\n";
- }
- }
- print "</td><td valign=middle align=right>";
-
-
-if ($tDisplay_back_show == 1)
-{
- print "<a href=\"list-virtual.php?domain=$fDomain&limit=$tDisplay_back#MidArrow\"><img border=\"0\" src=\"../images/arrow-l.png\" title=\"" . $PALANG['pOverview_left_arrow'] . "\" alt=\"" . $PALANG['pOverview_left_arrow'] . "\" /></a>\n";
-}
-if ($tDisplay_up_show == 1)
-{
- print "<a href=\"list-virtual.php?domain=$fDomain&limit=0#MidArrow\"><img border=\"0\" src=\"../images/arrow-u.png\" title=\"" . $PALANG['pOverview_up_arrow'] . "\" alt=\"" . $PALANG['pOverview_up_arrow'] . "\" /></a>\n";
-}
-if ($tDisplay_next_show == 1)
-{
- print "<a href=\"list-virtual.php?domain=$fDomain&limit=$tDisplay_next#MidArrow\"><img border=\"0\" src=\"../images/arrow-r.png\" title=\"" . $PALANG['pOverview_right_arrow'] . "\" alt=\"" . $PALANG['pOverview_right_arrow'] . "\" /></a>\n";
-}
-print "</td></tr></table></div>\n";
-
-
-if (sizeof ($tMailbox) > 0)
-{
- print "<table id=\"mailbox_table\">\n";
- print " <tr>\n";
- print " <td colspan=\"7\"><h3>" . $PALANG['pOverview_mailbox_title'] . "</h3></td>";
- print " </tr>";
- print " <tr class=\"header\">\n";
- if ($CONF['show_status'] == 'YES') { print "<td></td>\n"; }
- print " <td>" . $PALANG['pAdminList_virtual_mailbox_username'] . "</td>\n";
- print " <td>" . $PALANG['pAdminList_virtual_mailbox_name'] . "</td>\n";
- if ($CONF['quota'] == 'YES') print " <td>" . $PALANG['pAdminList_virtual_mailbox_quota'] . "</td>\n";
- print " <td>" . $PALANG['pAdminList_virtual_mailbox_modified'] . "</td>\n";
- print " <td>" . $PALANG['pAdminList_virtual_mailbox_active'] . "</td>\n";
- if ($CONF['alias_control'] == 'YES')
- {
- print " <td colspan=\"3\"> </td>\n";
- }
- else
- {
- print " <td colspan=\"2\"> </td>\n";
- }
- print " </tr>\n";
-
- for ($i = 0; $i < sizeof ($tMailbox); $i++)
- {
- if ((is_array ($tMailbox) and sizeof ($tMailbox) > 0))
- {
- print " <tr class=\"hilightoff\" onMouseOver=\"className='hilighton';\" onMouseOut=\"className='hilightoff';\">\n";
-
- if ($CONF['show_status'] == 'YES')
- {
- print " <td>" . gen_show_status($tMailbox[$i]['username']) . "</td>\n";
- }
-
- print " <td>" . $tMailbox[$i]['username'] . "</td>\n";
- print " <td>" . $tMailbox[$i]['name'] . "</td>\n";
- if ($CONF['quota'] == 'YES')
- {
- print " <td>";
- if ($tMailbox[$i]['quota'] == 0)
- {
- print $PALANG['pOverview_unlimited'];
- }
- elseif ($tMailbox[$i]['quota'] < 0)
- {
- print $PALANG['pOverview_disabled'];
- }
- else
- {
- print divide_quota ($tMailbox[$i]['quota']);
- }
- print "</td>\n";
- }
- print " <td>" . $tMailbox[$i]['modified'] . "</td>\n";
- $active = ($tMailbox[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO'];
- print " <td><a href=\"edit-active.php?username=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\">" . $active . "</a></td>\n";
-
- if ($CONF['vacation_control_admin'] == 'YES')
- {
- $v_active = ($tMailbox[$i]['v_active'] == 1) ? $PALANG['pOverview_vacation_edit'] : $PALANG['pOverview_vacation_option'];
- print " <td><a href=\"edit-vacation.php?username=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\">" .$v_active . "</a></td>\n";
- }
-
- if ($CONF['alias_control'] == 'YES')
- {
- print " <td><a href=\"edit-alias.php?address=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\">" . $PALANG['pOverview_alias_edit'] . "</a></td>\n";
- }
- print " <td><a href=\"edit-mailbox.php?username=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\">" . $PALANG['edit'] . "</a></td>\n";
- print " <td><a href=\"delete.php?table=mailbox" . "&delete=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_mailboxes'] . ": ". $tMailbox[$i]['username'] . "')\">" . $PALANG['del'] . "</a></td>\n";
- print " </tr>\n";
- }
- }
- print "</table>\n";
- print "<div id=\"nav_bar\"><a name=\"LowArrow\" /a>\n";
- if ($tDisplay_back_show == 1)
- {
- print "<a href=\"list-virtual.php?domain=$fDomain&limit=$tDisplay_back#LowArrow\"><img border=\"0\" src=\"../images/arrow-l.png\" title=\"" . $PALANG['pOverview_left_arrow'] . "\" alt=\"" . $PALANG['pOverview_left_arrow'] . "\" /></a>\n";
- }
- if ($tDisplay_up_show == 1)
- {
- print "<a href=\"list-virtual.php?domain=$fDomain&limit=0#LowArrow\"><img border=\"0\" src=\"../images/arrow-u.png\" title=\"" . $PALANG['pOverview_up_arrow'] . "\" alt=\"" . $PALANG['pOverview_up_arrow'] . "\" /></a>\n";
- }
- if ($tDisplay_next_show == 1)
- {
- print "<a href=\"list-virtual.php?domain=$fDomain&limit=$tDisplay_next#LowArrow\"><img border=\"0\" src=\"../images/arrow-r.png\" title=\"" . $PALANG['pOverview_right_arrow'] . "\" alt=\"" . $PALANG['pOverview_right_arrow'] . "\" /></a>\n";
- }
- print "</div>\n";
-
-}
-if($tCanAddMailbox) {
- print "<p><a href=\"create-mailbox.php?domain=$fDomain\">" . $PALANG['pMenu_create_mailbox'] . "</a>\n";
-}
-
-if ($CONF['show_status'] == 'YES' && $CONF['show_status_key'] == 'YES')
-{
- print "<br><br>";
- if ($CONF['show_undeliverable'] == 'YES')
- {
- print " <span style='background-color:" . $CONF['show_undeliverable_color'] .
- "'>" . $CONF['show_status_text'] . "</span>=" . $PALANG['pStatus_undeliverable'] . "\n";
- }
- if ($CONF['show_popimap'] == 'YES')
- {
- print " <span style='background-color:" . $CONF['show_popimap_color'] .
- "'>" . $CONF['show_status_text'] . "</span>=" . $PALANG['pStatus_popimap'] . "\n";
- }
- if ( $CONF['show_custom_count'] > 0 )
- {
- for ($i = 0; $i < sizeof ($CONF['show_custom_domains']); $i++)
- {
- print " <span style='background-color:" . $CONF['show_custom_colors'][$i] . "'>" .
- $CONF['show_status_text'] . "</span>=" . $PALANG['pStatus_custom'] .
- $CONF['show_custom_domains'][$i] . "\n";
- }
- }
-
-}
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
-?>
Modified: trunk/templates/overview.tpl
===================================================================
--- trunk/templates/overview.tpl 2007-10-02 23:31:47 UTC (rev 120)
+++ trunk/templates/overview.tpl 2007-10-03 00:51:47 UTC (rev 121)
@@ -1,7 +1,16 @@
<div id="overview">
-<form name="overview" method="get">
-<select name="domain" onChange="this.form.submit();">
+<form name="overview" method="post">
+<select name="fDomain" onChange="this.form.submit();">
<?php
+
+if (authentication_has_role('global-admin')) {
+ $file = 'list-virtual.php';
+ $incpath = '..'; # warning: overrides $incpath from common.php - TODO: fix common.php $incpath
+} else {
+ $file = 'overview.php';
+ $incpath = '.'; # warning: overrides $incpath from common.php - TODO: fix common.php $incpath
+}
+
if ($limit['aliases'] == 0) $limit['aliases'] = $PALANG['pOverview_unlimited'];
if ($limit['mailboxes'] == 0) $limit['mailboxes'] = $PALANG['pOverview_unlimited'];
if ($limit['maxquota'] == 0) $limit['maxquota'] = $PALANG['pOverview_unlimited'];
@@ -22,43 +31,56 @@
}
?>
</select>
-<input type="hidden" name="limit" value="0">
+<input type="hidden" name="limit" value="0" />
<input class="button" type="submit" name="go" value="<?php print $PALANG['pOverview_button']; ?>" />
</form>
<h4><?php print $PALANG['pOverview_welcome'] . $fDomain; ?></h4>
<p><?php print $PALANG['pOverview_alias_alias_count'] . ": " . $limit['alias_count'] . " / " . $limit['aliases']; ?></p>
<p><?php print $PALANG['pOverview_alias_mailbox_count'] . ": " . $limit['mailbox_count'] . " / " . $limit['mailboxes']; ?></p>
-<?php print $PALANG['pSearch']; ?>:<form name="search" method="post" action="search.php">
-<input type="textbox" name="search" size="10">
+<form name="search" method="post" action="search.php"><?php print $PALANG['pSearch']; ?>:
+<input type="textbox" name="search" size="10" />
</form>
</div>
+<div id="nav_bar">
+ <table width=730><colgroup span="1"><col width="550"></col></colgroup>
+ <tr><td align=left >
<?php
-print "<div id=\"nav_bar\">\n<table width=730><colgroup span=\"1\"> <col width=\"550\"></col></colgroup> <tr><td align=left >";
-if ( $limit['alias_pgindex_count'] ) print "<b>".$PALANG['pOverview_alias_title']."</b>  ";
+if ($limit['alias_pgindex_count'] ) print "<b>".$PALANG['pOverview_alias_title']."</b>  ";
($tDisplay_back_show == 1) ? $highlight_at = $tDisplay_back / $CONF['page_size'] + 1 : $highlight_at = 0;
+$current_limit=$highlight_at * $CONF['page_size'];
for ($i = 0; $i < $limit['alias_pgindex_count']; $i++)
{
if ( $i == $highlight_at )
{
- print "<a href=\"overview.php?domain=$fDomain&limit=" . $i * $CONF['page_size'] . "\"><b>" . $limit['alias_pgindex'][$i] . "</b></a>\n";
+ print "<a href=\"$file?domain=$fDomain&limit=" . $i * $CONF['page_size'] . "\"><b>" . $limit['alias_pgindex'][$i] . "</b></a>\n";
}
else
{
- print "<a href=\"overview.php?domain=$fDomain&limit=" . $i * $CONF['page_size'] . "\">" . $limit['alias_pgindex'][$i] . "</a>\n";
+ print "<a href=\"$file?domain=$fDomain&limit=" . $i * $CONF['page_size'] . "\">" . $limit['alias_pgindex'][$i] . "</a>\n";
}
}
print "</td><td valign=middle align=right>";
-if ($tDisplay_back_show == 1) print "<a href=\"overview.php?domain=$fDomain&limit=$tDisplay_back\"><img border=\"0\" src=\"images/arrow-l.png\" title=\"" . $PALANG['pOverview_left_arrow'] . "\" alt=\"" . $PALANG['pOverview_left_arrow'] . "\"></a>\n";
-if ($tDisplay_up_show == 1) print "<a href=\"overview.php?domain=$fDomain&limit=0\"><img border=\"0\" src=\"images/arrow-u.png\" title=\"" . $PALANG['pOverview_up_arrow']."\" alt=\"" . $PALANG['pOverview_up_arrow'] . "\"></a>\n";
-if ($tDisplay_next_show == 1) print "<a href=\"overview.php?domain=$fDomain&limit=$tDisplay_next\"><img border=\"0\" src=\"images/arrow-r.png\" title=\"" . $PALANG['pOverview_right_arrow'] . "\" alt=\"" . $PALANG['pOverview_right_arrow'] . "\"></a>\n";
+
+if ($tDisplay_back_show == 1)
+{
+ print "<a href=\"$file?domain=$fDomain&limit=$tDisplay_back\"><img border=\"0\" src=\"$incpath/images/arrow-l.png\" title=\"" . $PALANG['pOverview_left_arrow'] . "\" alt=\"" . $PALANG['pOverview_left_arrow'] . "\" /></a>\n";
+}
+if ($tDisplay_up_show == 1)
+{
+ print "<a href=\"$file?domain=$fDomain&limit=0\"><img border=\"0\" src=\"$incpath/images/arrow-u.png\" title=\"" . $PALANG['pOverview_up_arrow'] . "\" alt=\"" . $PALANG['pOverview_up_arrow'] . "\" /></a>\n";
+}
+if ($tDisplay_next_show == 1)
+{
+ print "<a href=\"$file?domain=$fDomain&limit=$tDisplay_next\"><img border=\"0\" src=\"$incpath/images/arrow-r.png\" title=\"" . $PALANG['pOverview_right_arrow'] . "\" alt=\"" . $PALANG['pOverview_right_arrow'] . "\" /></a>\n";
+}
print "</td></tr></table></div>\n";
if (sizeof ($tAlias) > 0)
{
print "<table id=\"alias_table\">\n";
print " <tr>\n";
- print " <td colspan=\"7\"><h3>".$PALANG['pOverview_alias_title']."</h3></td>";
+ print " <td colspan=\"7\"><h3>" . $PALANG['pOverview_alias_title'] . "</h3></td>";
print " </tr>";
print " <tr class=\"header\">\n";
if ($CONF['show_status'] == 'YES') { print "<td></td>\n"; }
@@ -87,6 +109,17 @@
}
print " <td>" . $tAlias[$i]['modified'] . "</td>\n";
+
+# TODO: merge superadmin / domain admin code
+ if (authentication_has_role('global-admin')) {
+# superadmin code
+ $active = ($tAlias[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO'];
+ print " <td><a href=\"edit-active.php?alias=" . urlencode ($tAlias[$i]['address']) . "&domain=$fDomain&return=$file?domain=$fDomain" . urlencode ("&limit=" . $current_limit) . "\">" . $active . "</a></td>\n";
+ print " <td><a href=\"edit-alias.php?address=" . urlencode ($tAlias[$i]['address']) . "&domain=$fDomain" . "\">" . $PALANG['edit'] . "</a></td>\n";
+ print " <td><a href=\"delete.php?table=alias" . "&delete=" . urlencode ($tAlias[$i]['address']) . "&domain=$fDomain" . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_aliases'] . ": ". $tAlias[$i]['address'] . "')\">" . $PALANG['del'] . "</a></td>\n";
+
+ } else {
+# domain admin code
if ($CONF['special_alias_control'] == 'YES')
{
$active = ($tAlias[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO'];
@@ -112,14 +145,19 @@
print " <td> </td>\n";
}
}
+# end diff
+ }
+
print " </tr>\n";
}
}
-
print "</table>\n";
}
+if($tCanAddAlias) {
print "<p><a href=\"create-alias.php?domain=$fDomain\">" . $PALANG['pMenu_create_alias'] . "</a>\n";
+}
+
print "<div id=\"nav_bar\"><a name=\"MidArrow\" /a>\n<table width=730><colgroup span=\"1\"> <col width=\"550\"></col></colgroup> <tr><td align=left >";
if ( $limit['mbox_pgindex_count'] ) print "<b>".$PALANG['pOverview_mailbox_title']."</b>  ";
($tDisplay_back_show == 1) ? $highlight_at = $tDisplay_back / $CONF['page_size'] + 1 : $highlight_at = 0;
@@ -127,28 +165,29 @@
{
if ( $i == $highlight_at )
{
- print "<a href=\"overview.php?domain=$fDomain&limit=" . $i * $CONF['page_size'] . "#MidArrow\"><b>" . $limit['mbox_pgindex'][$i] . "</b></a>\n";
+ print "<a href=\"$file?domain=$fDomain&limit=" . $i * $CONF['page_size'] . "#MidArrow\"><b>" . $limit['mbox_pgindex'][$i] . "</b></a>\n";
}
else
{
- print "<a href=\"overview.php?domain=$fDomain&limit=" . $i * $CONF['page_size'] . "#MidArrow\">" . $limit['mbox_pgindex'][$i] . "</a>\n";
+ print "<a href=\"$file?domain=$fDomain&limit=" . $i * $CONF['page_size'] . "#MidArrow\">" . $limit['mbox_pgindex'][$i] . "</a>\n";
}
}
print "</td><td valign=middle align=right>";
- if ($tDisplay_back_show == 1)
- {
- print "<a href=\"overview.php?domain=$fDomain&limit=$tDisplay_back#MidArrow\"><img border=\"0\" src=\"images/arrow-l.png\" title=\"" . $PALANG['pOverview_left_arrow'] . "\" alt=\"" . $PALANG['pOverview_left_arrow'] . "\" /></a>\n";
- }
- if ($tDisplay_up_show == 1)
- {
- print "<a href=\"overview.php?domain=$fDomain&limit=0#MidArrow\"><img border=\"0\" src=\"images/arrow-u.png\" title=\"" . $PALANG['pOverview_up_arrow'] . "\" alt=\"" . $PALANG['pOverview_up_arrow'] . "\" /></a>\n";
- }
- if ($tDisplay_next_show == 1)
- {
- print "<a href=\"overview.php?domain=$fDomain&limit=$tDisplay_next#MidArrow\"><img border=\"0\" src=\"images/arrow-r.png\" title=\"" . $PALANG['pOverview_right_arrow'] . "\" alt=\"" . $PALANG['pOverview_right_arrow'] . "\" /></a>\n";
- }
- print "</td></tr></table></div>\n";
+if ($tDisplay_back_show == 1)
+{
+ print "<a href=\"$file?domain=$fDomain&limit=$tDisplay_back#MidArrow\"><img border=\"0\" src=\"$incpath/images/arrow-l.png\" title=\"" . $PALANG['pOverview_left_arrow'] . "\" alt=\"" . $PALANG['pOverview_left_arrow'] . "\" /></a>\n";
+}
+if ($tDisplay_up_show == 1)
+{
+ print "<a href=\"$file?domain=$fDomain&limit=0#MidArrow\"><img border=\"0\" src=\"$incpath/images/arrow-u.png\" title=\"" . $PALANG['pOverview_up_arrow'] . "\" alt=\"" . $PALANG['pOverview_up_arrow'] . "\" /></a>\n";
+}
+if ($tDisplay_next_show == 1)
+{
+ print "<a href=\"$file?domain=$fDomain&limit=$tDisplay_next#MidArrow\"><img border=\"0\" src=\"$incpath/images/arrow-r.png\" title=\"" . $PALANG['pOverview_right_arrow'] . "\" alt=\"" . $PALANG['pOverview_right_arrow'] . "\" /></a>\n";
+}
+print "</td></tr></table></div>\n";
+
if (sizeof ($tMailbox) > 0)
{
$colspan=8;
@@ -156,7 +195,7 @@
if ($CONF['alias_control_admin'] == 'YES') $colspan=$colspan+1;
print "<table id=\"mailbox_table\">\n";
print " <tr>\n";
- print " <td colspan=\"$colspan\"><h3>".$PALANG['pOverview_mailbox_title']."</h3></td>";
+ print " <td colspan=\"$colspan\"><h3>" . $PALANG['pOverview_mailbox_title'] . "</h3></td>";
print " </tr>";
print " <tr class=\"header\">\n";
if ($CONF['show_status'] == 'YES') { print "<td></td>\n"; }
@@ -174,6 +213,7 @@
if ((is_array ($tMailbox) and sizeof ($tMailbox) > 0))
{
print " <tr class=\"hilightoff\" onMouseOver=\"className='hilighton';\" onMouseOut=\"className='hilightoff';\">\n";
+
if ($CONF['show_status'] == 'YES')
{
print " <td>" . gen_show_status($tMailbox[$i]['username']) . "</td>\n";
@@ -201,6 +241,7 @@
print " <td>" . $tMailbox[$i]['modified'] . "</td>\n";
$active = ($tMailbox[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO'];
print " <td><a href=\"edit-active.php?username=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\">" . $active . "</a></td>\n";
+
if ($CONF['vacation_control_admin'] == 'YES')
{
$v_active_int = $tMailbox[$i]['v_active'];
@@ -218,12 +259,18 @@
echo "<td> </td>\n";
}
}
- if ($CONF['alias_control_admin'] == 'YES')
+
+ $edit_aliases=0;
+ if ( authentication_has_role('global-admin') && $CONF['alias_control_admin'] == 'YES') $edit_aliases = 1;
+ if ( (! authentication_has_role('global-admin')) && $CONF['alias_control'] == 'YES') $edit_aliases = 1;
+
+ if ($edit_aliases == 1)
{
print " <td><a href=\"edit-alias.php?address=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\">" . $PALANG['pOverview_alias_edit'] . "</a></td>\n";
}
+
print " <td><a href=\"edit-mailbox.php?username=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\">" . $PALANG['edit'] . "</a></td>\n";
- print " <td><a href=\"delete.php?delete=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_mailboxes'] . ": ". $tMailbox[$i]['username'] . "')\">" . $PALANG['del'] . "</a></td>\n";
+ print " <td><a href=\"delete.php?table=mailbox" . "&delete=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_mailboxes'] . ": ". $tMailbox[$i]['username'] . "')\">" . $PALANG['del'] . "</a></td>\n";
print " </tr>\n";
}
}
@@ -231,19 +278,22 @@
print "<div id=\"nav_bar\"><a name=\"LowArrow\" /a>\n";
if ($tDisplay_back_show == 1)
{
- print "<a href=\"overview.php?domain=$fDomain&limit=$tDisplay_back#LowArrow\"><img border=\"0\" src=\"images/arrow-l.png\" title=\"" . $PALANG['pOverview_left_arrow'] . "\" alt=\"" . $PALANG['pOverview_left_arrow'] . "\" /></a>\n";
+ print "<a href=\"$file?domain=$fDomain&limit=$tDisplay_back#LowArrow\"><img border=\"0\" src=\"$incpath/images/arrow-l.png\" title=\"" . $PALANG['pOverview_left_arrow'] . "\" alt=\"" . $PALANG['pOverview_left_arrow'] . "\" /></a>\n";
}
if ($tDisplay_up_show == 1)
{
- print "<a href=\"overview.php?domain=$fDomain&limit=0#LowArrow\"><img border=\"0\" src=\"images/arrow-u.png\" title=\"" . $PALANG['pOverview_up_arrow'] . "\" alt=\"" . $PALANG['pOverview_up_arrow'] . "\" /></a>\n";
+ print "<a href=\"$file?domain=$fDomain&limit=0#LowArrow\"><img border=\"0\" src=\"$incpath/images/arrow-u.png\" title=\"" . $PALANG['pOverview_up_arrow'] . "\" alt=\"" . $PALANG['pOverview_up_arrow'] . "\" /></a>\n";
}
if ($tDisplay_next_show == 1)
{
- print "<a href=\"overview.php?domain=$fDomain&limit=$tDisplay_next#LowArrow\"><img border=\"0\" src=\"images/arrow-r.png\" title=\"" . $PALANG['pOverview_right_arrow'] . "\" alt=\"" . $PALANG['pOverview_right_arrow'] . "\" /></a>\n";
+ print "<a href=\"$file?domain=$fDomain&limit=$tDisplay_next#LowArrow\"><img border=\"0\" src=\"$incpath/images/arrow-r.png\" title=\"" . $PALANG['pOverview_right_arrow'] . "\" alt=\"" . $PALANG['pOverview_right_arrow'] . "\" /></a>\n";
}
print "</div>\n";
+
}
-print "<p><a href=\"create-mailbox.php?domain=$fDomain\">" . $PALANG['pMenu_create_mailbox'] . "</a>\n";
+if($tCanAddMailbox) {
+ print "<p><a href=\"create-mailbox.php?domain=$fDomain\">" . $PALANG['pMenu_create_mailbox'] . "</a>\n";
+}
if ($CONF['show_status'] == 'YES' && $CONF['show_status_key'] == 'YES')
{
@@ -263,11 +313,11 @@
for ($i = 0; $i < sizeof ($CONF['show_custom_domains']); $i++)
{
print " <span style='background-color:" . $CONF['show_custom_colors'][$i] . "'>" .
- $CONF['show_status_text'] . "</span>=" . $PALANG['pStatus_custom'] .
+ $CONF['show_status_text'] . "</span>=" . $PALANG['pStatus_custom'] .
$CONF['show_custom_domains'][$i] . "\n";
}
}
}
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3 ft=php */
+/* vim: set ft=php expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2007-10-02 23:31:45
|
Revision: 120
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=120&view=rev
Author: christian_boltz
Date: 2007-10-02 16:31:47 -0700 (Tue, 02 Oct 2007)
Log Message:
-----------
- fix colspan in table headlines
- fix: display create mailbox link even if no mailbox exists yet
Modified Paths:
--------------
trunk/templates/overview.tpl
Modified: trunk/templates/overview.tpl
===================================================================
--- trunk/templates/overview.tpl 2007-10-02 23:17:07 UTC (rev 119)
+++ trunk/templates/overview.tpl 2007-10-02 23:31:47 UTC (rev 120)
@@ -58,7 +58,7 @@
{
print "<table id=\"alias_table\">\n";
print " <tr>\n";
- print " <td colspan=\"6\"><h3>".$PALANG['pOverview_alias_title']."</h3></td>";
+ print " <td colspan=\"7\"><h3>".$PALANG['pOverview_alias_title']."</h3></td>";
print " </tr>";
print " <tr class=\"header\">\n";
if ($CONF['show_status'] == 'YES') { print "<td></td>\n"; }
@@ -151,9 +151,12 @@
if (sizeof ($tMailbox) > 0)
{
+ $colspan=8;
+ if ($CONF['vacation_control_admin'] == 'YES') $colspan=$colspan+1;
+ if ($CONF['alias_control_admin'] == 'YES') $colspan=$colspan+1;
print "<table id=\"mailbox_table\">\n";
print " <tr>\n";
- print " <td colspan=\"7\"><h3>".$PALANG['pOverview_mailbox_title']."</h3></td>";
+ print " <td colspan=\"$colspan\"><h3>".$PALANG['pOverview_mailbox_title']."</h3></td>";
print " </tr>";
print " <tr class=\"header\">\n";
if ($CONF['show_status'] == 'YES') { print "<td></td>\n"; }
@@ -162,9 +165,7 @@
if ($CONF['quota'] == 'YES') print " <td>" . $PALANG['pOverview_mailbox_quota'] . "</td>\n";
print " <td>" . $PALANG['pOverview_mailbox_modified'] . "</td>\n";
print " <td>" . $PALANG['pOverview_mailbox_active'] . "</td>\n";
- $colspan=2;
- if ($CONF['vacation_control_admin'] == 'YES') $colspan=$colspan+1;
- if ($CONF['alias_control_admin'] == 'YES') $colspan=$colspan+1;
+ $colspan = $colspan - 6;
print " <td colspan=\"$colspan\"> </td>\n";
print " </tr>\n";
@@ -241,9 +242,8 @@
print "<a href=\"overview.php?domain=$fDomain&limit=$tDisplay_next#LowArrow\"><img border=\"0\" src=\"images/arrow-r.png\" title=\"" . $PALANG['pOverview_right_arrow'] . "\" alt=\"" . $PALANG['pOverview_right_arrow'] . "\" /></a>\n";
}
print "</div>\n";
-
- print "<p><a href=\"create-mailbox.php?domain=$fDomain\">" . $PALANG['pMenu_create_mailbox'] . "</a>\n";
}
+print "<p><a href=\"create-mailbox.php?domain=$fDomain\">" . $PALANG['pMenu_create_mailbox'] . "</a>\n";
if ($CONF['show_status'] == 'YES' && $CONF['show_status_key'] == 'YES')
{
@@ -267,8 +267,7 @@
$CONF['show_custom_domains'][$i] . "\n";
}
}
-
}
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
+/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3 ft=php */
?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2007-10-02 23:17:11
|
Revision: 119
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=119&view=rev
Author: christian_boltz
Date: 2007-10-02 16:17:07 -0700 (Tue, 02 Oct 2007)
Log Message:
-----------
- Fix HTML (<span> is opened inside the error message, close it again)
Modified Paths:
--------------
trunk/edit-mailbox.php
Modified: trunk/edit-mailbox.php
===================================================================
--- trunk/edit-mailbox.php 2007-10-02 13:41:23 UTC (rev 118)
+++ trunk/edit-mailbox.php 2007-10-02 23:17:07 UTC (rev 119)
@@ -60,7 +60,7 @@
$tName = $fName;
$tQuota = $fQuota;
$tActive = $fActive;
- $tMessage = $PALANG['pEdit_mailbox_domain_error'] . "$fDomain</font>"; // XXX ergh; why is a closing font tag here?
+ $tMessage = $PALANG['pEdit_mailbox_domain_error'] . "$fDomain</span>";
}
$user_details = db_array($result['result']);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Gin...@us...> - 2007-10-02 13:41:19
|
Revision: 118
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=118&view=rev
Author: GingerDog
Date: 2007-10-02 06:41:23 -0700 (Tue, 02 Oct 2007)
Log Message:
-----------
reformatting; should be ignorable
Modified Paths:
--------------
trunk/admin/list-admin.php
trunk/admin/list-domain.php
Modified: trunk/admin/list-admin.php
===================================================================
--- trunk/admin/list-admin.php 2007-10-02 13:37:42 UTC (rev 117)
+++ trunk/admin/list-admin.php 2007-10-02 13:41:23 UTC (rev 118)
@@ -25,11 +25,9 @@
authentication_require_role('global-admin');
-$list_admins = list_admins ();
-if ((is_array ($list_admins) and sizeof ($list_admins) > 0))
-{
- for ($i = 0; $i < sizeof ($list_admins); $i++)
- {
+$list_admins = list_admins();
+if ((is_array ($list_admins) and sizeof ($list_admins) > 0)) {
+ for ($i = 0; $i < sizeof ($list_admins); $i++) {
$admin_properties[$i] = get_admin_properties ($list_admins[$i]);
}
}
Modified: trunk/admin/list-domain.php
===================================================================
--- trunk/admin/list-domain.php 2007-10-02 13:37:42 UTC (rev 117)
+++ trunk/admin/list-domain.php 2007-10-02 13:41:23 UTC (rev 118)
@@ -31,12 +31,9 @@
$list_admins = list_admins ();
-if ($_SERVER['REQUEST_METHOD'] == "GET")
-{
- if (isset ($_GET['username']))
- {
+if ($_SERVER['REQUEST_METHOD'] == "GET") {
+ if (isset ($_GET['username'])) {
$fUsername = escape_string ($_GET['username']);
-
$list_domains = list_domains_for_admin ($fUsername);
if ($list_domains != 0)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Gin...@us...> - 2007-10-02 13:37:39
|
Revision: 117
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=117&view=rev
Author: GingerDog
Date: 2007-10-02 06:37:42 -0700 (Tue, 02 Oct 2007)
Log Message:
-----------
edit-mailbox.php; try and make it work properly
Modified Paths:
--------------
trunk/edit-mailbox.php
Modified: trunk/edit-mailbox.php
===================================================================
--- trunk/edit-mailbox.php 2007-10-02 12:49:56 UTC (rev 116)
+++ trunk/edit-mailbox.php 2007-10-02 13:37:42 UTC (rev 117)
@@ -38,6 +38,10 @@
authentication_require_role('admin');
$SESSID_USERNAME = authentication_get_username();
+$fUsername = 'x';
+$fDomain = 'y';
+$error = 0;
+
if (isset ($_GET['username'])) $fUsername = escape_string ($_GET['username']);
$fUsername = strtolower ($fUsername);
if (isset ($_GET['domain'])) $fDomain = escape_string ($_GET['domain']);
@@ -45,33 +49,40 @@
$pEdit_mailbox_name_text = $PALANG['pEdit_mailbox_name_text'];
$pEdit_mailbox_quota_text = $PALANG['pEdit_mailbox_quota_text'];
+$result = db_query("SELECT * FROM $table_mailbox WHERE username = '$fUsername' AND domain = '$fDomain'");
+if($result['rows'] != 1) {
+ die("Invalid username chosen; user does not exist in mailbox table");
+}
+
+if (!(check_owner ($SESSID_USERNAME, $fDomain) || authentication_has_role('global-admin')) )
+{
+ $error = 1;
+ $tName = $fName;
+ $tQuota = $fQuota;
+ $tActive = $fActive;
+ $tMessage = $PALANG['pEdit_mailbox_domain_error'] . "$fDomain</font>"; // XXX ergh; why is a closing font tag here?
+}
+
+$user_details = db_array($result['result']);
+
if ($_SERVER['REQUEST_METHOD'] == "GET")
{
- if (check_owner ($SESSID_USERNAME, $fDomain) || authentication_has_role('global-admin'))
+ if (check_owner($SESSID_USERNAME, $fDomain) || authentication_has_role('global-admin'))
{
- $result = db_query ("SELECT * FROM $table_mailbox WHERE username='$fUsername' AND domain='$fDomain'");
- if ($result['rows'] == 1)
- {
- $row = db_array ($result['result']);
- $tName = $row['name'];
- $tQuota = divide_quota($row['quota']);
- $tActive = $row['active'];
- if ('pgsql'==$CONF['database_type']) {
- $tActive = ('t'==$row['active']) ? 1 : 0;
- }
+ $tName = $user_details['name'];
+ $tQuota = divide_quota($user_details['quota']);
+ $tActive = $user_details['active'];
+ if ('pgsql'==$CONF['database_type']) {
+ $tActive = ('t'==$user_details['active']) ? 1 : 0;
}
$result = db_query ("SELECT * FROM $table_domain WHERE domain='$fDomain'");
if ($result['rows'] == 1)
{
- $row = db_array ($result['result']);
- $tMaxquota = $row['maxquota'];
+ $row = db_array ($result['result']);
+ $tMaxquota = $row['maxquota'];
}
}
- else
- {
- $tMessage = $PALANG['pEdit_mailbox_login_error'];
- }
}
if ($_SERVER['REQUEST_METHOD'] == "POST")
@@ -82,22 +93,15 @@
if (isset ($_POST['fQuota'])) $fQuota = intval ($_POST['fQuota']);
if (isset ($_POST['fActive'])) $fActive = escape_string ($_POST['fActive']);
- if (! (check_owner ($SESSID_USERNAME, $fDomain) || authentication_has_role('global-admin')) )
- {
- $error = 1;
- $tName = $fName;
- $tQuota = $fQuota;
- $tActive = $fActive;
- $tMessage = $PALANG['pEdit_mailbox_domain_error'] . "$fDomain</font>";
- }
- if ($fPassword != $fPassword2)
- {
- $error = 1;
- $tName = $fName;
- $tQuota = $fQuota;
- $tActive = $fActive;
- $pEdit_mailbox_password_text = $PALANG['pEdit_mailbox_password_text_error'];
+ if($fPassword != $user_details['password']){
+ if($fPassword == $fPassword2) {
+ $fPassword = pacrypt($fPassword);
+ }
+ else {
+ flash_error($PALANG['pEdit_mailbox_password_text_error']);
+ $error = 1;
+ }
}
if ($CONF['quota'] == "YES")
@@ -111,7 +115,6 @@
$pEdit_mailbox_quota_text = $PALANG['pEdit_mailbox_quota_text_error'];
}
}
-
if ($error != 1)
{
if (!empty ($fQuota))
@@ -125,35 +128,20 @@
if ($fActive == "on")
{
+ $sqlActive = db_get_boolean(True);
$fActive = 1;
}
else
{
+ $sqlActive = db_get_boolean(False);
$fActive = 0;
}
- $sqlActive=$fActive;
- if ('pgsql'==$CONF['database_type']) {
- $sqlActive=($fActive) ? 'true':'false';
- }
- if (empty ($fPassword) and empty ($fPassword2))
- {
- $result = db_query ("UPDATE $table_mailbox SET name='$fName',quota=$quota,modified=NOW(),active=$sqlActive WHERE username='$fUsername' AND domain='$fDomain'");
- if ($result['rows'] == 1) $result = db_query ("UPDATE $table_alias SET modified=NOW(),active='$sqlActive' WHERE address='$fUsername' AND domain='$fDomain'");
- }
- else
- {
- $password = pacrypt ($fPassword);
- $result = db_query ("UPDATE $table_mailbox SET password='$password',name='$fName',quota=$quota,modified=NOW(),active=$sqlActive WHERE username='$fUsername' AND domain='$fDomain'");
- if ($result['rows'] == 1) $result = db_query ("UPDATE $table_alias SET modified=NOW(),active='$sqlActive' WHERE address='$fUsername' AND domain='$fDomain'");
- }
-
- if ($result['rows'] != 1)
- {
+ $result = db_query ("UPDATE $table_mailbox SET name='$fName',password='$fPassword',quota=$quota,modified=NOW(),active=$sqlActive WHERE username='$fUsername' AND domain='$fDomain'");
+ if ($result['rows'] != 1) {
$tMessage = $PALANG['pEdit_mailbox_result_error'];
}
- else
- {
+ else {
db_log ($SESSID_USERNAME, $fDomain, 'edit_mailbox', $fUsername);
if (authentication_has_role('global-admin')) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Gin...@us...> - 2007-10-02 12:49:54
|
Revision: 116
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=116&view=rev
Author: GingerDog
Date: 2007-10-02 05:49:56 -0700 (Tue, 02 Oct 2007)
Log Message:
-----------
templates/edit-vacation.tpl: explicit action url
Modified Paths:
--------------
trunk/templates/edit-vacation.tpl
Modified: trunk/templates/edit-vacation.tpl
===================================================================
--- trunk/templates/edit-vacation.tpl 2007-10-02 12:49:00 UTC (rev 115)
+++ trunk/templates/edit-vacation.tpl 2007-10-02 12:49:56 UTC (rev 116)
@@ -7,7 +7,7 @@
</script>
<div id="edit_form">
-<form name="edit-vacation" method="post">
+<form name="edit-vacation" method="post" action=''>
<table>
<tr>
<td colspan="3"><h3><?php print $PALANG['pUsersVacation_welcome']; ?></h3></td>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Gin...@us...> - 2007-10-02 12:49:00
|
Revision: 115
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=115&view=rev
Author: GingerDog
Date: 2007-10-02 05:49:00 -0700 (Tue, 02 Oct 2007)
Log Message:
-----------
edit-vacation.php: fix handling of empty goto field; fix handling of vacation editing if done by "someone else"
Modified Paths:
--------------
trunk/edit-vacation.php
Modified: trunk/edit-vacation.php
===================================================================
--- trunk/edit-vacation.php 2007-10-02 12:48:21 UTC (rev 114)
+++ trunk/edit-vacation.php 2007-10-02 12:49:00 UTC (rev 115)
@@ -37,23 +37,29 @@
require_once('common.php');
-$SESSID_USERNAME = authentication_get_username();
-
if($CONF['vacation'] == 'NO') {
header("Location: " . $CONF['postfix_admin_url'] . "/main.php");
exit(0);
}
-$vacation_domain = $CONF['vacation_domain'];
-$vacation_goto = preg_replace('/@/', '#', $SESSID_USERNAME);
-$vacation_goto = $vacation_goto . '@' . $vacation_domain;
-
+$SESSID_USERNAME = authentication_get_username();
$tmp = preg_split ('/@/', $SESSID_USERNAME);
$USERID_DOMAIN = $tmp[1];
-if (isset ($_GET['username'])) $fUsername = escape_string ($_GET['username']);
-if (isset ($_GET['domain'])) $fDomain = escape_string ($_GET['domain']);
+// only allow admins to change someone else's 'stuff'
+if(authentication_has_role('admin')) {
+ if (isset($_GET['username'])) $fUsername = escape_string ($_GET['username']);
+ if (isset($_GET['domain'])) $fDomain = escape_string ($_GET['domain']);
+}
+else {
+ $fUsername = $SESSID_USERNAME;
+ $fDomain = $USERID_DOMAIN;
+}
+$vacation_domain = $CONF['vacation_domain'];
+$vacation_goto = preg_replace('/@/', '#', $fUsername);
+$vacation_goto = $vacation_goto . '@' . $vacation_domain;
+
$fCanceltarget = $CONF['postfix_admin_url'] . '/main.php';
if ($_SERVER['REQUEST_METHOD'] == "GET")
@@ -69,6 +75,7 @@
}
$tUseremail = $fUsername;
+ $tDomain = $fDomain;
if ($tSubject == '') { $tSubject = $PALANG['pUsersVacation_subject_text']; }
if ($tBody == '') { $tBody = $PALANG['pUsersVacation_body_text']; }
@@ -82,14 +89,14 @@
if (isset ($_POST['fChange'])) $fChange = escape_string ($_POST['fChange']);
if (isset ($_POST['fBack'])) $fBack = escape_string ($_POST['fBack']);
- if (isset ($_GET['domain'])) {
+ if(authentication_has_role('admin') && isset($_GET['domain'])) {
$fDomain = escape_string ($_GET['domain']);
}
else {
$fDomain = $USERID_DOMAIN;
}
- if (isset ($_GET['username'])) {
- $fUsername = escape_string ($_GET['username']);
+ if(authentication_has_role('admin') && isset ($_GET['username'])) {
+ $fUsername = escape_string($_GET['username']);
}
else {
$fUsername = authentication_get_username();
@@ -117,12 +124,17 @@
{
$row = db_array ($result['result']);
$goto = $row['goto'];
-
//only one of these will do something, first handles address at beginning and middle, second at end
$goto= preg_replace ( "/$vacation_goto,/", '', $goto);
$goto= preg_replace ( "/,$vacation_goto/", '', $goto);
-
- $result = db_query ("UPDATE $table_alias SET goto='$goto',modified=NOW() WHERE address='$fUsername'");
+ $goto= preg_replace ( "/$vacation_goto/", '', $goto);
+ if($goto == '') {
+ $sql = "DELETE FROM $table_alias WHERE address = '$fUsername'";
+ }
+ else {
+ $sql = "UPDATE $table_alias SET goto='$goto',modified=NOW() WHERE address='$fUsername'";
+ }
+ $result = db_query($sql);
if ($result['rows'] != 1)
{
$error = 1;
@@ -142,18 +154,22 @@
$row = db_array ($result['result']);
$goto = $row['goto'];
}
-
- ($CONF['database_type']=='pgsql') ? $Active='true' : $Active=1;
+ $Active = db_get_boolean(True);
$result = db_query ("INSERT INTO $table_vacation (email,subject,body,domain,created,active) VALUES ('$fUsername','$fSubject','$fBody','$fDomain',NOW(),$Active)");
if ($result['rows'] != 1)
{
$error = 1;
}
-
- $goto = $goto . "," . $vacation_goto;
-
- $result = db_query ("UPDATE $table_alias SET goto='$goto',modified=NOW() WHERE address='$fUsername'");
+ if($goto == '') {
+ $goto = $vacation_goto;
+ $sql = "INSERT INTO $table_alias (goto, address, domain, modified) VALUES ('$goto', '$fUsername', '$fDomain', NOW())";
+ }
+ else {
+ $goto = $goto . "," . $vacation_goto;
+ $sql = "UPDATE $table_alias SET goto='$goto',modified=NOW() WHERE address='$fUsername'";
+ }
+ $result = db_query ($sql);
if ($result['rows'] != 1)
{
$error = 1;
@@ -173,7 +189,6 @@
$tMessage = $PALANG['pVacation_result_error'];
}
-$tUseremail = $SESSID_USERNAME;
include ("$incpath/templates/header.tpl");
if (authentication_has_role('global-admin')) {
include ("$incpath/templates/admin_menu.tpl");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Gin...@us...> - 2007-10-02 12:48:27
|
Revision: 114
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=114&view=rev
Author: GingerDog
Date: 2007-10-02 05:48:21 -0700 (Tue, 02 Oct 2007)
Log Message:
-----------
functions.inc.php: reduce global usage
Modified Paths:
--------------
trunk/functions.inc.php
Modified: trunk/functions.inc.php
===================================================================
--- trunk/functions.inc.php 2007-10-02 12:22:38 UTC (rev 113)
+++ trunk/functions.inc.php 2007-10-02 12:48:21 UTC (rev 114)
@@ -1064,12 +1064,10 @@
// Action: Creates MD5 encrypted password
// Call: md5crypt (string cleartextpassword)
//
-$MAGIC = "$1$";
-$ITOA64 = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
function md5crypt ($pw, $salt="", $magic="")
{
- global $MAGIC;
+ $MAGIC = "$1$";
if ($magic == "") $magic = $MAGIC;
if ($salt == "") $salt = create_salt ();
@@ -1155,7 +1153,7 @@
function to64 ($v, $n)
{
- global $ITOA64;
+ $ITOA64 = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
$ret = "";
while (($n - 1) >= 0)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Gin...@us...> - 2007-10-02 12:22:38
|
Revision: 113
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=113&view=rev
Author: GingerDog
Date: 2007-10-02 05:22:38 -0700 (Tue, 02 Oct 2007)
Log Message:
-----------
fix broken MySQL Schema (thanks to cytdevel - http://sourceforge.net/forum/forum.php?thread_id=1836415&forum_id=676076)
Modified Paths:
--------------
trunk/DATABASE_MYSQL.TXT
Modified: trunk/DATABASE_MYSQL.TXT
===================================================================
--- trunk/DATABASE_MYSQL.TXT 2007-10-02 12:06:10 UTC (rev 112)
+++ trunk/DATABASE_MYSQL.TXT 2007-10-02 12:22:38 UTC (rev 113)
@@ -1,8 +1,6 @@
#
# Postfix Admin
-# by Mischa Peters <mischa at high5 dot net>
-# Copyright (c) 2002 - 2005 High5!
-# Licensed under GPL for more info check GPL-LICENSE.TXT
+# Licensed under GPL for more info check LICENSE.TXT
#
# This is the complete MySQL database structure for Postfix Admin.
@@ -25,19 +23,21 @@
#
# Postfix / MySQL
#
+
USE mysql;
+CREATE DATABASE IF NOT EXISTS postfix;
# Postfix user & password
-INSERT INTO user (Host, User, Password) VALUES ('localhost','postfix',password('postfix'));
-INSERT INTO db (Host, Db, User, Select_priv) VALUES ('localhost','postfix','postfix','Y');
+#INSERT INTO user (Host, User, Password) VALUES ('localhost','postfix',password('postfix'));
# Postfix Admin user & password
-INSERT INTO user (Host, User, Password) VALUES ('localhost','postfixadmin',password('postfixadmin'));
-INSERT INTO db (Host, Db, User, Select_priv, Insert_priv, Update_priv, Delete_priv) VALUES ('localhost', 'postfix', 'postfixadmin', 'Y', 'Y', 'Y', 'Y');
+#INSERT INTO user (Host, User, Password) VALUES ('localhost','postfixadmin',password('postfixadmin'));
+# Priviledges
+#INSERT INTO db (Host, Db, User, Select_priv) VALUES ('localhost','postfix','postfix','Y');
+#INSERT INTO db (Host, Db, User, Select_priv, Insert_priv, Update_priv, Delete_priv) VALUES ('localhost', 'postfix', 'postfixadmin', 'Y', 'Y', 'Y', 'Y');
FLUSH PRIVILEGES;
GRANT USAGE ON postfix.* TO postfix@localhost;
GRANT SELECT, INSERT, DELETE, UPDATE ON postfix.* TO postfix@localhost;
GRANT USAGE ON postfix.* TO postfixadmin@localhost;
GRANT SELECT, INSERT, DELETE, UPDATE ON postfix.* TO postfixadmin@localhost;
-CREATE DATABASE postfix;
USE postfix;
#
@@ -49,7 +49,7 @@
`created` datetime NOT NULL default '0000-00-00 00:00:00',
`modified` datetime NOT NULL default '0000-00-00 00:00:00',
`active` tinyint(1) NOT NULL default '1',
- PRIMARY KEY (`username`),
+ PRIMARY KEY (`username`)
) TYPE=MyISAM COMMENT='Postfix Admin - Virtual Admins';
#
@@ -62,7 +62,7 @@
`created` datetime NOT NULL default '0000-00-00 00:00:00',
`modified` datetime NOT NULL default '0000-00-00 00:00:00',
`active` tinyint(1) NOT NULL default '1',
- PRIMARY KEY (`address`),
+ PRIMARY KEY (`address`)
) TYPE=MyISAM COMMENT='Postfix Admin - Virtual Aliases';
#
@@ -80,7 +80,7 @@
`created` datetime NOT NULL default '0000-00-00 00:00:00',
`modified` datetime NOT NULL default '0000-00-00 00:00:00',
`active` tinyint(1) NOT NULL default '1',
- PRIMARY KEY (`domain`),
+ PRIMARY KEY (`domain`)
) TYPE=MyISAM COMMENT='Postfix Admin - Virtual Domains';
#
@@ -119,7 +119,7 @@
`created` datetime NOT NULL default '0000-00-00 00:00:00',
`modified` datetime NOT NULL default '0000-00-00 00:00:00',
`active` tinyint(1) NOT NULL default '1',
- PRIMARY KEY (`username`),
+ PRIMARY KEY (`username`)
) TYPE=MyISAM COMMENT='Postfix Admin - Virtual Mailboxes';
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Gin...@us...> - 2007-10-02 12:10:50
|
Revision: 108
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=108&view=rev
Author: GingerDog
Date: 2007-10-02 04:55:46 -0700 (Tue, 02 Oct 2007)
Log Message:
-----------
create-alias.php: syntax error fix
Modified Paths:
--------------
trunk/create-alias.php
Modified: trunk/create-alias.php
===================================================================
--- trunk/create-alias.php 2007-09-30 15:53:54 UTC (rev 107)
+++ trunk/create-alias.php 2007-10-02 11:55:46 UTC (rev 108)
@@ -65,7 +65,7 @@
$fGoto = strtolower ($fGoto);
}
if(isset($_POST['fActive'])) {
- $fActive = escape_string ($_POST['fActive'])
+ $fActive = escape_string ($_POST['fActive']);
}
else {
$fActive = "1";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Gin...@us...> - 2007-10-02 12:10:43
|
Revision: 110
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=110&view=rev
Author: GingerDog
Date: 2007-10-02 04:58:11 -0700 (Tue, 02 Oct 2007)
Log Message:
-----------
ensure domain name is in a list of valid domain names; set for use within the template so the right one is selected if ?domain=XXX was in the url
Modified Paths:
--------------
trunk/create-mailbox.php
Modified: trunk/create-mailbox.php
===================================================================
--- trunk/create-mailbox.php 2007-10-02 11:57:28 UTC (rev 109)
+++ trunk/create-mailbox.php 2007-10-02 11:58:11 UTC (rev 110)
@@ -46,7 +46,7 @@
$list_domains = list_domains ();
}
else {
- $list_domains = list_domains_for_admin ($SESSID_USERNAME);
+ $list_domains = list_domains_for_admin($SESSID_USERNAME);
}
@@ -56,14 +56,18 @@
if ($_SERVER['REQUEST_METHOD'] == "GET")
{
+ $fDomain = $list_domains[0];
if (isset ($_GET['domain'])) $fDomain = escape_string ($_GET['domain']);
+ if(!in_array($fDomain, $list_domains)) {
+ die("Invalid domain name selected, or you tried to select a domain you are not an admin for");
+ }
+ $tDomain = $fDomain;
$result = db_query ("SELECT * FROM $table_domain WHERE domain='$fDomain'");
if ($result['rows'] == 1)
{
$row = db_array ($result['result']);
$tQuota = $row['maxquota'];
-
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Gin...@us...> - 2007-10-02 12:10:41
|
Revision: 111
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=111&view=rev
Author: GingerDog
Date: 2007-10-02 04:58:46 -0700 (Tue, 02 Oct 2007)
Log Message:
-----------
make links for adding mailbox and adding alias dependant on controller logic
Modified Paths:
--------------
trunk/templates/admin_list-virtual.tpl
Modified: trunk/templates/admin_list-virtual.tpl
===================================================================
--- trunk/templates/admin_list-virtual.tpl 2007-10-02 11:58:11 UTC (rev 110)
+++ trunk/templates/admin_list-virtual.tpl 2007-10-02 11:58:46 UTC (rev 111)
@@ -102,7 +102,9 @@
}
print "</table>\n";
}
-print "<p><a href=\"create-alias.php?domain=$fDomain\">" . $PALANG['pMenu_create_alias'] . "</a>\n";
+if($tCanAddAlias) {
+ print "<p><a href=\"create-alias.php?domain=$fDomain\">" . $PALANG['pMenu_create_alias'] . "</a>\n";
+}
print "<div id=\"nav_bar\"><a name=\"MidArrow\" /a>\n<table width=730><colgroup span=\"1\"> <col width=\"550\"></col></colgroup> <tr><td align=left >";
if ( $limit['mbox_pgindex_count'] ) print "<b>".$PALANG['pOverview_mailbox_title']."</b>  ";
@@ -224,6 +226,8 @@
}
print "</div>\n";
+}
+if($tCanAddMailbox) {
print "<p><a href=\"create-mailbox.php?domain=$fDomain\">" . $PALANG['pMenu_create_mailbox'] . "</a>\n";
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Gin...@us...> - 2007-10-02 12:10:19
|
Revision: 112
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=112&view=rev
Author: GingerDog
Date: 2007-10-02 05:06:10 -0700 (Tue, 02 Oct 2007)
Log Message:
-----------
functions.inc.php: mysqli is a valid database_type as well!
Modified Paths:
--------------
trunk/functions.inc.php
Modified: trunk/functions.inc.php
===================================================================
--- trunk/functions.inc.php 2007-10-02 11:58:46 UTC (rev 111)
+++ trunk/functions.inc.php 2007-10-02 12:06:10 UTC (rev 112)
@@ -1330,7 +1330,7 @@
}
return 'false';
}
- elseif($CONF['database_type'] == 'mysql') {
+ elseif($CONF['database_type'] == 'mysql' || $CONF['database_type'] == 'mysqli') {
if($bool) {
return 1;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Gin...@us...> - 2007-10-02 11:57:26
|
Revision: 109
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=109&view=rev
Author: GingerDog
Date: 2007-10-02 04:57:28 -0700 (Tue, 02 Oct 2007)
Log Message:
-----------
admin/list-virtual.php: correctly display add mailbox or add alias links for a domain as appropriate (not if it is a backup mx or inactive or alias/mailbox limit has been reached
Modified Paths:
--------------
trunk/admin/list-virtual.php
Modified: trunk/admin/list-virtual.php
===================================================================
--- trunk/admin/list-virtual.php 2007-10-02 11:55:46 UTC (rev 108)
+++ trunk/admin/list-virtual.php 2007-10-02 11:57:28 UTC (rev 109)
@@ -55,7 +55,6 @@
if ((is_array ($list_domains) and sizeof ($list_domains) > 0)) if (empty ($fDomain)) $fDomain = $list_domains[0];
-$limit = get_domain_properties ($fDomain);
if ((is_array ($list_domains) and sizeof ($list_domains) > 0)) if (empty ($fDomain)) $fDomain = $list_domains[1];
@@ -116,22 +115,46 @@
}
}
-if (isset ($limit))
-{
- if ($fDisplay >= $page_size)
- {
+$tCanAddAlias = false;
+$tCanAddMailbox = false;
+
+$limit = get_domain_properties($fDomain);
+if (isset ($limit)) {
+ if ($fDisplay >= $page_size) {
$tDisplay_back_show = 1;
$tDisplay_back = $fDisplay - $page_size;
}
- if (($limit['alias_count'] > $page_size) or ($limit['mailbox_count'] > $page_size))
- {
+ if (($limit['alias_count'] > $page_size) or ($limit['mailbox_count'] > $page_size)) {
$tDisplay_up_show = 1;
}
- if ((($fDisplay + $page_size) < $limit['alias_count']) or (($fDisplay + $page_size) < $limit['mailbox_count']))
+ if ((($fDisplay + $page_size) < $limit['alias_count']) or
+ (($fDisplay + $page_size) < $limit['mailbox_count']))
{
$tDisplay_next_show = 1;
$tDisplay_next = $fDisplay + $page_size;
}
+
+ $active = $limit['active'];
+ if($active == 't' || $active == 1) {
+ $backup_mx = $limit['backupmx'];
+ if($backup_mx == 'f' || $backup_mx == 0) {
+ if($limit['aliases'] == -1) {
+ $tCanAddAlias = true;
+ }
+ elseif($limit['alias_count'] < $limit['aliases']) {
+ $tCanAddAlias = true;
+ echo 'xxx2';
+ }
+ if($limit['mailboxes'] == -1) {
+ $tCanAddMailbox = true;
+ echo 'xxx3';
+ }
+ elseif($limit['mailbox_count'] < $limit['mailboxes']) {
+ $tCanAddMailbox = true;
+ echo 'xxx4';
+ }
+ }
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|