postfixadmin-svn Mailing List for PostfixAdmin (Page 114)
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: <chr...@us...> - 2007-11-03 22:46:16
|
Revision: 182
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=182&view=rev
Author: christian_boltz
Date: 2007-11-03 15:46:20 -0700 (Sat, 03 Nov 2007)
Log Message:
-----------
- upgrade_90(): replace spaces with underscore in log.action
(change was caused by translatable logging)
Modified Paths:
--------------
trunk/upgrade.php
Modified: trunk/upgrade.php
===================================================================
--- trunk/upgrade.php 2007-11-03 22:24:34 UTC (rev 181)
+++ trunk/upgrade.php 2007-11-03 22:46:20 UTC (rev 182)
@@ -333,6 +333,13 @@
);
}
+function upgrade_90() {
+ # translatable logging
+ # old format: "create alias"
+ # new format: "create_alias"
+ $result = db_query_parsed("UPDATE " . table_by_key ('log') . " SET action = REPLACE(action,' ','_')", TRUE);
+}
+
function upgrade_169_mysql() { # MySQL only
# allow quota > 2 GB
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2007-11-03 22:24:30
|
Revision: 181
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=181&view=rev
Author: christian_boltz
Date: 2007-11-03 15:24:34 -0700 (Sat, 03 Nov 2007)
Log Message:
-----------
merged overview.php into list-domain.php and list-virtual.php
list-domain.php:
- added several admin/superadmin switches and permission checks
- merged GET and POST code
- Note: still different templates for superadmins (admin_list-domain.tpl)
and admins (overview-get.tpl) because of large layout difference
list-virtual.php:
- added several admin/superadmin switches and permission checks
- added check for admins without any domains (redirects to domain list,
which can handle this situation)
- migrated FIXME from overview.php
-> David, please review the query and remove the FIXME afterwards
overview.php:
- DELETED - no longer needed
overview.tpl:
- RENAMED overview.tpl to list-virtual.tpl
- removed admin/superadmin filename switch
- removed $incpath switch for images
menu.tpl:
- menu for domain admins now has "domain list" and "virtual list"
instead of "overview"
delete.php, edit-active.php, edit-alias.php, edit-mailbox.php, search.php:
- changed redirect to list-virtual.php
overview-get.tpl:
- changed link to list-virtual.php
main.tpl:
- changed overview link to list-domain.php
Modified Paths:
--------------
trunk/delete.php
trunk/edit-active.php
trunk/edit-alias.php
trunk/edit-mailbox.php
trunk/list-domain.php
trunk/list-virtual.php
trunk/search.php
trunk/templates/main.tpl
trunk/templates/menu.tpl
trunk/templates/overview-get.tpl
Added Paths:
-----------
trunk/templates/list-virtual.tpl
Removed Paths:
-------------
trunk/overview.php
trunk/templates/overview.tpl
Modified: trunk/delete.php
===================================================================
--- trunk/delete.php 2007-11-03 19:21:27 UTC (rev 180)
+++ trunk/delete.php 2007-11-03 22:24:34 UTC (rev 181)
@@ -149,9 +149,7 @@
if ($error != 1)
{
if ($CONF['database_type'] == "pgsql") db_query('COMMIT');
- $url = "overview.php";
- if (authentication_has_role('global-admin')) $url = "list-virtual.php";
- header ("Location: $url?domain=$fDomain");
+ header ("Location: list-virtual.php?domain=$fDomain");
exit;
} else {
$tMessage = $PALANG['pDelete_delete_error'] . "<b>$fDelete</b> (physical mail)!</span>";
Modified: trunk/edit-active.php
===================================================================
--- trunk/edit-active.php 2007-11-03 19:21:27 UTC (rev 180)
+++ trunk/edit-active.php 2007-11-03 22:24:34 UTC (rev 181)
@@ -78,7 +78,6 @@
if ($error != 1)
{
if ( preg_match( "/^list-virtual.php.*/", $fReturn ) ||
- preg_match( "/^overview.php.*/", $fReturn ) ||
preg_match( "/^search.php.*/", $fReturn ) )
{
//$fReturn appears OK, jump there
@@ -86,11 +85,7 @@
}
else
{
- if (authentication_has_role('global-admin')) {
- header ("Location: list-virtual.php?domain=$fDomain");
- } else {
- header ("Location: overview.php?domain=$fDomain");
- }
+ header ("Location: list-virtual.php?domain=$fDomain");
}
exit;
}
Modified: trunk/edit-alias.php
===================================================================
--- trunk/edit-alias.php 2007-11-03 19:21:27 UTC (rev 180)
+++ trunk/edit-alias.php 2007-11-03 22:24:34 UTC (rev 181)
@@ -118,11 +118,7 @@
{
db_log ($SESSID_USERNAME, $fDomain, 'edit_alias', "$fAddress -> $goto");
- if (authentication_has_role('global-admin')) {
- header ("Location: list-virtual.php?domain=$fDomain");
- } else {
- header ("Location: overview.php?domain=$fDomain");
- }
+ header ("Location: list-virtual.php?domain=$fDomain");
exit;
}
}
Modified: trunk/edit-mailbox.php
===================================================================
--- trunk/edit-mailbox.php 2007-11-03 19:21:27 UTC (rev 180)
+++ trunk/edit-mailbox.php 2007-11-03 22:24:34 UTC (rev 181)
@@ -144,11 +144,7 @@
else {
db_log ($SESSID_USERNAME, $fDomain, 'edit_mailbox', $fUsername);
- if (authentication_has_role('global-admin')) {
- header ("Location: list-virtual.php?domain=$fDomain");
- } else {
- header ("Location: overview.php?domain=$fDomain");
- }
+ header ("Location: list-virtual.php?domain=$fDomain");
exit;
}
}
Modified: trunk/list-domain.php
===================================================================
--- trunk/list-domain.php 2007-11-03 19:21:27 UTC (rev 180)
+++ trunk/list-domain.php 2007-11-03 22:24:34 UTC (rev 181)
@@ -27,41 +27,28 @@
require_once('common.php');
-authentication_require_role('global-admin');
+authentication_require_role('admin');
-$list_admins = list_admins ();
+if (authentication_has_role('global-admin')) {
+ $list_admins = list_admins ();
+ $is_superadmin = 1;
+} else {
+ $list_admins = array(authentication_get_username());
+ $is_superadmin = 0;
+}
-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)
- {
- for ($i = 0; $i < sizeof ($list_domains); $i++)
- {
- $domain_properties[$i] = get_domain_properties ($list_domains[$i]);
- }
- }
- }
- else
- {
- $list_domains = list_domains ();
- if ((is_array ($list_domains) and sizeof ($list_domains) > 0))
- for ($i = 0; $i < sizeof ($list_domains); $i++)
- {
- $domain_properties[$i] = get_domain_properties ($list_domains[$i]);
- }
- }
+if ($_SERVER['REQUEST_METHOD'] == "POST" && $is_superadmin && isset ($_POST['fUsername'])) {
+ $fUsername = escape_string ($_POST['fUsername']);
+ $list_domains = list_domains_for_admin ($fUsername);
+} elseif ($_SERVER['REQUEST_METHOD'] == "GET" && $is_superadmin && isset ($_GET['username'])) {
+ $fUsername = escape_string ($_GET['username']);
+ $list_domains = list_domains_for_admin ($fUsername);
+} elseif ($is_superadmin) {
+ $list_domains = list_domains ();
+} else {
+ $list_domains = list_domains_for_admin(authentication_get_username());
}
-if ($_SERVER['REQUEST_METHOD'] == "POST")
-{
- if (isset ($_POST['fUsername']))
- {
- $fUsername = escape_string ($_POST['fUsername']);
- $list_domains = list_domains_for_admin ($fUsername);
- }
-
if (!empty ($list_domains))
{
for ($i = 0; $i < sizeof ($list_domains); $i++)
@@ -69,10 +56,15 @@
$domain_properties[$i] = get_domain_properties ($list_domains[$i]);
}
}
-}
+#}
include ("templates/header.tpl");
include ("templates/menu.tpl");
-include ("templates/admin_list-domain.tpl");
+
+if ($is_superadmin) {
+ include ("templates/admin_list-domain.tpl");
+} else {
+ include ("templates/overview-get.tpl");
+}
include ("templates/footer.tpl");
?>
Modified: trunk/list-virtual.php
===================================================================
--- trunk/list-virtual.php 2007-11-03 19:21:27 UTC (rev 180)
+++ trunk/list-virtual.php 2007-11-03 22:24:34 UTC (rev 181)
@@ -15,7 +15,7 @@
* File: list-virtual.php
* List virtual users for a domain.
*
- * Template File: overview.tpl
+ * Template File: list-virtual.tpl
*
* Template Variables:
*
@@ -31,11 +31,16 @@
require_once('common.php');
-authentication_require_role('global-admin');
+authentication_require_role('admin');
-$list_domains = list_domains ();
+if (authentication_has_role('global-admin')) {
+ $list_domains = list_domains ();
+ $is_superadmin = 1;
+} else {
+ $list_domains = list_domains_for_admin(authentication_get_username());
+ $is_superadmin = 0;
+}
-
$tAlias = array();
$tMailbox = array();
$fDisplay = 0;
@@ -52,12 +57,21 @@
if (isset ($_POST['limit'])) $fDisplay = intval ($_POST['limit']);
}
+if (count($list_domains) == 0) {
+# die("no domains");
+ header("Location: list-domain.php"); # no domains (for this admin at least) - redirect to domain list
+}
if ((is_array ($list_domains) and sizeof ($list_domains) > 0)) if (empty ($fDomain)) $fDomain = $list_domains[0];
-if ((is_array ($list_domains) and sizeof ($list_domains) > 0)) if (empty ($fDomain)) $fDomain = $list_domains[1];
+if ((is_array ($list_domains) and sizeof ($list_domains) > 0)) if (empty ($fDomain)) $fDomain = $list_domains[1]; # TODO: should never happen?!? ($fDomain should already be filled by the line above)
+if (!check_owner(authentication_get_username(), $fDomain)) {
+# die($PALANG['invalid_parameter']);
+ header("Location: list-domain.php"); # domain not owned by this admin
+}
+
$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 $fDisplay, $page_size";
if ('pgsql'==$CONF['database_type'])
{
@@ -83,6 +97,7 @@
$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.domain='$fDomain' ORDER BY $table_mailbox.username LIMIT $fDisplay, $page_size");
if ('pgsql'==$CONF['database_type'])
{
+ //TODO/FIXME: postgres query needs to be rewrited
$query = "SELECT *,extract(epoch from created) as uts_created,extract(epoch from modified) as uts_modified FROM $table_mailbox WHERE domain='$fDomain' ORDER BY username LIMIT $page_size OFFSET $fDisplay";
}
}
@@ -106,7 +121,7 @@
$row['created']=gmstrftime('%c %Z',$row['uts_created']);
$row['modified']=gmstrftime('%c %Z',$row['uts_modified']);
$row['active']=('t'==$row['active']) ? 1 : 0;
- $row['v_active'] = 1; // default to off...
+ $row['v_active'] = 1; // default to off... TODO: 1 is NOT off
if(isset($row['v_active'])) { /* key may not be present in results due to query from above */
$row['v_active']=('t'==$row['v_active']) ? 1 : 0;
}
@@ -157,7 +172,7 @@
include ("templates/header.tpl");
include ("templates/menu.tpl");
-include ("templates/overview.tpl");
+include ("templates/list-virtual.tpl");
include ("templates/footer.tpl");
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
Deleted: trunk/overview.php
===================================================================
--- trunk/overview.php 2007-11-03 19:21:27 UTC (rev 180)
+++ trunk/overview.php 2007-11-03 22:24:34 UTC (rev 181)
@@ -1,249 +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: overview.php
- * Shows an overview for admins.
- *
- * Template File: overview.tpl
- *
- * Template Variables:
- *
- * tAlias
- * tDomain
- * tMailbox
- * tDisplay_back
- * tDisplay_next
- *
- * Form POST \ GET Variables:
- *
- * domain
- * fDomain
- * limit
- */
-
-require_once('common.php');
-
-authentication_require_role('admin');
-
-$SESSID_USERNAME = authentication_get_username();
-
-if(authentication_has_role('global-admin')) {
- $list_domains = list_domains ();
-}
-else {
- $list_domains = list_domains_for_admin ($SESSID_USERNAME);
-}
-
-$tAlias = array();
-$tMailbox = array();
-
-if ($_SERVER['REQUEST_METHOD'] == "GET")
-{
- $fDisplay = 0;
- $page_size = $CONF['page_size'];
-
- if (isset ($_GET['domain'])) $fDomain = escape_string ($_GET['domain']);
- if (isset ($_GET['limit'])) $fDisplay = escape_string ($_GET['limit']);
-
- $limit = get_domain_properties ($fDomain);
-
- $limitSql=('pgsql'==$CONF['database_type']) ? "$page_size OFFSET $fDisplay" : "$fDisplay, $page_size";
-
- 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'])
- {
- $query = "SELECT address,goto,extract(epoch from modified) as modified,active FROM $table_alias WHERE domain='$fDomain' AND NOT EXISTS(SELECT 1 FROM $table_mailbox WHERE username=$table_alias.address) ORDER BY address LIMIT $limitSql";
- }
-
- $result = db_query ($query);
- if ($result['rows'] > 0)
- {
- while ($row = db_array ($result['result']))
- {
- 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.domain='$fDomain' ORDER BY $table_mailbox.username LIMIT $limitSql");
- if ('pgsql'==$CONF['database_type'])
- {
- //FIXME: postgres query needs to be rewrited
- $query = "SELECT *,extract(epoch from created) as uts_created,extract(epoch from modified) as uts_modified FROM $table_mailbox WHERE domain='$fDomain' ORDER BY username LIMIT $limitSql";
- }
- }
- else
- {
- $query = "SELECT * FROM $table_mailbox WHERE domain='$fDomain' ORDER BY username LIMIT $limitSql";
- 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 domain='$fDomain' ORDER BY username LIMIT $limitSql";
- }
- }
-
- $result = db_query ($query);
- if ($result['rows'] > 0)
- {
- while ($row = db_array ($result['result']))
- {
- if ('pgsql'==$CONF['database_type'])
- {
- $row['created']=gmstrftime('%c %Z',$row['uts_created']);
- $row['modified']=gmstrftime('%c %Z',$row['uts_modified']);
- $row['active']=('t'==$row['active']) ? 1 : 0;
- if(isset($row['v_active'])) {
- $row['v_active']=('t'==$row['v_active']) ? 1 : 0;
- }
- else {
- $row['v_active'] = -1 ; //unknown; broken query above..
- }
- unset($row['uts_created']);
- unset($row['uts_modified']);
- }
- $tMailbox[] = $row;
- }
- }
- $template = "overview.tpl";
- }
- else
- {
- $template = "overview-get.tpl";
- }
-
- $tDomain = $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))
- {
- $tDisplay_up_show = 1;
- }
- if ((($fDisplay + $page_size) < $limit['alias_count']) or (($fDisplay + $page_size) < $limit['mailbox_count']))
- {
- $tDisplay_next_show = 1;
- $tDisplay_next = $fDisplay + $page_size;
- }
- }
-
- include ("./templates/header.tpl");
- include ("./templates/menu.tpl");
- include ("./templates/$template");
- include ("./templates/footer.tpl");
-}
-
-if ($_SERVER['REQUEST_METHOD'] == "POST")
-{
- $fDisplay = 0;
- $page_size = $CONF['page_size'];
-
- if (isset ($_POST['limit'])) $fDisplay = escape_string ($_POST['limit']);
- if (isset ($_POST['domain'])) $fDomain = escape_string ($_POST['fDomain']);
-
- if (check_owner ($SESSID_USERNAME, escape_string ($_POST['fDomain'])))
- {
- $limitSql=('pgsql'==$CONF['database_type']) ? "$page_size OFFSET $fDisplay" : "$fDisplay, $page_size";
-
- if ($CONF['alias_control_admin'] == "YES")
- {
- $query = "SELECT address,goto,modified,active FROM $table_alias WHERE domain='$fDomain' ORDER BY address LIMIT $limitSql";
- if ('pgsql'==$CONF['database_type'])
- {
- $query = "SELECT address,goto,extract(epoch from modified) as modified,active FROM $table_alias WHERE domain='$fDomain' ORDER BY address LIMIT $limitSql";
- }
- }
- else
- {
- $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'])
- {
- $query="SELECT address,goto,extract(epoch from modified) as modified,active FROM $table_alias WHERE domain='$fDomain' AND NOT EXISTS(SELECT 1 FROM $table_mailbox WHERE username=$table_alias.address) ORDER BY address LIMIT $limitSql";
- }
- }
-
- $result = db_query ("$query");
- if ($result['rows'] > 0)
- {
- while ($row = db_array ($result['result']))
- {
- if ('pgsql'==$CONF['database_type'])
- {
- $row['modified']=gmstrftime('%c %Z',$row['modified']);
- $row['active']=('t'==$row['active']) ? 1 : 0;
- }
- $tAlias[] = $row;
- }
- }
-
- $query = "SELECT * FROM $table_mailbox WHERE domain='$fDomain' ORDER BY username LIMIT $limitSql";
- 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 domain='$fDomain' ORDER BY username LIMIT $limitSql";
- }
- $result = db_query ($query);
- if ($result['rows'] > 0)
- {
- while ($row = db_array ($result['result']))
- {
- if ('pgsql'==$CONF['database_type'])
- {
- $row['created']=gmstrftime('%c %Z',$row['uts_created']);
- $row['modified']=gmstrftime('%c %Z',$row['uts_modified']);
- $row['active']=('t'==$row['active']) ? 1 : 0;
- }
- $tMailbox[] = $row;
- }
- }
- }
-
- 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))
- {
- $tDisplay_up_show = 1;
- }
- if ((($fDisplay + $page_size) < $limit['alias_count']) or (($fDisplay + $page_size) < $limit['mailbox_count']))
- {
- $tDisplay_next_show = 1;
- $tDisplay_next = $fDisplay + $page_size;
- }
- }
-
- include ("./templates/header.tpl");
- include ("./templates/menu.tpl");
- include ("./templates/overview.tpl");
- include ("./templates/footer.tpl");
-}
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
-?>
Modified: trunk/search.php
===================================================================
--- trunk/search.php 2007-11-03 19:21:27 UTC (rev 180)
+++ trunk/search.php 2007-11-03 22:24:34 UTC (rev 181)
@@ -59,14 +59,7 @@
if (empty ($fSearch) /* && !empty ($fGo) */)
{
- if (authentication_has_role('global-admin'))
- {
- header("Location: list-virtual.php?domain=" . $fDomain ) && exit;
- }
- else
- {
- header("Location: overview.php?domain=" . $fDomain ) && exit;
- }
+ header("Location: list-virtual.php?domain=" . $fDomain ) && exit;
}
if ($CONF['alias_control_admin'] == "YES")
Copied: trunk/templates/list-virtual.tpl (from rev 175, trunk/templates/overview.tpl)
===================================================================
--- trunk/templates/list-virtual.tpl (rev 0)
+++ trunk/templates/list-virtual.tpl 2007-11-03 22:24:34 UTC (rev 181)
@@ -0,0 +1,317 @@
+<div id="overview">
+<form name="overview" method="post">
+<select name="fDomain" onChange="this.form.submit();">
+<?php
+
+$file = 'list-virtual.php';
+
+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'];
+if ($limit['aliases'] < 0) $limit['aliases'] = $PALANG['pOverview_disabled'];
+if ($limit['mailboxes'] < 0) $limit['mailboxes'] = $PALANG['pOverview_disabled'];
+if ($limit['maxquota'] < 0) $limit['maxquota'] = $PALANG['pOverview_disabled'];
+
+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 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>
+<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=\"$file?domain=$fDomain&limit=" . $i * $CONF['page_size'] . "\"><b>" . $limit['alias_pgindex'][$i] . "</b></a>\n";
+ }
+ else
+ {
+ 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=\"$file?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=\"$file?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=\"$file?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=\"7\"><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['pOverview_alias_address'] . "</td>\n";
+ print " <td>" . $PALANG['pOverview_alias_goto'] . "</td>\n";
+ print " <td>" . $PALANG['pOverview_alias_modified'] . "</td>\n";
+ print " <td>" . $PALANG['pOverview_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";
+
+
+# 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'];
+ print " <td><a href=\"edit-active.php?alias=" . urlencode ($tAlias[$i]['address']) . "&domain=$fDomain" . "\">" . $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
+ {
+ if ( check_alias_owner ($SESSID_USERNAME, $tAlias[$i]['address']))
+ {
+ $active = ($tAlias[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO'];
+ print " <td><a href=\"edit-active.php?alias=" . urlencode ($tAlias[$i]['address']) . "&domain=$fDomain" . "\">" . $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=mailbox&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
+ {
+ //this is a special alias, show status only, don't allow changes
+ $active = ($tAlias[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO'];
+ print " <td>" . $active . "</td>\n";
+ print " <td> </td>\n";
+ 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;
+ for ($i = 0; $i < $limit['mbox_pgindex_count']; $i++)
+ {
+ if ( $i == $highlight_at )
+ {
+ print "<a href=\"$file?domain=$fDomain&limit=" . $i * $CONF['page_size'] . "#MidArrow\"><b>" . $limit['mbox_pgindex'][$i] . "</b></a>\n";
+ }
+ else
+ {
+ 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=\"$file?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=\"$file?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=\"$file?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)
+{
+ $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=\"$colspan\"><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['pOverview_mailbox_username'] . "</td>\n";
+ print " <td>" . $PALANG['pOverview_mailbox_name'] . "</td>\n";
+ 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 = $colspan - 6;
+ print " <td colspan=\"$colspan\"> </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_int = $tMailbox[$i]['v_active'];
+ if($v_active_int !== -1) {
+ if($v_active_int == 1) {
+ $v_active = $PALANG['pOverview_vacation_edit'];
+ }
+ else {
+ $v_active = $PALANG['pOverview_vacation_option'];
+ }
+ print "<td><a href=\"edit-vacation.php?username=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\">" . $v_active . "</a></td>\n";
+ }
+ else {
+ // can't tell vacation state - broken pgsql query
+ echo "<td> </td>\n";
+ }
+ }
+
+ $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?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=\"$file?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=\"$file?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=\"$file?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 ft=php expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
+?>
Modified: trunk/templates/main.tpl
===================================================================
--- trunk/templates/main.tpl 2007-11-03 19:21:27 UTC (rev 180)
+++ trunk/templates/main.tpl 2007-11-03 22:24:34 UTC (rev 181)
@@ -1,7 +1,7 @@
<div id="main_menu">
<table>
<tr>
- <td nowrap><a target="_top" href="overview.php"><?php print $PALANG['pMenu_overview']; ?></a></td>
+ <td nowrap><a target="_top" href="list-domain.php"><?php print $PALANG['pMenu_overview']; ?></a></td>
<td><?php print $PALANG['pMain_overview']; ?></td>
</tr>
<tr>
Modified: trunk/templates/menu.tpl
===================================================================
--- trunk/templates/menu.tpl 2007-11-03 19:21:27 UTC (rev 180)
+++ trunk/templates/menu.tpl 2007-11-03 22:24:34 UTC (rev 181)
@@ -26,15 +26,16 @@
$submenu_domain = "";
}
+
if (authentication_has_role('global-admin')) {
print _menulink("list-admin.php", $PALANG['pAdminMenu_list_admin'], $submenu_admin);
- print _menulink("list-domain.php", $PALANG['pAdminMenu_list_domain'], $submenu_domain);
- print _menulink("list-virtual.php", $PALANG['pAdminMenu_list_virtual'], $submenu_virtual);
} else {
print _menulink("main.php", $PALANG['pMenu_main']);
- print _menulink("overview.php", $PALANG['pMenu_overview'], $submenu_virtual);
}
+print _menulink("list-domain.php", $PALANG['pAdminMenu_list_domain'], $submenu_domain);
+print _menulink("list-virtual.php", $PALANG['pAdminMenu_list_virtual'], $submenu_virtual);
+
if ($CONF['fetchmail'] == 'YES') {
print _menulink("fetchmail.php", $PALANG['pMenu_fetchmail'], $submenu_fetchmail);
}
Modified: trunk/templates/overview-get.tpl
===================================================================
--- trunk/templates/overview-get.tpl 2007-11-03 19:21:27 UTC (rev 180)
+++ trunk/templates/overview-get.tpl 2007-11-03 22:24:34 UTC (rev 181)
@@ -48,7 +48,7 @@
if ($limit['maxquota'] < 0) $limit['maxquota'] = $PALANG['pOverview_disabled'];
print " <tr class=\"hilightoff\" onMouseOver=\"className='hilighton';\" onMouseOut=\"className='hilightoff';\">\n";
- print " <td><a href=\"overview.php?domain=" . $list_domains[$i] . "\">" . $list_domains[$i] . "</a></td>\n";
+ print " <td><a href=\"list-virtual.php?domain=" . $list_domains[$i] . "\">" . $list_domains[$i] . "</a></td>\n";
print " <td>" . $limit['alias_count'] . " / " . $limit['aliases'] . "</td>\n";
print " <td>" . $limit['mailbox_count'] . " / " . $limit['mailboxes'] . "</td>\n";
if ($CONF['quota'] == 'YES') print " <td>" . $limit['maxquota'] . "</td>\n";
Deleted: trunk/templates/overview.tpl
===================================================================
--- trunk/templates/overview.tpl 2007-11-03 19:21:27 UTC (rev 180)
+++ trunk/templates/overview.tpl 2007-11-03 22:24:34 UTC (rev 181)
@@ -1,323 +0,0 @@
-<div id="overview">
-<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'];
-if ($limit['aliases'] < 0) $limit['aliases'] = $PALANG['pOverview_disabled'];
-if ($limit['mailboxes'] < 0) $limit['mailboxes'] = $PALANG['pOverview_disabled'];
-if ($limit['maxquota'] < 0) $limit['maxquota'] = $PALANG['pOverview_disabled'];
-
-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 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>
-<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=\"$file?domain=$fDomain&limit=" . $i * $CONF['page_size'] . "\"><b>" . $limit['alias_pgindex'][$i] . "</b></a>\n";
- }
- else
- {
- 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=\"$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 " </tr>";
- print " <tr class=\"header\">\n";
- if ($CONF['show_status'] == 'YES') { print "<td></td>\n"; }
- print " <td>" . $PALANG['pOverview_alias_address'] . "</td>\n";
- print " <td>" . $PALANG['pOverview_alias_goto'] . "</td>\n";
- print " <td>" . $PALANG['pOverview_alias_modified'] . "</td>\n";
- print " <td>" . $PALANG['pOverview_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";
-
-
-# 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'];
- print " <td><a href=\"edit-active.php?alias=" . urlencode ($tAlias[$i]['address']) . "&domain=$fDomain" . "\">" . $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
- {
- if ( check_alias_owner ($SESSID_USERNAME, $tAlias[$i]['address']))
- {
- $active = ($tAlias[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO'];
- print " <td><a href=\"edit-active.php?alias=" . urlencode ($tAlias[$i]['address']) . "&domain=$fDomain" . "\">" . $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=mailbox&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
- {
- //this is a special alias, show status only, don't allow changes
- $active = ($tAlias[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO'];
- print " <td>" . $active . "</td>\n";
- print " <td> </td>\n";
- 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;
- for ($i = 0; $i < $limit['mbox_pgindex_count']; $i++)
- {
- if ( $i == $highlight_at )
- {
- print "<a href=\"$file?domain=$fDomain&limit=" . $i * $CONF['page_size'] . "#MidArrow\"><b>" . $limit['mbox_pgindex'][$i] . "</b></a>\n";
- }
- else
- {
- 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=\"$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;
- 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=\"$colspan\"><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['pOverview_mailbox_username'] . "</td>\n";
- print " <td>" . $PALANG['pOverview_mailbox_name'] . "</td>\n";
- 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 = $colspan - 6;
- print " <td colspan=\"$colspan\"> </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_int = $tMailbox[$i]['v_active'];
- if($v_active_int !== -1) {
- if($v_active_int == 1) {
- $v_active = $PALANG['pOverview_vacation_edit'];
- }
- else {
- $v_active = $PALANG['pOverview_vacation_option'];
- }
- print "<td><a href=\"edit-vacation.php?username=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\">" . $v_active . "</a></td>\n";
- }
- else {
- // can't tell vacation state - broken pgsql query
- echo "<td> </td>\n";
- }
- }
-
- $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?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=\"$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=\"$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=\"$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";
-
-}
-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 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: <Gin...@us...> - 2007-11-03 19:21:22
|
Revision: 180
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=180&view=rev
Author: GingerDog
Date: 2007-11-03 12:21:27 -0700 (Sat, 03 Nov 2007)
Log Message:
-----------
setup.php: try and make sure the "ALL" domain exists to start with when creating the super admin user; fix html so li elements are closed
Modified Paths:
--------------
trunk/setup.php
Modified: trunk/setup.php
===================================================================
--- trunk/setup.php 2007-11-03 19:03:43 UTC (rev 179)
+++ trunk/setup.php 2007-11-03 19:21:27 UTC (rev 180)
@@ -59,11 +59,11 @@
{
if (phpversion() < 5) $phpversion = 4;
if (phpversion() >= 5) $phpversion = 5;
- print "<li>PHP version " . phpversion () . "\n";
+ print "<li>PHP version " . phpversion () . "</li>\n";
}
else
{
- print "<li><b>Unable to check for PHP version. (missing function: phpversion())</b>\n";
+ print "<li><b>Unable to check for PHP version. (missing function: phpversion())</b></li>\n";
}
//
@@ -71,11 +71,11 @@
//
if ($f_apache_get_version == 1)
{
- print "<li>" . apache_get_version() . "\n";
+ print "<li>" . apache_get_version() . "</li>\n";
}
else
{
- print "<li><b>Unable to check for Apache version. (missing function: apache_get_version())</b>\n";
+ print "<li><b>Unable to check for Apache version. (missing function: apache_get_version())</b></li>\n";
}
print "</ul>";
@@ -89,16 +89,16 @@
{
if (get_magic_quotes_gpc () == 0)
{
- print "<li>Magic Quotes: Disabled - OK\n";
+ print "<li>Magic Quotes: Disabled - OK</li>\n";
}
else
{
- print "<li><b>Warning: Magic Quotes: ON (internal workaround used)</b>\n";
+ print "<li><b>Warning: Magic Quotes: ON (internal workaround used)</b></li>\n";
}
}
else
{
- print "<li><b>Unable to check for Magic Quotes. (missing function: get_magic_quotes_gpc())</b>\n";
+ print "<li><b>Unable to check for Magic Quotes. (missing function: get_magic_quotes_gpc())</b></li>\n";
}
//
@@ -107,16 +107,16 @@
$config_loaded = 0;
if ($file_config == 1)
{
- print "<li>Depends on: presence config.inc.php - OK\n";
+ print "<li>Depends on: presence config.inc.php - OK</li>\n";
require_once('config.inc.php');
$config_loaded = 1;
}
else
{
- print "<li><b>Error: Depends on: presence config.inc.php - NOT FOUND</b><br />\n";
- print "Create the file.<br />";
+ print "<li><b>Error: Depends on: presence config.inc.php - NOT FOUND</b><br /></li>\n";
+ print "Create the file, and edit as appropriate (e.g. select database type etc)<br />";
print "For example:<br />\n";
- print "<pre>% cp config.inc.php.sample config.inc.php</pre>\n";
+ print "<code><pre>cp config.inc.php.sample config.inc.php</pre></code>\n";
$error =+ 1;
}
@@ -143,7 +143,7 @@
print "<pre>% cd /usr/ports/databases/php$phpversion-pgsql/\n";
print "% make clean install\n";
print " - or with portupgrade -\n";
- print "% portinstall php$phpversion-pgsql</pre>\n";
+ print "% portinstall php$phpversion-pgsql</pre></li>\n";
$error =+ 1;
}
//
@@ -151,7 +151,7 @@
//
if ($f_mysql_connect == 1)
{
- print "<li>Depends on: MySQL 3.23, 4.0 - OK\n";
+ print "<li>Depends on: MySQL 3.23, 4.0 - OK</li>\n";
}
//
@@ -165,6 +165,7 @@
if ( !($config_loaded && $CONF['database_type'] == 'mysqli') ) {
print "(change the database_type to 'mysqli' in config.inc.php!!)\n";
}
+ print "</li>";
}
}
@@ -177,6 +178,7 @@
if ( !($config_loaded && $CONF['database_type'] == 'pgsql') ) {
print "(change the database_type to 'pgsql' in config.inc.php!!)\n";
}
+ print "</li>";
}
//
@@ -185,11 +187,11 @@
if ($config_loaded) {
list ($link, $error_text) = db_connect(TRUE);
if ($error_text == "") {
- print "<li>Testing database connection - OK";
+ print "<li>Testing database connection - OK - {$CONF['database_type']}://{$CONF['database_user']}:xxxxx@{$CONF['database_host']}/{$CONF['database_name']}</li>";
} else {
print "<li><b>Error: Can't connect to database</b><br />\n";
print "Please edit the \$CONF['database_*'] parameters in config.inc.php.\n";
- print "$error_text\n";
+ print "$error_text</li>\n";
$error ++;
}
}
@@ -199,7 +201,7 @@
//
if ($f_session_start == 1)
{
- print "<li>Depends on: session - OK\n";
+ print "<li>Depends on: session - OK</li>\n";
}
else
{
@@ -208,7 +210,7 @@
print "<pre>% cd /usr/ports/www/php$phpversion-session/\n";
print "% make clean install\n";
print " - or with portupgrade -\n";
- print "% portinstall php$phpversion-session</pre>\n";
+ print "% portinstall php$phpversion-session</pre></li>\n";
$error =+ 1;
}
@@ -217,7 +219,7 @@
//
if ($f_preg_match == 1)
{
- print "<li>Depends on: pcre - OK\n";
+ print "<li>Depends on: pcre - OK</li>\n";
}
else
{
@@ -226,7 +228,7 @@
print "<pre>% cd /usr/ports/devel/php$phpversion-pcre/\n";
print "% make clean install\n";
print " - or with portupgrade -\n";
- print "% portinstall php$phpversion-pcre</pre>\n";
+ print "% portinstall php$phpversion-pcre</pre></li>\n";
$error =+ 1;
}
@@ -252,6 +254,12 @@
if (isset ($_POST['fPassword'])) $fPassword = escape_string ($_POST['fPassword']);
if (isset ($_POST['fPassword2'])) $fPassword2 = escape_string ($_POST['fPassword2']);
+ // XXX need to ensure domains table includes an 'ALL' entry.
+ $r = db_query("SELECT * FROM domain WHERE domain = 'ALL'");
+ if($r['rows'] == 0) {
+ db_insert('domain', array('domain' => 'ALL')); // all other fields should default through the schema.
+ }
+
list ($error, $tMessage, $pAdminCreate_admin_username_text, $pAdminCreate_admin_password_text) = create_admin($fUsername, $fPassword, $fPassword2, array('ALL'), TRUE);
if ($error != 0) {
if (isset ($_POST['fUsername'])) $tUsername = escape_string ($_POST['fUsername']);
@@ -301,7 +309,6 @@
print "<b>Make sure you delete this setup.php file!</b><br />\n";
print "Also check the config.inc.php file for any settings that you might need to change!<br />\n";
- print "Click here to go to the <a href=\"admin\">admin section</a> (make sure that your .htaccess is setup properly)\n";
}
?>
</div>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Gin...@us...> - 2007-11-03 19:03:41
|
Revision: 179
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=179&view=rev
Author: GingerDog
Date: 2007-11-03 12:03:43 -0700 (Sat, 03 Nov 2007)
Log Message:
-----------
functions.inc.php: change doc block formatting
Modified Paths:
--------------
trunk/functions.inc.php
Modified: trunk/functions.inc.php
===================================================================
--- trunk/functions.inc.php 2007-11-03 18:46:32 UTC (rev 178)
+++ trunk/functions.inc.php 2007-11-03 19:03:43 UTC (rev 179)
@@ -1526,11 +1526,13 @@
}
-//
-// db_insert
-// Action: Inserts a row from a specified table
-// Call: db_insert (string table, array values)
-//
+/**
+ * db_insert
+ * Action: Inserts a row from a specified table
+ * Call: db_insert (string table, array values)
+ * @param String $table - table name
+ * @param array - key/value map of data to insert into the table.
+ */
function db_insert ($table, $values)
{
$sql_values = "(" . implode(",",escape_string(array_keys($values))).") VALUES ('".implode("','",escape_string($values))."')";
@@ -1549,22 +1551,19 @@
-//
-// db_log
-// Action: Logs actions from admin
-// Call: db_log (string username, string domain, string action, string data)
-/*
-
-Possible actions are:
-'create_alias'
-'delete_alias'
-'delete_mailbox'
-'edit_alias'
-'edit_alias_state'
-'edit_mailbox'
-'edit_mailbox_state'
-'edit_password'
-
+/**
+ * db_log
+ * Action: Logs actions from admin
+ * Call: db_log (string username, string domain, string action, string data)
+ * Possible actions are:
+ * 'create_alias'
+ * 'delete_alias'
+ * 'delete_mailbox'
+ * 'edit_alias'
+ * 'edit_alias_state'
+ * 'edit_mailbox'
+ * 'edit_mailbox_state'
+ * 'edit_password'
*/
function db_log ($username,$domain,$action,$data)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Gin...@us...> - 2007-11-03 18:46:28
|
Revision: 178
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=178&view=rev
Author: GingerDog
Date: 2007-11-03 11:46:32 -0700 (Sat, 03 Nov 2007)
Log Message:
-----------
SUPERADMIN.TXT: updating docs
Modified Paths:
--------------
trunk/DOCUMENTS/SUPERADMIN.TXT
Modified: trunk/DOCUMENTS/SUPERADMIN.TXT
===================================================================
--- trunk/DOCUMENTS/SUPERADMIN.TXT 2007-11-03 18:41:38 UTC (rev 177)
+++ trunk/DOCUMENTS/SUPERADMIN.TXT 2007-11-03 18:46:32 UTC (rev 178)
@@ -32,3 +32,6 @@
Bye
Then you can log in as ne...@do..., password: admin
+
+
+(The domain 'ALL' should already exist in the domain table; if not you'll need to recreate it)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Gin...@us...> - 2007-11-03 18:41:33
|
Revision: 177
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=177&view=rev
Author: GingerDog
Date: 2007-11-03 11:41:38 -0700 (Sat, 03 Nov 2007)
Log Message:
-----------
SUPERADMIN.TXT: updating docs
Modified Paths:
--------------
trunk/DOCUMENTS/SUPERADMIN.TXT
Modified: trunk/DOCUMENTS/SUPERADMIN.TXT
===================================================================
--- trunk/DOCUMENTS/SUPERADMIN.TXT 2007-11-03 18:32:10 UTC (rev 176)
+++ trunk/DOCUMENTS/SUPERADMIN.TXT 2007-11-03 18:41:38 UTC (rev 177)
@@ -1,17 +1,16 @@
-
-
------------------------------------
Recreating a superadmin account
-The database scripts DATABASE_MYSQL.TXT and DATABASE_PGSQL.TXT create a super admin
- of ad...@do..., password: admin
-
+When you run setup.php you will be required to enter a super user name and password.
+This user will be able to login and modify any domain or setting. Hence, superadmin!.
+
With that login you can create new superadmins (and you should delete or change the
password of ad...@do...). If that user is no longer there or you didn't use
-the .TXT files, you could add another manually from the database. Just use the code
-from one of the .TXT files. Do this as root on the MySQL machine:
-
+the .TXT files, you could add another manually from the database.
+
+(The example uses MySQL, the syntax will be similar for PostgreSQL)
+
# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8186 to server version: 5.0.27
@@ -33,4 +32,3 @@
Bye
Then you can log in as ne...@do..., password: admin
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Gin...@us...> - 2007-11-03 18:32:07
|
Revision: 176
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=176&view=rev
Author: GingerDog
Date: 2007-11-03 11:32:10 -0700 (Sat, 03 Nov 2007)
Log Message:
-----------
DATABASE_PGSQL.TXT: schema typo fix; thanks to http://sourceforge.net/forum/forum.php?thread_id=1843123&forum_id=676076 and jpalmer on irc
Modified Paths:
--------------
trunk/DATABASE_PGSQL.TXT
Modified: trunk/DATABASE_PGSQL.TXT
===================================================================
--- trunk/DATABASE_PGSQL.TXT 2007-11-02 00:50:58 UTC (rev 175)
+++ trunk/DATABASE_PGSQL.TXT 2007-11-03 18:32:10 UTC (rev 176)
@@ -126,7 +126,7 @@
domain,
domain_admins,
log,
- mailbox,
+ mailbox
TO postfixadmin;
GRANT SELECT ON alias,domain,mailbox TO postfix;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2007-11-02 00:50:53
|
Revision: 175
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=175&view=rev
Author: christian_boltz
Date: 2007-11-01 17:50:58 -0700 (Thu, 01 Nov 2007)
Log Message:
-----------
- fixed some SQL syntax errors
- debug output now includes the query
Modified Paths:
--------------
trunk/upgrade.php
Modified: trunk/upgrade.php
===================================================================
--- trunk/upgrade.php 2007-11-02 00:35:46 UTC (rev 174)
+++ trunk/upgrade.php 2007-11-02 00:50:58 UTC (rev 175)
@@ -92,7 +92,7 @@
'{PRIMARY}' => 'primary key',
'{UNSIGNED}' => 'unsigned' ,
'{FULLTEXT}' => 'FULLTEXT',
- '{BOOLEAN}' => '`active` tinyint(1) NOT NULL',
+ '{BOOLEAN}' => 'tinyint(1) NOT NULL',
'{UTF_8}' => '/*!40100 CHARACTER SET utf8 COLLATE utf8_unicode_ci */',
'{LATIN1}' => '/*!40100 CHARACTER SET latin1 COLLATE latin1_swedish_ci */',
'{IF_NOT_EXISTS}' => 'IF NOT EXISTS',
@@ -128,7 +128,8 @@
$query = trim(str_replace(array_keys($replace), $replace, $sql));
$result = db_query($query, $ignore_errors);
if (safeget('debug') != "") {
- print $result['error'];
+ print "<p style='color:#999'>$query";
+ print "<div style='color:#f00'>" . $result['error'] . "</div>";
}
return $result;
}
@@ -195,7 +196,7 @@
ALTER TABLE $table_vacation ADD COLUMN created DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL AFTER domain;
ALTER TABLE $table_vacation ADD COLUMN active TINYINT(1) DEFAULT '1' NOT NULL AFTER created;
ALTER TABLE $table_vacation DROP PRIMARY KEY
- ALTER TABLE $table_vacation ADD COLUMN PRIMARY KEY(email);
+ ALTER TABLE $table_vacation ADD PRIMARY KEY(email)
UPDATE $table_vacation SET domain=SUBSTRING_INDEX(email, '@', -1) WHERE email=email;
"));
@@ -286,10 +287,10 @@
function upgrade_79_mysql() { # MySQL only
# drop useless indicies (already available as primary key)
- $result = db_query_parsed(_drop_index('admin', 'username'));
- $result = db_query_parsed(_drop_index('alias', 'address'));
- $result = db_query_parsed(_drop_index('domain', 'domain'));
- $result = db_query_parsed(_drop_index('mailbox', 'username'));
+ $result = db_query_parsed(_drop_index('admin', 'username'), True);
+ $result = db_query_parsed(_drop_index('alias', 'address'), True);
+ $result = db_query_parsed(_drop_index('domain', 'domain'), True);
+ $result = db_query_parsed(_drop_index('mailbox', 'username'), True);
}
function upgrade_81_mysql() { # MySQL only
@@ -337,9 +338,9 @@
$table_domain = table_by_key ('domain');
$table_mailbox = table_by_key ('mailbox');
- $result = db_query_parsed("ALTER TABLE $table_domain ALTER COLUMN `quota` bigint(20) NOT NULL default '0'", TRUE);
- $result = db_query_parsed("ALTER TABLE $table_mailbox ALTER COLUMN `maxquota` bigint(20) NOT NULL default '0'", TRUE);
- $result = db_query_parsed("ALTER TABLE $table_mailbox ALTER COLUMN `quota` bigint(20) NOT NULL default '0'", TRUE);
+ $result = db_query_parsed("ALTER TABLE $table_domain MODIFY COLUMN `quota` bigint(20) NOT NULL default '0'", TRUE);
+ $result = db_query_parsed("ALTER TABLE $table_domain MODIFY COLUMN `maxquota` bigint(20) NOT NULL default '0'", TRUE);
+ $result = db_query_parsed("ALTER TABLE $table_mailbox MODIFY COLUMN `quota` bigint(20) NOT NULL default '0'", TRUE);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2007-11-02 00:35:42
|
Revision: 174
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=174&view=rev
Author: christian_boltz
Date: 2007-11-01 17:35:46 -0700 (Thu, 01 Nov 2007)
Log Message:
-----------
- next try to expand $Revision$ in upgrade.php :-/
Modified Paths:
--------------
trunk/upgrade.php
Modified: trunk/upgrade.php
===================================================================
--- trunk/upgrade.php 2007-11-02 00:27:32 UTC (rev 173)
+++ trunk/upgrade.php 2007-11-02 00:35:46 UTC (rev 174)
@@ -37,7 +37,7 @@
function _do_upgrade($current_version) {
global $CONF;
- $target_version = preg_replace('/[^0-9]/', '', '$Revision:42$');
+ $target_version = preg_replace('/[^0-9]/', '', '$Revision$');
if ($current_version >= $target_version) {
# already up to date
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2007-11-02 00:27:27
|
Revision: 173
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=173&view=rev
Author: christian_boltz
Date: 2007-11-01 17:27:32 -0700 (Thu, 01 Nov 2007)
Log Message:
-----------
fetchmail.php:
- cancel button did not work on $new
Modified Paths:
--------------
trunk/fetchmail.php
Modified: trunk/fetchmail.php
===================================================================
--- trunk/fetchmail.php 2007-11-02 00:24:36 UTC (rev 172)
+++ trunk/fetchmail.php 2007-11-02 00:27:32 UTC (rev 173)
@@ -150,6 +150,7 @@
if ($cancel) {
$edit=0;
+ $new=0;
} elseif ($delete) {
$result = db_query ("delete from fetchmail WHERE id=".$delete);
if ($result['rows'] != 1)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2007-11-02 00:24:32
|
Revision: 172
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=172&view=rev
Author: christian_boltz
Date: 2007-11-01 17:24:36 -0700 (Thu, 01 Nov 2007)
Log Message:
-----------
upgrade.php:
- create config table at startup (not nice, but works)
- changed _do_upgrade to use "for ($i = $current_version +1;
$i <= $target_version; $i++)" loop and function_exists()
- added support for upgrade_<number>>_mysql() and
upgrade_<number>_pgsql() functions for database-specific changes
- added function db_query_parsed(), idea taken from serendipity's
include/db/*.php serendipity_db_schema_import()
- added function _drop_index() - MySQL and PgSQL syntax differs too
much on this
- added pre-2.1 database updates (DOCUMENTS/TABLE_BACKUP_MX.TXT and
DOCUMENTS/TABLE_CHANGES.TXT)
- added all database changes between 2.1 and current SVN.
Everything since the move to sourceforge has the revision number in
the function name.
(still several TODOs left)
Modified Paths:
--------------
trunk/upgrade.php
Property Changed:
----------------
trunk/upgrade.php
Modified: trunk/upgrade.php
===================================================================
--- trunk/upgrade.php 2007-11-01 23:58:12 UTC (rev 171)
+++ trunk/upgrade.php 2007-11-02 00:24:36 UTC (rev 172)
@@ -1,10 +1,27 @@
<?php
require_once('common.php');
+
+# Note: run with upgrade.php?debug=1 to see all SQL error messages
+
+
+# Not nice, but works:
+# We don't know if the config table exists, so we simply try to create it ;-)
+# Better solution (TODO): query the db to see if the 'config' table exists
+
+$sql = "
+CREATE TABLE {IF_NOT_EXISTS} " . table_by_key ('config') . "(
+ `id` {AUTOINCREMENT} {PRIMARY},
+ `name` VARCHAR(20) {LATIN1} NOT NULL DEFAULT '',
+ `value` VARCHAR(20) {LATIN1} NOT NULL DEFAULT '',
+ UNIQUE name ( `name` )
+)
+";
+
+db_query_parsed($sql, 0, " ENGINE = MYISAM COMMENT = 'PostfixAdmin settings'");
+
$sql = "SELECT * FROM config WHERE name = 'version'";
-// create table config (name varchar(20), value varchar(20));
// insert into config('version', '01');
-// Should really query the db to see if the 'config' table exists first!
$r = db_query($sql);
@@ -12,57 +29,334 @@
$rs = $r['result'];
$row = db_array($rs);
$version = $row['value'];
- _do_upgrade($version);
+} else {
+ $version = 0;
}
+_do_upgrade($version);
function _do_upgrade($current_version) {
- $all_functions = get_defined_functions();
- $upgrade_functions = array();
- foreach($all_functions['user'] as $function_name) {
- if(preg_match('!upgrade_(\d+)!', $function_name, $matches)) {
- $version = $matches[1];
- if($version <= $current_version) {
- continue;
- }
- $upgrade_functions[$matches[1]] = $function_name;
- }
+ global $CONF;
+ $target_version = preg_replace('/[^0-9]/', '', '$Revision:42$');
+
+ if ($current_version >= $target_version) {
+ # already up to date
+ echo "up to date";
+ return true;
}
- ksort($upgrade_functions);
- foreach($upgrade_functions as $version => $function) {
- $function();
- }
+ echo "<p>Updating database:<p>old version: $current_version; target version: $target_version";
+
+ for ($i = $current_version +1; $i <= $target_version; $i++) {
+ $function = "upgrade_$i";
+ $function_mysql = $function . "_mysql";
+ $function_pgsql = $function . "_pgsql";
+ if (function_exists($function)) {
+ echo "<p>updating to version $i (all databases)...";
+ $function();
+ echo " done";
+ }
+ if ($CONF['database_type'] == 'mysql' || $CONF['database_type'] == 'mysqli' ) {
+ if (function_exists($function_mysql)) {
+ echo "<p>updating to version $i (MySQL)...";
+ $function_mysql();
+ echo " done";
+ }
+ } elseif($CONF['database_type'] == 'pgsql') {
+ if (function_exists($function_pgsql)) {
+ echo "<p>updating to version $i (PgSQL)...";
+ $function_pgsql();
+ echo " done";
+ }
+ }
+ # TODO: update version in config table after each change
+ # TODO: this avoids problems in case the script hits the max_execution_time,
+ # TODO: simply rerunning it will continue where it was stopped
+ };
}
-function upgrade_00() {
+/**
+ * Replaces database specific parts in a query
+ * @param String sql query with placeholders
+ * @param String (optional) MySQL specific code to attach, useful for COMMENT= on CREATE TABLE
+ * @return String sql query
+ */
+
+function db_query_parsed($sql, $ignore_errors = 0, $attach_mysql = "") {
global $CONF;
- if($CONF['database_type'] == 'mysql') {
- echo 'mysql 00';
+
+ if ($CONF['database_type'] == 'mysql' || $CONF['database_type'] == 'mysqli' ) {
+
+ $replace = array(
+ '{AUTOINCREMENT}' => 'int(11) not null auto_increment',
+ '{PRIMARY}' => 'primary key',
+ '{UNSIGNED}' => 'unsigned' ,
+ '{FULLTEXT}' => 'FULLTEXT',
+ '{BOOLEAN}' => '`active` tinyint(1) NOT NULL',
+ '{UTF_8}' => '/*!40100 CHARACTER SET utf8 COLLATE utf8_unicode_ci */',
+ '{LATIN1}' => '/*!40100 CHARACTER SET latin1 COLLATE latin1_swedish_ci */',
+ '{IF_NOT_EXISTS}' => 'IF NOT EXISTS',
+ '{RENAME_COLUMN}' => 'CHANGE COLUMN',
+ );
+ $sql = "$sql $attach_mysql";
+
+ } elseif($CONF['database_type'] == 'pgsql') {
+ static $replace = array(
+ '{AUTOINCREMENT}' => 'SERIAL',
+ '{PRIMARY}' => 'primary key',
+ '{UNSIGNED}' => '',
+ '{FULLTEXT}' => '',
+ '{BOOLEAN}' => 'BOOLEAN NOT NULL',
+ '{UTF_8}' => '', # TODO: UTF_8 is simply ignored.
+ '{LATIN1}' => '', # TODO: same for latin1
+ '{IF_NOT_EXISTS}' => 'IF NOT EXISTS', # TODO: does this work with PgSQL?
+ '{RENAME_COLUMN}' => 'CHANGE COLUMN', # TODO: probably wrong
+ 'int(1)' => 'int2',
+ 'int(10)' => 'int4',
+ 'int(11)' => 'int4',
+ 'int(4)' => 'int4',
+ );
+
+ } else {
+ echo "Sorry, unsupported database type " . $conf['database_type'];
+ exit;
}
- if($CONF['database_type'] == 'pgsql') {
- echo 'pgsql 00';
+
+ $replace['{BOOL_TRUE}'] = db_get_boolean(True);
+ $replace['{BOOL_FALSE}'] = db_get_boolean(False);
+
+ $query = trim(str_replace(array_keys($replace), $replace, $sql));
+ $result = db_query($query, $ignore_errors);
+ if (safeget('debug') != "") {
+ print $result['error'];
}
+ return $result;
}
-function upgrade_01() {
+function _drop_index ($table, $index) {
global $CONF;
- if($CONF['database_type'] == 'mysql') {
- echo 'mysql 01';
+ $tabe = table_by_key ($table);
+
+ if ($CONF['database_type'] == 'mysql' || $CONF['database_type'] == 'mysqli' ) {
+ return "ALTER TABLE $table DROP INDEX $index";
+ } elseif($CONF['database_type'] == 'pgsql') {
+ return "DROP INDEX $index"; # TODO: on which table?!
+ } else {
+ echo "Sorry, unsupported database type " . $conf['database_type'];
+ exit;
}
- if($CONF['database_type'] == 'pgsql') {
- echo 'pgsql 01';
- }
}
-function upgrade_02() {
- global $CONF;
- if($CONF['database_type'] == 'mysql') {
- echo 'mysql 02';
+
+function upgrade_1() {
+ # inserting the version number is a good start ;-)
+ db_insert(
+ 'config',
+ array(
+ 'name' => 'version',
+ 'value' => '1',
+ )
+ );
+ echo "upgrade_1";
+}
+
+function upgrade_2() {
+ # upgrade pre-2.1 database
+ # from TABLE_BACKUP_MX.TXT
+ $table_domain = table_by_key ('domain');
+ $result = db_query_parsed("ALTER TABLE $table_domain ADD COLUMN transport VARCHAR(255) AFTER maxquota;", TRUE);
+ $result = db_query_parsed("ALTER TABLE $table_domain ADD COLUMN backupmx {BOOLEAN} DEFAULT {BOOL_FALSE} AFTER transport;", TRUE);
+}
+
+function upgrade_3() {
+ # upgrade pre-2.1 database
+ # from TABLE_CHANGES.TXT
+ $table_admin = table_by_key ('admin');
+ $table_alias = table_by_key ('alias');
+ $table_domain = table_by_key ('domain');
+ $table_mailbox = table_by_key ('mailbox');
+ $table_vacation = table_by_key ('vacation');
+
+ $all_sql = split("\n", trim("
+ ALTER TABLE $table_admin {RENAME_COLUMN} create_date created DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL;
+ ALTER TABLE $table_admin {RENAME_COLUMN} change_date modified DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL;
+ ALTER TABLE $table_alias {RENAME_COLUMN} create_date created DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL;
+ ALTER TABLE $table_alias {RENAME_COLUMN} change_date modified DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL;
+ ALTER TABLE $table_domain {RENAME_COLUMN} create_date created DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL;
+ ALTER TABLE $table_domain {RENAME_COLUMN} change_date modified DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL;
+ ALTER TABLE $table_domain ADD COLUMN aliases INT(10) DEFAULT '-1' NOT NULL AFTER description;
+ ALTER TABLE $table_domain ADD COLUMN mailboxes INT(10) DEFAULT '-1' NOT NULL AFTER aliases;
+ ALTER TABLE $table_domain ADD COLUMN maxquota INT(10) DEFAULT '-1' NOT NULL AFTER mailboxes;
+ ALTER TABLE $table_domain ADD COLUMN transport VARCHAR(255) AFTER maxquota;
+ ALTER TABLE $table_domain ADD COLUMN backupmx TINYINT(1) DEFAULT '0' NOT NULL AFTER transport;
+ ALTER TABLE $table_mailbox {RENAME_COLUMN} create_date created DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL;
+ ALTER TABLE $table_mailbox {RENAME_COLUMN} change_date modified DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL;
+ ALTER TABLE $table_mailbox ADD COLUMN quota INT(10) DEFAULT '-1' NOT NULL AFTER maildir;
+ ALTER TABLE $table_vacation ADD COLUMN domain VARCHAR(255) DEFAULT '' NOT NULL AFTER cache;
+ ALTER TABLE $table_vacation ADD COLUMN created DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL AFTER domain;
+ ALTER TABLE $table_vacation ADD COLUMN active TINYINT(1) DEFAULT '1' NOT NULL AFTER created;
+ ALTER TABLE $table_vacation DROP PRIMARY KEY
+ ALTER TABLE $table_vacation ADD COLUMN PRIMARY KEY(email);
+ UPDATE $table_vacation SET domain=SUBSTRING_INDEX(email, '@', -1) WHERE email=email;
+ "));
+
+ foreach ($all_sql as $sql) {
+ $result = db_query_parsed($sql, TRUE);
}
- if($CONF['database_type'] == 'pgsql') {
- echo 'pgsql 02';
- }
}
-function upgrade_03() {
- echo 'woof 03';
+
+function upgrade_4_mysql() { # MySQL only
+ # changes between 2.1 and moving to sourceforge
+ $table_domain = table_by_key ('domain');
+ $result = db_query_parsed("ALTER TABLE $table_domain ADD COLUMN quota int(10) NOT NULL default '0' AFTER maxquota", TRUE);
}
+
+function upgrade_4_pgsql() { # PgSQL only
+ # changes between 2.1 and moving to sourceforge
+
+/* TODO
+
+Changes in DATABASE_PGSQL.TXT: (in diff format - "-" means removed, "+" means added)
+
+TABLE domain
+- domain character varying(255) NOT NULL default '',
++ domain character varying(255) NOT NULL,
++ quota integer NOT NULL default 0,
+
++CREATE INDEX domain_domain_active ON domain(domain,active);
+
+
+TABLE "admin"
+- "username" character varying(255) NOT NULL default '',
++ "username" character varying(255) NOT NULL,
+
+
+TABLE alias
+- address character varying(255) NOT NULL default '',
++ address character varying(255) NOT NULL,
+- domain character varying(255) NOT NULL default '',
++ domain character varying(255) NOT NULL REFERENCES domain,
+
++CREATE INDEX alias_address_active ON alias(address,active);
+
+TABLE domain_admins
+- username character varying(255) NOT NULL default '',
++ username character varying(255) NOT NULL,
+- domain character varying(255) NOT NULL default '',
++ domain character varying(255) NOT NULL REFERENCES domain,
+
+TABLE log
+- data character varying(255) NOT NULL default ''
++ data text NOT NULL default ''
+
+TABLE mailbox
+- username character varying(255) NOT NULL default '',
++ username character varying(255) NOT NULL,
+- domain character varying(255) NOT NULL default '',
++ domain character varying(255) NOT NULL REFERENCES domain,
+
++CREATE INDEX mailbox_username_active ON mailbox(username,active);
+
+TABLE vacation
+- email character varying(255) NOT NULL default '',
++ email character varying(255) PRIMARY KEY,
+- body text NOT NULL,
++ body text NOT NULL DEFAULT '',
+- cache text NOT NULL,
++ cache text NOT NULL DEFAULT '',
+- domain character varying(255) NOT NULL default '',
++ "domain" character varying(255) NOT NULL REFERENCES "domain",
+- active boolean NOT NULL default true,
++ active boolean DEFAULT true NOT NULL
+- Constraint "vacation_key" Primary Key ("email")
+
+-COMMENT ON TABLE vacation IS 'Postfix Admin - Virtual Vacation';
+
++CREATE INDEX vacation_email_active ON vacation(email,active);
+
++CREATE TABLE vacation_notification (
++ on_vacation character varying(255) NOT NULL REFERENCES vacation(email) ON DELETE CASCADE,
++ notified character varying(255) NOT NULL,
++ notified_at timestamp with time zone NOT NULL DEFAULT now(),
++ CONSTRAINT vacation_notification_pkey primary key(on_vacation,notified)
++);
+
+
+*/
+}
+
+function upgrade_79_mysql() { # MySQL only
+ # drop useless indicies (already available as primary key)
+ $result = db_query_parsed(_drop_index('admin', 'username'));
+ $result = db_query_parsed(_drop_index('alias', 'address'));
+ $result = db_query_parsed(_drop_index('domain', 'domain'));
+ $result = db_query_parsed(_drop_index('mailbox', 'username'));
+}
+
+function upgrade_81_mysql() { # MySQL only
+/* TODO
+
+table vacation -
+- all varchar + text fields changed to utf8
+- active was tinyint (1), now (4)
+- ENGINE changed
+- DEFAULT CHARSET changed
+- COLLATE changed
+
+diff:
+ - `body` text NOT NULL default '',
+ - `cache` text NOT NULL default '',
+ + body text NOT NULL,
+ + cache text NOT NULL,
+ - `active` tinyint(1) NOT NULL default '1',
+ + active tinyint(4) NOT NULL default '1', -> boolean are usually tinyint(1)
+ -) TYPE=MyISAM COMMENT='Postfix Admin - Virtual Vacation';
+ +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci TYPE=InnoDB COMMENT='Postfix Admin - Virtual Vacation' ;
+
+
+
+ */
+
+ db_query_parsed(
+ " CREATE TABLE {IF_NOT_EXISTS} vacation_notification (
+ on_vacation varchar(255) NOT NULL,
+ notified varchar(255) NOT NULL,
+ notified_at timestamp NOT NULL default now(),
+ CONSTRAINT vacation_notification_pkey PRIMARY KEY(on_vacation, notified),
+ FOREIGN KEY (on_vacation) REFERENCES vacation(email) ON DELETE CASCADE
+ )
+ ",
+ TRUE,
+ " ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci TYPE=InnoDB
+ COMMENT='Postfix Admin - Virtual Vacation Notifications'
+ "
+ );
+}
+
+function upgrade_169_mysql() { # MySQL only
+ # allow quota > 2 GB
+
+ $table_domain = table_by_key ('domain');
+ $table_mailbox = table_by_key ('mailbox');
+ $result = db_query_parsed("ALTER TABLE $table_domain ALTER COLUMN `quota` bigint(20) NOT NULL default '0'", TRUE);
+ $result = db_query_parsed("ALTER TABLE $table_mailbox ALTER COLUMN `maxquota` bigint(20) NOT NULL default '0'", TRUE);
+ $result = db_query_parsed("ALTER TABLE $table_mailbox ALTER COLUMN `quota` bigint(20) NOT NULL default '0'", TRUE);
+}
+
+
+/*
+TODO
+
+ Database changes that should be done:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+MySQL:
+* vacation: DROP INDEX email
+* vacation_notification:
+ - DEFAULT CHARSET and COLLATE should be changed
+ - change all varchar fields to latin1 (email addresses don't contain utf8 characters)
+* remove all DROP TABLE statements from DATABASE_*
+
+*/
+
+
+/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */
Property changes on: trunk/upgrade.php
___________________________________________________________________
Name: svn:keywords
+ Revision
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2007-11-01 23:58:13
|
Revision: 171
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=171&view=rev
Author: christian_boltz
Date: 2007-11-01 16:58:12 -0700 (Thu, 01 Nov 2007)
Log Message:
-----------
- added function db_insert()
- added optional $ignore_errors parameter to db_query()
- db_query() now returns 'error' as additional key in the result array
- renamed $setup to $ignore_errors in db_connect()
- added fallback to $table_key to table_by_key()
Modified Paths:
--------------
trunk/functions.inc.php
Modified: trunk/functions.inc.php
===================================================================
--- trunk/functions.inc.php 2007-10-31 20:18:53 UTC (rev 170)
+++ trunk/functions.inc.php 2007-11-01 23:58:12 UTC (rev 171)
@@ -1284,20 +1284,20 @@
* db_connect
* Action: Makes a connection to the database if it doesn't exist
* Call: db_connect ()
- * Optional parameter: $setup = TRUE, used by setup.php
+ * Optional parameter: $ignore_errors = TRUE, used by setup.php
*
* Return value:
- * a) without $setup or $setup == 0
+ * a) without $ignore_errors or $ignore_errors == 0
* - $link - the database connection -OR-
* - call die() in case of connection problems
- * b) with $setup == TRUE
+ * b) with $ignore_errors == TRUE
* array($link, $error_text);
*/
-function db_connect ($setup = 0)
+function db_connect ($ignore_errors = 0)
{
global $CONF;
global $DEBUG_TEXT;
- if ($setup != 0) $DEBUG_TEXT = '';
+ if ($ignore_errors != 0) $DEBUG_TEXT = '';
$error_text = '';
$link = 0;
@@ -1351,7 +1351,7 @@
$error_text = "<p />DEBUG INFORMATION:<br />Invalid \$CONF['database_type']! Please fix your config.inc.php! $DEBUG_TEXT";
}
- if ($setup)
+ if ($ignore_errors)
{
return array($link, $error_text);
}
@@ -1406,43 +1406,53 @@
// db_query
// Action: Sends a query to the database and returns query result and number of rows
// Call: db_query (string query)
+// Optional parameter: $ignore_errors = TRUE, used by upgrade.php
//
-function db_query ($query)
+function db_query ($query, $ignore_errors = 0)
{
global $CONF;
global $DEBUG_TEXT;
$result = "";
$number_rows = "";
static $link;
+ $error_text = "";
+ if ($ignore_errors) $DEBUG_TEXT = "";
if (!is_resource($link)) $link = db_connect ();
- if ($CONF['database_type'] == "mysql") $result = @mysql_query ($query, $link) or die ("<p />DEBUG INFORMATION:<br />Invalid query: " . mysql_error($link) . "$DEBUG_TEXT");
- if ($CONF['database_type'] == "mysqli") $result = @mysqli_query ($link, $query) or die ("<p />DEBUG INFORMATION:<br />Invalid query: " . mysqli_error($link) . "$DEBUG_TEXT");
+ if ($CONF['database_type'] == "mysql") $result = @mysql_query ($query, $link)
+ or $error_text = "<p />DEBUG INFORMATION:<br />Invalid query: " . mysql_error($link) . "$DEBUG_TEXT";
+ if ($CONF['database_type'] == "mysqli") $result = @mysqli_query ($link, $query)
+ or $error_text = "<p />DEBUG INFORMATION:<br />Invalid query: " . mysqli_error($link) . "$DEBUG_TEXT";
if ($CONF['database_type'] == "pgsql")
{
- $result = @pg_query ($link, $query) or die ("<p />DEBUG INFORMATION:<br />Invalid query: " . pg_last_error() . "$DEBUG_TEXT");
+ $result = @pg_query ($link, $query)
+ or $error_text = "<p />DEBUG INFORMATION:<br />Invalid query: " . pg_last_error() . "$DEBUG_TEXT";
}
+ if ($error_text != "" && $ignore_errors == 0) die($error_text);
- if (eregi ("^SELECT", $query))
- {
- // if $query was a SELECT statement check the number of rows with [database_type]_num_rows ().
- if ($CONF['database_type'] == "mysql") $number_rows = mysql_num_rows ($result);
- if ($CONF['database_type'] == "mysqli") $number_rows = mysqli_num_rows ($result);
- if ($CONF['database_type'] == "pgsql") $number_rows = pg_num_rows ($result);
+ if ($error_text == "") {
+ if (eregi ("^SELECT", $query))
+ {
+ // if $query was a SELECT statement check the number of rows with [database_type]_num_rows ().
+ if ($CONF['database_type'] == "mysql") $number_rows = mysql_num_rows ($result);
+ if ($CONF['database_type'] == "mysqli") $number_rows = mysqli_num_rows ($result);
+ if ($CONF['database_type'] == "pgsql") $number_rows = pg_num_rows ($result);
+ }
+ else
+ {
+ // if $query was something else, UPDATE, DELETE or INSERT check the number of rows with
+ // [database_type]_affected_rows ().
+ if ($CONF['database_type'] == "mysql") $number_rows = mysql_affected_rows ($link);
+ if ($CONF['database_type'] == "mysqli") $number_rows = mysqli_affected_rows ($link);
+ if ($CONF['database_type'] == "pgsql") $number_rows = pg_affected_rows ($result);
+ }
}
- else
- {
- // if $query was something else, UPDATE, DELETE or INSERT check the number of rows with
- // [database_type]_affected_rows ().
- if ($CONF['database_type'] == "mysql") $number_rows = mysql_affected_rows ($link);
- if ($CONF['database_type'] == "mysqli") $number_rows = mysqli_affected_rows ($link);
- if ($CONF['database_type'] == "pgsql") $number_rows = pg_affected_rows ($result);
- }
$return = array (
"result" => $result,
- "rows" => $number_rows
+ "rows" => $number_rows,
+ "error" => $error_text
);
return $return;
}
@@ -1516,7 +1526,29 @@
}
+//
+// db_insert
+// Action: Inserts a row from a specified table
+// Call: db_insert (string table, array values)
+//
+function db_insert ($table, $values)
+{
+ $sql_values = "(" . implode(",",escape_string(array_keys($values))).") VALUES ('".implode("','",escape_string($values))."')";
+ $table = table_by_key ($table);
+ $result = db_query ("INSERT INTO $table $sql_values");
+ if ($result['rows'] >= 1)
+ {
+ return $result['rows'];
+ }
+ else
+ {
+ return true;
+ }
+}
+
+
+
//
// db_log
// Action: Logs actions from admin
@@ -1571,6 +1603,7 @@
{
global $CONF;
$table = $CONF['database_prefix'].$CONF['database_tables'][$table_key];
+ if (empty($table)) $table = $table_key;
return $table;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Gin...@us...> - 2007-10-31 20:18:55
|
Revision: 170
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=170&view=rev
Author: GingerDog
Date: 2007-10-31 13:18:53 -0700 (Wed, 31 Oct 2007)
Log Message:
-----------
upgrade.php: test edition of a db upgrade script, based loosely around what Drupal uses
Added Paths:
-----------
trunk/upgrade.php
Added: trunk/upgrade.php
===================================================================
--- trunk/upgrade.php (rev 0)
+++ trunk/upgrade.php 2007-10-31 20:18:53 UTC (rev 170)
@@ -0,0 +1,68 @@
+<?php
+require_once('common.php');
+$sql = "SELECT * FROM config WHERE name = 'version'";
+
+// create table config (name varchar(20), value varchar(20));
+// insert into config('version', '01');
+// Should really query the db to see if the 'config' table exists first!
+
+$r = db_query($sql);
+
+if($r['rows'] == 1) {
+ $rs = $r['result'];
+ $row = db_array($rs);
+ $version = $row['value'];
+ _do_upgrade($version);
+}
+
+
+function _do_upgrade($current_version) {
+ $all_functions = get_defined_functions();
+ $upgrade_functions = array();
+ foreach($all_functions['user'] as $function_name) {
+ if(preg_match('!upgrade_(\d+)!', $function_name, $matches)) {
+ $version = $matches[1];
+ if($version <= $current_version) {
+ continue;
+ }
+ $upgrade_functions[$matches[1]] = $function_name;
+ }
+ }
+
+ ksort($upgrade_functions);
+ foreach($upgrade_functions as $version => $function) {
+ $function();
+ }
+}
+
+function upgrade_00() {
+ global $CONF;
+ if($CONF['database_type'] == 'mysql') {
+ echo 'mysql 00';
+ }
+ if($CONF['database_type'] == 'pgsql') {
+ echo 'pgsql 00';
+ }
+}
+
+function upgrade_01() {
+ global $CONF;
+ if($CONF['database_type'] == 'mysql') {
+ echo 'mysql 01';
+ }
+ if($CONF['database_type'] == 'pgsql') {
+ echo 'pgsql 01';
+ }
+}
+function upgrade_02() {
+ global $CONF;
+ if($CONF['database_type'] == 'mysql') {
+ echo 'mysql 02';
+ }
+ if($CONF['database_type'] == 'pgsql') {
+ echo 'pgsql 02';
+ }
+}
+function upgrade_03() {
+ echo 'woof 03';
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Gin...@us...> - 2007-10-31 19:31:26
|
Revision: 169
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=169&view=rev
Author: GingerDog
Date: 2007-10-31 12:31:30 -0700 (Wed, 31 Oct 2007)
Log Message:
-----------
DATABASE_MYSQL.TXT: use bigints for quota - as suggested by xpoint on irc
Modified Paths:
--------------
trunk/DATABASE_MYSQL.TXT
Modified: trunk/DATABASE_MYSQL.TXT
===================================================================
--- trunk/DATABASE_MYSQL.TXT 2007-10-31 18:24:40 UTC (rev 168)
+++ trunk/DATABASE_MYSQL.TXT 2007-10-31 19:31:30 UTC (rev 169)
@@ -73,8 +73,8 @@
`description` varchar(255) NOT NULL default '',
`aliases` int(10) NOT NULL default '0',
`mailboxes` int(10) NOT NULL default '0',
- `maxquota` int(10) NOT NULL default '0',
- `quota` int(10) NOT NULL default '0',
+ `maxquota` bigint(20) NOT NULL default '0',
+ `quota` bigint(20) NOT NULL default '0',
`transport` varchar(255) default NULL,
`backupmx` tinyint(1) NOT NULL default '0',
`created` datetime NOT NULL default '0000-00-00 00:00:00',
@@ -114,7 +114,7 @@
`password` varchar(255) NOT NULL default '',
`name` varchar(255) NOT NULL default '',
`maildir` varchar(255) NOT NULL default '',
- `quota` int(10) NOT NULL default '0',
+ `quota` bigint(20) NOT NULL default '0',
`domain` varchar(255) NOT NULL default '',
`created` datetime NOT NULL default '0000-00-00 00:00:00',
`modified` datetime NOT NULL default '0000-00-00 00:00:00',
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2007-10-31 18:24:36
|
Revision: 168
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=168&view=rev
Author: christian_boltz
Date: 2007-10-31 11:24:40 -0700 (Wed, 31 Oct 2007)
Log Message:
-----------
Finally got rid of admin/ :-)
- moved admin-only scripts from admin/ to /
- removed all merged files ("require('../$file')") from admin/
- changed include paths - no more admin/superadmin switching needed
- admin_menu.tpl is also gone
- removed all menu.tpl / admin_menu.tpl switches - no more needed
- admin/index.php still exists and redirects to /
Modified Paths:
--------------
trunk/admin/index.php
trunk/create-alias.php
trunk/create-mailbox.php
trunk/delete.php
trunk/edit-active.php
trunk/edit-alias.php
trunk/edit-mailbox.php
trunk/edit-vacation.php
trunk/login.php
trunk/search.php
trunk/viewlog.php
Added Paths:
-----------
trunk/backup.php
trunk/broadcast-message.php
trunk/create-admin.php
trunk/create-domain.php
trunk/edit-active-admin.php
trunk/edit-active-domain.php
trunk/edit-admin.php
trunk/edit-domain.php
trunk/list-admin.php
trunk/list-domain.php
trunk/list-virtual.php
Removed Paths:
-------------
trunk/admin/backup.php
trunk/admin/broadcast-message.php
trunk/admin/create-admin.php
trunk/admin/create-alias.php
trunk/admin/create-domain.php
trunk/admin/create-mailbox.php
trunk/admin/delete.php
trunk/admin/edit-active-admin.php
trunk/admin/edit-active-domain.php
trunk/admin/edit-active.php
trunk/admin/edit-admin.php
trunk/admin/edit-alias.php
trunk/admin/edit-domain.php
trunk/admin/edit-mailbox.php
trunk/admin/edit-vacation.php
trunk/admin/list-admin.php
trunk/admin/list-domain.php
trunk/admin/list-virtual.php
trunk/admin/main.php
trunk/admin/search.php
trunk/admin/viewlog.php
trunk/templates/admin_menu.tpl
Deleted: trunk/admin/backup.php
===================================================================
--- trunk/admin/backup.php 2007-10-31 01:31:37 UTC (rev 167)
+++ trunk/admin/backup.php 2007-10-31 18:24:40 UTC (rev 168)
@@ -1,118 +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: backup.php
- * Used to save all settings - but only works for MySQL databases.
- * Template File: -none-
- *
- * Template Variables: -none-
- *
- * Form POST \ GET Variables: -none-
- */
-
-require_once('../common.php');
-
-authentication_require_role('global-admin');
-
-(($CONF['backup'] == 'NO') ? header("Location: " . $CONF['postfix_admin_url'] . "/main.php") && exit : '1');
-
-// TODO: make backup supported for postgres
-if ('pgsql'==$CONF['database_type'])
-{
- print '<p>Sorry: Backup is currently not supported for your DBMS.</p>';
-}
-/*
- SELECT attnum,attname,typname,atttypmod-4,attnotnull,atthasdef,adsrc
- AS def FROM pg_attribute,pg_class,pg_type,pg_attrdef
- WHERE pg_class.oid=attrelid AND pg_type.oid=atttypid
- AND attnum>0 AND pg_class.oid=adrelid AND adnum=attnum AND atthasdef='t' AND lower(relname)='admin'
- UNION SELECT attnum,attname,typname,atttypmod-4,attnotnull,atthasdef,''
- AS def FROM pg_attribute,pg_class,pg_type
- WHERE pg_class.oid=attrelid
- AND pg_type.oid=atttypid
- AND attnum>0
- AND atthasdef='f'
- AND lower(relname)='admin'
-$db = $_GET['db'];
-$cmd = "pg_dump -c -D -f /tix/miner/miner.sql -F p -N -U postgres $db";
-$res = `$cmd`;
-// Alternate: $res = shell_exec($cmd);
-echo $res;
-*/
-
-if ($_SERVER['REQUEST_METHOD'] == "GET")
-{
- umask (077);
- $path = (ini_get('upload_tmp_dir') != '') ? ini_get('upload_tmp_dir') : '/tmp/';
- $filename = "postfixadmin-" . date ("Ymd") . "-" . getmypid() . ".sql";
- $backup = $path . $filename;
-
- $header = "#\n# Postfix Admin $version\n# Date: " . date ("D M j G:i:s T Y") . "\n#\n";
-
- if (!$fh = fopen ($backup, 'w'))
- {
- $tMessage = "<div class=\"error_msg\">Cannot open file ($backup)</div>";
- include ("../templates/header.tpl");
- include ("../templates/admin_menu.tpl");
- include ("../templates/message.tpl");
- include ("../templates/footer.tpl");
- }
- else
- {
- fwrite ($fh, $header);
-
- $tables = array('admin','alias','domain','domain_admins','log','mailbox','vacation');
-
- for ($i = 0 ; $i < sizeof ($tables) ; ++$i)
- {
- $result = db_query ("SHOW CREATE TABLE ".table_by_pos($i));
- if ($result['rows'] > 0)
- {
- while ($row = db_array ($result['result']))
- {
- fwrite ($fh, "$row[1];\n\n");
- }
- }
- }
-
- for ($i = 0 ; $i < sizeof ($tables) ; ++$i)
- {
- $result = db_query ("SELECT * FROM ".table_by_pos($i));
- if ($result['rows'] > 0)
- {
- while ($row = db_assoc ($result['result']))
- {
- foreach ($row as $key=>$val)
- {
- $fields[] = $key;
- $values[] = $val;
- }
-
- fwrite ($fh, "INSERT INTO ". $tables[$i] . " (". implode (',',$fields) . ") VALUES ('" . implode ('\',\'',$values) . "');\n");
- $fields = "";
- $values = "";
- }
- }
- }
- }
- header ("Content-Type: application/octet-stream");
- header ("Content-Disposition: attachment; filename=\"$filename\"");
- header ("Content-Transfer-Encoding: binary");
- header ("Content-Length: " . filesize("$backup"));
- header ("Content-Description: Postfix Admin");
- $download_backup = fopen ("$backup", "r");
- unlink ("$backup");
- fpassthru ($download_backup);
-}
-?>
Deleted: trunk/admin/broadcast-message.php
===================================================================
--- trunk/admin/broadcast-message.php 2007-10-31 01:31:37 UTC (rev 167)
+++ trunk/admin/broadcast-message.php 2007-10-31 18:24:40 UTC (rev 168)
@@ -1,92 +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: broadcast-message.php
- * Used to send a message to _ALL_ users with mailboxes on this server.
- *
- * Template File: broadcast-message.tpl
- *
- * Template Variables: -none-
- *
- * Form POST \ GET Variables:
- *
- * name
- * subject
- * message
- */
-
-require_once('../common.php');
-
-authentication_require_role('global-admin');
-
-$SESSID_USERNAME = authentication_get_username();
-
-if ($_SERVER['REQUEST_METHOD'] == "POST")
-{
- if (empty($_POST['subject']) || empty($_POST['message']) || empty($_POST['name']))
- {
- $error = 1;
- }
- else
- {
- $q = 'select username from mailbox union '.
- 'select goto from alias '.
- 'where goto not in (select username from mailbox)';
-
- $result = db_query ($q);
- if ($result['rows'] > 0)
- {
- $b_name = mb_encode_mimeheader( $_POST['name'], 'UTF-8', 'Q');
- $b_subject = mb_encode_mimeheader( $_POST['subject'], 'UTF-8', 'Q');
- $b_message = encode_base64($_POST['message']);
-
- $i = 0;
- while ($row = db_array ($result['result'])) {
- $fTo = $row[0];
- $fHeaders = 'To: ' . $fTo . "\n";
- $fHeaders .= 'From: ' . $b_name . ' <' . $CONF['admin_email'] . ">\n";
- $fHeaders .= 'Subject: ' . $b_subject . "\n";
- $fHeaders .= 'MIME-Version: 1.0' . "\n";
- $fHeaders .= 'Content-Type: text/plain; charset=UTF-8' . "\n";
- $fHeaders .= 'Content-Transfer-Encoding: base64' . "\n";
-
- $fHeaders .= $b_message;
-
- if (!smtp_mail ($fTo, $CONF['admin_email'], $fHeaders))
- {
- $tMessage .= "<br />" . $PALANG['pSendmail_result_error'] . "<br />";
- }
- else
- {
- $tMessage .= "<br />" . $PALANG['pSendmail_result_success'] . "<br />";
- }
- }
- }
- include ("../templates/header.tpl");
- include ("../templates/admin_menu.tpl");
- echo '<p>'.$PALANG['pBroadcast_success'].'</p>';
- include ("../templates/footer.tpl");
- }
-}
-
-if ($_SERVER['REQUEST_METHOD'] == "GET" || $error == 1)
-{
- include ("../templates/header.tpl");
- include ("../templates/admin_menu.tpl");
- include ("../templates/broadcast-message.tpl");
- include ("../templates/footer.tpl");
-}
-
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
-?>
Deleted: trunk/admin/create-admin.php
===================================================================
--- trunk/admin/create-admin.php 2007-10-31 01:31:37 UTC (rev 167)
+++ trunk/admin/create-admin.php 2007-10-31 18:24:40 UTC (rev 168)
@@ -1,73 +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: create-admin.php
- * Used to create new administrators.
- * Template File: admin_create-admin.tpl
- *
- *
- * Template Variables:
- *
- * tMessage
- * tUsername
- * tDomains
- *
- * Form POST \ GET Variables:
- *
- * fUsername
- * fPassword
- * fPassword2
- * fDomains
- */
-
-require_once('../common.php');
-
-authentication_require_role('global-admin');
-
-$list_domains = list_domains ();
-$tDomains = array();
-
-if ($_SERVER['REQUEST_METHOD'] == "GET")
-{
- $pAdminCreate_admin_username_text = $PALANG['pAdminCreate_admin_username_text'];
- $tDomains = array ();
-
- include ("../templates/header.tpl");
- include ("../templates/admin_menu.tpl");
- include ("../templates/admin_create-admin.tpl");
- include ("../templates/footer.tpl");
-}
-
-if ($_SERVER['REQUEST_METHOD'] == "POST")
-{
- if (isset ($_POST['fUsername'])) $fUsername = escape_string ($_POST['fUsername']);
- if (isset ($_POST['fPassword'])) $fPassword = escape_string ($_POST['fPassword']);
- if (isset ($_POST['fPassword2'])) $fPassword2 = escape_string ($_POST['fPassword2']);
- $fDomains = array();
- if (!empty ($_POST['fDomains'])) $fDomains = $_POST['fDomains'];
-
- list ($error, $tMessage, $pAdminCreate_admin_username_text, $pAdminCreate_admin_password_text) = create_admin($fUsername, $fPassword, $fPassword2, $fDomains);
-
- if ($error != 0) {
- if (isset ($_POST['fUsername'])) $tUsername = escape_string ($_POST['fUsername']);
- if (isset ($_POST['fDomains'])) $tDomains = $_POST['fDomains'];
- }
-
- include ("../templates/header.tpl");
- include ("../templates/admin_menu.tpl");
- include ("../templates/admin_create-admin.tpl");
- include ("../templates/footer.tpl");
-}
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
-?>
Deleted: trunk/admin/create-alias.php
===================================================================
--- trunk/admin/create-alias.php 2007-10-31 01:31:37 UTC (rev 167)
+++ trunk/admin/create-alias.php 2007-10-31 18:24:40 UTC (rev 168)
@@ -1,3 +0,0 @@
-<?php
-require ("../create-alias.php");
-?>
Deleted: trunk/admin/create-domain.php
===================================================================
--- trunk/admin/create-domain.php 2007-10-31 01:31:37 UTC (rev 167)
+++ trunk/admin/create-domain.php 2007-10-31 18:24:40 UTC (rev 168)
@@ -1,129 +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: create-domain.php
- * Allows administrators to create new domains.
- * Template File: admin_create-domain.tpl
- *
- * Template Variables:
- *
- * tMessage
- * tDomain
- * tDescription
- * tAliases
- * tMailboxes
- * tMaxquota
- * tDefaultaliases
- *
- * Form POST \ GET Variables:
- *
- * fDomain
- * fDescription
- * fAliases
- * fMailboxes
- * fMaxquota
- * fDefaultaliases
- */
-
-require_once('../common.php');
-
-authentication_require_role('global-admin');
-
-
-if ($_SERVER['REQUEST_METHOD'] == "GET")
-{
- $tAliases = $CONF['aliases'];
- $tMailboxes = $CONF['mailboxes'];
- $tMaxquota = $CONF['maxquota'];
- $tTransport = $CONF['transport_default'];
-
- include ("../templates/header.tpl");
- include ("../templates/admin_menu.tpl");
- include ("../templates/admin_create-domain.tpl");
- include ("../templates/footer.tpl");
-}
-
-if ($_SERVER['REQUEST_METHOD'] == "POST")
-{
- if (isset ($_POST['fDomain'])) $fDomain = escape_string ($_POST['fDomain']);
- foreach(array('fDescription' => '', 'fAliases' => '0', 'fMailboxes' => '0',
- 'fMaxquota' => '0', 'fTransport' => 'virtual',
- 'fDefaultaliases' => '0', 'fBackupmx' => '0') as $key => $default) {
- if(isset($_POST[$key]) && !empty($POST[$key])) {
- $$key = escape_string($_POST[$key]);
- }
- $$key = $default;
- }
-
- if (empty ($fDomain) or domain_exist ($fDomain) or !check_domain ($fDomain))
- {
- $error = 1;
- $tDomain = escape_string ($_POST['fDomain']);
- $tDescription = escape_string ($_POST['fDescription']);
- $tAliases = escape_string ($_POST['fAliases']);
- $tMailboxes = escape_string ($_POST['fMailboxes']);
- if (isset ($_POST['fMaxquota'])) $tMaxquota = escape_string ($_POST['fMaxquota']);
- if (isset ($_POST['fTransport'])) $tTransport = escape_string ($_POST['fTransport']);
- if (isset ($_POST['fDefaultaliases'])) $tDefaultaliases = escape_string ($_POST['fDefaultaliases']);
- if (isset ($_POST['fBackupmx'])) $tBackupmx = escape_string ($_POST['fBackupmx']);
- if (domain_exist ($fDomain)) $pAdminCreate_domain_domain_text = $PALANG['pAdminCreate_domain_domain_text_error'];
- if (empty ($fDomain) or !check_domain ($fDomain)) $pAdminCreate_domain_domain_text = $PALANG['pAdminCreate_domain_domain_text_error2'];
- }
-
- if ($error != 1)
- {
- $tAliases = $CONF['aliases'];
- $tMailboxes = $CONF['mailboxes'];
- $tMaxquota = $CONF['maxquota'];
-
- if ($fBackupmx == "on")
- {
- $fAliases = -1;
- $fMailboxes = -1;
- $fMaxquota = -1;
- $fBackupmx = 1;
- $sqlBackupmx = ('pgsql'==$CONF['database_type']) ? 'true' : 1;
- }
- else
- {
- $fBackupmx = 0;
- $sqlBackupmx = ('pgsql'==$CONF['database_type']) ? 'false' : 0;
- }
- $sql_query = "INSERT INTO $table_domain (domain,description,aliases,mailboxes,maxquota,transport,backupmx,created,modified) VALUES ('$fDomain','$fDescription',$fAliases,$fMailboxes,$fMaxquota,'$fTransport',$sqlBackupmx,NOW(),NOW())";
- $result = db_query($sql_query);
- if ($result['rows'] != 1)
- {
- $tMessage = $PALANG['pAdminCreate_domain_result_error'] . "<br />($fDomain)<br />";
- }
- else
- {
- if ($fDefaultaliases == "on")
- {
- foreach ($CONF['default_aliases'] as $address=>$goto)
- {
- $address = $address . "@" . $fDomain;
- $result = db_query ("INSERT INTO $table_alias (address,goto,domain,created,modified) VALUES ('$address','$goto','$fDomain',NOW(),NOW())");
- }
- }
- $tMessage = $PALANG['pAdminCreate_domain_result_success'] . "<br />($fDomain)</br />";
- }
- }
-
- include ("../templates/header.tpl");
- include ("../templates/admin_menu.tpl");
- include ("../templates/admin_create-domain.tpl");
- include ("../templates/footer.tpl");
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
-}
-?>
Deleted: trunk/admin/create-mailbox.php
===================================================================
--- trunk/admin/create-mailbox.php 2007-10-31 01:31:37 UTC (rev 167)
+++ trunk/admin/create-mailbox.php 2007-10-31 18:24:40 UTC (rev 168)
@@ -1,3 +0,0 @@
-<?php
-require ("../create-mailbox.php");
-?>
Deleted: trunk/admin/delete.php
===================================================================
--- trunk/admin/delete.php 2007-10-31 01:31:37 UTC (rev 167)
+++ trunk/admin/delete.php 2007-10-31 18:24:40 UTC (rev 168)
@@ -1,3 +0,0 @@
-<?php
-require('../delete.php');
-?>
Deleted: trunk/admin/edit-active-admin.php
===================================================================
--- trunk/admin/edit-active-admin.php 2007-10-31 01:31:37 UTC (rev 167)
+++ trunk/admin/edit-active-admin.php 2007-10-31 18:24:40 UTC (rev 168)
@@ -1,69 +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: edit-active-admin.php
- * Edit an active administrator. This is used as a 'toggle' page from list-admin.
- *
- * Template File: message.tpl
- *
- * Template Variables:
- *
- * tMessage
- *
- * Form POST \ GET Variables:
- *
- * fUsername
- */
-
-require_once('../common.php');
-
-authentication_require_role('global-admin');
-
-if ($_SERVER['REQUEST_METHOD'] == "GET")
-{
- if (isset ($_GET['username'])) $fUsername = escape_string ($_GET['username']);
-
- $sqlSet='active=1-active';
- if ('pgsql'==$CONF['database_type']) $sqlSet='active=NOT active';
-
- $result = db_query ("UPDATE $table_admin SET $sqlSet,modified=NOW() WHERE username='$fUsername'");
- if ($result['rows'] != 1)
- {
- $error = 1;
- $tMessage = $PALANG['pAdminEdit_admin_result_error'];
- }
-
- if ($error != 1)
- {
- header ("Location: list-admin.php");
- exit;
- }
-
- include ("../templates/header.tpl");
- include ("../templates/admin_menu.tpl");
- include ("../templates/message.tpl");
- include ("../templates/footer.tpl");
-}
-
-if ($_SERVER['REQUEST_METHOD'] == "POST")
-{
- include ("../templates/header.tpl");
- include ("../templates/admin_menu.tpl");
- include ("../templates/message.tpl");
- include ("../templates/footer.tpl");
-}
-
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
-
-?>
Deleted: trunk/admin/edit-active-domain.php
===================================================================
--- trunk/admin/edit-active-domain.php 2007-10-31 01:31:37 UTC (rev 167)
+++ trunk/admin/edit-active-domain.php 2007-10-31 18:24:40 UTC (rev 168)
@@ -1,67 +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: edit-active-domain.php
- * Responsible for toggling the status of a domain
- * Template File: message.tpl
- *
- * Template Variables:
- *
- * tMessage
- *
- * Form POST \ GET Variables:
- *
- * fDomain
- */
-
-require_once('../common.php');
-
-authentication_require_role('global-admin');
-
-if ($_SERVER['REQUEST_METHOD'] == "GET")
-{
- if (isset ($_GET['domain'])) $fDomain = escape_string ($_GET['domain']);
-
- $sqlSet='active=1-active';
- if ('pgsql'==$CONF['database_type']) $sqlSet='active=NOT active';
-
- $result = db_query ("UPDATE $table_domain SET $sqlSet,modified=NOW() WHERE domain='$fDomain'");
- if ($result['rows'] != 1)
- {
- $error = 1;
- $tMessage = $PALANG['pAdminEdit_domain_result_error'];
- }
-
- if ($error != 1)
- {
- header ("Location: list-domain.php");
- exit;
- }
-
- include ("../templates/header.tpl");
- include ("../templates/admin_menu.tpl");
- include ("../templates/message.tpl");
- include ("../templates/footer.tpl");
-}
-
-if ($_SERVER['REQUEST_METHOD'] == "POST")
-{
- include ("../templates/header.tpl");
- include ("../templates/admin_menu.tpl");
- include ("../templates/message.tpl");
- include ("../templates/footer.tpl");
-}
-
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
-?>
Deleted: trunk/admin/edit-active.php
===================================================================
--- trunk/admin/edit-active.php 2007-10-31 01:31:37 UTC (rev 167)
+++ trunk/admin/edit-active.php 2007-10-31 18:24:40 UTC (rev 168)
@@ -1,3 +0,0 @@
-<?php
-require("../edit-active.php");
-?>
Deleted: trunk/admin/edit-admin.php
===================================================================
--- trunk/admin/edit-admin.php 2007-10-31 01:31:37 UTC (rev 167)
+++ trunk/admin/edit-admin.php 2007-10-31 18:24:40 UTC (rev 168)
@@ -1,152 +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: edit-admin.php
- * Edits a normal administrator's details.
- *
- * Template File: admin_edit-admin.tpl
- *
- * Template Variables:
- *
- * tAllDomains
- * tDomains
- * tActive
- * tSadmin
- *
- * Form POST \ GET Variables:
- *
- * fDescription
- * fAliases
- * fMailboxes
- * fMaxquota
- * fActive
- */
-
-require_once('../common.php');
-
-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 ($_POST['fPassword'])) $fPassword = escape_string ($_POST['fPassword']);
- if(isset ($_POST['fPassword2'])) $fPassword2 = escape_string ($_POST['fPassword2']);
-
-
- $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'];
-
- $tAllDomains = list_domains ();
-
- // has the password changed?
- $originalPassword = $admin_details['password'];
- if($fPassword != '') {
- 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'];
- }
- }
- }
- $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);
- }
-
- $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..
- 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']);
- header("Location: list-admin.php");
- exit(0);
- }
- else {
- flash_error($PALANG['pAdminEdit_admin_result_error']);
- }
-}
-if (isset($_GET['username'])) $username = escape_string ($_GET['username']);
-
-$tAllDomains = list_domains();
-$tDomains = list_domains_for_admin ($username);
-$tActive = '';
-$tPassword = $admin_details['password'];
-
-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 */
- }
- }
-}
-
-include ("../templates/header.tpl");
-include ("../templates/admin_menu.tpl");
-include ("../templates/admin_edit-admin.tpl");
-include ("../templates/footer.tpl");
Deleted: trunk/admin/edit-alias.php
===================================================================
--- trunk/admin/edit-alias.php 2007-10-31 01:31:37 UTC (rev 167)
+++ trunk/admin/edit-alias.php 2007-10-31 18:24:40 UTC (rev 168)
@@ -1,3 +0,0 @@
-<?php
-require("../edit-alias.php");
-?>
Deleted: trunk/admin/edit-domain.php
===================================================================
--- trunk/admin/edit-domain.php 2007-10-31 01:31:37 UTC (rev 167)
+++ trunk/admin/edit-domain.php 2007-10-31 18:24:40 UTC (rev 168)
@@ -1,118 +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: edit-domain.php
- * Updates the properties of a domain.
- * Template File: admin_edit-domain.tpl
- *
- * Template Variables:
- *
- * tDescription
- * tAliases
- * tMailboxes
- * tMaxquota
- * tActive
- *
- * Form POST \ GET Variables:
- *
- * fDescription
- * fAliases
- * fMailboxes
- * fMaxquota
- * fActive
- */
-
-require_once('../common.php');
-
-authentication_require_role('global-admin');
-
-if ($_SERVER['REQUEST_METHOD'] == "GET")
-{
- if (isset ($_GET['domain']))
- {
- $domain = escape_string ($_GET['domain']);
- $domain_properties = get_domain_properties ($domain);
-
- $tDescription = $domain_properties['description'];
- $tAliases = $domain_properties['aliases'];
- $tMailboxes = $domain_properties['mailboxes'];
- $tMaxquota = $domain_properties['maxquota'];
- $tTransport = $domain_properties['transport'];
- $tBackupmx = $domain_properties['backupmx'];
- $tActive = $domain_properties['active'];
- }
-
- include ("../templates/header.tpl");
- include ("../templates/admin_menu.tpl");
- include ("../templates/admin_edit-domain.tpl");
- include ("../templates/footer.tpl");
-}
-
-if ($_SERVER['REQUEST_METHOD'] == "POST")
-{
- if (isset ($_GET['domain'])) $domain = escape_string ($_GET['domain']);
-
- if (isset ($_POST['fDescription'])) $fDescription = escape_string ($_POST['fDescription']);
- if (isset ($_POST['fAliases'])) $fAliases = intval($_POST['fAliases']);
- if (isset ($_POST['fMailboxes'])) $fMailboxes = intval($_POST['fMailboxes']);
- if (isset ($_POST['fMaxquota'])) {
- $fMaxquota = intval($_POST['fMaxquota']);
- } else {
- $fMaxquota = 0;
- }
- if (isset ($_POST['fTransport'])) $fTransport = escape_string ($_POST['fTransport']);
- if (isset ($_POST['fBackupmx'])) $fBackupmx = escape_string ($_POST['fBackupmx']);
- if (isset ($_POST['fActive'])) $fActive = escape_string ($_POST['fActive']);
-
- if ($fBackupmx == "on")
- {
- $fAliases = -1;
- $fMailboxes = -1;
- $fMaxquota = -1;
- $fBackupmx = 1;
- $sqlBackupmx = db_get_boolean(True);
- }
- else
- {
- $fBackupmx = 0;
- $sqlBackupmx = db_get_boolean(False);
- }
-
- if ($fActive == "on") {
- $sqlActive = db_get_boolean(True);
- }
- else {
- $sqlActive = db_get_boolean(False);
- }
-
-
- $result = db_query ("UPDATE $table_domain SET description='$fDescription',aliases=$fAliases,mailboxes=$fMailboxes,maxquota=$fMaxquota,transport='$fTransport',backupmx='$sqlBackupmx',active='$sqlActive',modified=NOW() WHERE domain='$domain'");
- if ($result['rows'] == 1)
- {
- header ("Location: list-domain.php");
- exit;
- }
- else
- {
- $tMessage = $PALANG['pAdminEdit_domain_result_error'];
- }
-
- include ("../templates/header.tpl");
- include ("../templates/admin_menu.tpl");
- include ("../templates/admin_edit-domain.tpl");
- include ("../templates/footer.tpl");
-}
-
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
-?>
Deleted: trunk/admin/edit-mailbox.php
===================================================================
--- trunk/admin/edit-mailbox.php 2007-10-31 01:31:37 UTC (rev 167)
+++ trunk/admin/edit-mailbox.php 2007-10-31 18:24:40 UTC (rev 168)
@@ -1,3 +0,0 @@
-<?php
-require("../edit-mailbox.php");
-?>
Deleted: trunk/admin/edit-vacation.php
===================================================================
--- trunk/admin/edit-vacation.php 2007-10-31 01:31:37 UTC (rev 167)
+++ trunk/admin/edit-vacation.php 2007-10-31 18:24:40 UTC (rev 168)
@@ -1,3 +0,0 @@
-<?php
-require ("../edit-vacation.php");
-?>
Modified: trunk/admin/index.php
===================================================================
--- trunk/admin/index.php 2007-10-31 01:31:37 UTC (rev 167)
+++ trunk/admin/index.php 2007-10-31 18:24:40 UTC (rev 168)
@@ -1,4 +1,4 @@
<?php
-header ("Location: list-admin.php");
+header ("Location: ../login.php");
exit(0);
?>
Deleted: trunk/admin/list-admin.php
===================================================================
--- trunk/admin/list-admin.php 2007-10-31 01:31:37 UTC (rev 167)
+++ trunk/admin/list-admin.php 2007-10-31 18:24:40 UTC (rev 168)
@@ -1,50 +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: list-admin.php
- * Lists all administrators
- * Template File: list-admin.tpl
- *
- * Template Variables: -none-
- *
- * Form POST \ GET Variables: -none-
- */
-
-require_once("../common.php");
-
-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++) {
- $admin_properties[$i] = get_admin_properties ($list_admins[$i]);
- }
-}
-
-if ($_SERVER['REQUEST_METHOD'] == "GET")
-{
- include ("../templates/header.tpl");
- include ("../templates/admin_menu.tpl");
- include ("../templates/admin_list-admin.tpl");
- include ("../templates/footer.tpl");
-}
-
-if ($_SERVER['REQUEST_METHOD'] == "POST")
-{
- include ("../templates/header.tpl");
- include ("../templates/admin_menu.tpl");
- include ("../templates/admin_list-admin.tpl");
- include ("../templates/footer.tpl");
-}
-?>
Deleted: trunk/admin/list-domain.php
===================================================================
--- trunk/admin/list-domain.php 2007-10-31 01:31:37 UTC (rev 167)
+++ trunk/admin/list-domain.php 2007-10-31 18:24:40 UTC (rev 168)
@@ -1,83 +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: list-domain.php
- * List all domains as a quick overview.
- * Template File: admin_list-domain.tpl
- *
- * Template Variables:
- *
- * -none-
- *
- * Form POST \ GET Variables:
- *
- * fUsername
- */
-
-require_once('../common.php');
-
-authentication_require_role('global-admin');
-
-$list_admins = list_admins ();
-
-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)
- {
- for ($i = 0; $i < sizeof ($list_domains); $i++)
- {
- $domain_properties[$i] = get_domain_properties ($list_domains[$i]);
- }
- }
- }
- else
- {
- $list_domains = list_domains ();
- if ((is_array ($list_domains) and sizeof ($list_domains) > 0))
- for ($i = 0; $i < sizeof ($list_domains); $i++)
- {
- $domain_properties[$i] = get_domain_properties ($list_domains[$i]);
- }
- }
-
- include ("../templates/header.tpl");
- include ("../templates/admin_menu.tpl");
- include ("../templates/admin_list-domain.tpl");
- include ("../templates/footer.tpl");
-}
-
-if ($_SERVER['REQUEST_METHOD'] == "POST")
-{
- if (isset ($_POST['fUsername']))
- {
- $fUsername = escape_string ($_POST['fUsername']);
- $list_domains = list_domains_for_admin ($fUsername);
- }
-
- if (!empty ($list_domains))
- {
- for ($i = 0; $i < sizeof ($list_domains); $i++)
- {
- $domain_properties[$i] = get_domain_properties ($list_domains[$i]);
- }
- }
-
- include ("../templates/header.tpl");
- include ("../templates/admin_menu.tpl");
- include ("../templates/admin_list-domain.tpl");
- include ("../templates/footer.tpl");
-}
-?>
Deleted: trunk/admin/list-virtual.php
===================================================================
--- trunk/admin/list-virtual.php 2007-10-31 01:31:37 UTC (rev 167)
+++ trunk/admin/list-virtual.php 2007-10-31 18:24:40 UTC (rev 168)
@@ -1,164 +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: list-virtual.php
- * List virtual users for a domain.
- *
- * Template File: overview.tpl
- *
- * Template Variables:
- *
- * tMessage
- * tAlias
- * tMailbox
- *
- * Form POST \ GET Variables:
- *
- * fDomain
- * fDisplay
- */
-
-require_once('../common.php');
-
-authentication_require_role('global-admin');
-
-$list_domains = list_domains ();
-
-
-$tAlias = array();
-$tMailbox = array();
-$fDisplay = 0;
-$page_size = $CONF['page_size'];
-
-if ($_SERVER['REQUEST_METHOD'] == "GET")
-{
- if (isset ($_GET['domain'])) $fDomain = escape_string ($_GET['domain']);
- if (isset ($_GET['limit'])) $fDisplay = intval ($_GET['limit']);
-}
-else
-{
- if (isset ($_POST['fDomain'])) $fDomain = escape_string ($_POST['fDomain']);
- if (isset ($_POST['limit'])) $fDisplay = intval ($_POST['limit']);
-}
-
-
-if ((is_array ($list_domains) and sizeof ($list_domains) > 0)) if (empty ($fDomain)) $fDomain = $list_domains[0];
-
-
-if ((is_array ($list_domains) and sizeof ($list_domains) > 0)) if (empty ($fDomain)) $fDomain = $list_domains[1];
-
-$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 $fDisplay, $page_size";
-if ('pgsql'==$CONF['database_type'])
-{
- $query = "SELECT address,goto,extract(epoch from modified) as modified,active FROM $table_alias WHERE domain='$fDomain' AND NOT EXISTS(SELECT 1 FROM $table_mailbox WHERE username=$table_alias.address) ORDER BY address LIMIT $page_size OFFSET $fDisplay";
-}
-
-$result = db_query ($query);
-if ($result['rows'] > 0)
-{
- while ($row = db_array ($result['result']))
- {
- 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.domain='$fDomain' ORDER BY $table_mailbox.username LIMIT $fDisplay, $page_size");
- 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 domain='$fDomain' ORDER BY username LIMIT $page_size OFFSET $fDisplay";
- }
-}
-else
-{
-
- $query = "SELECT * FROM $table_mailbox WHERE domain='$fDomain' ORDER BY username LIMIT $fDisplay, $page_size";
- 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 domain='$fDomain' ORDER BY username LIMIT $page_size OFFSET $fDisplay";
- }
-
-}
-$result = db_query ($query);
-if ($result['rows'] > 0)
-{
- while ($row = db_array ($result['result']))
- {
- if ('pgsql'==$CONF['database_type'])
- {
- $row['created']=gmstrftime('%c %Z',$row['uts_created']);
- $row['modified']=gmstrftime('%c %Z',$row['uts_modified']);
- $row['active']=('t'==$row['active']) ? 1 : 0;
- $row['v_active'] = 1; // default to off...
- if(isset($row['v_active'])) { /* key may not be present in results due to query from above */
- $row['v_active']=('t'==$row['v_active']) ? 1 : 0;
- }
- }
- $tMailbox[] = $row;
- }
-}
-
-$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)) {
- $tDisplay_up_show = 1;
- }
- 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'] == 0) {
- $tCanAddAlias = true;
- }
- elseif($limit['alias_count'] < $limit['aliases']) {
- $tCanAddAlias = true;
- }
- if($limit['mailboxes'] == 0) {
- $tCanAddMailbox = true;
- }
- elseif($limit['mailbox_count'] < $limit['mailboxes']) {
- $tCanAddMailbox = true;
- }
- }
- }
-}
-
-
-include ("../templates/header.tpl");
-include ("../templates/admin_menu.tpl");
-include ("../templates/overview.tpl");
-include ("../templates/footer.tpl");
-
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
-?>
Deleted: trunk/admin/main.php
===================================================================
--- trunk/admin/main.php 2007-10-31 01:31:37 UTC (rev 167)
+++ trunk/admin/main.php 2007-10-31 18:24:40 UTC (rev 168)
@@ -1,4 +0,0 @@
-<?php
-header ("Location: list-admin.php");
-exit;
-?>
Deleted: trunk/admin/search.php
===================================================================
--- trunk/admin/search.php 2007-10-31 01:31:37 UTC (rev 167)
+++ trunk/admin/search.php 2007-10-31 18:24:40 UTC (rev 168)
@@ -1,180 +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: search.php
- * Allows for search by e.g. name, mailbox name etc.
- * Template File: search.tpl
- *
- * Template Variables:
- *
- * tAlias
- * tMailbox
- *
- * Form POST \ GET Variables:
- *
- * search
- * fDomain
- * fGo
- */
-
-require_once('../common.php');
-
-require_once('../search.php');
-
-/*
-authentication_require_role('global-admin');
-
-$tAlias = array();
-$tMailbox = array();
-$list_domains = list_domains ();
-
-
-if ($_SERVER['REQUEST_METHOD'] == "GET")
-{
- if (isset ($_GET['search'])) $fSearch = escape_string ($_GET['search']);
-
- if ($CONF['alias_control'] == "YES")
- {
- $query = "SELECT address,goto,modified,domain,active FROM $table_alias WHERE address LIKE '%$fSearch%' OR goto LIKE '%$fSearch%' ORDER BY address";
- if ('pgsql'==$CONF['database_type'])
- {
- $query = "SELECT address,goto,extract (epoch from modified) as modified,domain,active FROM $table_alias WHERE address LIKE '%$fSearch%' OR goto LIKE '%$fSearch%' ORDER BY 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";
- if ('pgsql'==$CONF['database_type'])
- {
- $query = "SELECT address,goto,extract(epoch from modified) as modified,domain,active FROM $table_alias WHERE address LIKE '%$fSearch%' AND NOT EXISTS(SELECT 1 FROM $table_mailbox WHERE username=$table_alias.address) ORDER BY address";
- }
- }
-
- $result = db_query ("$query");
-
- if ($result['rows'] > 0)
- {
- while ($row = db_array ($result['result']))
- {
- if ('pgsql'==$CONF['database_type'])
- {
- $row['modified'] = gmstrftime('%c %Z',$row['modified']);
- $row['active']=('t'==$row['active']) ? 1 : 0;
- }
- $tAlias[] = $row;
- }
- }
-
- $query = "SELECT * FROM $table_mailbox WHERE username LIKE '%$fSearch%' OR name LIKE '%$fSearch%' ORDER BY username";
- 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);
- if ($result['rows'] > 0)
- {
- while ($row = db_array ($result['result']))
- {
- if ('pgsql'==$CONF['database_type'])
- {
- $row['created']=gmstrftime('%c %Z',$row['uts_created']);
- $row['modified']=gmstrftime('%c %Z',$row['uts_modified']);
- $row['active']=('t'==$row['active']) ? 1 : 0;
- unset($row['uts_created']);
- unset($row['uts_modified']);
- }
- $tMailbox[] = $row;
- }
- }
-
- include ("../templates/header.tpl");
- include ("../templates/admin_menu.tpl");
- include ("../templates/search.tpl");
- include ("../templates/footer.tpl");
-}
-
-if ($_SERVER['REQUEST_METHOD'] == "POST")
-{
- if (isset ($_POST['search'])) $fSearch = escape_string ($_POST['search']);
- if (isset ($_POST['fGo'])) $fGo = escape_string ($_POST['fGo']);
- if (isset ($_POST['fDomain'])) $fDomain = escape_string ($_POST['fDomain']);
-
- if (empty ($fSearch) && !empty ($fGo))
- {
- header("Location: list-virtual.php?domain=" . $fDomain ) && exit;
- }
-
-
- if ($CONF['alias_control'] == "YES")
- {
- $query = "SELECT address,goto,modified,domain,active FROM $table_alias WHERE address LIKE '%$fSearch%' OR goto LIKE '%$fSearch%' ORDER BY address";
- if ('pgsql'==$CONF['database_type'])
- {
- $query = "SELECT address,goto,extract (epoch from modified) as modified,domain,active FROM $table_alias WHERE address LIKE '%$fSearch%' OR goto LIKE '%$fSearch%' ORDER BY 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";
- if ('pgsql'==$CONF['database_type'])
- {
- $query = "SELECT $table_alias.address,$table_alias.goto,extract(epoch from $table_alias.modified) as $table_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 ('pgsql'==$CONF['database_type'])
- {
- $row['modified'] = gmstrftime('%c %Z',$row['modified']);
- $row['active']=('t'==$row['active']) ? 1 : 0;
- }
- $tAlias[] = $row;
- }
- }
-
- $query = "SELECT * FROM $table_mailbox WHERE username LIKE '%$fSearch%' OR name LIKE '%$fSearch%' ORDER BY username";
- 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");
- if ($result['rows'] > 0)
- {
- while ($row = db_array ($result['result']))
- {
- if ('pgsql'==$CONF['database_type'])
- {
- $row['created']=gmstrftime('%c %Z',$row['uts_created']);
- $row['modified']=gmstrftime('%c %Z',$row['uts_modified']);
- $row['active']=('t'==$row['active']) ? 1 : 0;
- unset($row['uts_created']);
- unset($row['uts_modified']);
- }
- $tMailbox[] = $row;
- }
- }
-
- include ("../templates/header.tpl");
- include ("../templates/admin_menu.tpl");
- include ("../templates/search.tpl");
- include ("../templates/footer.tpl");
-}
-*/
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
-?>
Deleted: trunk/admin/viewlog.php
===================================================================
--- trunk/admin/viewlog.php 2007-10-31 01:31:37 UTC (rev 167)
+++ trunk/admin/viewlog.php 2007-10-31 18:24:40 UTC (rev 168)
@@ -1,3 +0,0 @@
-<?php
-require("../viewlog.php");
-?>
Copied: trunk/backup.php (from rev 164, trunk/admin/backup.php)
===================================================================
--- trunk/backup.php (rev 0)
+++ trunk/backup.php 2007-10-31 18:24:40 UTC (rev 168)
@@ -0,0 +1,118 @@
+<?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: backup.php
+ * Used to save all settings - but only works for MySQL databases.
+ * Template File: -none-
+ *
+ * Template Variables: -none-
+ *
+ * Form POST \ GET Variables: -none-
+ */
+
+require_once('common.php');
+
+authentication_require_role('global-admin');
+
+(($CONF['backup'] == 'NO') ? header("Location: " . $CONF['postfix_admin_url'] . "/main.php") && exit : '1');
+
+// TODO: make backup supported for postgres
+if ('pgsql'==$CONF['database_type'])
+{
+ print '<p>Sorry: Backup is currently not supported for your DBMS.</p>';
+}
+/*
+ SELECT attnum,attname,typname,atttypmod-4,attnotnull,atthasdef,adsrc
+ AS def FROM pg_attribute,pg_class,pg_type,pg_attrdef
+ WHERE pg_class.oid=attrelid AND pg_type.oid=atttypid
+ AND attnum>0 AND pg_class.oid=adrelid AND adnum=attnum AND atthasdef='t' AND lower(relname)='admin'
+ UNION SELECT attnum,attname,typname,atttypmod-4,attnotnull,atthasdef,''
+ AS def FROM pg_attribute,pg_class,pg_type
+ WHERE pg_class.oid=attrelid
+ AND pg_type.oid=atttypid
+ AND attnum>0
+ AND atthasdef='f'
+ AND lower(relname)='admin'
+$db = $_GET['db'];
+$cmd = "pg_dump -c -D -f /tix/miner/miner.sql -F p -N -U postgres $db";
+$res = `$cmd`;
+// Alternate: $res = shell_exec($cmd);
+echo $res;
+*/
+
+if ($_SERVER['REQUEST_METHOD'] == "GET")
+{
+ umask (077);
+ $path = (ini_get('upload_tmp_dir') != '') ? ini_get('upload_tmp_dir') : '/tmp/';
+ $filename = "postfixadmin-" . date ("Ymd") . "-" . getmypid() . ".sql";
+ $backup = $path . $filename;
+
+ $header = "#\n# Postfix Admin $version\n# Date: " . date ("D M j G:i:s T Y") . "\n#\n";
+
+ if (!$fh = fopen ($backup, 'w'))
+ {
+ $tMessage = "<div class=\"error_msg\">Cannot open file ($backup)</div>";
+ include ("templates/header.tpl");
+ include ("templates/menu.tpl");
+ include ("templates/message.tpl");
+ include ("templates/footer.tpl");
+ }
+ else
+ {
+ fwrite ($fh, $header);
+
+ $tables = array('admin','alias','domain','domain_admins','log','mailbox','vacation');
+
+ for ($i = 0 ; $i < sizeof ($tables) ; ++$i)
+ {
+ $result = db_query ("SHOW CREATE TABLE ".table_by_pos($i));
+ if ($result['rows'] > 0)
+ {
+ while ($row = db_array ($result['result']))
+ {
+ fwrite ($fh, "$row[1];\n\n");
+ }
+ }
+ }
+
+ for ($i = 0 ; $i < sizeof ($tables) ; ++$i)
+ {
+ $result = db_query ("SELECT * FROM ".table_by_pos($i));
+ if ($result['rows'] > 0)
+ {
+ while ($row = db_assoc ($result['result']))
+ {
+ foreach ($row as $key=>$val)
+ {
+ $fields[] = $key;
+ $values[] = $val;
+ }
+
+ fwrite ($fh, "INSERT INTO ". $tables[$i] . " (". implode (',',$fields) . ") VALUES ('" . implode ('\',\'',$values) . "');\n");
+ $fields = "";
+ $values = "";
+ }
+ }
+ }
+ }
+ header ("Content-Type: application/octet-stream");
+ header ("Content-Disposition: attachment; filename=\"$filename\"");
+ header ("Content-Transfer-Encoding: binary");
+ header ("Content-Length: " . filesize("$backup"));
+ header ("Content-Description: Postfix Admin");
+ $download_backup = fopen ("$backup", "r");
+ unlink ("$backup");
+ fpassthru ($download_backup);
+}
+?>
Copied: trunk/broadcast-message.php (from rev 164, trunk/admin/broadcast-message.php)
===================================================================
--- trunk/broadcast-message.php (rev 0)
+++ trunk/broadcast-message.php 2007-10-31 18:24:40 UTC (rev 168)
@@ -0,0 +1,92 @@
+<?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: broadcast-message.php
+ * Used to send a message to _ALL_ users with mailboxes on this server.
+ *
+ * Template File: broadcast-message.tpl
+ *
+ * Template Variables: -none-
+ *
+ * Form POST \ GET Variables:
+ *
+ * name
+ * subject
+ * message
+ */
+
+require_once('common.php');
+
+authentication_require_role('global-admin');
+
+$SESSID_USERNAME = authentication_get_username();
+
+if ($_SERVER['REQUEST_METHOD'] == "POST")
+{
+ if (empty($_POST['subject']) || empty($_POST['message']) || empty($_POST['name']))
+ {
+ $error = 1;
+ }
+ else
+ {
+ $q = 'select username from mailbox union '.
+ 'select goto from alias '.
+ 'where goto not in (select username from mailbox)';
+
+ $result = db_query ($q);
+ if ($result['rows'] > 0)
+ {
+ $b_name = mb_encode_mimeheader( $_POST['name'], 'UTF-8', 'Q');
+ $b_subject = mb_encode_mimeheader( $_POST['subject'], 'UTF-8', 'Q');
+ $b_message = encode_base64($_POST['message']);
+
+ $i = 0;
+ while ($row = db_array ($result['result'])) {
+ $fTo = $row[0];
+ $fHeaders = 'To: ' . $fTo . "\n";
+ $fHeaders .= 'From: ' . $b_name . ' <' . $CONF['admin_email'] . ">\n";
+ $fHeaders .= 'Subject: ' . $b_subject . "\n";
+ $fHeaders .= 'MIME-Version: 1.0' . "\n";
+ $fHeaders .= 'Content-Type: text/plain; charset=UTF-8' . "\n";
+ $fHeaders .= 'Content-Transfer-Encoding: base64' . "\n";
+
+ $fHeaders .= $b_message;
+
+ if (!smtp_mail ($fTo, $CONF['admin_email'], $fHeaders))
+ {
+ $tMessage .= "<br />" . $PALANG['pSendmail_result_error'] . "<br />";
+ }
+ else
+ {
+ $tMessage .= "<br />" . $PALANG['pSendmail_result_success'] . "<br />";
+ }
+ }
+ }
+ include ("templates/header.tpl");
+ include ("templates/menu.tpl");
+ echo '<p>'.$PALANG['pBroadcast_success'].'</p>';
+ include ("templates/footer.tpl");
+ }
+}
+
+if ($_SERVER['REQUEST_METHOD'] == "GET" || $error == 1)
+{
+ include ("templates/header.tpl");
+ include ("templates/menu.tpl");
+ include ("templates/broadcast-message.tpl");
+ include ("templates/footer.tpl");
+}
+
+/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
+?>
Copied: trunk/create-admin.php (from rev 164, trunk/admin/create-admin.php)
===================================================================
--- trunk/create-admin.php (rev 0)
+++ trunk/create-admin.php 2007-10-31 18:24:40 UTC (rev 168)
@@ -0,0 +1,69 @@
+<?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: create-admin.php
+ * Used to create new administrators.
+ * Template File: admin_create-admin.tpl
+ *
+ *
+ * Template Variables:
+ *
+ * tMessage
+ * tUsername
+ * tDomains
+ *
+ * Form POST \ GET Variables:
+ *
+ * fUsername
+ * fPassword
+ * fPassword2
+ * fDomains
+ */
+
+require_once('common.php');
+
+authentication_require_role('global-admin');
+
+$list_domains = list_domains ();
+$tDomains = array();
+
+if ($_SERVER['REQUEST_METHOD'] == "GET")
+{
+ $pAdminCreate_admin_username_text = $PALANG['pAdminCreate_admin_username_text'];
+ $tDomains = array ();
+}
+
+if ($_SERVER['REQUEST_METHOD'] == "POST")
+{
+ if (isset ($_POST['fUsername'])) $fUsername = escape_string ($_POST['fUsername']);
+ if (isset ($_POST['fPassword'])) $fPassword = escape_string ($_POST['fPassword']);
+ if (isset ($_POST['fPassword2'])) $fPassword2 = escape_string ($_POST['fPassword2']);
+ $fDomains = array();
+ if (!empty ($_POST['fDomains'])) $fDomains = $_POST['fDomains'];
+
+ list ($error, $tMessage, $pAdminCreate_admin_username_text, $pAdminCreate_admin_password_text) = create_admin($fUsername, $fPassword, $fPassword2, $fDomains);
+
+ if ($error != 0) {
+ if (isset ($_POST['fUsername'])) $tUsername = escape_string ($_POST['fUsername']);
+ if (isset ($_POST['fDomains'])) $tDomains = $_POST['fDomains'];
+ }
+}
+
+include ("templates/header.tpl");
+include ("templates/menu.tpl");
+include ("templates/admin_create-admin.tpl");
+include ("templates/footer.tpl");
+
+/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
+?>
Modified: trunk/create-alias.php
===================================================================
--- trunk/create-alias.php 2007-10-31 01:31:37 UTC (rev 167)
+++ trunk/create-alias.php 2007-10-31 18:24:40 UTC (rev 168)
@@ -153,13 +153,7 @@
}
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/menu.tpl");
include ("$incpath/templates/create-alias.tpl");
include ("$incpath/templates/footer.tpl");
?>
Copied: trunk/create-domain.php (from rev 164, trunk/admin/create-domain.php)
===================================================================
--- trunk/create-domain.php (rev 0)
+++ trunk/create-domain.php 2007-10-31 18:24:40 UTC (rev 168)
@@ -0,0 +1,125 @@
+<?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: create-domain.php
+ * Allows administrators to create new domains.
+ * Template File: admin_create-domain.tpl
+ *
+ * Template Variables:
+ *
+ * tMessage
+ * tDomain
+ * tDescription
+ * tAliases
+ * tMailboxes
+ * tMaxquota
+ * tDefaultaliases
+ *
+ * Form POST \ GET Variables:
+ *
+ * fDomain
+ * fDescription
+ * fAliases
+ * fMailboxes
+ * fMaxquota
+ * fDefaultaliases
+ */
+
+require_once('common.php');
+
+authentication_require_role('global-admin');
+
+
+if ($_SERVER['REQUEST_METHOD'] == "GET")
+{
+ $tAliases = $CONF['aliases'];
+ $tMailboxes = $CONF['mailboxes'];
+ $tMaxquota = $CONF['maxquota'];
+ $tTransport = $CONF['transport_default'];
+}
+
+if ($_SERVER['REQUEST_METHOD'] == "POST")
+{
+ if (isset ($_POST['fDomain'])) $fDomain = escape_string ($_POST['fDomain']);
+ foreach(array('fDescription' => '', 'fAliases' => '0', 'fMailboxes' => '0',
+ 'fMaxquota' => '0', 'fTransport' => 'virtual',
+ 'fDefaultaliases' => '0', 'fBackupmx' => '0') as $key => $default) {
+ if(isset($_POST[$key]) && !empty($POST[$key])) {
+ $$key = escape_string($_POST[$key]);
+ }
+ $$key = $default;
+ }
+
+ if (empty ($fDomain) or domain_exist ($fDomain) or !check_domain ($fDomain))
+ {
+ $error = 1;
+ $tDomain = escape_string ($_POST['fDomain']);
+ $tDescription = escape_string ($_POST['fDescription']);
+ $tAliases = escape_string ($_POST['fAliases']);
+ $tMailboxes = escape_string ($_POST['fMailboxes']);
+ if (isset ($_POST['fMaxquota'])) $tMaxquota = escape_string ($_POST['fMaxquota']);
+ if (isset ($_POST['fTransport'])) $tTransport = escape_string ($_POST['fTransport']);
+ if (isset ($_POST['fDefaultaliases'])) $tDefaultaliases = escape_string ($_POST['fDefaultaliases']);
+ if (isset ($_POST['fBackupmx'])) $tBackupmx = escape_string ($_POST['fBackupmx']);
+ if (domain_exist ($fDomain)) $pAdminCreate_domain_domain_text = $PALANG['pAdminCreate_domain_domain_text_error'];
+ if (empty ($fDoma...
[truncated message content] |
|
From: <chr...@us...> - 2007-10-31 01:31:36
|
Revision: 167
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=167&view=rev
Author: christian_boltz
Date: 2007-10-30 18:31:37 -0700 (Tue, 30 Oct 2007)
Log Message:
-----------
stylesheet.css
- added styles for CSS-based dropdown menu, based on "Son of Suckerfish"
http://www.htmldog.com/articles/suckerfish/dropdowns/
menu.tpl
- merged admin_menu.tpl into menu.tpl
- changed menu layout: the "create ..." items are now submenu items
Notes:
- superadmins still see the old menu
- dropdowns don't work in IE yet (requires some JS)
Modified Paths:
--------------
trunk/stylesheet.css
trunk/templates/menu.tpl
Modified: trunk/stylesheet.css
===================================================================
--- trunk/stylesheet.css 2007-10-30 00:18:53 UTC (rev 166)
+++ trunk/stylesheet.css 2007-10-31 01:31:37 UTC (rev 167)
@@ -87,28 +87,66 @@
white-space: nowrap;
}
-#menu ul li {
- display: inline;
+#menu ul {
+ padding: 0;
+ margin: 0;
+ margin-left:auto;
+ margin-right:auto;
+ list-style: none;
+}
+
+#menu li {
+ float: left;
background: #efefef;
- padding: 20px 5px 5px 5px;
margin-right: 3px;
border-top: 4px solid #aaaaaa;
}
-#menu ul li:hover {
- background: #BFFF00; /* #F32121; */
- color: white;
+#menu li:hover {
+ background: #BFFF00;
}
-#menu ul li a {
+#menu li ul {
+ position: absolute;
+ width: auto;
+ left: -999em;
+ border:2px solid white;
+ border-top:none;
+}
+#menu li:hover ul {
+ left: auto;
+}
+
+
+#menu li ul li {
+ float: none;
+ margin-right: 0px;
+ border-top:2px solid white;;
+ text-align:left;
+}
+
+
+
+
+#menu a {
+ display: block;
+ width: auto;
+ padding: 20px 5px 5px 5px;
color: #888888;
}
-#menu ul li a:hover {
+#menu a:hover {
color: #888888;
}
+
+#menu li ul li a {
+ padding: 5px 5px 5px 5px;
+}
+
+
+
#main_menu, #edit_form {
width: 750px;
margin: 0 auto;
Modified: trunk/templates/menu.tpl
===================================================================
--- trunk/templates/menu.tpl 2007-10-30 00:18:53 UTC (rev 166)
+++ trunk/templates/menu.tpl 2007-10-31 01:31:37 UTC (rev 167)
@@ -1,29 +1,84 @@
-<div id="menu">
-<ul>
- <li><a target="_top" href="main.php"><?php print $PALANG['pMenu_main']; ?></a></li>
- <li><a target="_top" href="overview.php"><?php print $PALANG['pMenu_overview']; ?></a></li>
- <?php $url = "create-alias.php"; if (isset ($_GET['domain'])) $url .= "?domain=" . $_GET['domain']; ?>
- <li><a target="_top" href="<?php print $url; ?>"><?php print $PALANG['pMenu_create_alias']; ?></a></li>
- <?php $url = "create-mailbox.php"; if (isset ($_GET['domain'])) $url .= "?domain=" . $_GET['domain']; ?>
- <li><a target="_top" href="<?php print $url; ?>"><?php print $PALANG['pMenu_create_mailbox']; ?></a></li>
- <?php if ($CONF['fetchmail'] == "YES") { ?>
- <li><a target="_top" href="fetchmail.php"><?php print $PALANG['pMenu_fetchmail']; ?></a></li>
- <?php } ?>
- <?php if ($CONF['sendmail'] == 'YES') { ?><li><a target="_top" href="sendmail.php"><?php print $PALANG['pMenu_sendmail']; ?></a></li><?php } ?>
- <?php if ($CONF['vacation'] == "YES") { ?>
- <li><a target="_top" href="edit-vacation.php"><?php print $PALANG['pUsersMenu_vacation']; ?></a></li>
- <?php } ?>
- <li><a target="_top" href="password.php"><?php print $PALANG['pMenu_password']; ?></a></li>
- <li><a target="_top" href="viewlog.php"><?php print $PALANG['pMenu_viewlog']; ?></a></li>
- <li><a target="_top" href="logout.php"><?php print $PALANG['pMenu_logout']; ?></a></li>
-</ul>
-</div>
+<?php
+function _menulink ($href, $title, $submenu = "") {
+ if ($submenu != "") $submenu = "<ul><li><a target='_top' href='$href'>$title</a>$submenu</li></ul>";
+ return "<li><a target='_top' href='$href'>$title</a>$submenu</li>";
+}
-<?php
-if (file_exists (realpath ("motd.txt")))
+authentication_has_role('global-admin');
+
+echo "<div id='menu'>\n";
+echo "<ul>\n";
+
+$url = "create-mailbox.php"; if (isset ($_GET['domain'])) $url .= "?domain=" . $_GET['domain'];
+$submenu_virtual = _menulink($url, $PALANG['pMenu_create_mailbox']);
+
+$url = "create-alias.php"; if (isset ($_GET['domain'])) $url .= "?domain=" . $_GET['domain'];
+$submenu_virtual .= _menulink($url, $PALANG['pMenu_create_alias']);
+
+$submenu_admin = _menulink("create-admin.php", $PALANG['pAdminMenu_create_admin']);
+
+$submenu_fetchmail = _menulink("fetchmail.php?new=1", $PALANG['pFetchmail_new_entry']);
+
+
+if (authentication_has_role('global-admin')) {
+ $submenu_domain = _menulink("create-domain.php", $PALANG['pAdminMenu_create_domain']);
+} else {
+ $submenu_domain = "";
+}
+
+if (authentication_has_role('global-admin')) {
+ print _menulink("list-admin.php", $PALANG['pAdminMenu_list_admin'], $submenu_admin);
+ print _menulink("list-domain.php", $PALANG['pAdminMenu_list_domain'], $submenu_domain);
+ print _menulink("list-virtual.php", $PALANG['pAdminMenu_list_virtual'], $submenu_virtual);
+} else {
+ print _menulink("main.php", $PALANG['pMenu_main']);
+ print _menulink("overview.php", $PALANG['pMenu_overview'], $submenu_virtual);
+}
+
+if ($CONF['fetchmail'] == 'YES') {
+ print _menulink("fetchmail.php", $PALANG['pMenu_fetchmail'], $submenu_fetchmail);
+}
+
+if ($CONF['sendmail'] == 'YES') {
+ print _menulink("sendmail.php", $PALANG['pMenu_sendmail']);
+}
+
+# not really useful in the admin menu
+#if ($CONF['vacation'] == 'YES') {
+# print _menulink("edit-vacation.php", $PALANG['pUsersMenu_vacation']);
+#}
+
+if (authentication_has_role('global-admin')) {
+ print _menulink("broadcast-message.php", $PALANG['pAdminMenu_broadcast_message']);
+}
+
+print _menulink("password.php", $PALANG['pMenu_password']);
+
+if (authentication_has_role('global-admin') && 'pgsql'!=$CONF['database_type'] && $CONF['backup'] == 'YES') {
+ print _menulink("backup.php", $PALANG['pAdminMenu_backup']);
+}
+
+print _menulink("viewlog.php", $PALANG['pMenu_viewlog']);
+
+print _menulink("logout.php", $PALANG['pMenu_logout']);
+
+echo "</ul>\n";
+echo "</div>\n";
+
+print "<br clear='all' /><br>"; # TODO
+
+if (authentication_has_role('global-admin')) {
+ $motd_file = "motd-admin.txt";
+} else {
+ $motd_file = "motd.txt";
+}
+
+if (file_exists (realpath ($motd_file)))
{
print "<div id=\"motd\">\n";
- include ("motd.txt");
+ include ($motd_file);
print "</div>";
}
+
+/* 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-30 00:18:54
|
Revision: 166
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=166&view=rev
Author: christian_boltz
Date: 2007-10-29 17:18:53 -0700 (Mon, 29 Oct 2007)
Log Message:
-----------
- merged admin/delete.php into /delete.php
- the WHERE fieldname is now hardcoded instead of being a $_GET parameter
This fixes a possible security hole in admin/delete.php (only vulnerabe
when logged in as global-admin)
Modified Paths:
--------------
trunk/admin/delete.php
trunk/delete.php
trunk/templates/admin_list-admin.tpl
trunk/templates/admin_list-domain.tpl
trunk/templates/overview.tpl
Modified: trunk/admin/delete.php
===================================================================
--- trunk/admin/delete.php 2007-10-26 06:13:46 UTC (rev 165)
+++ trunk/admin/delete.php 2007-10-30 00:18:53 UTC (rev 166)
@@ -1,161 +1,3 @@
<?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: delete.php
- * Used to delete a domain, mailbox or alias.
- *
- * Template File: message.tpl
- *
- * Template Variables:
- *
- * tMessage
- *
- * Form POST \ GET Variables:
- *
- * fTable
- * fWhere
- * fDelete
- * fDomain
- */
-
-require_once('../common.php');
-
-authentication_require_role('global-admin');
-
-if ($_SERVER['REQUEST_METHOD'] == "GET")
-{
- if (isset ($_GET['table'])) $fTable = escape_string ($_GET['table']);
- if (isset ($_GET['where'])) $fWhere = escape_string ($_GET['where']);
- if (isset ($_GET['delete'])) $fDelete = escape_string ($_GET['delete']);
- if (isset ($_GET['domain'])) $fDomain = escape_string ($_GET['domain']);
-
- if ($CONF['database_type'] == "pgsql") db_query('BEGIN');
-
- $error=0;
-
- if (empty ($fTable))
- {
- $error = 1;
- }
-
- if ($fTable == "domain")
- {
- $result_domain_admins = db_delete ($table_domain_admins,$fWhere,$fDelete);
- $result_alias = db_delete ($table_alias,$fWhere,$fDelete);
- $result_mailbox = db_delete ($table_mailbox,$fWhere,$fDelete);
- $result_log = db_delete ($table_log,$fWhere,$fDelete);
- if ($CONF['vacation'] == "YES")
- {
- $result_vacation = db_delete ($table_vacation,$fWhere,$fDelete);
- }
- $result_domain = db_delete ($table_domain,$fWhere,$fDelete);
-
- if (!$result_domain || !domain_postdeletion($fDelete))
- {
- $error = 1;
- $tMessage = $PALANG['pAdminDelete_domain_error'];
- }
- else
- {
- $url = "list-domain.php";
- }
- }
-
- if ($fTable == "admin")
- {
- $result_admin = db_delete ($table_admin,$fWhere,$fDelete);
- $result_domain_admins = db_delete ($table_domain_admins,$fWhere,$fDelete);
-
- if (!($result_admin == 1) and ($result_domain_admins >= 0))
- {
- $error = 1;
- $tMessage = $PALANG['pAdminDelete_admin_error'];
- }
- else
- {
- $url = "list-admin.php";
- }
- }
-
- if ($fTable == "alias" or $fTable == "mailbox")
- {
- if ($CONF['database_type'] == "pgsql") db_query('BEGIN');
- $result = db_query ("DELETE FROM $table_alias WHERE address='$fDelete' AND domain='$fDomain'");
- if ($result['rows'] != 1)
- {
- $error = 1;
- $tMessage = $PALANG['pDelete_delete_error'] . "<b>$fDelete</b> (alias)!</span>";
- }
- else
- {
- $url = "list-virtual.php?domain=$fDomain";
- db_log ($SESSID_USERNAME , $fDomain, 'delete_alias', $fDelete);
- }
-
- if (!$error)
- {
- $result = db_query ("SELECT * FROM $table_mailbox WHERE username='$fDelete' AND domain='$fDomain'");
- if ($result['rows'] == 1)
- {
- $result = db_query ("DELETE FROM $table_mailbox WHERE username='$fDelete' AND domain='$fDomain'");
- $postdel_res=mailbox_postdeletion($fDelete,$fDomain);
- if ($result['rows'] != 1 || !$postdel_res)
- {
- $error = 1;
- $tMessage = $PALANG['pDelete_delete_error'] . "<b>$fDelete</b> (";
- if ($result['rows']!=1)
- {
- $tMessage.='mailbox';
- if (!$postdel_res) $tMessage.=', ';
- }
- if (!$postdel_res)
- {
- $tMessage.='post-deletion';
- }
- $tMessage.=')</span>';
- }
- else
- {
- $url = "list-virtual.php?domain=$fDomain";
- db_query ("DELETE FROM $table_vacation WHERE email='$fDelete' AND domain='$fDomain'");
- db_log ($SESSID_USERNAME, $fDomain, 'delete_mailbox', $fDelete);
- }
- }
- }
- }
-
- if ($error == 1)
- {
- if ($CONF['database_type']=='pgsql') { db_query('ROLLBACK'); }
- } else {
- if ($CONF['database_type']=='pgsql') { db_query('COMMIT'); }
- header ("Location: $url");
- exit;
- }
-
- include ("../templates/header.tpl");
- include ("../templates/admin_menu.tpl");
- include ("../templates/message.tpl");
- include ("../templates/footer.tpl");
-}
-
-if ($_SERVER['REQUEST_METHOD'] == "POST")
-{
- include ("../templates/header.tpl");
- include ("../templates/menu.tpl");
- include ("../templates/message.tpl");
- include ("../templates/footer.tpl");
-}
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
+require('../delete.php');
?>
Modified: trunk/delete.php
===================================================================
--- trunk/delete.php 2007-10-26 06:13:46 UTC (rev 165)
+++ trunk/delete.php 2007-10-30 00:18:53 UTC (rev 166)
@@ -13,15 +13,10 @@
* @license GNU GPL v2 or later.
*
* File: delete.php
- * Responsible for allowing for the deletion of domains; note if
- * a domain is deleted, all mailboxes and aliases belonging to the
- * domain are also removed.
+ * Used to delete admins, domains, mailboxes and aliases.
+ * Note: if a domain is deleted, all mailboxes and aliases belonging
+ * to the domain are also removed.
*
- * @version $Id$
- * @license GNU GPL v2 or later.
- *
- * Template Variables:
- *
* Template File: message.tpl
*
* Template Variables:
@@ -30,6 +25,7 @@
*
* Form POST \ GET Variables:
*
+ * fTable
* fDelete
* fDomain
*/
@@ -39,12 +35,62 @@
authentication_require_role('admin');
$SESSID_USERNAME = authentication_get_username();
+$error = 0;
-if ($_SERVER['REQUEST_METHOD'] == "GET")
+$fTable = escape_string (safeget('table') ); # see the if blocks below for valid values
+$fDelete = escape_string (safeget('delete'));
+$fDomain = escape_string (safeget('domain'));
+
+$error=0;
+
+if ($fTable == "admin")
{
- if (isset ($_GET['delete'])) $fDelete = escape_string ($_GET['delete']);
- if (isset ($_GET['domain'])) $fDomain = escape_string ($_GET['domain']);
+ authentication_require_role('global-admin');
+ $fWhere = 'username';
+ $result_admin = db_delete ($table_admin,$fWhere,$fDelete);
+ $result_domain_admins = db_delete ($table_domain_admins,$fWhere,$fDelete);
+
+ if (!($result_admin == 1) and ($result_domain_admins >= 0))
+ {
+ $error = 1;
+ $tMessage = $PALANG['pAdminDelete_admin_error'];
+ }
+ else
+ {
+ $url = "list-admin.php";
+ header ("Location: $url");
+ }
+} # ($fTable == "admin")
+elseif ($fTable == "domain")
+{
+ authentication_require_role('global-admin');
+ $fWhere = 'domain';
+ $result_domain_admins = db_delete ($table_domain_admins,$fWhere,$fDelete);
+ $result_alias = db_delete ($table_alias,$fWhere,$fDelete);
+ $result_mailbox = db_delete ($table_mailbox,$fWhere,$fDelete);
+ $result_log = db_delete ($table_log,$fWhere,$fDelete);
+ if ($CONF['vacation'] == "YES")
+ {
+ $result_vacation = db_delete ($table_vacation,$fWhere,$fDelete);
+ }
+ $result_domain = db_delete ($table_domain,$fWhere,$fDelete);
+
+ if (!$result_domain || !domain_postdeletion($fDelete))
+ {
+ $error = 1;
+ $tMessage = $PALANG['pAdminDelete_domain_error'];
+ }
+ else
+ {
+ $url = "list-domain.php";
+ header ("Location: $url");
+ }
+} # ($fTable == "domain")
+
+elseif ($fTable == "alias" or $fTable == "mailbox")
+{
+
if (!check_owner ($SESSID_USERNAME, $fDomain))
{
$error = 1;
@@ -58,7 +104,6 @@
else
{
if ($CONF['database_type'] == "pgsql") db_query('BEGIN');
-
$result = db_query ("DELETE FROM $table_alias WHERE address='$fDelete' AND domain='$fDomain'");
if ($result['rows'] != 1)
{
@@ -70,46 +115,67 @@
db_log ($SESSID_USERNAME, $fDomain, 'delete_alias', $fDelete);
}
- $result = db_query ("SELECT * FROM $table_mailbox WHERE username='$fDelete' AND domain='$fDomain'");
- if ($result['rows'] == 1)
+ if (!$error)
{
- $result = db_query ("DELETE FROM $table_mailbox WHERE username='$fDelete' AND domain='$fDomain'");
- $postdel_res = mailbox_postdeletion($fDelete,$fDomain);
- if ($result['rows'] != 1 || !$postdel_res)
+ $result = db_query ("SELECT * FROM $table_mailbox WHERE username='$fDelete' AND domain='$fDomain'");
+ if ($result['rows'] == 1)
{
- $error = 1;
- $tMessage = $PALANG['pDelete_delete_error'] . "<b>$fDelete</b> (";
- if ($result['rows']!=1)
+ $result = db_query ("DELETE FROM $table_mailbox WHERE username='$fDelete' AND domain='$fDomain'");
+ $postdel_res=mailbox_postdeletion($fDelete,$fDomain);
+ if ($result['rows'] != 1 || !$postdel_res)
{
- $tMessage.='mailbox';
- if (!$postdel_res) $tMessage.=', ';
+ $error = 1;
+ $tMessage = $PALANG['pDelete_delete_error'] . "<b>$fDelete</b> (";
+ if ($result['rows']!=1)
+ {
+ $tMessage.='mailbox';
+ if (!$postdel_res) $tMessage.=', ';
+ }
+ if (!$postdel_res)
+ {
+ $tMessage.='post-deletion';
+ }
+ $tMessage.=')</span>';
}
- if (!$postdel_res) $tMessage.='post-deletion';
- $tMessage.=')</span>';
+ else
+ {
+ db_query ("DELETE FROM $table_vacation WHERE email='$fDelete' AND domain='$fDomain'");
+ db_log ($SESSID_USERNAME, $fDomain, 'delete_mailbox', $fDelete);
+ }
}
- else
- {
- db_query ("DELETE FROM $table_vacation WHERE email='$fDelete' AND domain='$fDomain'");
- db_log ($SESSID_USERNAME, $fDomain, 'delete_mailbox', $fDelete);
- }
}
}
if ($error != 1)
{
if ($CONF['database_type'] == "pgsql") db_query('COMMIT');
- header ("Location: overview.php?domain=$fDomain");
+ $url = "overview.php";
+ if (authentication_has_role('global-admin')) $url = "list-virtual.php";
+ header ("Location: $url?domain=$fDomain");
exit;
} else {
$tMessage = $PALANG['pDelete_delete_error'] . "<b>$fDelete</b> (physical mail)!</span>";
if ($CONF['database_type'] == "pgsql") db_query('ROLLBACK');
}
+} # ($fTable == "alias" or $fTable == "mailbox")
+
+else
+{
+ # unknown $fTable value
+ flash_error($PALANG['invalid_parameter']);
}
-include ("./templates/header.tpl");
-include ("./templates/menu.tpl");
-include ("./templates/message.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/message.tpl");
+include ("$incpath/templates/footer.tpl");
+
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/templates/admin_list-admin.tpl
===================================================================
--- trunk/templates/admin_list-admin.tpl 2007-10-26 06:13:46 UTC (rev 165)
+++ trunk/templates/admin_list-admin.tpl 2007-10-30 00:18:53 UTC (rev 166)
@@ -22,7 +22,7 @@
$active = ($admin_properties[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO'];
print " <td><a href=\"edit-active-admin.php?username=" . $list_admins[$i] . "\">" . $active . "</a></td>";
print " <td><a href=\"edit-admin.php?username=" . $list_admins[$i] . "\">" . $PALANG['edit'] . "</a></td>";
- print " <td><a href=\"delete.php?table=admin&where=username&delete=" . $list_admins[$i] . "\" onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pAdminList_admin_username'] . ": " . $list_admins[$i] . "')\">" . $PALANG['del'] . "</a></td>";
+ print " <td><a href=\"delete.php?table=admin&delete=" . $list_admins[$i] . "\" onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pAdminList_admin_username'] . ": " . $list_admins[$i] . "')\">" . $PALANG['del'] . "</a></td>";
print " </tr>\n";
}
}
Modified: trunk/templates/admin_list-domain.tpl
===================================================================
--- trunk/templates/admin_list-domain.tpl 2007-10-26 06:13:46 UTC (rev 165)
+++ trunk/templates/admin_list-domain.tpl 2007-10-30 00:18:53 UTC (rev 166)
@@ -75,7 +75,7 @@
$active = ($domain_properties[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO'];
print "<td><a href=\"edit-active-domain.php?domain=" . $list_domains[$i] . "\">" . $active . "</a></td>";
print "<td><a href=\"edit-domain.php?domain=" . $list_domains[$i] . "\">" . $PALANG['edit'] . "</a></td>";
- print "<td><a href=\"delete.php?table=domain&where=domain&delete=" . $list_domains[$i] . "\" onclick=\"return confirm ('" . $PALANG['confirm_domain'] . $PALANG['pAdminList_admin_domain'] . ": " . $list_domains[$i] . "')\">" . $PALANG['del'] . "</a></td>";
+ print "<td><a href=\"delete.php?table=domain&delete=" . $list_domains[$i] . "\" onclick=\"return confirm ('" . $PALANG['confirm_domain'] . $PALANG['pAdminList_admin_domain'] . ": " . $list_domains[$i] . "')\">" . $PALANG['del'] . "</a></td>";
print "</tr>\n";
}
}
Modified: trunk/templates/overview.tpl
===================================================================
--- trunk/templates/overview.tpl 2007-10-26 06:13:46 UTC (rev 165)
+++ trunk/templates/overview.tpl 2007-10-30 00:18:53 UTC (rev 166)
@@ -125,7 +125,7 @@
$active = ($tAlias[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO'];
print " <td><a href=\"edit-active.php?alias=" . urlencode ($tAlias[$i]['address']) . "&domain=$fDomain" . "\">" . $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?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 " <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
{
@@ -134,7 +134,7 @@
$active = ($tAlias[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO'];
print " <td><a href=\"edit-active.php?alias=" . urlencode ($tAlias[$i]['address']) . "&domain=$fDomain" . "\">" . $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?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 " <td><a href=\"delete.php?table=mailbox&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
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Gin...@us...> - 2007-10-26 06:13:45
|
Revision: 165
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=165&view=rev
Author: GingerDog
Date: 2007-10-25 23:13:46 -0700 (Thu, 25 Oct 2007)
Log Message:
-----------
ADDITIONS/fetchmail.pl: typo fix for field name - use poll_time, not pool_time - thanks to xpoint on irc who reported this
Modified Paths:
--------------
trunk/ADDITIONS/fetchmail.pl
Modified: trunk/ADDITIONS/fetchmail.pl
===================================================================
--- trunk/ADDITIONS/fetchmail.pl 2007-10-25 23:12:51 UTC (rev 164)
+++ trunk/ADDITIONS/fetchmail.pl 2007-10-26 06:13:46 UTC (rev 165)
@@ -20,7 +20,7 @@
$sql=<<SQL;
SELECT id,mailbox,src_server,src_auth,src_user,src_password,src_folder,fetchall,keep,protocol,mda,extra_options
FROM fetchmail
-WHERE unix_timestamp(now())-unix_timestamp(date) > pool_time*60
+WHERE unix_timestamp(now())-unix_timestamp(date) > poll_time*60
SQL
my (%config);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2007-10-25 23:12:50
|
Revision: 164
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=164&view=rev
Author: christian_boltz
Date: 2007-10-25 16:12:51 -0700 (Thu, 25 Oct 2007)
Log Message:
-----------
- replaced tabs with spaces in fetchmail.php and fetchmail.tpl
- whitespace changes only, no other difference
Modified Paths:
--------------
trunk/fetchmail.php
trunk/templates/fetchmail.tpl
Modified: trunk/fetchmail.php
===================================================================
--- trunk/fetchmail.php 2007-10-25 22:59:52 UTC (rev 163)
+++ trunk/fetchmail.php 2007-10-25 23:12:51 UTC (rev 164)
@@ -73,38 +73,39 @@
$display_status = 1;
if ($new || $edit) $display_status = 0;
-$fm_struct=array( // list($editible,$view,$type,$title,$comment)
+$fm_struct=array( // list($editible,$view,$type,$title,$comment)
# first column: allow editing?
# second column: display field?
- "id" =>array(0,0,'id', 'ID','Record ID'),
- "mailbox" =>array(1,1,'enum', 'Mailbox','Local mailbox'),
- "src_server" =>array(1,1,'text', 'Server','Remote Server'),
- "src_auth" =>array(1,1,'enum', 'Auth Type','Mostly password'),
- "src_user" =>array(1,1,'text', 'User','Remote User'),
- "src_password" =>array(1,0,'password', 'Password','Remote Password'),
- "src_folder" =>array(1,1,'text', 'Folder','Remote Folder'),
- "poll_time" =>array(1,1,'num', 'Poll','Poll Time (min)'),
- "fetchall" =>array(1,1,'bool', 'Fetch All','Retrieve both old (seen) and new messages'),
- "keep" =>array(1,1,'bool', 'Keep','Keep retrieved messages on the remote mailserver'),
- "protocol" =>array(1,1,'enum', 'Protocol','Protocol to use'),
- "extra_options" =>array($extra_options,$extra_options,'longtext', 'Extra Options','Extra fetchmail Options'),
- "mda" =>array($extra_options,$extra_options,'longtext', 'MDA','Mail Delivery Agent'),
- "date" => array(0,$display_status,'text', 'Date','Date of last polling/configuration change'),
- "returned_text" => array(0,$display_status,'longtext', 'Returned Text','Text message from last polling'),
+ # the others: type title help text (in edit form)
+ "id" => array(0,0,'id', 'ID', 'Record ID'),
+ "mailbox" => array(1,1,'enum', 'Mailbox', 'Local mailbox'),
+ "src_server" => array(1,1,'text', 'Server', 'Remote Server'),
+ "src_auth" => array(1,1,'enum', 'Auth Type','Mostly password'),
+ "src_user" => array(1,1,'text', 'User', 'Remote User'),
+ "src_password" => array(1,0,'password', 'Password', 'Remote Password'),
+ "src_folder" => array(1,1,'text', 'Folder', 'Remote Folder'),
+ "poll_time" => array(1,1,'num', 'Poll', 'Poll Time (min)'),
+ "fetchall" => array(1,1,'bool', 'Fetch All','Retrieve both old (seen) and new messages'),
+ "keep" => array(1,1,'bool', 'Keep', 'Keep retrieved messages on the remote mailserver'),
+ "protocol" => array(1,1,'enum', 'Protocol', 'Protocol to use'),
+ "extra_options" => array($extra_options,$extra_options,'longtext', 'Extra Options','Extra fetchmail Options'),
+ "mda" => array($extra_options,$extra_options,'longtext', 'MDA', 'Mail Delivery Agent'),
+ "date" => array(0,$display_status, 'text', 'Date', 'Date of last polling/configuration change'),
+ "returned_text" => array(0,$display_status, 'longtext', 'Returned Text','Text message from last polling'),
);
$SESSID_USERNAME = authentication_get_username();
if (!$SESSID_USERNAME )
- exit;
+ exit;
$fm_defaults=array(
- "id" =>0,
- "mailbox" => array($SESSID_USERNAME),
+ "id" =>0,
+ "mailbox" => array($SESSID_USERNAME),
"poll_time" => 10,
- "src_auth" =>
- array('password','kerberos_v5','kerberos','kerberos_v4','gssapi','cram-md5','otp','ntlm','msn','ssh','any'),
- "protocol" =>
- array('POP3','IMAP','POP2','ETRN','AUTO'),
+ "src_auth" =>
+ array('password','kerberos_v5','kerberos','kerberos_v4','gssapi','cram-md5','otp','ntlm','msn','ssh','any'),
+ "protocol" =>
+ array('POP3','IMAP','POP2','ETRN','AUTO'),
);
@@ -115,14 +116,14 @@
$res = db_query ($sql);
if ($res['rows'] > 0){
- $fm_defaults["mailbox"]=array();
- while ($name = db_array ($res['result'])){
- $fm_defaults["mailbox"][] = $name["username"];
- }
+ $fm_defaults["mailbox"]=array();
+ while ($name = db_array ($res['result'])){
+ $fm_defaults["mailbox"][] = $name["username"];
+ }
}
else{
- $fm_defaults["mailbox"]=array();
- $fm_defaults["mailbox"][]=$SESSID_USERNAME; # TODO: Does this really make sense? Or should we display a message "please create a mailbox first!"?
+ $fm_defaults["mailbox"]=array();
+ $fm_defaults["mailbox"][]=$SESSID_USERNAME; # TODO: Does this really make sense? Or should we display a message "please create a mailbox first!"?
}
$row_id = 0;
@@ -148,7 +149,7 @@
if ($cancel) {
- $edit=0;
+ $edit=0;
} elseif ($delete) {
$result = db_query ("delete from fetchmail WHERE id=".$delete);
if ($result['rows'] != 1)
@@ -160,16 +161,16 @@
$delete=0;
} elseif ( ($edit || $new) && $save) {
$formvars=array();
- foreach($fm_struct as $key=>$row){
- list($editible,$view,$type,$title,$comment)=$row;
- if ($editible != 0){
- $func="_inp_".$type;
- $val=safepost($key);
+ foreach($fm_struct as $key=>$row){
+ list($editible,$view,$type,$title,$comment)=$row;
+ if ($editible != 0){
+ $func="_inp_".$type;
+ $val=safepost($key);
if ($type!="password" || strlen($val) > 0) { # skip on empty (aka unchanged) password
$formvars[$key]= escape_string( function_exists($func) ?$func($val) :$val);
}
- }
- }
+ }
+ }
$formvars['id'] = $edit; # results in 0 on $new
if (!in_array($formvars['mailbox'], $fm_defaults['mailbox'])) {
@@ -234,21 +235,21 @@
}
function _inp_num($val){
- return (int)($val);
+ return (int)($val);
}
function _inp_bool($val){
- return $val?db_get_boolean(true):db_get_boolean(false);
+ return $val?db_get_boolean(true):db_get_boolean(false);
}
function _inp_password($val){
- return base64_encode($val);
+ return base64_encode($val);
}
- include ("./templates/header.tpl");
- include ("./templates/menu.tpl");
- include ("./templates/fetchmail.tpl");
- include ("./templates/footer.tpl");
+include ("./templates/header.tpl");
+include ("./templates/menu.tpl");
+include ("./templates/fetchmail.tpl");
+include ("./templates/footer.tpl");
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/templates/fetchmail.tpl
===================================================================
--- trunk/templates/fetchmail.tpl 2007-10-25 22:59:52 UTC (rev 163)
+++ trunk/templates/fetchmail.tpl 2007-10-25 23:12:51 UTC (rev 164)
@@ -1,12 +1,12 @@
<?php
- $headers=array();
- foreach($fm_struct as $row){
- list($editible,$view,$type,$title,$comment)=$row;
- if ($view){
- $headers[]=$row;
- }
- }
+$headers=array();
+foreach($fm_struct as $row){
+ list($editible,$view,$type,$title,$comment)=$row;
+ if ($view){
+ $headers[]=$row;
+ }
+}
if ($edit || $new) { # edit mode
echo '<div id="edit_form">';
@@ -17,36 +17,36 @@
print '<div id="overview">';
print '<form name="overview" method="post">';
print "<table id=\"log_table\" border=0>\n";
- print " <tr>\n";
- print " <td colspan=\"".(sizeof($headers)+2)."\"><h3>".$PALANG['pFetchmail_welcome'].$user_domains."</h3></td>\n";
- print " </tr>\n";
- print " <tr class=\"header\">\n";
- foreach($headers as $row){
- list($editible,$view,$type,$title,$comment)=$row;
- print " <td>" . $title . "</td>\n";
- }
+ print " <tr>\n";
+ print " <td colspan=\"".(sizeof($headers)+2)."\"><h3>".$PALANG['pFetchmail_welcome'].$user_domains."</h3></td>\n";
+ print " </tr>\n";
+ print " <tr class=\"header\">\n";
+ foreach($headers as $row){
+ list($editible,$view,$type,$title,$comment)=$row;
+ print " <td>" . $title . "</td>\n";
+ }
print "<td> </td>";
print "<td> </td>";
- print " </tr>\n";
-
+ print " </tr>\n";
+
if (sizeof ($tFmail) > 0){
foreach($tFmail as $row){
- print " <tr class=\"hilightoff\" onMouseOver=\"className='hilighton';\" onMouseOut=\"className='hilightoff';\">\n";
- foreach($row as $key=>$val){
+ print " <tr class=\"hilightoff\" onMouseOver=\"className='hilighton';\" onMouseOut=\"className='hilightoff';\">\n";
+ foreach($row as $key=>$val){
- if (!isset($fm_struct[$key])) continue; # TODO: not really nice, but avoids undefined index warnings ;-)
+ if (!isset($fm_struct[$key])) continue; # TODO: not really nice, but avoids undefined index warnings ;-)
list($editible,$view,$type,$title,$comment)=$fm_struct[$key];
- if ($view){
- $func="_listview_".$type;
- print " <td nowrap>" . (function_exists($func)?$func($val):$val) . "</td>\n";
- }
+ if ($view){
+ $func="_listview_".$type;
+ print " <td nowrap>" . (function_exists($func)?$func($val):$val) . "</td>\n";
+ }
- }
+ }
print "<td><a href=\"fetchmail.php?edit=" . $row['id'] . "\">" . $PALANG['edit'] . "</a></td>";
print " <td><a href=\"fetchmail.php?delete=" . $row['id'] . "\"onclick=\"return confirm ('"
. $PALANG['confirm'] . $PALANG['pMenu_fetchmail'] . ": ". htmlentities($row['src_user']) . " @ "
. htmlentities($row['src_server']) . "')\">" . $PALANG['del'] . "</a></td>\n";
- print " </tr>\n";
+ print " </tr>\n";
}
}
print "</table>";
@@ -54,121 +54,121 @@
print "</form>\n";
print "</div>\n";
- print "<p><a href='?new=1'>".$PALANG['pFetchmail_new_entry']."</a></p>\n";
+ print "<p><a href='?new=1'>".$PALANG['pFetchmail_new_entry']."</a></p>\n";
} # end display mode
function fetchmail_edit_row($data=array()){
- global $fm_struct,$fm_defaults,$PALANG;
- $id=$data["id"];
- $_id=$data["id"]*100+1;
- $ret="<table>";
+ global $fm_struct,$fm_defaults,$PALANG;
+ $id=$data["id"];
+ $_id=$data["id"]*100+1;
+ $ret="<table>";
$ret .= '<tr><td colspan="3"><h3>' . $PALANG['pMenu_fetchmail'] . '</h3></td></tr>';
# TODO: $formvars possibly contains db-specific boolean values
# TODO: no problems with MySQL, to be tested with PgSQL
# TODO: undefined values may also occour
- foreach($fm_struct as $key=>$struct){
- list($editible,$view,$type,$title,$comment)=$struct;
- if ($editible){
- $ret.="<tr><td align=left valign=top><label for=${_id} style='width:20em;'>${title}: </label></td>";
- $ret.="<td align=left style='padding-left:.25em;padding-right:.25em;background-color:white;'>";
- $func="_edit_".$type;
- if (! function_exists($func))
- $func="_edit_text";
- $val=isset($data[$key])
- ?$data[$key]
- :(! is_array($fm_defaults[$key])
- ?$fm_defaults[$key]
- :''
- );
- $fm_defaults_key = ""; if (isset($fm_defaults[$key])) $fm_defaults_key = $fm_defaults[$key];
- $ret.=$func($_id++,$key,$fm_defaults_key,$val);
- $ret.="</td><td align=left valign=top><i> ${comment}</i></td></tr>\n";
- }
- elseif($view){
- $func="_view_".$type;
- $val=isset($data[$key])
- ?(function_exists($func)
- ?$func($data[$key])
- :nl2br($data[$key])
- )
- :"--x--";
- $ret.="<tr><td align=left valign=top>${title}: </label></td>";
- $ret.="<td align=left valign=top style='padding-left:.25em;padding-right:.25em;background-color:white;'>".$val;
- $ret.="</td><td align=left valign=top><i> ${comment}</i></td></tr>\n";
- }
- }
+ foreach($fm_struct as $key=>$struct){
+ list($editible,$view,$type,$title,$comment)=$struct;
+ if ($editible){
+ $ret.="<tr><td align=left valign=top><label for=${_id} style='width:20em;'>${title}: </label></td>";
+ $ret.="<td align=left style='padding-left:.25em;padding-right:.25em;background-color:white;'>";
+ $func="_edit_".$type;
+ if (! function_exists($func))
+ $func="_edit_text";
+ $val=isset($data[$key])
+ ?$data[$key]
+ :(! is_array($fm_defaults[$key])
+ ?$fm_defaults[$key]
+ :''
+ );
+ $fm_defaults_key = ""; if (isset($fm_defaults[$key])) $fm_defaults_key = $fm_defaults[$key];
+ $ret.=$func($_id++,$key,$fm_defaults_key,$val);
+ $ret.="</td><td align=left valign=top><i> ${comment}</i></td></tr>\n";
+ }
+ elseif($view){
+ $func="_view_".$type;
+ $val=isset($data[$key])
+ ?(function_exists($func)
+ ?$func($data[$key])
+ :nl2br($data[$key])
+ )
+ :"--x--";
+ $ret.="<tr><td align=left valign=top>${title}: </label></td>";
+ $ret.="<td align=left valign=top style='padding-left:.25em;padding-right:.25em;background-color:white;'>".$val;
+ $ret.="</td><td align=left valign=top><i> ${comment}</i></td></tr>\n";
+ }
+ }
# TODO: pressing enter in the form "clicks" cancel button instead of submit button
- $ret.="<tr><td align=left><input type=submit name=cancel value='Abbrechen'></td><td align=right><input type=submit name=save value='Save'></td><td align=right>";
- if ($id){
- $ret.="<input type=hidden name=edit value='${id}'>";
- }
- $ret.="</td></tr>\n";
- $ret.="</table>\n";
+ $ret.="<tr><td align=left><input type=submit name=cancel value='Abbrechen'></td><td align=right><input type=submit name=save value='Save'></td><td align=right>";
+ if ($id){
+ $ret.="<input type=hidden name=edit value='${id}'>";
+ }
+ $ret.="</td></tr>\n";
+ $ret.="</table>\n";
$ret.="<p />\n";
$ret.="</form>\n";
$ret.="</div>\n";
- return $ret;
+ return $ret;
}
function _edit_text($id,$key,$def_vals,$val=""){
- $val=htmlspecialchars($val);
- return "<input type=text name=${key} id=${id} value='${val}'>";
+ $val=htmlspecialchars($val);
+ return "<input type=text name=${key} id=${id} value='${val}'>";
}
function _edit_password($id,$key,$def_vals,$val=""){
- $val=preg_replace("{.}","*",$val);
- return "<input type=password name=${key} id=${id} value='${val}'>";
+ $val=preg_replace("{.}","*",$val);
+ return "<input type=password name=${key} id=${id} value='${val}'>";
}
function _edit_num($id,$key,$def_vals,$val=""){
- $val=(int)($val);
- return "<input type=text name=${key} id=${id} value='${val}'>";
+ $val=(int)($val);
+ return "<input type=text name=${key} id=${id} value='${val}'>";
}
function _edit_bool($id,$key,$def_vals,$val=""){
- $ret="<input type=checkbox name=${key} id=${id}";
- if ($val)
- $ret.=" checked";
- $ret.=">";
- return $ret;
+ $ret="<input type=checkbox name=${key} id=${id}";
+ if ($val)
+ $ret.=" checked";
+ $ret.=">";
+ return $ret;
}
function _edit_longtext($id,$key,$def_vals,$val=""){
- $val=htmlspecialchars($val);
- return "<textarea name=${key} id=${id} rows=2 style='width:20em;'>${val}</textarea>";
+ $val=htmlspecialchars($val);
+ return "<textarea name=${key} id=${id} rows=2 style='width:20em;'>${val}</textarea>";
}
function _edit_enum($id,$key,$def_vals,$val=""){
- $ret="<select name=${key} id=${id}>";
- foreach($def_vals as $opt_val){
- $ret.="<option";
- if ($opt_val==$val)
- $ret.=" selected";
- $ret.=">${opt_val}</option>\n";
- }
- $ret.="</select>\n";
- return $ret;
+ $ret="<select name=${key} id=${id}>";
+ foreach($def_vals as $opt_val){
+ $ret.="<option";
+ if ($opt_val==$val)
+ $ret.=" selected";
+ $ret.=">${opt_val}</option>\n";
+ }
+ $ret.="</select>\n";
+ return $ret;
}
function _listview_id($val){
- return "<a href='?edit=${val}'> ${val} </a>";
+ return "<a href='?edit=${val}'> ${val} </a>";
}
function _listview_bool($val){
- return $val?"+":"";
+ return $val?"+":"";
}
function _listview_longtext($val){
- return strlen($val)?"Text - ".strlen($val)." chars":"--x--";
+ return strlen($val)?"Text - ".strlen($val)." chars":"--x--";
}
function _listview_text($val){
- return sizeof($val)?$val:"--x--";
+ return sizeof($val)?$val:"--x--";
}
function _listview_password($val){
- return preg_replace("{.}","*",$val);
+ return preg_replace("{.}","*",$val);
}
/* 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-25 22:59:50
|
Revision: 163
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=163&view=rev
Author: christian_boltz
Date: 2007-10-25 15:59:52 -0700 (Thu, 25 Oct 2007)
Log Message:
-----------
The work of two nights causes a long changelog. Here we go:
fetchmail.php:
- IMPORTANT: fixed typo in database column name. If you have created the
fetchmail database already, you have to rename the "pool_time" column
to "poll_time"
- fixed adding of new entries
- don't display status fields (last poll date and result) in edit mode
- validate and quote the GET and POST variables
- show POSTed data again if invalid values were entered (data to display
in the edit form is passed to fetchmail.tpl in $formvars)
- check results of database operations and display error/success
messages
- check owner of target mailbox on all operations
- changed password handling: empty means no change (instead of sending
"******" around)
- reworked and moved around large code portions
- added some TODO notes
fetchmail.tpl:
- use data from $formvars in edit mode instead of parsing the full array
- moved "new entry" below the table
- replaced delete button with delete links
- Note: the boolean fields need testing with PgSQL. Especially test if
they are displayed as active correctly in list and edit mode!
*.lang:
- added several fetchmail-related strings, more to follow
- added $PALANG['please_keep_this_as_last_entry'] which always has to be
the last entry in the language files. This solves the problem that
language-check.sh mixes up the string order when adding strings at the
end of the language files.
- added vim:ft=php
Modified Paths:
--------------
trunk/fetchmail.php
trunk/languages/bg.lang
trunk/languages/ca.lang
trunk/languages/cn.lang
trunk/languages/cs.lang
trunk/languages/da.lang
trunk/languages/de.lang
trunk/languages/en.lang
trunk/languages/es.lang
trunk/languages/et.lang
trunk/languages/eu.lang
trunk/languages/fi.lang
trunk/languages/fo.lang
trunk/languages/fr.lang
trunk/languages/hr.lang
trunk/languages/hu.lang
trunk/languages/is.lang
trunk/languages/it.lang
trunk/languages/lt.lang
trunk/languages/mk.lang
trunk/languages/nl.lang
trunk/languages/nn.lang
trunk/languages/pl.lang
trunk/languages/pt-br.lang
trunk/languages/ru.lang
trunk/languages/sk.lang
trunk/languages/sl.lang
trunk/languages/sv.lang
trunk/languages/tr.lang
trunk/languages/tw.lang
trunk/templates/fetchmail.tpl
Modified: trunk/fetchmail.php
===================================================================
--- trunk/fetchmail.php 2007-10-25 12:29:38 UTC (rev 162)
+++ trunk/fetchmail.php 2007-10-25 22:59:52 UTC (rev 163)
@@ -20,11 +20,17 @@
*
* Template Variables:
*
- * TODO
- *
* Form POST \ GET Variables:
*
- * TODO
+ * GET:
+ * - edit
+ * - delete
+ * - new
+ *
+ * POST:
+ * - save
+ * - cancel
+ * - all editable form values, see $fm_struct
*/
/* new sql table: fetchmail
@@ -37,7 +43,7 @@
src_user varchar(255) not null default '',
src_password varchar(255) not null default '',
src_folder varchar(255) not null default '',
- pool_time int(11) unsigned not null default 10,
+ poll_time int(11) unsigned not null default 10,
fetchall tinyint(1) unsigned not null default 0,
keep tinyint(1) unsigned not null default 0,
protocol enum('POP3','IMAP','POP2','ETRN','AUTO'),
@@ -57,6 +63,16 @@
$extra_options = 0;
if ($CONF['fetchmail_extra_options'] == 'YES') $extra_options = 1;
+# import control GET/POST variables. Form values are imported below.
+$new = (int) safeget ("new") == 1 ? 1:0;
+$edit = (int) safeget ("edit");
+$delete = (int) safeget ("delete");
+$save = safepost("save") != "" ? 1:0;
+$cancel = safepost("cancel") != "" ? 1:0;
+
+$display_status = 1;
+if ($new || $edit) $display_status = 0;
+
$fm_struct=array( // list($editible,$view,$type,$title,$comment)
# first column: allow editing?
# second column: display field?
@@ -67,14 +83,14 @@
"src_user" =>array(1,1,'text', 'User','Remote User'),
"src_password" =>array(1,0,'password', 'Password','Remote Password'),
"src_folder" =>array(1,1,'text', 'Folder','Remote Folder'),
- "pool_time" =>array(1,1,'num', 'Poll','Poll Time (min)'),
+ "poll_time" =>array(1,1,'num', 'Poll','Poll Time (min)'),
"fetchall" =>array(1,1,'bool', 'Fetch All','Retrieve both old (seen) and new messages'),
"keep" =>array(1,1,'bool', 'Keep','Keep retrieved messages on the remote mailserver'),
"protocol" =>array(1,1,'enum', 'Protocol','Protocol to use'),
"extra_options" =>array($extra_options,$extra_options,'longtext', 'Extra Options','Extra fetchmail Options'),
"mda" =>array($extra_options,$extra_options,'longtext', 'MDA','Mail Delivery Agent'),
- "date" =>array(0,1,'text', 'Date','Date of last pooling/configuration change'),
- "returned_text" =>array(0,1,'longtext', 'Returned Text','Text message from last pooling'),
+ "date" => array(0,$display_status,'text', 'Date','Date of last polling/configuration change'),
+ "returned_text" => array(0,$display_status,'longtext', 'Returned Text','Text message from last polling'),
);
$SESSID_USERNAME = authentication_get_username();
@@ -84,7 +100,7 @@
$fm_defaults=array(
"id" =>0,
"mailbox" => array($SESSID_USERNAME),
- "pool_time" =>10,
+ "poll_time" => 10,
"src_auth" =>
array('password','kerberos_v5','kerberos','kerberos_v4','gssapi','cram-md5','otp','ntlm','msn','ssh','any'),
"protocol" =>
@@ -93,9 +109,9 @@
$list_domains = list_domains_for_admin ($SESSID_USERNAME);
-$user_domains=implode("','",array_values($list_domains)); # for displaying
+$user_domains=implode(", ",array_values($list_domains)); # for displaying
$user_domains_sql=implode("','",escape_string(array_values($list_domains))); # for SQL
-$sql="SELECT username FROM mailbox WHERE domain in ('".$user_domains_sql."')";
+$sql="SELECT username FROM mailbox WHERE domain in ('".$user_domains_sql."')"; # TODO: replace with domain selection dropdown
$res = db_query ($sql);
if ($res['rows'] > 0){
@@ -109,56 +125,112 @@
$fm_defaults["mailbox"][]=$SESSID_USERNAME; # TODO: Does this really make sense? Or should we display a message "please create a mailbox first!"?
}
-$new = (int) safeget ("new");
-$edit = (int) safeget ("edit");
-$delete = safepost("delete");
-$save = safepost("save");
-$cancel = safepost("cancel");
+$row_id = 0;
+if ($delete) {
+ $row_id = $delete;
+} elseif ($edit) {
+ $row_id = $edit;
+}
-if ($cancel){
+if ($row_id) {
+ $result = db_query ("SELECT ".implode(",",escape_string(array_keys($fm_struct)))." FROM fetchmail WHERE id=" . $row_id);
+ if ($result['rows'] > 0) {
+ $edit_row = db_array ($result['result']);
+ $account = $edit_row['src_user'] . " @ " . $edit_row['src_server'];
+ }
+
+ $edit_row_domain = explode('@', $edit_row['mailbox']);
+ if ($result['rows'] <= 0 || !check_owner($SESSID_USERNAME, $edit_row_domain[1])) { # owner check for $edit and $delete
+ flash_error(sprintf($PALANG['pFetchmail_error_invalid_id'], $row_id));
+ $edit = 0; $delete = 0;
+ }
+}
+
+
+if ($cancel) {
$edit=0;
-}
-elseif($edit && $save){
- $_vals=array();
+} elseif ($delete) {
+ $result = db_query ("delete from fetchmail WHERE id=".$delete);
+ if ($result['rows'] != 1)
+ {
+ flash_error($PALANG['pDelete_delete_error']) . '</span';
+ } else {
+ flash_info(sprintf($PALANG['pDelete_delete_success'],$account));
+ }
+ $delete=0;
+} elseif ( ($edit || $new) && $save) {
+ $formvars=array();
foreach($fm_struct as $key=>$row){
list($editible,$view,$type,$title,$comment)=$row;
if ($editible != 0){
$func="_inp_".$type;
$val=safepost($key);
- if ($type!="password" || substr($val,0,1)!="*"){
- $_vals[]=$key."='".escape_string(
- function_exists($func)
- ?$func($val)
- :$val)."'";
- }
+ if ($type!="password" || strlen($val) > 0) { # skip on empty (aka unchanged) password
+ $formvars[$key]= escape_string( function_exists($func) ?$func($val) :$val);
+ }
}
}
- $sql="UPDATE fetchmail SET ".implode(",",$_vals).",returned_text='' WHERE id=".$edit;
- $res= db_query ($sql);
+ $formvars['id'] = $edit; # results in 0 on $new
+
+ if (!in_array($formvars['mailbox'], $fm_defaults['mailbox'])) {
+ flash_error($PALANG['pFetchmail_invalid_mailbox']);
+ $save = 0;
+ }
+ if ($formvars['src_server'] == '') {
+ flash_error($PALANG['pFetchmail_server_missing']);
+ # TODO: validate domain name
+ $save = 0;
+ }
+ if (empty($formvars['src_user']) ) {
+ flash_error($PALANG['pFetchmail_user_missing']);
+ $save = 0;
+ }
+ if ($new && empty($formvars['src_password']) ) {
+ flash_error($PALANG['pFetchmail_password_missing']);
+ $save = 0;
+ }
+
+ if ($save) {
+ if ($new) {
+ $sql="INSERT fetchmail (".implode(",",escape_string(array_keys($formvars))).") VALUES ('".implode("','",escape_string($formvars))."')";
+ } else { # $edit
+ foreach(array_keys($formvars) as $key) {
+ $formvars[$key] = escape_string($key) . "='" . escape_string($formvars[$key]) . "'";
+ }
+ $sql="UPDATE fetchmail SET ".implode(",",$formvars).",returned_text='', date=NOW() WHERE id=".$edit;
+ }
+ $result = db_query ($sql);
+ if ($result['rows'] != 1)
+ {
+ flash_error($PALANG['pFetchmail_database_save_error']);
+ } else {
+ flash_info($PALANG['pFetchmail_database_save_success']);
+ $edit = 0; $new = 0; # display list after saving
+ }
+ } else {
+ $formvars['src_password'] = ''; # never display password
+ }
+
+} elseif ($edit) {
+ $formvars = $edit_row;
+ $formvars['src_password'] = '';
+} elseif ($new) {
+ foreach (array_keys($fm_struct) as $value) {
+ if (isset($fm_defaults[$value])) {
+ $formvars[$value] = $fm_defaults[$value];
+ } else {
+ $formvars[$value] = '';
+ }
+ }
}
-elseif($delete){
- db_query ("delete from fetchmail WHERE id=".$edit);
- $edit=0;
-}
-elseif ($new){
- $_keys=array();
- $_vals=array();
- foreach($fm_defaults as $key=>$val){
- $_keys[]=$key;
- $_vals[]="'".(is_array($val)?$val[0]:$val)."'";
- }
- $sql="INSERT fetchmail (".implode(",",escape_string($_keys)).") VALUES (".implode(",",escape_string($_vals)).")";
- $res= db_query ($sql);
- $sql="SELECT id FROM fetchmail order by id desc limit 1";
- $res= db_query ($sql);
- list($edit)=mysql_fetch_row($res['result']);
-}
-$res = db_query ("SELECT ".implode(",",escape_string(array_keys($fm_struct)))." FROM fetchmail order by id desc");
-if ($res['rows'] > 0){
- while ($row = db_array ($res['result'])){
- $tFmail[] = $row;
- }
+if ($edit + $new == 0) { # display list
+ $res = db_query ("SELECT ".implode(",",escape_string(array_keys($fm_struct)))." FROM fetchmail order by id desc");
+ if ($res['rows'] > 0) {
+ while ($row = db_array ($res['result'])) {
+ $tFmail[] = $row;
+ }
+ }
}
function _inp_num($val){
@@ -178,4 +250,5 @@
include ("./templates/fetchmail.tpl");
include ("./templates/footer.tpl");
+/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/languages/bg.lang
===================================================================
--- trunk/languages/bg.lang 2007-10-25 12:29:38 UTC (rev 162)
+++ trunk/languages/bg.lang 2007-10-25 22:59:52 UTC (rev 163)
@@ -73,6 +73,7 @@
$PALANG['pOverview_get_modified'] = 'Ïîñëåäíî ìîäèôèöèðàí';
$PALANG['pDelete_delete_error'] = '<span class="error_msg">Íå ìîãà äà èçòðèÿ çàïèñà ';
+$PALANG['pDelete_delete_success'] = '%s deleted.'; # XXX
$PALANG['pDelete_postdelete_error'] = '<span class="error_msg">Unable to remove mailbox '; # XXX
$PALANG['pDelete_domain_error'] = '<span class="error_msg">Òîçè äîìåéí íå å âàø! ';
$PALANG['pDelete_alias_error'] = '<span class="error_msg">Unable to delete alias '; # XXX
@@ -319,6 +320,13 @@
$PALANG['pUsersVacation_result_success'] = 'Âàøèÿò àâòîìàòè÷åí îòãîâîð áåøå ïðåìàõíàò!';
$PALANG['pCreate_dbLog_createmailbox'] = 'create mailbox';
+$PALANG['pFetchmail_database_save_error'] = 'Could not save this entry in the database!'; # XXX
+$PALANG['pFetchmail_database_save_success'] = 'Entry saved in database.'; # XXX
+$PALANG['pFetchmail_error_invalid_id'] = 'No entry with ID %s found!'; # XXX
+$PALANG['pFetchmail_invalid_mailbox'] = 'Invalid mailbox!'; # XXX
+$PALANG['pFetchmail_server_missing'] = 'Please enter the remote server name!'; # XXX
+$PALANG['pFetchmail_user_missing'] = 'Please enter the remote username!'; # XXX
+$PALANG['pFetchmail_password_missing'] = 'Please enter the remote password!'; # XXX
$PALANG['pCreate_dbLog_createalias'] = 'create alias';
$PALANG['pDelete_dbLog_deletealias'] = 'delete alias';
$PALANG['pDelete_dbLog_deletemailbox'] = 'delete mailbox';
@@ -346,5 +354,6 @@
$PALANG['pFetchmail_welcome'] = 'Fetch mail for:'; # XXX
$PALANG['pFetchmail_new_entry'] = 'New entry'; # XXX
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
+$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
+/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/languages/ca.lang
===================================================================
--- trunk/languages/ca.lang 2007-10-25 12:29:38 UTC (rev 162)
+++ trunk/languages/ca.lang 2007-10-25 22:59:52 UTC (rev 163)
@@ -72,6 +72,7 @@
$PALANG['pOverview_get_modified'] = 'Última Modificació';
$PALANG['pDelete_delete_error'] = '<span class="error_msg">Imposible borrar el registre ';
+$PALANG['pDelete_delete_success'] = '%s deleted.'; # XXX
$PALANG['pDelete_postdelete_error'] = '<span class="error_msg">Unable to remove mailbox '; # XXX
$PALANG['pDelete_domain_error'] = '<span class="error_msg">Aquest domini no et pertany ';
$PALANG['pDelete_alias_error'] = '<span class="error_msg">Unable to delete alias '; # XXX
@@ -318,6 +319,13 @@
$PALANG['pUsersVacation_result_error'] = '<span class="error_msg">Imposible actualitzar la configuració de la seva resposta automàtica!</span>';
$PALANG['pUsersVacation_result_success'] = 'La seva resposta automàtica ha estat esborrada!';
+$PALANG['pFetchmail_database_save_error'] = 'Could not save this entry in the database!'; # XXX
+$PALANG['pFetchmail_database_save_success'] = 'Entry saved in database.'; # XXX
+$PALANG['pFetchmail_error_invalid_id'] = 'No entry with ID %s found!'; # XXX
+$PALANG['pFetchmail_invalid_mailbox'] = 'Invalid mailbox!'; # XXX
+$PALANG['pFetchmail_server_missing'] = 'Please enter the remote server name!'; # XXX
+$PALANG['pFetchmail_user_missing'] = 'Please enter the remote username!'; # XXX
+$PALANG['pFetchmail_password_missing'] = 'Please enter the remote password!'; # XXX
$PALANG['pCreate_dbLog_createmailbox'] = 'create mailbox';
$PALANG['pCreate_dbLog_createalias'] = 'create alias';
$PALANG['pDelete_dbLog_deletealias'] = 'delete alias';
@@ -346,5 +354,6 @@
$PALANG['pFetchmail_welcome'] = 'Fetch mail for:'; # XXX
$PALANG['pFetchmail_new_entry'] = 'New entry'; # XXX
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
+$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
+/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/languages/cn.lang
===================================================================
--- trunk/languages/cn.lang 2007-10-25 12:29:38 UTC (rev 162)
+++ trunk/languages/cn.lang 2007-10-25 22:59:52 UTC (rev 163)
@@ -73,6 +73,7 @@
$PALANG['pOverview_get_modified'] = '最后修改日期';
$PALANG['pDelete_delete_error'] = '<span class="error_msg">不能删除本记录';
+$PALANG['pDelete_delete_success'] = '%s deleted.'; # XXX
$PALANG['pDelete_postdelete_error'] = '<span class="error_msg">Unable to remove mailbox '; # XXX
$PALANG['pDelete_domain_error'] = '<span class="error_msg">你没有该域的管理权限';
$PALANG['pDelete_alias_error'] = '<span class="error_msg">Unable to delete alias '; # XXX
@@ -319,6 +320,13 @@
$PALANG['pUsersVacation_result_success'] = '你的自动回复已经关闭!';
$PALANG['pCreate_dbLog_createmailbox'] = '新建邮箱';
+$PALANG['pFetchmail_database_save_error'] = 'Could not save this entry in the database!'; # XXX
+$PALANG['pFetchmail_database_save_success'] = 'Entry saved in database.'; # XXX
+$PALANG['pFetchmail_error_invalid_id'] = 'No entry with ID %s found!'; # XXX
+$PALANG['pFetchmail_invalid_mailbox'] = 'Invalid mailbox!'; # XXX
+$PALANG['pFetchmail_server_missing'] = 'Please enter the remote server name!'; # XXX
+$PALANG['pFetchmail_user_missing'] = 'Please enter the remote username!'; # XXX
+$PALANG['pFetchmail_password_missing'] = 'Please enter the remote password!'; # XXX
$PALANG['pCreate_dbLog_createalias'] = '新建别名';
$PALANG['pDelete_dbLog_deletealias'] = '删除别名';
$PALANG['pDelete_dbLog_deletemailbox'] = '邮件邮箱';
@@ -346,5 +354,6 @@
$PALANG['pFetchmail_welcome'] = 'Fetch mail for:'; # XXX
$PALANG['pFetchmail_new_entry'] = 'New entry'; # XXX
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
+$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
+/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/languages/cs.lang
===================================================================
--- trunk/languages/cs.lang 2007-10-25 12:29:38 UTC (rev 162)
+++ trunk/languages/cs.lang 2007-10-25 22:59:52 UTC (rev 163)
@@ -76,6 +76,7 @@
$PALANG['pOverview_get_modified'] = 'Naposledy změněno';
$PALANG['pDelete_delete_error'] = '<span class="error_msg">Nelze smazat položku ';
+$PALANG['pDelete_delete_success'] = '%s deleted.'; # XXX
$PALANG['pDelete_postdelete_error'] = '<span class="error_msg">Nelze odstranit schránku ';
$PALANG['pDelete_domain_error'] = '<span class="error_msg">Tato doména není vaše ';
$PALANG['pDelete_alias_error'] = '<span class="error_msg">Nelze odstranit přesměrování ';
@@ -322,6 +323,13 @@
EOM;
$PALANG['pUsersVacation_button_away'] = 'Odjet pryč';
$PALANG['pUsersVacation_button_back'] = 'Vrátit se';
+$PALANG['pFetchmail_database_save_error'] = 'Could not save this entry in the database!'; # XXX
+$PALANG['pFetchmail_database_save_success'] = 'Entry saved in database.'; # XXX
+$PALANG['pFetchmail_error_invalid_id'] = 'No entry with ID %s found!'; # XXX
+$PALANG['pFetchmail_invalid_mailbox'] = 'Invalid mailbox!'; # XXX
+$PALANG['pFetchmail_server_missing'] = 'Please enter the remote server name!'; # XXX
+$PALANG['pFetchmail_user_missing'] = 'Please enter the remote username!'; # XXX
+$PALANG['pFetchmail_password_missing'] = 'Please enter the remote password!'; # XXX
$PALANG['pUsersVacation_result_error'] = '<span class="error_msg">Nepodařilo se upravit nastavení!</span>';
$PALANG['pUsersVacation_result_success'] = 'Nastavení bylo upraveno!';
@@ -356,5 +364,6 @@
$PALANG['pFetchmail_welcome'] = 'Fetch mail for:'; # XXX
$PALANG['pFetchmail_new_entry'] = 'New entry'; # XXX
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
+$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
+/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/languages/da.lang
===================================================================
--- trunk/languages/da.lang 2007-10-25 12:29:38 UTC (rev 162)
+++ trunk/languages/da.lang 2007-10-25 22:59:52 UTC (rev 163)
@@ -73,6 +73,7 @@
$PALANG['pOverview_get_modified'] = 'Senest rettet';
$PALANG['pDelete_delete_error'] = '<span class="error_msg">Kan ikke slette denne post ';
+$PALANG['pDelete_delete_success'] = '%s deleted.'; # XXX
$PALANG['pDelete_postdelete_error'] = '<span class="error_msg">Kunne ikke fjerne postkassen ';
$PALANG['pDelete_domain_error'] = '<span class="error_msg">Dette domæne er ikke dit ';
$PALANG['pDelete_alias_error'] = '<span class="error_msg">Unable to delete alias '; # XXX
@@ -319,6 +320,13 @@
$PALANG['pUsersVacation_result_error'] = '<span class="error_msg">Kan ikke opdatere dine autosvar indstillinger!</span>';
$PALANG['pUsersVacation_result_success'] = 'Dit autosvar er fjernet!';
+$PALANG['pFetchmail_database_save_error'] = 'Could not save this entry in the database!'; # XXX
+$PALANG['pFetchmail_database_save_success'] = 'Entry saved in database.'; # XXX
+$PALANG['pFetchmail_error_invalid_id'] = 'No entry with ID %s found!'; # XXX
+$PALANG['pFetchmail_invalid_mailbox'] = 'Invalid mailbox!'; # XXX
+$PALANG['pFetchmail_server_missing'] = 'Please enter the remote server name!'; # XXX
+$PALANG['pFetchmail_user_missing'] = 'Please enter the remote username!'; # XXX
+$PALANG['pFetchmail_password_missing'] = 'Please enter the remote password!'; # XXX
$PALANG['pCreate_dbLog_createmailbox'] = 'create mailbox';
$PALANG['pCreate_dbLog_createalias'] = 'create alias';
$PALANG['pDelete_dbLog_deletealias'] = 'delete alias';
@@ -347,5 +355,6 @@
$PALANG['pFetchmail_welcome'] = 'Fetch mail for:'; # XXX
$PALANG['pFetchmail_new_entry'] = 'New entry'; # XXX
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
+$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
+/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/languages/de.lang
===================================================================
--- trunk/languages/de.lang 2007-10-25 12:29:38 UTC (rev 162)
+++ trunk/languages/de.lang 2007-10-25 22:59:52 UTC (rev 163)
@@ -74,6 +74,7 @@
$PALANG['pOverview_get_modified'] = 'Zuletzt verändert';
$PALANG['pDelete_delete_error'] = '<span class="error_msg">Eintrag konnte nicht gelöscht werden ';
+$PALANG['pDelete_delete_success'] = '%s gelöscht.';
$PALANG['pDelete_postdelete_error'] = '<span class="error_msg">Mailbox konnte nicht gelöscht werden ';
$PALANG['pDelete_domain_error'] = '<span class="error_msg">Diese Domain gehört nicht Ihnen ';
$PALANG['pDelete_alias_error'] = '<span class="error_msg">Alias konnte nicht gelöscht werden ';
@@ -355,8 +356,15 @@
$PALANG['pPasswordTooShort'] = "Das Passwort ist zu kurz - mindestens %s Zeichen benötigt";
$PALANG['pFetchmail_welcome'] = 'E-Mail Abruf für: ';
-
$PALANG['pFetchmail_new_entry'] = 'Neuer Eintrag';
+$PALANG['pFetchmail_database_save_error'] = 'Eintrag konnte nicht in der Datenbank gespeichert werden!';
+$PALANG['pFetchmail_database_save_success'] = 'Eintrag wurde in der Datenbank gespeichert';
+$PALANG['pFetchmail_error_invalid_id'] = 'Kein Eintrag mit ID %s gefunden!';
+$PALANG['pFetchmail_invalid_mailbox'] = 'Ungültiges Postfach!';
+$PALANG['pFetchmail_server_missing'] = 'Bitte geben Sie den Namen des Servers ein!';
+$PALANG['pFetchmail_user_missing'] = 'Bitte geben Sie den Benutzernamen ein!';
+$PALANG['pFetchmail_password_missing'] = 'Bitte geben Sie das Passwort ein!';
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
+$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
+/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/languages/en.lang
===================================================================
--- trunk/languages/en.lang 2007-10-25 12:29:38 UTC (rev 162)
+++ trunk/languages/en.lang 2007-10-25 22:59:52 UTC (rev 163)
@@ -76,6 +76,7 @@
$PALANG['pOverview_get_modified'] = 'Last Modified';
$PALANG['pDelete_delete_error'] = '<span class="error_msg">Unable to delete the entry ';
+$PALANG['pDelete_delete_success'] = '%s deleted.';
$PALANG['pDelete_postdelete_error'] = '<span class="error_msg">Unable to remove mailbox ';
$PALANG['pDelete_domain_error'] = '<span class="error_msg">This domain is not yours ';
$PALANG['pDelete_alias_error'] = '<span class="error_msg">Unable to delete alias ';
@@ -357,7 +358,14 @@
$PALANG['pFetchmail_welcome'] = 'Fetch mail for:';
$PALANG['pFetchmail_new_entry'] = 'New entry';
+$PALANG['pFetchmail_database_save_error'] = 'Could not save this entry in the database!';
+$PALANG['pFetchmail_database_save_success'] = 'Entry saved in database.';
+$PALANG['pFetchmail_error_invalid_id'] = 'No entry with ID %s found!';
+$PALANG['pFetchmail_invalid_mailbox'] = 'Invalid mailbox!';
+$PALANG['pFetchmail_server_missing'] = 'Please enter the remote server name!';
+$PALANG['pFetchmail_user_missing'] = 'Please enter the remote username!';
+$PALANG['pFetchmail_password_missing'] = 'Please enter the remote password!';
-
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
+$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
+/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/languages/es.lang
===================================================================
--- trunk/languages/es.lang 2007-10-25 12:29:38 UTC (rev 162)
+++ trunk/languages/es.lang 2007-10-25 22:59:52 UTC (rev 163)
@@ -72,6 +72,7 @@
$PALANG['pOverview_get_modified'] = 'Última Modificación';
$PALANG['pDelete_delete_error'] = '<span class="error_msg">Imposible borrar el registro ';
+$PALANG['pDelete_delete_success'] = '%s deleted.'; # XXX
$PALANG['pDelete_postdelete_error'] = '<span class="error_msg">Unable to remove mailbox '; # XXX
$PALANG['pDelete_domain_error'] = '<span class="error_msg">Este dominio no le pertenece ';
$PALANG['pDelete_alias_error'] = '<span class="error_msg">Unable to delete alias '; # XXX
@@ -318,6 +319,13 @@
$PALANG['pUsersVacation_button_back'] = 'De vuelta';
$PALANG['pUsersVacation_result_error'] = '<span class="error_msg">¡Imposible actualizar la configuración de su respuesta automática!</span>';
$PALANG['pUsersVacation_result_success'] = '¡Su respuesta automática ha sido borrada!';
+$PALANG['pFetchmail_database_save_error'] = 'Could not save this entry in the database!'; # XXX
+$PALANG['pFetchmail_database_save_success'] = 'Entry saved in database.'; # XXX
+$PALANG['pFetchmail_error_invalid_id'] = 'No entry with ID %s found!'; # XXX
+$PALANG['pFetchmail_invalid_mailbox'] = 'Invalid mailbox!'; # XXX
+$PALANG['pFetchmail_server_missing'] = 'Please enter the remote server name!'; # XXX
+$PALANG['pFetchmail_user_missing'] = 'Please enter the remote username!'; # XXX
+$PALANG['pFetchmail_password_missing'] = 'Please enter the remote password!'; # XXX
$PALANG['pCreate_dbLog_createmailbox'] = 'create mailbox';
$PALANG['pCreate_dbLog_createalias'] = 'create alias';
@@ -347,5 +355,6 @@
$PALANG['pFetchmail_welcome'] = 'Fetch mail for:'; # XXX
$PALANG['pFetchmail_new_entry'] = 'New entry'; # XXX
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
+$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
+/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/languages/et.lang
===================================================================
--- trunk/languages/et.lang 2007-10-25 12:29:38 UTC (rev 162)
+++ trunk/languages/et.lang 2007-10-25 22:59:52 UTC (rev 163)
@@ -73,6 +73,7 @@
$PALANG['pOverview_get_modified'] = 'Viimati muudetud';
$PALANG['pDelete_delete_error'] = '<span class="error_msg">Kustutamine ebaõnnestus. Kirje: ';
+$PALANG['pDelete_delete_success'] = '%s deleted.'; # XXX
$PALANG['pDelete_postdelete_error'] = '<span class="error_msg">Unable to remove mailbox '; # XXX
$PALANG['pDelete_domain_error'] = '<span class="error_msg">Puuduvad õigused. Domeen: ';
$PALANG['pDelete_alias_error'] = '<span class="error_msg">Unable to delete alias '; # XXX
@@ -319,6 +320,13 @@
$PALANG['pUsersVacation_button_away'] = 'Olen eemal alates';
$PALANG['pUsersVacation_button_back'] = 'Tulen tagasi';
$PALANG['pUsersVacation_result_error'] = '<span class="error_msg">Automaatse vastuse uuendamine ebaõnnestus!</span>';
+$PALANG['pFetchmail_database_save_error'] = 'Could not save this entry in the database!'; # XXX
+$PALANG['pFetchmail_database_save_success'] = 'Entry saved in database.'; # XXX
+$PALANG['pFetchmail_error_invalid_id'] = 'No entry with ID %s found!'; # XXX
+$PALANG['pFetchmail_invalid_mailbox'] = 'Invalid mailbox!'; # XXX
+$PALANG['pFetchmail_server_missing'] = 'Please enter the remote server name!'; # XXX
+$PALANG['pFetchmail_user_missing'] = 'Please enter the remote username!'; # XXX
+$PALANG['pFetchmail_password_missing'] = 'Please enter the remote password!'; # XXX
$PALANG['pUsersVacation_result_success'] = 'Automaatne vastus on eemaldatud!';
$PALANG['pCreate_dbLog_createmailbox'] = 'postkasti loomine';
@@ -350,5 +358,6 @@
$PALANG['pFetchmail_welcome'] = 'Fetch mail for:'; # XXX
$PALANG['pFetchmail_new_entry'] = 'New entry'; # XXX
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
+$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
+/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/languages/eu.lang
===================================================================
--- trunk/languages/eu.lang 2007-10-25 12:29:38 UTC (rev 162)
+++ trunk/languages/eu.lang 2007-10-25 22:59:52 UTC (rev 163)
@@ -72,6 +72,7 @@
$PALANG['pOverview_get_modified'] = 'Azken aldaketa';
$PALANG['pDelete_delete_error'] = '<span class="error_msg">Ezinezkoa sarrera ezabatzea ';
+$PALANG['pDelete_delete_success'] = '%s deleted.'; # XXX
$PALANG['pDelete_postdelete_error'] = '<span class="error_msg">Unable to remove mailbox '; # XXX
$PALANG['pDelete_domain_error'] = '<span class="error_msg">Ez zara domeinu honen jabe';
$PALANG['pDelete_alias_error'] = '<span class="error_msg">Unable to delete alias '; # XXX
@@ -318,6 +319,13 @@
$PALANG['pUsersVacation_result_success'] = 'Zure erantzun automatikoa borratu da!';
$PALANG['pCreate_dbLog_createmailbox'] = 'create mailbox';
+$PALANG['pFetchmail_database_save_error'] = 'Could not save this entry in the database!'; # XXX
+$PALANG['pFetchmail_database_save_success'] = 'Entry saved in database.'; # XXX
+$PALANG['pFetchmail_error_invalid_id'] = 'No entry with ID %s found!'; # XXX
+$PALANG['pFetchmail_invalid_mailbox'] = 'Invalid mailbox!'; # XXX
+$PALANG['pFetchmail_server_missing'] = 'Please enter the remote server name!'; # XXX
+$PALANG['pFetchmail_user_missing'] = 'Please enter the remote username!'; # XXX
+$PALANG['pFetchmail_password_missing'] = 'Please enter the remote password!'; # XXX
$PALANG['pCreate_dbLog_createalias'] = 'create alias';
$PALANG['pDelete_dbLog_deletealias'] = 'delete alias';
$PALANG['pDelete_dbLog_deletemailbox'] = 'delete mailbox';
@@ -345,5 +353,6 @@
$PALANG['pFetchmail_welcome'] = 'Fetch mail for:'; # XXX
$PALANG['pFetchmail_new_entry'] = 'New entry'; # XXX
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
+$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
+/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/languages/fi.lang
===================================================================
--- trunk/languages/fi.lang 2007-10-25 12:29:38 UTC (rev 162)
+++ trunk/languages/fi.lang 2007-10-25 22:59:52 UTC (rev 163)
@@ -73,6 +73,7 @@
$PALANG['pOverview_get_modified'] = 'Viimeksi muokattu';
$PALANG['pDelete_delete_error'] = '<span class="error_msg">Tietueen poisto ei onnistu ';
+$PALANG['pDelete_delete_success'] = '%s deleted.'; # XXX
$PALANG['pDelete_postdelete_error'] = '<span class="error_msg">Unable to remove mailbox '; # XXX
$PALANG['pDelete_domain_error'] = '<span class="error_msg">Tämä ei ole sinun domainisi ';
$PALANG['pDelete_alias_error'] = '<span class="error_msg">Unable to delete alias '; # XXX
@@ -319,6 +320,13 @@
$PALANG['pCreate_dbLog_createmailbox'] = 'create mailbox';
$PALANG['pCreate_dbLog_createalias'] = 'create alias';
+$PALANG['pFetchmail_database_save_error'] = 'Could not save this entry in the database!'; # XXX
+$PALANG['pFetchmail_database_save_success'] = 'Entry saved in database.'; # XXX
+$PALANG['pFetchmail_error_invalid_id'] = 'No entry with ID %s found!'; # XXX
+$PALANG['pFetchmail_invalid_mailbox'] = 'Invalid mailbox!'; # XXX
+$PALANG['pFetchmail_server_missing'] = 'Please enter the remote server name!'; # XXX
+$PALANG['pFetchmail_user_missing'] = 'Please enter the remote username!'; # XXX
+$PALANG['pFetchmail_password_missing'] = 'Please enter the remote password!'; # XXX
$PALANG['pDelete_dbLog_deletealias'] = 'delete alias';
$PALANG['pDelete_dbLog_deletemailbox'] = 'delete mailbox';
@@ -345,5 +353,6 @@
$PALANG['pFetchmail_welcome'] = 'Fetch mail for:'; # XXX
$PALANG['pFetchmail_new_entry'] = 'New entry'; # XXX
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
+$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
+/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/languages/fo.lang
===================================================================
--- trunk/languages/fo.lang 2007-10-25 12:29:38 UTC (rev 162)
+++ trunk/languages/fo.lang 2007-10-25 22:59:52 UTC (rev 163)
@@ -73,6 +73,7 @@
$PALANG['pOverview_get_modified'] = 'Síðst broytt';
$PALANG['pDelete_delete_error'] = '<span class="error_msg">Fái ikki strikað ';
+$PALANG['pDelete_delete_success'] = '%s deleted.'; # XXX
$PALANG['pDelete_postdelete_error'] = '<span class="error_msg">Unable to remove mailbox '; # XXX
$PALANG['pDelete_domain_error'] = '<span class="error_msg">Hetta er ikki títt navnaøki ';
$PALANG['pDelete_alias_error'] = '<span class="error_msg">Unable to delete alias '; # XXX
@@ -319,6 +320,13 @@
Títt navn
EOM;
$PALANG['pUsersVacation_button_away'] = 'Burtur';
+$PALANG['pFetchmail_database_save_error'] = 'Could not save this entry in the database!'; # XXX
+$PALANG['pFetchmail_database_save_success'] = 'Entry saved in database.'; # XXX
+$PALANG['pFetchmail_error_invalid_id'] = 'No entry with ID %s found!'; # XXX
+$PALANG['pFetchmail_invalid_mailbox'] = 'Invalid mailbox!'; # XXX
+$PALANG['pFetchmail_server_missing'] = 'Please enter the remote server name!'; # XXX
+$PALANG['pFetchmail_user_missing'] = 'Please enter the remote username!'; # XXX
+$PALANG['pFetchmail_password_missing'] = 'Please enter the remote password!'; # XXX
$PALANG['pUsersVacation_button_back'] = 'Heima';
$PALANG['pUsersVacation_result_error'] = '<span class="error_msg">Fái ikki broytt tínar frítíðarboð uppsetingar!</span>';
$PALANG['pUsersVacation_result_success'] = 'Títt frítíðarboð er strikað!';
@@ -351,5 +359,6 @@
$PALANG['pFetchmail_welcome'] = 'Fetch mail for:'; # XXX
$PALANG['pFetchmail_new_entry'] = 'New entry'; # XXX
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
+$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
+/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/languages/fr.lang
===================================================================
--- trunk/languages/fr.lang 2007-10-25 12:29:38 UTC (rev 162)
+++ trunk/languages/fr.lang 2007-10-25 22:59:52 UTC (rev 163)
@@ -75,6 +75,7 @@
$PALANG['pOverview_get_modified'] = 'Dernière Modification';
$PALANG['pDelete_delete_error'] = '<span class="error_msg">Impossible d\'effacer cette entrée ';
+$PALANG['pDelete_delete_success'] = '%s deleted.'; # XXX
$PALANG['pDelete_postdelete_error'] = '<span class="error_msg">Impossible d\'effacer ce compte courriel';
$PALANG['pDelete_domain_error'] = '<span class="error_msg">Ce domaine n\'est pas le votre ';
$PALANG['pDelete_alias_error'] = '<span class="error_msg">Impossible d\'effacer cet alias ';
@@ -321,6 +322,13 @@
$PALANG['pUsersVacation_result_success'] = 'Votre réponse automatique a été enlevée!';
$PALANG['pCreate_dbLog_createmailbox'] = 'Création de compte';
+$PALANG['pFetchmail_database_save_error'] = 'Could not save this entry in the database!'; # XXX
+$PALANG['pFetchmail_database_save_success'] = 'Entry saved in database.'; # XXX
+$PALANG['pFetchmail_error_invalid_id'] = 'No entry with ID %s found!'; # XXX
+$PALANG['pFetchmail_invalid_mailbox'] = 'Invalid mailbox!'; # XXX
+$PALANG['pFetchmail_server_missing'] = 'Please enter the remote server name!'; # XXX
+$PALANG['pFetchmail_user_missing'] = 'Please enter the remote username!'; # XXX
+$PALANG['pFetchmail_password_missing'] = 'Please enter the remote password!'; # XXX
$PALANG['pCreate_dbLog_createalias'] = 'Création d\'alias';
$PALANG['pDelete_dbLog_deletealias'] = 'Suppression d\'alias';
$PALANG['pDelete_dbLog_deletemailbox'] = 'Suppression de compte';
@@ -348,5 +356,6 @@
$PALANG['pFetchmail_welcome'] = 'Récupérer le courrier pour :';
$PALANG['pFetchmail_new_entry'] = 'Nouvelle entrée';
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
+$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
+/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/languages/hr.lang
===================================================================
--- trunk/languages/hr.lang 2007-10-25 12:29:38 UTC (rev 162)
+++ trunk/languages/hr.lang 2007-10-25 22:59:52 UTC (rev 163)
@@ -72,6 +72,7 @@
$PALANG['pOverview_get_modified'] = 'Zadnja promjena';
$PALANG['pDelete_delete_error'] = '<span class="error_msg">Unos nije bilo moguče izbrisati ';
+$PALANG['pDelete_delete_success'] = '%s deleted.'; # XXX
$PALANG['pDelete_postdelete_error'] = '<span class="error_msg">Unable to remove mailbox '; # XXX
$PALANG['pDelete_domain_error'] = '<span class="error_msg">Izabrana domena nije pod vaim nadzorom ';
$PALANG['pDelete_alias_error'] = '<span class="error_msg">Unable to delete alias '; # XXX
@@ -318,6 +319,13 @@
$PALANG['pUsersVacation_result_success'] = 'Obvijest o odsutnosti je uklonjena!';
$PALANG['pCreate_dbLog_createmailbox'] = 'stvori potanski ormarić';
+$PALANG['pFetchmail_database_save_error'] = 'Could not save this entry in the database!'; # XXX
+$PALANG['pFetchmail_database_save_success'] = 'Entry saved in database.'; # XXX
+$PALANG['pFetchmail_error_invalid_id'] = 'No entry with ID %s found!'; # XXX
+$PALANG['pFetchmail_invalid_mailbox'] = 'Invalid mailbox!'; # XXX
+$PALANG['pFetchmail_server_missing'] = 'Please enter the remote server name!'; # XXX
+$PALANG['pFetchmail_user_missing'] = 'Please enter the remote username!'; # XXX
+$PALANG['pFetchmail_password_missing'] = 'Please enter the remote password!'; # XXX
$PALANG['pCreate_dbLog_createalias'] = 'stvori alias';
$PALANG['pDelete_dbLog_deletealias'] = 'pobrii alias';
$PALANG['pDelete_dbLog_deletemailbox'] = 'pobrii potanski ormarić';
@@ -345,5 +353,6 @@
$PALANG['pFetchmail_new_entry'] = 'New entry'; # XXX
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
+$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
+/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/languages/hu.lang
===================================================================
--- trunk/languages/hu.lang 2007-10-25 12:29:38 UTC (rev 162)
+++ trunk/languages/hu.lang 2007-10-25 22:59:52 UTC (rev 163)
@@ -75,6 +75,7 @@
$PALANG['pOverview_get_modified'] = 'Utolsó módosítás';
$PALANG['pDelete_delete_error'] = '<span class="error_msg">Nem sikerült törölni a bejegyzést ';
+$PALANG['pDelete_delete_success'] = '%s deleted.'; # XXX
$PALANG['pDelete_postdelete_error'] = '<span class="error_msg">Nem sikerült törölni a mailbox-ot ';
$PALANG['pDelete_domain_error'] = '<span class="error_msg">Ehhez a domainhez nincs jogosultságod ';
$PALANG['pDelete_alias_error'] = '<span class="error_msg">Nem sikerült törölni az alias-t ';
@@ -321,6 +322,13 @@
Ez egy automatikus üzenet.
EOM;
+$PALANG['pFetchmail_database_save_error'] = 'Could not save this entry in the database!'; # XXX
+$PALANG['pFetchmail_database_save_success'] = 'Entry saved in database.'; # XXX
+$PALANG['pFetchmail_error_invalid_id'] = 'No entry with ID %s found!'; # XXX
+$PALANG['pFetchmail_invalid_mailbox'] = 'Invalid mailbox!'; # XXX
+$PALANG['pFetchmail_server_missing'] = 'Please enter the remote server name!'; # XXX
+$PALANG['pFetchmail_user_missing'] = 'Please enter the remote username!'; # XXX
+$PALANG['pFetchmail_password_missing'] = 'Please enter the remote password!'; # XXX
$PALANG['pUsersVacation_button_away'] = 'Automatikus válaszadás bekapcsolása';
$PALANG['pUsersVacation_button_back'] = 'Automatikus válaszadás kikapcsolása';
$PALANG['pUsersVacation_result_error'] = '<span class="error_msg">Nem sikerült megváltoztatni az automatikus válasz konfigurációdat!</span>';
@@ -360,5 +368,6 @@
$PALANG['pFetchmail_new_entry'] = 'Új bejegyzés';
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
+$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
+/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/languages/is.lang
===================================================================
--- trunk/languages/is.lang 2007-10-25 12:29:38 UTC (rev 162)
+++ trunk/languages/is.lang 2007-10-25 22:59:52 UTC (rev 163)
@@ -73,6 +73,7 @@
$PALANG['pOverview_get_modified'] = 'Síðast breytt';
$PALANG['pDelete_delete_error'] = '<span class="error_msg">Get ekki eytt færslunni ';
+$PALANG['pDelete_delete_success'] = '%s deleted.'; # XXX
$PALANG['pDelete_postdelete_error'] = '<span class="error_msg">Unable to remove mailbox '; # XXX
$PALANG['pDelete_domain_error'] = '<span class="error_msg">Þetta er ekki þitt lén ';
$PALANG['pDelete_alias_error'] = '<span class="error_msg">Unable to delete alias '; # XXX
@@ -319,6 +320,13 @@
$PALANG['pCreate_dbLog_createmailbox'] = 'create mailbox';
$PALANG['pCreate_dbLog_createalias'] = 'create alias';
+$PALANG['pFetchmail_database_save_error'] = 'Could not save this entry in the database!'; # XXX
+$PALANG['pFetchmail_database_save_success'] = 'Entry saved in database.'; # XXX
+$PALANG['pFetchmail_error_invalid_id'] = 'No entry with ID %s found!'; # XXX
+$PALANG['pFetchmail_invalid_mailbox'] = 'Invalid mailbox!'; # XXX
+$PALANG['pFetchmail_server_missing'] = 'Please enter the remote server name!'; # XXX
+$PALANG['pFetchmail_user_missing'] = 'Please enter the remote username!'; # XXX
+$PALANG['pFetchmail_password_missing'] = 'Please enter the remote password!'; # XXX
$PALANG['pDelete_dbLog_deletealias'] = 'delete alias';
$PALANG['pDelete_dbLog_deletemailbox'] = 'delete mailbox';
@@ -345,5 +353,6 @@
$PALANG['pFetchmail_welcome'] = 'Fetch mail for:'; # XXX
$PALANG['pFetchmail_new_entry'] = 'New entry'; # XXX
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
+$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
+/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/languages/it.lang
===================================================================
--- trunk/languages/it.lang 2007-10-25 12:29:38 UTC (rev 162)
+++ trunk/languages/it.lang 2007-10-25 22:59:52 UTC (rev 163)
@@ -73,6 +73,7 @@
$PALANG['pOverview_get_modified'] = 'Ultima modifica';
$PALANG['pDelete_delete_error'] = '<span class="error_msg">Impossibile cancellare ';
+$PALANG['pDelete_delete_success'] = '%s deleted.'; # XXX
$PALANG['pDelete_postdelete_error'] = '<span class="error_msg">Unable to remove mailbox '; # XXX
$PALANG['pDelete_domain_error'] = '<span class="error_msg">Questo dominio non è tuo ';
$PALANG['pDelete_alias_error'] = '<span class="error_msg">Unable to delete alias '; # XXX
@@ -319,6 +320,13 @@
$PALANG['pUsersVacation_result_success'] = 'La tua risposta automatica è stata tolta!';
$PALANG['pCreate_dbLog_createmailbox'] = 'create mailbox';
+$PALANG['pFetchmail_database_save_error'] = 'Could not save this entry in the database!'; # XXX
+$PALANG['pFetchmail_database_save_success'] = 'Entry saved in database.'; # XXX
+$PALANG['pFetchmail_error_invalid_id'] = 'No entry with ID %s found!'; # XXX
+$PALANG['pFetchmail_invalid_mailbox'] = 'Invalid mailbox!'; # XXX
+$PALANG['pFetchmail_server_missing'] = 'Please enter the remote server name!'; # XXX
+$PALANG['pFetchmail_user_missing'] = 'Please enter the remote username!'; # XXX
+$PALANG['pFetchmail_password_missing'] = 'Please enter the remote password!'; # XXX
$PALANG['pCreate_dbLog_createalias'] = 'create alias';
$PALANG['pDelete_dbLog_deletealias'] = 'delete alias';
$PALANG['pDelete_dbLog_deletemailbox'] = 'delete mailbox';
@@ -346,5 +354,6 @@
$PALANG['pFetchmail_welcome'] = 'Fetch mail for:'; # XXX
$PALANG['pFetchmail_new_entry'] = 'New entry'; # XXX
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
+$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
+/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/languages/lt.lang
===================================================================
--- trunk/languages/lt.lang 2007-10-25 12:29:38 UTC (rev 162)
+++ trunk/languages/lt.lang 2007-10-25 22:59:52 UTC (rev 163)
@@ -72,6 +72,7 @@
$PALANG['pOverview_get_modified'] = 'Paskutinis keitimas';
$PALANG['pDelete_delete_error'] = '<span class="error_msg">Įrašo pašalinti nepavyko ';
+$PALANG['pDelete_delete_success'] = '%s deleted.'; # XXX
$PALANG['pDelete_postdelete_error'] = '<span class="error_msg">Unable to remove mailbox '; # XXX
$PALANG['pDelete_domain_error'] = '<span class="error_msg">Ne jūsų sritis ';
$PALANG['pDelete_alias_error'] = '<span class="error_msg">Unable to delete alias '; # XXX
@@ -318,6 +319,13 @@
$PALANG['pUsersVacation_result_success'] = 'Auto atsakovas išjungtas!';
$PALANG['pCreate_dbLog_createmailbox'] = 'pašto dėžutė sukurta';
+$PALANG['pFetchmail_database_save_error'] = 'Could not save this entry in the database!'; # XXX
+$PALANG['pFetchmail_database_save_success'] = 'Entry saved in database.'; # XXX
+$PALANG['pFetchmail_error_invalid_id'] = 'No entry with ID %s found!'; # XXX
+$PALANG['pFetchmail_invalid_mailbox'] = 'Invalid mailbox!'; # XXX
+$PALANG['pFetchmail_server_missing'] = 'Please enter the remote server name!'; # XXX
+$PALANG['pFetchmail_user_missing'] = 'Please enter the remote username!'; # XXX
+$PALANG['pFetchmail_password_missing'] = 'Please enter the remote password!'; # XXX
$PALANG['pCreate_dbLog_createalias'] = 'sinonimas sukurtas';
$PALANG['pDelete_dbLog_deletealias'] = 'sinonimas pašalintas';
$PALANG['pDelete_dbLog_deletemailbox'] = 'pašto dėžutė pašalinta';
@@ -345,5 +353,6 @@
$PALANG['pFetchmail_welcome'] = 'Fetch mail for:'; # XXX
$PALANG['pFetchmail_new_entry'] = 'New entry'; # XXX
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
+$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
+/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/languages/mk.lang
===================================================================
--- trunk/languages/mk.lang 2007-10-25 12:29:38 UTC (rev 162)
+++ trunk/languages/mk.lang 2007-10-25 22:59:52 UTC (rev 163)
@@ -73,6 +73,7 @@
$PALANG['pOverview_get_modified'] = 'Последна промена';
$PALANG['pDelete_delete_error'] = '<span class="error_msg">Не можам да го избришам записот ';
+$PALANG['pDelete_delete_success'] = '%s deleted.'; # XXX
$PALANG['pDelete_postdelete_error'] = '<span class="error_msg">Unable to remove mailbox '; # XXX
$PALANG['pDelete_domain_error'] = '<span class="error_msg">Овој домен не е ваш ';
$PALANG['pDelete_alias_error'] = '<span class="error_msg">Unable to delete alias '; # XXX
@@ -319,6 +320,13 @@
$PALANG['pUsersVacation_result_error'] = '<span class="error_msg">Не можам да ги променам сетирањата за автоматскиот одговор!</span>';
$PALANG['pUsersVacation_result_success'] = 'Вашиот автоматски одговор е отстранет!';
+$PALANG['pFetchmail_database_save_error'] = 'Could not save this entry in the database!'; # XXX
+$PALANG['pFetchmail_database_save_success'] = 'Entry saved in database.'; # XXX
+$PALANG['pFetchmail_error_invalid_id'] = 'No entry with ID %s found!'; # XXX
+$PALANG['pFetchmail_invalid_mailbox'] = 'Invalid mailbox!'; # XXX
+$PALANG['pFetchmail_server_missing'] = 'Please enter the remote server name!'; # XXX
+$PALANG['pFetchmail_user_missing'] = 'Please enter the remote username!'; # XXX
+$PALANG['pFetchmail_password_missing'] = 'Please enter the remote password!'; # XXX
$PALANG['pCreate_dbLog_createmailbox'] = 'create mailbox';
$PALANG['pCreate_dbLog_createalias'] = 'create alias';
$PALANG['pDelete_dbLog_deletealias'] = 'delete alias';
@@ -347,5 +355,6 @@
$PALANG['pFetchmail_welcome'] = 'Fetch mail for:'; # XXX
$PALANG['pFetchmail_new_entry'] = 'New entry'; # XXX
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
+$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
+/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/languages/nl.lang
===================================================================
--- trunk/languages/nl.lang 2007-10-25 12:29:38 UTC (rev 162)
+++ trunk/languages/nl.lang 2007-10-25 22:59:52 UTC (rev 163)
@@ -73,6 +73,7 @@
$PALANG['pOverview_get_modified'] = 'Laatst bewerkt';
$PALANG['pDelete_delete_error'] = '<span class="error_msg">Mislukt te verwijderen ';
+$PALANG['pDelete_delete_success'] = '%s deleted.'; # XXX
$PALANG['pDelete_postdelete_error'] = '<span class="error_msg">Unable to remove mailbox '; # XXX
$PALANG['pDelete_domain_error'] = '<span class="error_msg">Dit is niet uw domein ';
$PALANG['pDelete_alias_error'] = '<span class="error_msg">Unable to delete alias '; # XXX
@@ -319,6 +320,13 @@
$PALANG['pUsersVacation_result_success'] = 'Uw automatisch beantwoorder is verwijderd.';
$PALANG['pCreate_dbLog_createmailbox'] = 'create mailbox';
+$PALANG['pFetchmail_database_save_error'] = 'Could not save this entry in the database!'; # XXX
+$PALANG['pFetchmail_database_save_success'] = 'Entry saved in database.'; # XXX
+$PALANG['pFetchmail_error_invalid_id'] = 'No entry with ID %s found!'; # XXX
+$PALANG['pFetchmail_invalid_mailbox'] = 'Invalid mailbox!'; # XXX
+$PALANG['pFetchmail_server_missing'] = 'Please enter the remote server name!'; # XXX
+$PALANG['pFetchmail_user_missing'] = 'Please enter the remote username!'; # XXX
+$PALANG['pFetchmail_password_missing'] = 'Please enter the remote password!'; # XXX
$PALANG['pCreate_dbLog_createalias'] = 'create alias';
$PALANG['pDelete_dbLog_deletealias'] = 'delete alias';
$PALANG['pDelete_dbLog_deletemailbox'] = 'delete mailbox';
@@ -346,5 +354,6 @@
$PALANG['pFetchmail_welcome'] = 'Fetch mail for:'; # XXX
$PALANG['pFetchmail_new_entry'] = 'New entry'; # XXX
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
+$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
+/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/languages/nn.lang
===================================================================
--- trunk/languages/nn.lang 2007-10-25 12:29:38 UTC (rev 162)
+++ trunk/languages/nn.lang 2007-10-25 22:59:52 UTC (rev 163)
@@ -73,6 +73,7 @@
$PALANG['pOverview_get_modified'] = 'Sist endret';
$PALANG['pDelete_delete_error'] = '<span class="error_msg">Kan ikke slette';
+$PALANG['pDelete_delete_success'] = '%s deleted.'; # XXX
$PALANG['pDelete_postdelete_error'] = '<span class="error_msg">Unable to remove mailbox '; # XXX
$PALANG['pDelete_domain_error'] = '<span class="error_msg">Dette domenet er ikke ditt';
$PALANG['pDelete_alias_error'] = '<span class="error_msg">Unable to delete alias '; # XXX
@@ -319,6 +320,13 @@
$PALANG['pCreate_dbLog_createalias'] = 'opprett alias';
$PALANG['pDelete_dbLog_deletealias'] = 'slett alias';
$PALANG['pDelete_dbLog_deletemailbox'] = 'slett e-postkonto';
+$PALANG['pFetchmail_database_save_error'] = 'Could not save this entry in the database!'; # XXX
+$PALANG['pFetchmail_database_save_success'] = 'Entry saved in database.'; # XXX
+$PALANG['pFetchmail_error_invalid_id'] = 'No entry with ID %s found!'; # XXX
+$PALANG['pFetchmail_invalid_mailbox'] = 'Invalid mailbox!'; # XXX
+$PALANG['pFetchmail_server_missing'] = 'Please enter the remote server name!'; # XXX
+$PALANG['pFetchmail_user_missing'] = 'Please enter the remote username!'; # XXX
+$PALANG['pFetchmail_password_missing'] = 'Please enter the remote password!'; # XXX
$PALANG['pEdit_dbLog_editactive'] = 'endre status';
$PALANG['pEdit_dbLog_editalias'] = 'endre alias';
$PALANG['pEdit_dbLog_editmailbox'] = 'endre e-postkonto';
@@ -343,5 +351,6 @@
$PALANG['pFetchmail_new_entry'] = 'New entry'; # XXX
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
+$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
+/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/languages/pl.lang
===================================================================
--- trunk/languages/pl.lang 2007-10-25 12:29:38 UTC (rev 162)
+++ trunk/languages/pl.lang 2007-10-25 22:59:52 UTC (rev 163)
@@ -75,6 +75,7 @@
$PALANG['pOverview_get_modified'] = 'Ostatnio zmodyfikowany';
$PALANG['pDelete_delete_error'] = '<span class="error_msg">Nie można usunąć tego wpisu ';
+$PALANG['pDelete_delete_success'] = '%s deleted.'; # XXX
$PALANG['pDelete_postdelete_error'] = '<span class="error_msg">Nie można usunąć konta ';
$PALANG['pDelete_domain_error'] = '<span class="error_msg">Ta domena nie należy do Ciebie ';
$PALANG['pDelete_alias_error'] = '<span class="error_msg">Nie można usunąć aliasu ';
@@ -321,6 +322,13 @@
$PALANG['pUsersVacation_result_error'] = '<span class="error_msg">Nie mogę zaktualizować ustawień Twojej auto odpowiedzi!</span>';
$PALANG['pUsersVacation_result_success'] = 'Twoja auto odpowiedź została usunięta!';
+$PALANG['pFetchmail_database_save_error'] = 'Could not save this entry in the database!'; # XXX
+$PALANG['pFetchmail_database_save_success'] = 'Entry saved in database.'; # XXX
+$PALANG['pFetchmail_error_invalid_id'] = 'No entry with ID %s found!'; # XXX
+$PALANG['pFetchmail_invalid_mailbox'] = 'Invalid mailbox!'; # XXX
+$PALANG['pFetchmail_server_missing'] = 'Please enter the remote server name!'; # XXX
+$PALANG['pFetchmail_user_missing'] = 'Please enter the remote username!'; # XXX
+$PALANG['pFetchmail_password_missing'] = 'Please enter the remote password!'; # XXX
$PALANG['pCreate_dbLog_createmailbox'] = 'create mailbox';
$PALANG['pCreate_dbLog_createalias'] = 'create alias';
$PALANG['pDelete_dbLog_deletealias'] = 'delete alias';
@@ -349,5 +357,6 @@
$PALANG['pFetchmail_welcome'] = 'Fetch mail for:'; # XXX
$PALANG['pFetchmail_new_entry'] = 'New entry'; # XXX
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
+$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
+/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/languages/pt-br.lang
===================================================================
--- trunk/languages/pt-br.lang 2007-10-25 12:29:38 UTC (rev 162)
+++ trunk/languages/pt-br.lang 2007-10-25 22:59:52 UTC (rev 163)
@@ -73,6 +73,7 @@
$PALANG['pOverview_get_modified'] = 'Última modificação';
$PALANG['pDelete_delete_error'] = '<span class="error_msg">Não foi possível apagar esse registro ';
+$PALANG['pDelete_delete_success'] = '%s deleted.'; # XXX
$PALANG['pDelete_postdelete_error'] = '<span class="error_msg">Unable to remove mailbox '; # XXX
$PALANG['pDelete_domain_error'] = '<span class="error_msg">Esse domínio não é seu! ';
$PALANG['pDelete_alias_error'] = '<span class="error_msg">Unable to delete alias '; # XXX
@@ -319,6 +320,13 @@
$PALANG['pUsersVacation_result_success'] = 'Sua resposta automática foi removida!';
$PALANG['pCreate_dbLog_createmailbox'] = 'create mailbox';
+$PALANG['pFetchmail_database_save_error'] = 'Could not save this entry in the database!'; # XXX
+$PALANG['pFetchmail_database_save_success'] = 'Entry saved in database.'; # XXX
+$PALANG['pFetchmail_error_invalid_id'] = 'No entry with ID %s found!'; # XXX
+$PALANG['pFetchmail_invalid_mailbox'] = 'Invalid mailbox!'; # XXX
+$PALANG['pFetchmail_server_missing'] = 'Please enter the remote server name!'; # XXX
+$PALANG['pFetchmail_user_missing'] = 'Please enter the remote username!'; # XXX
+$PALANG['pFetchmail_password_missing'] = 'Please enter the remote password!'; # XXX
$PALANG['pCreate_dbLog_createalias'] = 'create alias';
$PALANG['pDelete_dbLog_deletealias'] = 'delete alias';
$PALANG['pDelete_dbLog_deletemailbox'] = 'delete mailbox';
@@ -346,5 +354,6 @@
$PALANG['pFetchmail_welcome'] = 'Fetch mail for:'; # XXX
$PALANG['pFetchmail_new_entry'] = 'New entry'; # XXX
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
+$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
+/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/languages/ru.lang
===================================================================
--- trunk/languages/ru.lang 2007-10-25 12:29:38 UTC (rev 162)
+++ trunk/languages/ru.lang 2007-10-25 22:59:52 UTC (rev 163)
@@ -76,6 +76,7 @@
$PALANG['pOverview_get_modified'] = 'Последнее изменение';
$PALANG['pDelete_delete_error'] = '<span class="error_msg">Невозможно удалить запись ';
+$PALANG['pDelete_delete_success'] = '%s deleted.'; # XXX
$PALANG['pDelete_postdelete_error'] = '<span class="error_msg">Невозможно удалить ящик ';
$PALANG['pDelete_domain_error'] = '<span class="error_msg">Этот домен не принадлежит вам ';
$PALANG['pDelete_alias_error'] = '<span class="error_msg">Невозможно удалить алиас ';
@@ -322,6 +323,13 @@
EOM;
$PALANG['pUsersVacation_button_away'] = 'Ухожу';
$PALANG['pUsersVacation_button_back'] = 'Возвращаюсь';
+$PALANG['pFetchmail_database_save_error'] = 'Could not save this entry in the database!'; # XXX
+$PALANG['pFetchmail_database_save_success'] = 'Entry saved in database.'; # XXX
+$PALANG['pFetchmail_error_invalid_id'] = 'No entry with ID %s found!'; # XXX
+$PALANG['pFetchmail_invalid_mailbox'] = 'Invalid mailbox!'; # XXX
+$PALANG['pFetchmail_server_missing'] = 'Please enter the remote server name!'; # XXX
+$PALANG['pFetchmail_user_missing'] = 'Please enter the remote username!'; # XXX
+$PALANG['pFetchmail_password_missing'] = 'Please enter the remote password!'; # XXX
$PALANG['pUsersVacation_result_error'] = '<span class="error_msg">Невозможно изменить настройки автоответчика!</span>';
$PALANG['pUsersVacation_result_success'] = 'Ваш автоответчик был убран!';
@@ -359,5 +367,6 @@
$PALANG['pFetchmail_new_entry'] = 'Новая запись';
-/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
+$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
+/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/languages/sk.lang
===================================================================
--- trunk/languages/sk.lang 2007-10-25 12:29:38 UTC (rev 162)
+++ trunk/languages/sk.lang 2007-10-25 22:59:52 UTC (rev 163)
@@ -73,6 +73,7 @@
$PALANG['pOverview_get_modified'] = 'Naposledy zmenené';
$PALANG['pDelete_delete_error'] = '<span class="error_msg">Nie je možné zmazať položku ';
+$PALANG['pDelete_delete_success'] = '%s deleted.'; # XXX
$PALANG['pDelete_postdelete_error'] = '<span class="error_msg">Unable to remove mailbox '; # XXX
$PALANG['pDelete_domain_error'] = '<span class="error_msg">Táto doména nie je vaša ';
$PALANG['pDelete_alias_error'] = '<span class="error_msg">Unable to delete alias '; # XXX
@@ -319,6 +320,13 @@
$PALANG['pUsersVacation_result_success'] = 'Nastavenie bolo upravené!';
$PALANG['pCreate_dbLog_createmailbox'] = 'vytvoriť mailbox';
+$PALANG['pFetchmail_database_save_error'] = 'Could not save this entry in the database!'; # XXX
+$PALANG['pFetchmail_database_save_success'] = 'Entry saved in database.'; # XXX
+$PALANG['pFetchmail_error_invalid_id'] = 'No entry with ID %s found!'; # XXX
+$PALANG['pFetchmail_invalid_mailbox'] = 'Invalid mailbox!'; # XXX
+$PALANG['pFetchmail_server_missing'] = 'Please enter the remote server name!'; # XXX
+$PALANG['pFetchmail_user_missing'] = 'Please enter the remote username!'; # XXX
+$PALANG['pFetchmail_password_missing'] = 'Please enter the remote password!'; # XXX
$PALANG['pCreate_dbLog_createalias'] = 'vytvoriť alias';
$PALANG['pDelete_dbLog_deletealias'] = 'zmazať alias';
$PALANG['pDelete_dbLog_deletemailbox'] = 'zmazať mailbox';
@@ -346,5 +354,6 @@
$PALANG['pFetchmail_welcome'] = 'Fetch mail for:'; # XXX
$PALANG['pFetchmail_new_entry'] = 'New entry'; ...
[truncated message content] |
|
From: <Gin...@us...> - 2007-10-25 12:30:03
|
Revision: 162
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=162&view=rev
Author: GingerDog
Date: 2007-10-25 05:29:38 -0700 (Thu, 25 Oct 2007)
Log Message:
-----------
functions.inc.php: code cleanups / documentation fixes etc
Modified Paths:
--------------
trunk/functions.inc.php
Modified: trunk/functions.inc.php
===================================================================
--- trunk/functions.inc.php 2007-10-23 00:18:52 UTC (rev 161)
+++ trunk/functions.inc.php 2007-10-25 12:29:38 UTC (rev 162)
@@ -205,13 +205,13 @@
}
-
-//
-// check_email
-// Action: Checks if email is valid and returns TRUE if this is the case.
-// Call: check_email (string email)
-//
-// TODO: make check_email able to handle already added domains
+/**
+ * check_email
+ * Checks if an email is valid - if it is, return true, else false.
+ * @param String $email - a string that may be an email address.
+ * @return boolean true if it's an email address, else false.
+ * TODO: make check_email able to handle already added domains
+ */
function check_email ($email)
{
global $CONF;
@@ -219,10 +219,12 @@
$ce_email=$email;
//strip the vacation domain out if we are using it
+ //and change from blah#fo...@au... to bl...@fo...
if ($CONF['vacation'] == 'YES')
{
$vacation_domain = $CONF['vacation_domain'];
$ce_email = preg_replace("/@$vacation_domain/", '', $ce_email);
+ $ce_email = preg_replace("/#/", '@', $ce_email);
}
if (
@@ -328,30 +330,47 @@
}
-// safeget
-// Action: get value from $_GET[$param], or $default if $_GET[$param] is not set
-// Call: $param = safeget('param') # replaces $param = $_GET['param']
-// - or -
-// $param = safeget('param', 'default')
+/**
+ * safeget
+ * Action: get value from $_GET[$param], or $default if $_GET[$param] is not set
+ * Call: $param = safeget('param') # replaces $param = $_GET['param']
+ * - or -
+ * $param = safeget('param', 'default')
+ *
+ * @param String parameter name.
+ * @param String (optional) - default value if key is not set.
+ * @return String
+ */
function safeget ($param, $default="") {
$retval=$default;
- if (isset($_GET["$param"])) $retval=$_GET["$param"];
+ if (isset($_GET[$param])) $retval=$_GET[$param];
return $retval;
}
-// safepost
-// same as safeget, but for $_POST
+/**
+ * safepost - similar to safeget()
+ * @see safeget()
+ * @param String parameter name
+ * @param String (optional) default value (defaults to "")
+ * @return String - value in $_POST[$param] or $default
+ * same as safeget, but for $_POST
+ */
function safepost ($param, $default="") {
$retval=$default;
- if (isset($_POST["$param"])) $retval=$_POST["$param"];
+ if (isset($_POST[$param])) $retval=$_POST[$param];
return $retval;
}
-// safeserver
-// same as safeget, but for $_SERVER
+/**
+ * safeserver
+ * @see safeget()
+ * @param String $param
+ * @param String $default (optional)
+ * @return String value from $_SERVER[$param] or $default
+ */
function safeserver ($param, $default="") {
$retval=$default;
- if (isset($_SERVER["$param"])) $retval=$_SERVER["$param"];
+ if (isset($_SERVER[$param])) $retval=$_SERVER[$param];
return $retval;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2007-10-23 00:18:50
|
Revision: 161
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=161&view=rev
Author: christian_boltz
Date: 2007-10-22 17:18:52 -0700 (Mon, 22 Oct 2007)
Log Message:
-----------
- reverted most changes from r151 in fetchmail.tpl, especially:
- removed $display_fields array again after understanding how $fm_struct
in fetchmail.php works
- added workaround for undefined index warnings in $fm_struct (line 47)
(for whatever reasons, there seem to be both numeric and named keys)
Modified Paths:
--------------
trunk/templates/fetchmail.tpl
Modified: trunk/templates/fetchmail.tpl
===================================================================
--- trunk/templates/fetchmail.tpl 2007-10-23 00:01:31 UTC (rev 160)
+++ trunk/templates/fetchmail.tpl 2007-10-23 00:18:52 UTC (rev 161)
@@ -1,39 +1,10 @@
<?php
-# fields to display in table view
-$display_fields=array(
- "id",
- "mailbox",
- "src_server",
- "src_auth",
- "src_user",
-# "src_password",
- "src_folder",
- "pool_time",
- "fetchall",
- "keep",
- "protocol",
-);
-
-if ($CONF['fetchmail_extra_options'] == 'YES') {
- array_push(
- $display_fields,
- "extra_options",
- "mda"
- );
-}
-
-array_push(
- $display_fields,
- "date",
- "returned_text"
-);
-
$headers=array();
- foreach($display_fields as $row){
- list($editible,$view,$type,$title,$comment)=$fm_struct[$row];
+ foreach($fm_struct as $row){
+ list($editible,$view,$type,$title,$comment)=$row;
if ($view){
- $headers[]=$fm_struct[$row];
+ $headers[]=$row;
}
}
@@ -71,10 +42,10 @@
# }
# else{
print " <tr class=\"hilightoff\" onMouseOver=\"className='hilighton';\" onMouseOut=\"className='hilightoff';\">\n";
- foreach($display_fields as $key){
+ foreach($row as $key=>$val){
- list($editible,$view,$type,$title,$comment)=$fm_struct[$key];
- $val = $row[$key];
+ if (!isset($fm_struct[$key])) continue; # TODO: not really nice, but avoids undefined index warnings ;-)
+ list($editible,$view,$type,$title,$comment)=$fm_struct[$key];
if ($view){
$func="_listview_".$type;
print " <td nowrap>" . (function_exists($func)?$func($val):$val) . "</td>\n";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2007-10-23 00:01:27
|
Revision: 160
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=160&view=rev
Author: christian_boltz
Date: 2007-10-22 17:01:31 -0700 (Mon, 22 Oct 2007)
Log Message:
-----------
fetchmail.php
- changed editable and display flags of some columns in $fm_struct
(this array is pretty useful once you understand how to use it ;-)
- completed support for $CONF['fetchmail_extra_options'] = 'NO'
- added several escape_string() calls
- fixed several $_GET/$_POST undefined index warnings
- fixed some MySQL vs. PgSQL issues
- some small fixes
fetchmail.tpl
- changed layout to separate list and edit view
- fixed an undefined index warning
- replaced ID column with edit link
Modified Paths:
--------------
trunk/fetchmail.php
trunk/templates/fetchmail.tpl
Modified: trunk/fetchmail.php
===================================================================
--- trunk/fetchmail.php 2007-10-22 23:49:10 UTC (rev 159)
+++ trunk/fetchmail.php 2007-10-23 00:01:31 UTC (rev 160)
@@ -54,20 +54,25 @@
authentication_require_role('admin');
+$extra_options = 0;
+if ($CONF['fetchmail_extra_options'] == 'YES') $extra_options = 1;
+
$fm_struct=array( // list($editible,$view,$type,$title,$comment)
- "id" =>array(0,1,'id', 'ID','Record ID'),
+ # first column: allow editing?
+ # second column: display field?
+ "id" =>array(0,0,'id', 'ID','Record ID'),
"mailbox" =>array(1,1,'enum', 'Mailbox','Local mailbox'),
"src_server" =>array(1,1,'text', 'Server','Remote Server'),
"src_auth" =>array(1,1,'enum', 'Auth Type','Mostly password'),
"src_user" =>array(1,1,'text', 'User','Remote User'),
- "src_password" =>array(1,1,'password', 'Password','Remote Password'),
+ "src_password" =>array(1,0,'password', 'Password','Remote Password'),
"src_folder" =>array(1,1,'text', 'Folder','Remote Folder'),
"pool_time" =>array(1,1,'num', 'Poll','Poll Time (min)'),
"fetchall" =>array(1,1,'bool', 'Fetch All','Retrieve both old (seen) and new messages'),
"keep" =>array(1,1,'bool', 'Keep','Keep retrieved messages on the remote mailserver'),
"protocol" =>array(1,1,'enum', 'Protocol','Protocol to use'),
- "extra_options" =>array(1,1,'longtext', 'Extra Options','Extra fetchmail Options'),
- "mda" =>array(1,1,'longtext', 'MDA','Mail Delivery Agent'),
+ "extra_options" =>array($extra_options,$extra_options,'longtext', 'Extra Options','Extra fetchmail Options'),
+ "mda" =>array($extra_options,$extra_options,'longtext', 'MDA','Mail Delivery Agent'),
"date" =>array(0,1,'text', 'Date','Date of last pooling/configuration change'),
"returned_text" =>array(0,1,'longtext', 'Returned Text','Text message from last pooling'),
);
@@ -86,10 +91,11 @@
array('POP3','IMAP','POP2','ETRN','AUTO'),
);
-
+
$list_domains = list_domains_for_admin ($SESSID_USERNAME);
-$user_domains=implode("','",array_values($list_domains));
-$sql="SELECT username FROM mailbox WHERE domain in ('".$user_domains."')";
+$user_domains=implode("','",array_values($list_domains)); # for displaying
+$user_domains_sql=implode("','",escape_string(array_values($list_domains))); # for SQL
+$sql="SELECT username FROM mailbox WHERE domain in ('".$user_domains_sql."')";
$res = db_query ($sql);
if ($res['rows'] > 0){
@@ -100,14 +106,14 @@
}
else{
$fm_defaults["mailbox"]=array();
- $fm_defaults["mailbox"][]=$SESSID_USERNAME;
+ $fm_defaults["mailbox"][]=$SESSID_USERNAME; # TODO: Does this really make sense? Or should we display a message "please create a mailbox first!"?
}
-$new=$_REQUEST["new"];
-$edit=(int)$_REQUEST["edit"];
-$delete=$_REQUEST["delete"];
-$save=$_REQUEST["save"];
-$cancel=$_REQUEST["cancel"];
+$new = (int) safeget ("new");
+$edit = (int) safeget ("edit");
+$delete = safepost("delete");
+$save = safepost("save");
+$cancel = safepost("cancel");
if ($cancel){
$edit=0;
@@ -116,11 +122,11 @@
$_vals=array();
foreach($fm_struct as $key=>$row){
list($editible,$view,$type,$title,$comment)=$row;
- if ($editible){
+ if ($editible != 0){
$func="_inp_".$type;
- $val=$_REQUEST[$key];
+ $val=safepost($key);
if ($type!="password" || substr($val,0,1)!="*"){
- $_vals[]=$key."='".mysql_escape_string(
+ $_vals[]=$key."='".escape_string(
function_exists($func)
?$func($val)
:$val)."'";
@@ -132,22 +138,23 @@
}
elseif($delete){
db_query ("delete from fetchmail WHERE id=".$edit);
+ $edit=0;
}
elseif ($new){
$_keys=array();
$_vals=array();
foreach($fm_defaults as $key=>$val){
$_keys[]=$key;
- $_vals[]="'".(is_array($val)?$val[0]:mysql_escape_string($val))."'";
+ $_vals[]="'".(is_array($val)?$val[0]:$val)."'";
}
- $sql="INSERT fetchmail (".implode(",",$_keys).") VALUES (".implode(",",$_vals).")";
+ $sql="INSERT fetchmail (".implode(",",escape_string($_keys)).") VALUES (".implode(",",escape_string($_vals)).")";
$res= db_query ($sql);
$sql="SELECT id FROM fetchmail order by id desc limit 1";
$res= db_query ($sql);
list($edit)=mysql_fetch_row($res['result']);
}
-$res = db_query ("SELECT ".implode(",",array_keys($fm_struct))." FROM fetchmail order by id desc");
+$res = db_query ("SELECT ".implode(",",escape_string(array_keys($fm_struct)))." FROM fetchmail order by id desc");
if ($res['rows'] > 0){
while ($row = db_array ($res['result'])){
$tFmail[] = $row;
@@ -159,7 +166,7 @@
}
function _inp_bool($val){
- return $val?1:0;
+ return $val?db_get_boolean(true):db_get_boolean(false);
}
function _inp_password($val){
Modified: trunk/templates/fetchmail.tpl
===================================================================
--- trunk/templates/fetchmail.tpl 2007-10-22 23:49:10 UTC (rev 159)
+++ trunk/templates/fetchmail.tpl 2007-10-23 00:01:31 UTC (rev 160)
@@ -1,6 +1,3 @@
-<div id="overview">
-<form name="overview" method="post">
-
<?php
# fields to display in table view
@@ -40,7 +37,21 @@
}
}
- print "<table id=\"log_table\" border=0>\n";
+if ($edit) { # edit mode
+ echo '<div id="edit_form">';
+ echo '<form name="fetchmail" method="post">';
+ if (sizeof ($tFmail) > 0){
+ foreach($tFmail as $row) {
+ if ($edit && $edit==$row["id"]) {
+ print fetchmail_edit_row($row);
+ }
+ }
+ }
+} else { # display mode
+
+ print '<div id="overview">';
+ print '<form name="overview" method="post">';
+ print "<table id=\"log_table\" border=0>\n";
print " <tr>\n";
print " <td colspan=\"".(sizeof($headers)-1)."\"><h3>".$PALANG['pFetchmail_welcome'].$user_domains."</h3></td>\n";
print " <td align=right><a href='?new=1'>>> ".$PALANG['pFetchmail_new_entry']."</a></td>\n";
@@ -50,14 +61,15 @@
list($editible,$view,$type,$title,$comment)=$row;
print " <td>" . $title . "</td>\n";
}
+ print "<td> </td>";
print " </tr>\n";
if (sizeof ($tFmail) > 0){
foreach($tFmail as $row){
- if ($edit && $edit==$row["id"]){
- print "<tr><td colspan=".sizeof($headers).">".fetchmail_edit_row($row)."</td></tr>\n";
- }
- else{
+# if ($edit && $edit==$row["id"]){
+# print "<tr><td colspan=".sizeof($headers).">".fetchmail_edit_row($row)."</td></tr>\n";
+# }
+# else{
print " <tr class=\"hilightoff\" onMouseOver=\"className='hilighton';\" onMouseOut=\"className='hilightoff';\">\n";
foreach($display_fields as $key){
@@ -69,16 +81,19 @@
}
}
+ print "<td><a href=\"fetchmail.php?edit=" . $row['id'] . "\">" . $PALANG['edit'] . "</a></td>";
print " </tr>\n";
- }
+# }
}
}
+} # end display mode
function fetchmail_edit_row($data=array()){
- global $fm_struct,$fm_defaults;
+ global $fm_struct,$fm_defaults,$PALANG;
$id=$data["id"];
$_id=$data["id"]*100+1;
- $ret="<table cellspacing=1 cellpadding=0 border=0 width=100%>";
+ $ret="<table>";
+ $ret .= '<tr><td colspan="3"><h3>' . $PALANG['pMenu_fetchmail'] . '</h3></td></tr>';
foreach($fm_struct as $key=>$struct){
list($editible,$view,$type,$title,$comment)=$struct;
if ($editible){
@@ -93,7 +108,8 @@
?$fm_defaults[$key]
:''
);
- $ret.=$func($_id++,$key,$fm_defaults[$key],$val);
+ $fm_defaults_key = ""; if (isset($fm_defaults[$key])) $fm_defaults_key = $fm_defaults[$key];
+ $ret.=$func($_id++,$key,$fm_defaults_key,$val);
$ret.="</td><td align=left valign=top><i> ${comment}</i></td></tr>\n";
}
elseif($view){
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2007-10-22 23:49:11
|
Revision: 159
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=159&view=rev
Author: christian_boltz
Date: 2007-10-22 16:49:10 -0700 (Mon, 22 Oct 2007)
Log Message:
-----------
- new functions safeget, safepost, safeserver
Action: get value from $_GET/$_POST/$_SERVER[$param], otherwise $default
Call: $param = safeget('param') # instead of $param = $_GET['param'] - or -
$param = safeget('param', 'default')
useful to avoid "undefined index" warnings ;-)
Modified Paths:
--------------
trunk/functions.inc.php
Modified: trunk/functions.inc.php
===================================================================
--- trunk/functions.inc.php 2007-10-19 21:07:56 UTC (rev 158)
+++ trunk/functions.inc.php 2007-10-22 23:49:10 UTC (rev 159)
@@ -328,7 +328,34 @@
}
+// safeget
+// Action: get value from $_GET[$param], or $default if $_GET[$param] is not set
+// Call: $param = safeget('param') # replaces $param = $_GET['param']
+// - or -
+// $param = safeget('param', 'default')
+function safeget ($param, $default="") {
+ $retval=$default;
+ if (isset($_GET["$param"])) $retval=$_GET["$param"];
+ return $retval;
+}
+// safepost
+// same as safeget, but for $_POST
+function safepost ($param, $default="") {
+ $retval=$default;
+ if (isset($_POST["$param"])) $retval=$_POST["$param"];
+ return $retval;
+}
+
+// safeserver
+// same as safeget, but for $_SERVER
+function safeserver ($param, $default="") {
+ $retval=$default;
+ if (isset($_SERVER["$param"])) $retval=$_SERVER["$param"];
+ return $retval;
+}
+
+
//
// get_domain_properties
// Action: Get all the properties of a domain.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2007-10-19 21:07:58
|
Revision: 158
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=158&view=rev
Author: christian_boltz
Date: 2007-10-19 14:07:56 -0700 (Fri, 19 Oct 2007)
Log Message:
-----------
- updated ru.lang - thanks to Pavel Usischev (pusischev)
https://sourceforge.net/tracker/?func=detail&atid=937964&aid=1815063&group_id=191583
Modified Paths:
--------------
trunk/languages/ru.lang
Modified: trunk/languages/ru.lang
===================================================================
--- trunk/languages/ru.lang 2007-10-16 21:43:57 UTC (rev 157)
+++ trunk/languages/ru.lang 2007-10-19 21:07:56 UTC (rev 158)
@@ -1,54 +1,56 @@
<?php
//
-// Language file Rusian
-// by Paul
+// Language file Russian
+// by Paul; updated by Pavel Usischev
//
+
$PALANG['YES'] = 'ДА';
$PALANG['NO'] = 'НЕТ';
$PALANG['edit'] = 'редактировать';
$PALANG['del'] = 'удалить';
-$PALANG['exit'] = 'Exit'; # XXX
+$PALANG['exit'] = 'Выйти';
$PALANG['confirm'] = 'Вы уверены, что хотите удалить это?\n';
$PALANG['confirm_domain'] = 'Вы действительно хотите удалить все настройки для домена? Это действие нельзя будет отменить!\n';
-$PALANG['check_update'] = 'Check for update';
-$PALANG['pFooter_logged_as'] = 'Logged as %s'; # XXX
+$PALANG['check_update'] = 'Проверить обновление';
+$PALANG['pFooter_logged_as'] = 'Вошли как %s';
+
$PALANG['pLogin_welcome'] = 'Вход для администрирования почтовых ящиков.';
-$PALANG['pLogin_username'] = 'имя (название ящика)';
+$PALANG['pLogin_username'] = 'Имя (название ящика)';
$PALANG['pLogin_password'] = 'Пароль';
$PALANG['pLogin_button'] = 'Войти';
$PALANG['pLogin_username_incorrect'] = '<span class="error_msg">Неправильное имя. Проверьте, правильно ли вы ввели имя (название ящика)!</span>';
$PALANG['pLogin_password_incorrect'] = '<span class="error_msg">Введен неправильный пароль!</span>';
$PALANG['pLogin_login_users'] = 'Вход для обычных пользователей.';
-$PALANG['pMenu_main'] = 'Main'; # XXX
+$PALANG['pMenu_main'] = 'Главная';
$PALANG['pMenu_overview'] = 'Обзор';
-$PALANG['pMenu_create_alias'] = 'Добавить алиас';
-$PALANG['pMenu_create_mailbox'] = 'Добавить ящик';
-$PALANG['pMenu_fetchmail'] = 'Fetch Email'; # XXX
+$PALANG['pMenu_create_alias'] = 'Создать алиас';
+$PALANG['pMenu_create_mailbox'] = 'Создать ящик';
+$PALANG['pMenu_fetchmail'] = 'Сбор почты';
$PALANG['pMenu_sendmail'] = 'Послать письмо';
$PALANG['pMenu_password'] = 'Пароль';
-$PALANG['pMenu_viewlog'] = 'просмотреть лог';
+$PALANG['pMenu_viewlog'] = 'Просмотреть журнал';
$PALANG['pMenu_logout'] = 'Выход';
$PALANG['pMain_welcome'] = 'Добро пожаловать в систему управления почтой Postfix Admin!';
-$PALANG['pMain_overview'] = 'Список ваших почтовых ящиков и алиасо. Вы можете удалять и редактировать их отсюда.';
+$PALANG['pMain_overview'] = 'Список ваших почтовых ящиков и алиасов. Вы можете удалять и редактировать их отсюда.';
$PALANG['pMain_create_alias'] = 'Создание нового алиаса для вашего домена.';
$PALANG['pMain_create_mailbox'] = 'Создание нового почтового ящика для вашего домена.';
-$PALANG['pMain_sendmail'] = 'Послать письмо на созданный почтовый ящик.';
+$PALANG['pMain_sendmail'] = 'Отправить письмо на созданный почтовый ящик.';
$PALANG['pMain_password'] = 'Смена пароля для эккаунта администратора.';
-$PALANG['pMain_viewlog'] = 'Просмотр истории работы с системой (log files).';
+$PALANG['pMain_viewlog'] = 'Просмотр журнала работы с системой.';
$PALANG['pMain_logout'] = 'Выход из системы';
-$PALANG['pOverview_disabled'] = 'Disabled';
-$PALANG['pOverview_unlimited'] = 'Unlimited';
-$PALANG['pOverview_title'] = ':: Defined Domains';
-$PALANG['pOverview_up_arrow'] = 'Go Top';
-$PALANG['pOverview_right_arrow'] = 'Next Page';
-$PALANG['pOverview_left_arrow'] = 'Previous Page';
-$PALANG['pOverview_alias_title'] = ':: Alias';
-$PALANG['pOverview_mailbox_title'] = ':: Mailboxes';
+$PALANG['pOverview_disabled'] = 'Отключено';
+$PALANG['pOverview_unlimited'] = 'Неограничено';
+$PALANG['pOverview_title'] = ':: Заданные домены';
+$PALANG['pOverview_up_arrow'] = 'Наверх';
+$PALANG['pOverview_right_arrow'] = 'Следующая страница';
+$PALANG['pOverview_left_arrow'] = 'Предыдущая страница';
+$PALANG['pOverview_alias_title'] = ':: Алиас';
+$PALANG['pOverview_mailbox_title'] = ':: Ящики';
$PALANG['pOverview_button'] = 'Выбрать';
$PALANG['pOverview_welcome'] = 'Обзор для ';
$PALANG['pOverview_alias_alias_count'] = 'Алиасы';
@@ -56,125 +58,129 @@
$PALANG['pOverview_alias_address'] = 'От';
$PALANG['pOverview_alias_goto'] = 'Кому';
$PALANG['pOverview_alias_modified'] = 'Последнее изменение';
-$PALANG['pOverview_alias_active'] = 'Active'; # XXX
-$PALANG['pOverview_alias_edit'] = 'Alias'; # XXX
+$PALANG['pOverview_alias_active'] = 'Активен';
+$PALANG['pOverview_alias_edit'] = 'Алиас';
$PALANG['pOverview_mailbox_username'] = 'Ящик';
$PALANG['pOverview_mailbox_name'] = 'Имя';
-$PALANG['pOverview_mailbox_quota'] = 'Размер (MB)';
+$PALANG['pOverview_mailbox_quota'] = 'Квота (МБ)';
$PALANG['pOverview_mailbox_modified'] = 'Последнее изменение';
-$PALANG['pOverview_mailbox_active'] = 'активный';
-$PALANG['pOverview_vacation_edit'] = 'VACATION IS ON'; # XXX
-$PALANG['pOverview_vacation_option'] = 'Set Vacation'; # XXX
+$PALANG['pOverview_mailbox_active'] = 'Активен';
+$PALANG['pOverview_vacation_edit'] = 'ВКЛЮЧЕН АВТООТВЕТЧИК';
+$PALANG['pOverview_vacation_option'] = 'Установить автоответчик';
+
$PALANG['pOverview_get_domain'] = 'Домен';
$PALANG['pOverview_get_aliases'] = 'Алиасы';
$PALANG['pOverview_get_mailboxes'] = 'Ящики';
-$PALANG['pOverview_get_quota'] = 'Размер ящика (MB)';
+$PALANG['pOverview_get_quota'] = 'Квота ящика (МБ)';
$PALANG['pOverview_get_modified'] = 'Последнее изменение';
$PALANG['pDelete_delete_error'] = '<span class="error_msg">Невозможно удалить запись ';
-$PALANG['pDelete_postdelete_error'] = '<span class="error_msg">Unable to remove mailbox '; # XXX
+$PALANG['pDelete_postdelete_error'] = '<span class="error_msg">Невозможно удалить ящик ';
$PALANG['pDelete_domain_error'] = '<span class="error_msg">Этот домен не принадлежит вам ';
-$PALANG['pDelete_alias_error'] = '<span class="error_msg">Unable to delete alias '; # XXX
+$PALANG['pDelete_alias_error'] = '<span class="error_msg">Невозможно удалить алиас ';
-$PALANG['pCreate_alias_welcome'] = 'Создайте новый алиас для вашего домена.';
+$PALANG['pCreate_alias_welcome'] = 'Создание нового алиаса для вашего домена.';
$PALANG['pCreate_alias_address'] = 'Алиас';
-$PALANG['pCreate_alias_address_text_error1'] = '<br /><span class="error_msg">неверное имя алиаса!</span>';
+$PALANG['pCreate_alias_address_text_error1'] = '<br /><span class="error_msg">Неверное имя алиаса!</span>';
$PALANG['pCreate_alias_address_text_error2'] = '<br /><span class="error_msg">Этот почтовый адрес уже существует, пожалуйста, выберите другой.</span>';
-$PALANG['pCreate_alias_address_text_error3'] = '<br /><span class="error_msg">Вы достигли лимита по созданным алиасам</span>';
+$PALANG['pCreate_alias_address_text_error3'] = '<br /><span class="error_msg">Вы достигли лимита по созданным алиасам!</span>';
$PALANG['pCreate_alias_goto'] = 'Кому';
-$PALANG['pCreate_alias_active'] = 'Active'; # XXX
+$PALANG['pCreate_alias_active'] = 'Активен';
$PALANG['pCreate_alias_button'] = 'Создать алиас';
-$PALANG['pCreate_alias_goto_text'] = 'Кому должна доставляться почта.';
-$PALANG['pCreate_alias_goto_text_error'] = 'Кому должна идти почта.<br /><span class="error_msg">Неверное поле Куда!</span>';
+$PALANG['pCreate_alias_goto_text'] = 'Куда должна доставляться почта.';
+$PALANG['pCreate_alias_goto_text_error'] = 'Куда должна идти почта.<br /><span class="error_msg">Неверное поле Кому!</span>';
$PALANG['pCreate_alias_result_error'] = '<span class="error_msg">Невозможно добавить алиас в список!</span>';
$PALANG['pCreate_alias_result_success'] = 'Алиас был успешно создан!';
$PALANG['pCreate_alias_catchall_text'] = 'Для создания catch-all почтового ящика используйте "*" в качестве имени алиаса.<br />для внутридоменного перенаправления используйте "*@domain.tld" для поле Кому';
-$PALANG['pEdit_alias_welcome'] = 'Редактировать алиас для вашего домена.<br />Одна запись для линии.';
+$PALANG['pEdit_alias_welcome'] = 'Редактирование алиаса для вашего домена.<br />Одна запись на строку.';
$PALANG['pEdit_alias_address'] = 'Алиас';
$PALANG['pEdit_alias_address_error'] = '<span class="error_msg">Невозможно определить алиас!</span>';
-$PALANG['pEdit_alias_goto'] = 'Куда';
-$PALANG['pEdit_alias_active'] = 'Active'; # XXX
+$PALANG['pEdit_alias_goto'] = 'Кому';
+$PALANG['pEdit_alias_active'] = 'Активен';
$PALANG['pEdit_alias_goto_text_error1'] = '<span class="error_msg">Вы ничего не ввели в поле Кому</span>';
-$PALANG['pEdit_alias_goto_text_error2'] = '<span class="error_msg"> Вы ввели неверный адрес ';
+$PALANG['pEdit_alias_goto_text_error2'] = '<span class="error_msg">Вы ввели неверный адрес: ';
$PALANG['pEdit_alias_domain_error'] = '<span class="error_msg">Этот домен не принадлежит вам: ';
-$PALANG['pEdit_alias_forward_and_store'] = 'Deliver to the local mailbox.';
-$PALANG['pEdit_alias_forward_only'] = 'Forward to given email addresses only.';
+$PALANG['pEdit_alias_forward_and_store'] = 'Доставлять в локальный почтовый ящик.';
+$PALANG['pEdit_alias_forward_only'] = 'Только пересылать на указанные адреса.';
$PALANG['pEdit_alias_button'] = 'Редактировать алиас';
$PALANG['pEdit_alias_result_error'] = '<span class="error_msg">Невозможно изменить алиас!</span>';
$PALANG['pCreate_mailbox_welcome'] = 'Создание нового почтового ящика для вашего домена.';
-$PALANG['pCreate_mailbox_username'] = 'Имя';
+$PALANG['pCreate_mailbox_username'] = 'Название';
$PALANG['pCreate_mailbox_username_text_error1'] = '<br /><span class="error_msg">Неверное имя!</span>';
$PALANG['pCreate_mailbox_username_text_error2'] = '<br /><span class="error_msg">Это имя уже существует, пожалуйста, выберите другое!</span>';
$PALANG['pCreate_mailbox_username_text_error3'] = '<br /><span class="error_msg">Вы достигли лимита по созданию почтовых ящиков!</span>';
$PALANG['pCreate_mailbox_password'] = 'Пароль';
$PALANG['pCreate_mailbox_password2'] = 'Пароль (еще раз)';
$PALANG['pCreate_mailbox_password_text'] = 'Пароль для POP3/IMAP';
-$PALANG['pCreate_mailbox_password_text_error'] = 'Пароль для POP3/IMAP<br /><span class="error_msg">Пароль, введенный вами не подходит!<br /> либо пуст!</span>';
+$PALANG['pCreate_mailbox_password_text_error'] = 'Пароль для POP3/IMAP<br /><span class="error_msg">Введенные вами пароли не совпадают!<br />Либо пусты!</span>';
$PALANG['pCreate_mailbox_name'] = 'Имя';
$PALANG['pCreate_mailbox_name_text'] = 'Полное имя';
$PALANG['pCreate_mailbox_quota'] = 'Квота';
-$PALANG['pCreate_mailbox_quota_text'] = 'MB';
-$PALANG['pCreate_mailbox_quota_text_error'] = 'MB<br /><span class="error_msg">Квота, выставленная вами, слишком велика!</span>';
-$PALANG['pCreate_mailbox_active'] = 'активный';
-$PALANG['pCreate_mailbox_mail'] = 'Создать ящик';
+$PALANG['pCreate_mailbox_quota_text'] = 'МБ';
+$PALANG['pCreate_mailbox_quota_text_error'] = 'МБ<br /><span class="error_msg">Квота, выставленная вами, слишком велика!</span>';
+$PALANG['pCreate_mailbox_active'] = 'Активен';
+$PALANG['pCreate_mailbox_mail'] = 'Отправить приветственное письмо';
$PALANG['pCreate_mailbox_button'] = 'Создать ящик';
$PALANG['pCreate_mailbox_result_error'] = '<span class="error_msg">Невозможно добавить ящик в список существующих ящиков!</span>';
$PALANG['pCreate_mailbox_result_success'] = 'Почтовый ящик был успешно создан!';
-$PALANG['pCreate_mailbox_result_succes_nosubfolders'] = 'The mailbox has been added to the mailbox table, but none (or only some) of the predefined sub-folders could be created'; # XXX
+$PALANG['pCreate_mailbox_result_succes_nosubfolders'] = 'Почтовый ящик был успешно создан, но в нем не удалось создать (некоторые) стандартные папки';
-$PALANG['pEdit_mailbox_welcome'] = 'Редактировать ящик для вашего домена.';
-$PALANG['pEdit_mailbox_username'] = 'Имя';
+$PALANG['pEdit_mailbox_welcome'] = 'Редактирование ящика для вашего домена.';
+$PALANG['pEdit_mailbox_username'] = 'Название';
$PALANG['pEdit_mailbox_username_error'] = '<span class="error_msg">Невозможно определить ящик!</span>';
$PALANG['pEdit_mailbox_password'] = 'Новый пароль';
$PALANG['pEdit_mailbox_password2'] = 'Новый пароль (еще раз)';
-$PALANG['pEdit_mailbox_password_text_error'] = '<span class="error_msg">Пароль введенный вами не подходит!</span>';
+$PALANG['pEdit_mailbox_password_text_error'] = '<span class="error_msg">Введенные вами пароли не совпадают!</span>';
$PALANG['pEdit_mailbox_name'] = 'Имя';
-$PALANG['pEdit_mailbox_name_text'] = 'Full name'; # XXX
+$PALANG['pEdit_mailbox_name_text'] = 'Полное имя';
$PALANG['pEdit_mailbox_quota'] = 'Квота';
-$PALANG['pEdit_mailbox_quota_text'] = 'MB';
-$PALANG['pEdit_mailbox_quota_text_error'] = 'MB<br /><span class="error_msg">Квота, выставленная вами, слишком велика!</span>';
+$PALANG['pEdit_mailbox_quota_text'] = 'МБ';
+$PALANG['pEdit_mailbox_quota_text_error'] = 'МБ<br /><span class="error_msg">Квота, выставленная вами, слишком велика!</span>';
$PALANG['pEdit_mailbox_domain_error'] = '<span class="error_msg">Этот домен не принадлежит вам: ';
$PALANG['pEdit_mailbox_button'] = 'Редактировать ящик';
$PALANG['pEdit_mailbox_result_error'] = '<span class="error_msg">Невозможно изменить пароль!</span>';
-$PALANG['pPassword_welcome'] = 'Изменение пароля.';
+$PALANG['pPassword_welcome'] = 'Изменение вашего пароля.';
$PALANG['pPassword_admin'] = 'Имя для входа';
-$PALANG['pPassword_admin_text_error'] = '<span class="error_msg">Имя, введенное вами, не соответствует ящику!</span>';
+$PALANG['pPassword_admin_text_error'] = '<span class="error_msg">Имя, введенное вами, не соответствует почтовому ящику!</span>';
$PALANG['pPassword_password_current'] = 'Текущий пароль';
-$PALANG['pPassword_password_current_text_error'] = '<span class="error_msg">Вы не изменили ваш текущий пароль!</span>';
+$PALANG['pPassword_password_current_text_error'] = '<span class="error_msg">Вы не указали ваш текущий пароль!</span>';
$PALANG['pPassword_password'] = 'Новый пароль';
$PALANG['pPassword_password2'] = 'Новый пароль (еще раз)';
-$PALANG['pPassword_password_text_error'] = '<span class="error_msg">Введенные вами пароли не совпадают!<br />или пусты!</span>';
+$PALANG['pPassword_password_text_error'] = '<span class="error_msg">Введенные вами пароли не совпадают!<br />Либо пусты!</span>';
$PALANG['pPassword_button'] = 'Изменить пароль';
$PALANG['pPassword_result_error'] = '<span class="error_msg">Невозможно изменить ваш пароль!</span>';
$PALANG['pPassword_result_success'] = 'Ваш пароль был изменен!';
-$PALANG['pEdit_vacation_set'] = 'Change / Set away message'; # XXX
-$PALANG['pEdit_vacation_remove'] = 'Remove away message'; # XXX
-$PALANG['pVacation_result_error'] = '<span class="error_msg">Unable to update auto response settings!</span>'; # XXX
-$PALANG['pVacation_result_removed'] = 'Auto response has been removed!'; # XXX
-$PALANG['pVacation_result_added'] = 'Auto response has been enabled!'; # XXX
+$PALANG['pEdit_vacation_set'] = 'Поменять / задать сообщение об отсутствии';
+$PALANG['pEdit_vacation_remove'] = 'Убрать сообщение об отсутствии';
+
+$PALANG['pVacation_result_error'] = '<span class="error_msg">Невозможно обновить настройки автоответчика!</span>';
+$PALANG['pVacation_result_removed'] = 'Автоответчик отключен!';
+$PALANG['pVacation_result_added'] = 'Автоответчик включен!';
+
$PALANG['pViewlog_welcome'] = 'Просмотреть последних 10 действий для ';
$PALANG['pViewlog_timestamp'] = 'Время создания/модификации';
$PALANG['pViewlog_username'] = 'Админ';
$PALANG['pViewlog_domain'] = 'Домен';
$PALANG['pViewlog_action'] = 'Действие';
-$PALANG['pViewlog_data'] = 'Дата';
-$PALANG['pViewlog_action_create_mailbox'] = 'create mailbox'; # XXX
-$PALANG['pViewlog_action_delete_mailbox'] = 'delete mailbox'; # XXX
-$PALANG['pViewlog_action_edit_mailbox'] = 'edit mailbox'; # XXX
-$PALANG['pViewlog_action_edit_mailbox_state'] = 'edit mailbox active'; # XXX
-$PALANG['pViewlog_action_create_alias'] = 'create alias'; # XXX
-$PALANG['pViewlog_action_delete_alias'] = 'delete alias'; # XXX
-$PALANG['pViewlog_action_edit_alias'] = 'edit alias'; # XXX
-$PALANG['pViewlog_action_edit_alias_state'] = 'edit alias active'; # XXX
-$PALANG['pViewlog_action_edit_password'] = 'change password'; # XXX
+$PALANG['pViewlog_data'] = 'Данные';
+$PALANG['pViewlog_action_create_mailbox'] = 'создание ящика';
+$PALANG['pViewlog_action_delete_mailbox'] = 'удаление ящика';
+$PALANG['pViewlog_action_edit_mailbox'] = 'редактирование ящика';
+$PALANG['pViewlog_action_edit_mailbox_state'] = 'изменение активности ящика';
+$PALANG['pViewlog_action_create_alias'] = 'создание алиаса';
+$PALANG['pViewlog_action_delete_alias'] = 'удаление алиаса';
+$PALANG['pViewlog_action_edit_alias'] = 'редактирование алиаса';
+$PALANG['pViewlog_action_edit_alias_state'] = 'изменение активности алиаса';
+$PALANG['pViewlog_action_edit_password'] = 'изменение пароля';
+
$PALANG['pViewlog_button'] = 'Выбрать';
-$PALANG['pViewlog_result_error'] = '<span class="error_msg">Невозможно найти лог-файлы!</span>';
+$PALANG['pViewlog_result_error'] = '<span class="error_msg">Невозможно найти журнал!</span>';
$PALANG['pSendmail_welcome'] = 'Послать письмо.';
$PALANG['pSendmail_admin'] = 'От';
@@ -187,32 +193,32 @@
$PALANG['pSendmail_result_error'] = '<span class="error_msg">Невозможно создать почтовый ящик!</span>';
$PALANG['pSendmail_result_success'] = 'Почтовый ящик был создан!';
-$PALANG['pAdminMenu_list_admin'] = 'Список Администраторов';
+$PALANG['pAdminMenu_list_admin'] = 'Список админов';
$PALANG['pAdminMenu_list_domain'] = 'Список доменов';
-$PALANG['pAdminMenu_list_virtual'] = 'Virtual List';
-$PALANG['pAdminMenu_viewlog'] = 'Просмотр истории';
-$PALANG['pAdminMenu_backup'] = 'Backup';
-$PALANG['pAdminMenu_create_domain_admins'] = 'Администраторы доменов';
-$PALANG['pAdminMenu_create_admin'] = 'Новый администратор';
+$PALANG['pAdminMenu_list_virtual'] = 'Обзор';
+$PALANG['pAdminMenu_viewlog'] = 'Журнал';
+$PALANG['pAdminMenu_backup'] = 'Бэкап';
+$PALANG['pAdminMenu_create_domain_admins'] = 'Админы доменов';
+$PALANG['pAdminMenu_create_admin'] = 'Новый админ';
$PALANG['pAdminMenu_create_domain'] = 'Новый домен';
-$PALANG['pAdminMenu_create_alias'] = 'Добавить алиас';
-$PALANG['pAdminMenu_create_mailbox'] = 'Добавить ящик';
+$PALANG['pAdminMenu_create_alias'] = 'Создать алиас';
+$PALANG['pAdminMenu_create_mailbox'] = 'Создать ящик';
$PALANG['pAdminList_admin_domain'] = 'Домен';
$PALANG['pAdminList_admin_username'] = 'Админ';
$PALANG['pAdminList_admin_count'] = 'Домены';
$PALANG['pAdminList_admin_modified'] = 'Последнее изменение';
-$PALANG['pAdminList_admin_active'] = 'Активный';
+$PALANG['pAdminList_admin_active'] = 'Активен';
$PALANG['pAdminList_domain_domain'] = 'Домен';
$PALANG['pAdminList_domain_description'] = 'Описание';
$PALANG['pAdminList_domain_aliases'] = 'Алиасы';
$PALANG['pAdminList_domain_mailboxes'] = 'Ящики';
-$PALANG['pAdminList_domain_maxquota'] = 'Макс. Квота (MB)';
-$PALANG['pAdminList_domain_transport'] = 'Transport';
+$PALANG['pAdminList_domain_maxquota'] = 'Квота (МБ)';
+$PALANG['pAdminList_domain_transport'] = 'Транспорт';
$PALANG['pAdminList_domain_backupmx'] = 'Backup MX';
$PALANG['pAdminList_domain_modified'] = 'Последнее изменение';
-$PALANG['pAdminList_domain_active'] = 'Активный';
+$PALANG['pAdminList_domain_active'] = 'Активен';
$PALANG['pAdminList_virtual_button'] = 'Выбрать';
$PALANG['pAdminList_virtual_welcome'] = 'Обзор для ';
@@ -223,84 +229,85 @@
$PALANG['pAdminList_virtual_alias_modified'] = 'Последнее изменение';
$PALANG['pAdminList_virtual_mailbox_username'] = 'Ящик';
$PALANG['pAdminList_virtual_mailbox_name'] = 'Имя';
-$PALANG['pAdminList_virtual_mailbox_quota'] = 'Квота (MB)';
+$PALANG['pAdminList_virtual_mailbox_quota'] = 'Квота (МБ)';
$PALANG['pAdminList_virtual_mailbox_modified'] = 'Последнее изменение';
$PALANG['pAdminList_virtual_mailbox_active'] = 'Активный';
-$PALANG['pAdminCreate_domain_welcome'] = 'Добавить новый домен';
-$PALANG['pAdminCreate_domain_domain'] = 'домен';
+$PALANG['pAdminCreate_domain_welcome'] = 'Добавление нового домена';
+$PALANG['pAdminCreate_domain_domain'] = 'Домен';
$PALANG['pAdminCreate_domain_domain_text_error'] = '<span class="error_msg">Домен уже существует!</span>';
-$PALANG['pAdminCreate_domain_domain_text_error2'] = '<span class="error_msg">The domain is invalid!</span>'; # XXX
+$PALANG['pAdminCreate_domain_domain_text_error2'] = '<span class="error_msg">Некорректный домен!</span>';
$PALANG['pAdminCreate_domain_description'] = 'Описание';
$PALANG['pAdminCreate_domain_aliases'] = 'Алиасы';
-$PALANG['pAdminCreate_domain_aliases_text'] = '-1 = запретить | 0 = неограниченное';
+$PALANG['pAdminCreate_domain_aliases_text'] = '-1 = отключить | 0 = неограниченное';
$PALANG['pAdminCreate_domain_mailboxes'] = 'Ящики';
-$PALANG['pAdminCreate_domain_mailboxes_text'] = '-1 = запретить | 0 = неограниченное';
-$PALANG['pAdminCreate_domain_maxquota'] = 'макс. квота';
-$PALANG['pAdminCreate_domain_maxquota_text'] = 'MB<br /> -1 = запретить | 0 = неограниченное';
-$PALANG['pAdminCreate_domain_transport'] = 'Transport';
-$PALANG['pAdminCreate_domain_transport_text'] = 'Define transport';
+$PALANG['pAdminCreate_domain_mailboxes_text'] = '-1 = отключить | 0 = неограниченное';
+$PALANG['pAdminCreate_domain_maxquota'] = 'Макс. квота';
+$PALANG['pAdminCreate_domain_maxquota_text'] = 'МБ<br /> -1 = отключить | 0 = неограниченное';
+$PALANG['pAdminCreate_domain_transport'] = 'Транспорт';
+$PALANG['pAdminCreate_domain_transport_text'] = 'Укажите транспорт';
$PALANG['pAdminCreate_domain_defaultaliases'] = 'Добавить стандартные алиасы для домена';
-$PALANG['pAdminCreate_domain_defaultaliases_text'] = ''; # XXX
-$PALANG['pAdminCreate_domain_backupmx'] = 'Mail server is backup MX';
+$PALANG['pAdminCreate_domain_defaultaliases_text'] = '';
+$PALANG['pAdminCreate_domain_backupmx'] = 'Почтовый сервер является backup MX';
$PALANG['pAdminCreate_domain_button'] = 'Добавить домен';
$PALANG['pAdminCreate_domain_result_error'] = '<span class="error_msg">Невозможно добавить домен!</span>';
$PALANG['pAdminCreate_domain_result_success'] = 'Домен был добавлен!';
-$PALANG['pAdminDelete_domain_error'] = '<span class="error_msg">Unable to remove domain!</span>'; # XXX
-$PALANG['pAdminEdit_domain_welcome'] = 'Редактировать домен';
+$PALANG['pAdminDelete_domain_error'] = '<span class="error_msg">Невозможно удалить домен!</span>';
+
+$PALANG['pAdminEdit_domain_welcome'] = 'Редактирование домена';
$PALANG['pAdminEdit_domain_domain'] = 'Домен';
$PALANG['pAdminEdit_domain_description'] = 'Описание';
$PALANG['pAdminEdit_domain_aliases'] = 'Алиасы';
-$PALANG['pAdminEdit_domain_aliases_text'] = '-1 = запретить | 0 = неограниченное';
+$PALANG['pAdminEdit_domain_aliases_text'] = '-1 = отключить | 0 = неограниченное';
$PALANG['pAdminEdit_domain_mailboxes'] = 'Ящики';
-$PALANG['pAdminEdit_domain_mailboxes_text'] = '-1 = запретить | 0 = неограниченное';
-$PALANG['pAdminEdit_domain_maxquota'] = 'макс. квота';
-$PALANG['pAdminEdit_domain_maxquota_text'] = 'MB<br /> -1 = запретить | 0 = неограниченное';
-$PALANG['pAdminEdit_domain_transport'] = 'Transport';
-$PALANG['pAdminEdit_domain_transport_text'] = 'Define transport';
-$PALANG['pAdminEdit_domain_backupmx'] = 'Mail server is backup MX';
-$PALANG['pAdminEdit_domain_active'] = 'Активный';
-$PALANG['pAdminEdit_domain_button'] = 'Редактировать Домен';
+$PALANG['pAdminEdit_domain_mailboxes_text'] = '-1 = отключить | 0 = неограниченное';
+$PALANG['pAdminEdit_domain_maxquota'] = 'Макс. квота';
+$PALANG['pAdminEdit_domain_maxquota_text'] = 'МБ<br /> -1 = отключить | 0 = неограниченное';
+$PALANG['pAdminEdit_domain_transport'] = 'Транспорт';
+$PALANG['pAdminEdit_domain_transport_text'] = 'Укажите транспорт';
+$PALANG['pAdminEdit_domain_backupmx'] = 'Почтовый сервер является backup MX';
+$PALANG['pAdminEdit_domain_active'] = 'Активен';
+$PALANG['pAdminEdit_domain_button'] = 'Редактировать домен';
$PALANG['pAdminEdit_domain_result_error'] = '<span class="error_msg">Невозможно изменить домен!</span>';
-$PALANG['pAdminCreate_admin_welcome'] = 'Добавить нового админа домена';
-$PALANG['pAdminCreate_admin_username'] = 'Админ';
+$PALANG['pAdminCreate_admin_welcome'] = 'Добавление нового администратора домена';
+$PALANG['pAdminCreate_admin_username'] = 'Администратор';
$PALANG['pAdminCreate_admin_username_text'] = 'Почтовый адрес';
-$PALANG['pAdminCreate_admin_username_text_error1'] = 'Почтовый адрес<br /><span class="error_msg">Некорректный адрес админа!</span>';
-$PALANG['pAdminCreate_admin_username_text_error2'] = 'Почтовый адрес<br /><span class="error_msg">Админ уже существует либо некорректное имя</span>';
+$PALANG['pAdminCreate_admin_username_text_error1'] = 'Почтовый адрес<br /><span class="error_msg">Некорректный адрес администратора!</span>';
+$PALANG['pAdminCreate_admin_username_text_error2'] = 'Почтовый адрес<br /><span class="error_msg">Администратор уже существует либо некорректное имя</span>';
$PALANG['pAdminCreate_admin_password'] = 'Пароль';
$PALANG['pAdminCreate_admin_password2'] = 'Пароль (еще раз)';
-$PALANG['pAdminCreate_admin_password_text_error'] = '<span class="error_msg">Пароли, которые вы ввели не совпадают!<br />либо пустые!</span>';
-$PALANG['pAdminCreate_admin_button'] = 'Добавить админа';
-$PALANG['pAdminCreate_admin_result_error'] = '<span class="error_msg">евозможно добавить админа!</span>';
-$PALANG['pAdminCreate_admin_result_success'] = 'Админ был добавлен!';
+$PALANG['pAdminCreate_admin_password_text_error'] = '<span class="error_msg">Введенные вами пароли не совпадают!<br />Либо пустые!</span>';
+$PALANG['pAdminCreate_admin_button'] = 'Добавить администратора';
+$PALANG['pAdminCreate_admin_result_error'] = '<span class="error_msg">Невозможно добавить администратора!</span>';
+$PALANG['pAdminCreate_admin_result_success'] = 'Администратор был добавлен!';
$PALANG['pAdminCreate_admin_address'] = 'Домен';
-$PALANG['pAdminEdit_admin_welcome'] = 'Редактировать админа домена';
-$PALANG['pAdminEdit_admin_username'] = 'Админ';
+$PALANG['pAdminEdit_admin_welcome'] = 'Редактирование администратора домена';
+$PALANG['pAdminEdit_admin_username'] = 'Администратор';
$PALANG['pAdminEdit_admin_password'] = 'Пароль';
$PALANG['pAdminEdit_admin_password2'] = 'Пароль (еще раз)';
-$PALANG['pAdminEdit_admin_password_text_error'] = '<span class="error_msg">Пароли, которые вы ввели не совпадают!<br />либо пустые!</span>';
-$PALANG['pAdminEdit_admin_active'] = 'Активный';
-$PALANG['pAdminEdit_admin_super_admin'] = 'Super admin';
-$PALANG['pAdminEdit_admin_button'] = 'Редактировать админа';
-$PALANG['pAdminEdit_admin_result_error'] = '<span class="error_msg">Невозможно изменить админа!</span>';
-$PALANG['pAdminEdit_admin_result_success'] = 'Админ был изменен!';
+$PALANG['pAdminEdit_admin_password_text_error'] = '<span class="error_msg">Введенные вами пароли не совпадают!<br />Либо пустые!</span>';
+$PALANG['pAdminEdit_admin_active'] = 'Активен';
+$PALANG['pAdminEdit_admin_super_admin'] = 'Супер админ';
+$PALANG['pAdminEdit_admin_button'] = 'Редактировать администратора';
+$PALANG['pAdminEdit_admin_result_error'] = '<span class="error_msg">Невозможно изменить администратора!</span>';
+$PALANG['pAdminEdit_admin_result_success'] = 'Администратор был изменен!';
$PALANG['pUsersLogin_welcome'] = 'Вход пользователей для изменения паролей и алиасов.';
-$PALANG['pUsersLogin_username'] = 'Имя (ящик)';
+$PALANG['pUsersLogin_username'] = 'Имя (адрес)';
$PALANG['pUsersLogin_password'] = 'Пароль';
-$PALANG['pUsersLogin_button'] = 'Имя';
-$PALANG['pUsersLogin_username_incorrect'] = 'Введено неправильное имя. Проверьте правильность введенного имени!';
+$PALANG['pUsersLogin_button'] = 'Войти';
+$PALANG['pUsersLogin_username_incorrect'] = 'Введено неправильное имя. Проверьте, что вы ввели свой адрес электронной почты!';
$PALANG['pUsersLogin_password_incorrect'] = 'Введен неверный пароль!';
$PALANG['pUsersMenu_vacation'] = 'Автоответчик';
-$PALANG['pUsersMenu_edit_alias'] = 'Изменить перенаправление';
+$PALANG['pUsersMenu_edit_alias'] = 'Изменить пересылку почты';
$PALANG['pUsersMenu_password'] = 'Изменить пароль';
-$PALANG['pUsersMain_vacation'] = 'Настройте сообщение "вне офиса либо автоответчик для вашей почты.';
-$PALANG['pUsersMain_vacationSet'] = $PALANG['pUsersMenu_vacation'] . ' is ON, click \'' . $PALANG['pUsersMenu_vacation'] . '\' to ' . $PALANG['edit'] . '/remove'; # XXX
+$PALANG['pUsersMain_vacation'] = 'Настроить сообщение "вне офиса" либо автоответчик для вашей почты.';
+$PALANG['pUsersMain_vacationSet'] = $PALANG['pUsersMenu_vacation'] . ' ВКЛЮЧЕН, щелкните \'' . $PALANG['pUsersMenu_vacation'] . '\', чтобы ' . $PALANG['edit'] . '/убрать';
$PALANG['pUsersMain_edit_alias'] = 'Изменить перенаправление почты.';
$PALANG['pUsersMain_password'] = 'Изменить текущий пароль.';
@@ -310,41 +317,47 @@
$PALANG['pUsersVacation_subject_text'] = 'Вне офиса';
$PALANG['pUsersVacation_body'] = 'Текст';
$PALANG['pUsersVacation_body_text'] = <<<EOM
-Я буду отсутствовать с <date> по <date>.
-В экстренных случаях вы можете обратиться к <contact person>.
+Я буду отсутствовать с <даты> по <дату>.
+По срочным вопросам вы можете обратиться к <контактному лицу>.
EOM;
$PALANG['pUsersVacation_button_away'] = 'Ухожу';
$PALANG['pUsersVacation_button_back'] = 'Возвращаюсь';
$PALANG['pUsersVacation_result_error'] = '<span class="error_msg">Невозможно изменить настройки автоответчика!</span>';
$PALANG['pUsersVacation_result_success'] = 'Ваш автоответчик был убран!';
-$PALANG['pCreate_dbLog_createmailbox'] = 'create mailbox';
-$PALANG['pCreate_dbLog_createalias'] = 'create alias';
-$PALANG['pDelete_dbLog_deletealias'] = 'delete alias';
-$PALANG['pDelete_dbLog_deletemailbox'] = 'delete mailbox';
+$PALANG['pCreate_dbLog_createmailbox'] = 'создание ящика';
+$PALANG['pCreate_dbLog_createalias'] = 'создание алиаса';
+$PALANG['pDelete_dbLog_deletealias'] = 'удаление алиаса';
+$PALANG['pDelete_dbLog_deletemailbox'] = 'удаление ящика';
-$PALANG['pEdit_dbLog_editactive'] = 'change active state';
-$PALANG['pEdit_dbLog_editalias'] = 'edit alias';
-$PALANG['pEdit_dbLog_editmailbox'] = 'edit mailbox';
+$PALANG['pEdit_dbLog_editactive'] = 'изменение статуса активности';
+$PALANG['pEdit_dbLog_editalias'] = 'редактирование алиаса';
+$PALANG['pEdit_dbLog_editmailbox'] = 'редактирование ящика';
-$PALANG['pSearch'] = 'search'; # XXX
-$PALANG['pSearch_welcome'] = 'Searching for: ';
-$PALANG['pReturn_to'] = 'Return to'; # XXX
-$PALANG['pBroadcast_title'] = 'Send broadcast message'; # XXX
-$PALANG['pBroadcast_from'] = 'From'; # XXX
-$PALANG['pBroadcast_name'] = 'Your name'; # XXX
-$PALANG['pBroadcast_subject'] = 'Subject'; # XXX
-$PALANG['pBroadcast_message'] = 'Message'; # XXX
-$PALANG['pBroadcast_send'] = 'Send message'; # XXX
-$PALANG['pBroadcast_success'] = 'Your broadcast message was sent.'; # XXX
-$PALANG['pAdminMenu_broadcast_message'] = 'BC message'; # XXX
-$PALANG['pBroadcast_error_empty'] = 'The fields Name, Subject and Message should\'t be empty !'; # XXX
-$PALANG['pStatus_undeliverable'] = 'maybe UNDELIVERABLE '; # XXX
-$PALANG['pStatus_custom'] = 'Delivers to '; # XXX
-$PALANG['pStatus_popimap'] = 'POP/IMAP '; # XXX
-$PALANG['pPasswordTooShort'] = "Password is too short - requires %s characters"; # XXX
-$PALANG['pFetchmail_welcome'] = 'Fetch mail for:'; # XXX
-$PALANG['pFetchmail_new_entry'] = 'New entry'; # XXX
+$PALANG['pSearch'] = 'поиск';
+$PALANG['pSearch_welcome'] = 'Искать: ';
+$PALANG['pReturn_to'] = 'Вернуться к';
+
+$PALANG['pBroadcast_title'] = 'Отправка широковещательного сообщения';
+$PALANG['pBroadcast_from'] = 'От';
+$PALANG['pBroadcast_name'] = 'Ваше имя';
+$PALANG['pBroadcast_subject'] = 'Тема';
+$PALANG['pBroadcast_message'] = 'Сообщение';
+$PALANG['pBroadcast_send'] = 'Отправить сообщение';
+$PALANG['pBroadcast_success'] = 'Ваше широковещательное сообщение было отправлено.';
+$PALANG['pAdminMenu_broadcast_message'] = 'ШВ сообщение';
+$PALANG['pBroadcast_error_empty'] = 'Поля Имя, Тема и Сообщение не должны быть пустыми!';
+
+$PALANG['pStatus_undeliverable'] = 'возможно НЕ ДОСТАВЛЕНО ';
+$PALANG['pStatus_custom'] = 'Доставляется для ';
+$PALANG['pStatus_popimap'] = 'POP/IMAP ';
+
+$PALANG['pPasswordTooShort'] = "Пароль слишком короткий - требуется %s символов";
+
+$PALANG['pFetchmail_welcome'] = 'Собирать почту для:';
+$PALANG['pFetchmail_new_entry'] = 'Новая запись';
+
+
/* vim: set 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.
|