Thread: SF.net SVN: postfixadmin: [243] trunk (Page 2)
Brought to you by:
christian_boltz,
gingerdog
|
From: <chr...@us...> - 2007-11-26 23:30:14
|
Revision: 243
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=243&view=rev
Author: christian_boltz
Date: 2007-11-26 15:30:16 -0800 (Mon, 26 Nov 2007)
Log Message:
-----------
several *.php files:
- no longer use $incpath - merging admin/ is done
http://sourceforge.net/tracker/index.php?func=detail&aid=1838327&group_id=191583&atid=937964
Note that $incpath is still used by common.php - removing it would break users/
Modified Paths:
--------------
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/search.php
trunk/viewlog.php
Modified: trunk/create-alias.php
===================================================================
--- trunk/create-alias.php 2007-11-26 07:38:56 UTC (rev 242)
+++ trunk/create-alias.php 2007-11-26 23:30:16 UTC (rev 243)
@@ -152,8 +152,8 @@
}
}
-include ("$incpath/templates/header.tpl");
-include ("$incpath/templates/menu.tpl");
-include ("$incpath/templates/create-alias.tpl");
-include ("$incpath/templates/footer.tpl");
+include ("templates/header.tpl");
+include ("templates/menu.tpl");
+include ("templates/create-alias.tpl");
+include ("templates/footer.tpl");
?>
Modified: trunk/create-mailbox.php
===================================================================
--- trunk/create-mailbox.php 2007-11-26 07:38:56 UTC (rev 242)
+++ trunk/create-mailbox.php 2007-11-26 23:30:16 UTC (rev 243)
@@ -330,10 +330,10 @@
}
}
-include ("$incpath/templates/header.tpl");
-include ("$incpath/templates/menu.tpl");
-include ("$incpath/templates/create-mailbox.tpl");
-include ("$incpath/templates/footer.tpl");
+include ("templates/header.tpl");
+include ("templates/menu.tpl");
+include ("templates/create-mailbox.tpl");
+include ("templates/footer.tpl");
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/delete.php
===================================================================
--- trunk/delete.php 2007-11-26 07:38:56 UTC (rev 242)
+++ trunk/delete.php 2007-11-26 23:30:16 UTC (rev 243)
@@ -164,10 +164,10 @@
}
-include ("$incpath/templates/header.tpl");
-include ("$incpath/templates/menu.tpl");
-include ("$incpath/templates/message.tpl");
-include ("$incpath/templates/footer.tpl");
+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: */
?>
Modified: trunk/edit-active.php
===================================================================
--- trunk/edit-active.php 2007-11-26 07:38:56 UTC (rev 242)
+++ trunk/edit-active.php 2007-11-26 23:30:16 UTC (rev 243)
@@ -91,9 +91,9 @@
}
}
-include ("$incpath/templates/header.tpl");
-include ("$incpath/templates/menu.tpl");
-include ("$incpath/templates/message.tpl");
-include ("$incpath/templates/footer.tpl");
+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: */
?>
Modified: trunk/edit-alias.php
===================================================================
--- trunk/edit-alias.php 2007-11-26 07:38:56 UTC (rev 242)
+++ trunk/edit-alias.php 2007-11-26 23:30:16 UTC (rev 243)
@@ -124,8 +124,8 @@
}
}
-include ("$incpath/templates/header.tpl");
-include ("$incpath/templates/menu.tpl");
-include ("$incpath/templates/edit-alias.tpl");
-include ("$incpath/templates/footer.tpl");
+include ("templates/header.tpl");
+include ("templates/menu.tpl");
+include ("templates/edit-alias.tpl");
+include ("templates/footer.tpl");
?>
Modified: trunk/edit-mailbox.php
===================================================================
--- trunk/edit-mailbox.php 2007-11-26 07:38:56 UTC (rev 242)
+++ trunk/edit-mailbox.php 2007-11-26 23:30:16 UTC (rev 243)
@@ -157,9 +157,9 @@
}
}
-include ("$incpath/templates/header.tpl");
-include ("$incpath/templates/menu.tpl");
-include ("$incpath/templates/edit-mailbox.tpl");
-include ("$incpath/templates/footer.tpl");
+include ("templates/header.tpl");
+include ("templates/menu.tpl");
+include ("templates/edit-mailbox.tpl");
+include ("templates/footer.tpl");
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/edit-vacation.php
===================================================================
--- trunk/edit-vacation.php 2007-11-26 07:38:56 UTC (rev 242)
+++ trunk/edit-vacation.php 2007-11-26 23:30:16 UTC (rev 243)
@@ -191,9 +191,9 @@
$tMessage = $PALANG['pVacation_result_error'];
}
-include ("$incpath/templates/header.tpl");
-include ("$incpath/templates/menu.tpl");
-include ("$incpath/templates/edit-vacation.tpl");
-include ("$incpath/templates/footer.tpl");
+include ("templates/header.tpl");
+include ("templates/menu.tpl");
+include ("templates/edit-vacation.tpl");
+include ("templates/footer.tpl");
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/search.php
===================================================================
--- trunk/search.php 2007-11-26 07:38:56 UTC (rev 242)
+++ trunk/search.php 2007-11-26 23:30:16 UTC (rev 243)
@@ -116,9 +116,9 @@
}
}
-include ("$incpath/templates/header.tpl");
-include ("$incpath/templates/menu.tpl");
-include ("$incpath/templates/search.tpl");
-include ("$incpath/templates/footer.tpl");
+include ("templates/header.tpl");
+include ("templates/menu.tpl");
+include ("templates/search.tpl");
+include ("templates/footer.tpl");
?>
Modified: trunk/viewlog.php
===================================================================
--- trunk/viewlog.php 2007-11-26 07:38:56 UTC (rev 242)
+++ trunk/viewlog.php 2007-11-26 23:30:16 UTC (rev 243)
@@ -74,10 +74,10 @@
}
}
-include ("$incpath/templates/header.tpl");
-include ("$incpath/templates/menu.tpl");
-include ("$incpath/templates/viewlog.tpl");
-include ("$incpath/templates/footer.tpl");
+include ("templates/header.tpl");
+include ("templates/menu.tpl");
+include ("templates/viewlog.tpl");
+include ("templates/footer.tpl");
/* 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.
|
|
From: <Gin...@us...> - 2007-12-02 13:59:31
|
Revision: 250
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=250&view=rev
Author: GingerDog
Date: 2007-12-02 05:59:33 -0800 (Sun, 02 Dec 2007)
Log Message:
-----------
rename templates to .php instead of .tpl
Modified Paths:
--------------
trunk/backup.php
trunk/broadcast-message.php
trunk/create-admin.php
trunk/create-alias.php
trunk/create-domain.php
trunk/create-mailbox.php
trunk/delete.php
trunk/edit-active-admin.php
trunk/edit-active-domain.php
trunk/edit-active.php
trunk/edit-admin.php
trunk/edit-alias.php
trunk/edit-domain.php
trunk/edit-mailbox.php
trunk/edit-vacation.php
trunk/fetchmail.php
trunk/list-admin.php
trunk/list-domain.php
trunk/list-virtual.php
trunk/login.php
trunk/main.php
trunk/password.php
trunk/search.php
trunk/sendmail.php
trunk/setup.php
trunk/users/edit-alias.php
trunk/users/login.php
trunk/users/main.php
trunk/users/password.php
trunk/users/vacation.php
trunk/viewlog.php
Added Paths:
-----------
trunk/templates/admin_create-admin.php
trunk/templates/admin_create-domain.php
trunk/templates/admin_edit-admin.php
trunk/templates/admin_edit-domain.php
trunk/templates/admin_list-admin.php
trunk/templates/admin_list-domain.php
trunk/templates/admin_search.php
trunk/templates/broadcast-message.php
trunk/templates/create-alias.php
trunk/templates/create-mailbox.php
trunk/templates/edit-alias.php
trunk/templates/edit-mailbox.php
trunk/templates/edit-vacation.php
trunk/templates/fetchmail.php
trunk/templates/footer.php
trunk/templates/header.php
trunk/templates/list-virtual.php
trunk/templates/login.php
trunk/templates/main.php
trunk/templates/menu.php
trunk/templates/message.php
trunk/templates/overview-get.php
trunk/templates/password.php
trunk/templates/search.php
trunk/templates/sendmail.php
trunk/templates/users_edit-alias.php
trunk/templates/users_login.php
trunk/templates/users_main.php
trunk/templates/users_menu.php
trunk/templates/users_password.php
trunk/templates/users_vacation.php
trunk/templates/viewlog.php
Removed Paths:
-------------
trunk/templates/admin_create-admin.tpl
trunk/templates/admin_create-domain.tpl
trunk/templates/admin_edit-admin.tpl
trunk/templates/admin_edit-domain.tpl
trunk/templates/admin_list-admin.tpl
trunk/templates/admin_list-domain.tpl
trunk/templates/admin_search.tpl
trunk/templates/broadcast-message.tpl
trunk/templates/create-alias.tpl
trunk/templates/create-mailbox.tpl
trunk/templates/edit-alias.tpl
trunk/templates/edit-mailbox.tpl
trunk/templates/edit-vacation.tpl
trunk/templates/fetchmail.tpl
trunk/templates/footer.tpl
trunk/templates/header.tpl
trunk/templates/list-virtual.tpl
trunk/templates/login.tpl
trunk/templates/main.tpl
trunk/templates/menu.tpl
trunk/templates/message.tpl
trunk/templates/overview-get.tpl
trunk/templates/password.tpl
trunk/templates/search.tpl
trunk/templates/sendmail.tpl
trunk/templates/users_edit-alias.tpl
trunk/templates/users_login.tpl
trunk/templates/users_main.tpl
trunk/templates/users_menu.tpl
trunk/templates/users_password.tpl
trunk/templates/users_vacation.tpl
trunk/templates/viewlog.tpl
Modified: trunk/backup.php
===================================================================
--- trunk/backup.php 2007-11-27 23:24:37 UTC (rev 249)
+++ trunk/backup.php 2007-12-02 13:59:33 UTC (rev 250)
@@ -63,10 +63,10 @@
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");
+ include ("templates/header.php");
+ include ("templates/menu.php");
+ include ("templates/message.php");
+ include ("templates/footer.php");
}
else
{
Modified: trunk/broadcast-message.php
===================================================================
--- trunk/broadcast-message.php 2007-11-27 23:24:37 UTC (rev 249)
+++ trunk/broadcast-message.php 2007-12-02 13:59:33 UTC (rev 250)
@@ -15,7 +15,7 @@
* File: broadcast-message.php
* Used to send a message to _ALL_ users with mailboxes on this server.
*
- * Template File: broadcast-message.tpl
+ * Template File: broadcast-message.php
*
* Template Variables: -none-
*
@@ -78,19 +78,19 @@
}
}
}
- include ("templates/header.tpl");
- include ("templates/menu.tpl");
+ include ("templates/header.php");
+ include ("templates/menu.php");
echo '<p>'.$PALANG['pBroadcast_success'].'</p>';
- include ("templates/footer.tpl");
+ include ("templates/footer.php");
}
}
if ($_SERVER['REQUEST_METHOD'] == "GET" || $error == 1)
{
- include ("templates/header.tpl");
- include ("templates/menu.tpl");
- include ("templates/broadcast-message.tpl");
- include ("templates/footer.tpl");
+ include ("templates/header.php");
+ include ("templates/menu.php");
+ include ("templates/broadcast-message.php");
+ include ("templates/footer.php");
}
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
Modified: trunk/create-admin.php
===================================================================
--- trunk/create-admin.php 2007-11-27 23:24:37 UTC (rev 249)
+++ trunk/create-admin.php 2007-12-02 13:59:33 UTC (rev 250)
@@ -14,7 +14,7 @@
*
* File: create-admin.php
* Used to create new administrators.
- * Template File: admin_create-admin.tpl
+ * Template File: admin_create-admin.php
*
*
* Template Variables:
@@ -60,10 +60,10 @@
}
}
-include ("templates/header.tpl");
-include ("templates/menu.tpl");
-include ("templates/admin_create-admin.tpl");
-include ("templates/footer.tpl");
+include ("templates/header.php");
+include ("templates/menu.php");
+include ("templates/admin_create-admin.php");
+include ("templates/footer.php");
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/create-alias.php
===================================================================
--- trunk/create-alias.php 2007-11-27 23:24:37 UTC (rev 249)
+++ trunk/create-alias.php 2007-12-02 13:59:33 UTC (rev 250)
@@ -11,7 +11,7 @@
* http://www.postfixadmin.com or http://postfixadmin.sf.net
*
* File: create-alias.php
- * Template File: create-alias.tpl
+ * Template File: create-alias.php
* Responsible for allowing for the creation of mail aliases.
*
* @version $Id$
@@ -152,8 +152,8 @@
}
}
-include ("templates/header.tpl");
-include ("templates/menu.tpl");
-include ("templates/create-alias.tpl");
-include ("templates/footer.tpl");
+include ("templates/header.php");
+include ("templates/menu.php");
+include ("templates/create-alias.php");
+include ("templates/footer.php");
?>
Modified: trunk/create-domain.php
===================================================================
--- trunk/create-domain.php 2007-11-27 23:24:37 UTC (rev 249)
+++ trunk/create-domain.php 2007-12-02 13:59:33 UTC (rev 250)
@@ -14,7 +14,7 @@
*
* File: create-domain.php
* Allows administrators to create new domains.
- * Template File: admin_create-domain.tpl
+ * Template File: admin_create-domain.php
*
* Template Variables:
*
@@ -120,10 +120,10 @@
}
}
-include ("templates/header.tpl");
-include ("templates/menu.tpl");
-include ("templates/admin_create-domain.tpl");
-include ("templates/footer.tpl");
+include ("templates/header.php");
+include ("templates/menu.php");
+include ("templates/admin_create-domain.php");
+include ("templates/footer.php");
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/create-mailbox.php
===================================================================
--- trunk/create-mailbox.php 2007-11-27 23:24:37 UTC (rev 249)
+++ trunk/create-mailbox.php 2007-12-02 13:59:33 UTC (rev 250)
@@ -330,10 +330,10 @@
}
}
-include ("templates/header.tpl");
-include ("templates/menu.tpl");
-include ("templates/create-mailbox.tpl");
-include ("templates/footer.tpl");
+include ("templates/header.php");
+include ("templates/menu.php");
+include ("templates/create-mailbox.php");
+include ("templates/footer.php");
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/delete.php
===================================================================
--- trunk/delete.php 2007-11-27 23:24:37 UTC (rev 249)
+++ trunk/delete.php 2007-12-02 13:59:33 UTC (rev 250)
@@ -17,7 +17,7 @@
* Note: if a domain is deleted, all mailboxes and aliases belonging
* to the domain are also removed.
*
- * Template File: message.tpl
+ * Template File: message.php
*
* Template Variables:
*
@@ -164,10 +164,10 @@
}
-include ("templates/header.tpl");
-include ("templates/menu.tpl");
-include ("templates/message.tpl");
-include ("templates/footer.tpl");
+include ("templates/header.php");
+include ("templates/menu.php");
+include ("templates/message.php");
+include ("templates/footer.php");
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/edit-active-admin.php
===================================================================
--- trunk/edit-active-admin.php 2007-11-27 23:24:37 UTC (rev 249)
+++ trunk/edit-active-admin.php 2007-12-02 13:59:33 UTC (rev 250)
@@ -15,7 +15,7 @@
* File: edit-active-admin.php
* Edit an active administrator. This is used as a 'toggle' page from list-admin.
*
- * Template File: message.tpl
+ * Template File: message.php
*
* Template Variables:
*
@@ -51,10 +51,10 @@
}
}
-include ("templates/header.tpl");
-include ("templates/menu.tpl");
-include ("templates/message.tpl");
-include ("templates/footer.tpl");
+include ("templates/header.php");
+include ("templates/menu.php");
+include ("templates/message.php");
+include ("templates/footer.php");
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
Modified: trunk/edit-active-domain.php
===================================================================
--- trunk/edit-active-domain.php 2007-11-27 23:24:37 UTC (rev 249)
+++ trunk/edit-active-domain.php 2007-12-02 13:59:33 UTC (rev 250)
@@ -14,7 +14,7 @@
*
* File: edit-active-domain.php
* Responsible for toggling the status of a domain
- * Template File: message.tpl
+ * Template File: message.php
*
* Template Variables:
*
@@ -50,10 +50,10 @@
}
}
-include ("templates/header.tpl");
-include ("templates/menu.tpl");
-include ("templates/message.tpl");
-include ("templates/footer.tpl");
+include ("templates/header.php");
+include ("templates/menu.php");
+include ("templates/message.php");
+include ("templates/footer.php");
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/edit-active.php
===================================================================
--- trunk/edit-active.php 2007-11-27 23:24:37 UTC (rev 249)
+++ trunk/edit-active.php 2007-12-02 13:59:33 UTC (rev 250)
@@ -15,7 +15,7 @@
* File: edit-active.php
* Responsible for toggling the active status of a mailbox.
*
- * Template File: message.tpl
+ * Template File: message.php
*
* Template Variables:
*
@@ -91,9 +91,9 @@
}
}
-include ("templates/header.tpl");
-include ("templates/menu.tpl");
-include ("templates/message.tpl");
-include ("templates/footer.tpl");
+include ("templates/header.php");
+include ("templates/menu.php");
+include ("templates/message.php");
+include ("templates/footer.php");
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/edit-admin.php
===================================================================
--- trunk/edit-admin.php 2007-11-27 23:24:37 UTC (rev 249)
+++ trunk/edit-admin.php 2007-12-02 13:59:33 UTC (rev 250)
@@ -15,7 +15,7 @@
* File: edit-admin.php
* Edits a normal administrator's details.
*
- * Template File: admin_edit-admin.tpl
+ * Template File: admin_edit-admin.php
*
* Template Variables:
*
@@ -150,10 +150,10 @@
}
}
-include ("templates/header.tpl");
-include ("templates/menu.tpl");
-include ("templates/admin_edit-admin.tpl");
-include ("templates/footer.tpl");
+include ("templates/header.php");
+include ("templates/menu.php");
+include ("templates/admin_edit-admin.php");
+include ("templates/footer.php");
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/edit-alias.php
===================================================================
--- trunk/edit-alias.php 2007-11-27 23:24:37 UTC (rev 249)
+++ trunk/edit-alias.php 2007-12-02 13:59:33 UTC (rev 250)
@@ -15,7 +15,7 @@
* File: edit-alias.php
* Used to update an alias.
*
- * Template File: edit-alias.tpl
+ * Template File: edit-alias.php
*
* Template Variables:
*
@@ -127,10 +127,10 @@
}
}
-include ("templates/header.tpl");
-include ("templates/menu.tpl");
-include ("templates/edit-alias.tpl");
-include ("templates/footer.tpl");
+include ("templates/header.php");
+include ("templates/menu.php");
+include ("templates/edit-alias.php");
+include ("templates/footer.php");
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/edit-domain.php
===================================================================
--- trunk/edit-domain.php 2007-11-27 23:24:37 UTC (rev 249)
+++ trunk/edit-domain.php 2007-12-02 13:59:33 UTC (rev 250)
@@ -14,7 +14,7 @@
*
* File: edit-domain.php
* Updates the properties of a domain.
- * Template File: admin_edit-domain.tpl
+ * Template File: admin_edit-domain.php
*
* Template Variables:
*
@@ -104,10 +104,10 @@
}
}
-include ("templates/header.tpl");
-include ("templates/menu.tpl");
-include ("templates/admin_edit-domain.tpl");
-include ("templates/footer.tpl");
+include ("templates/header.php");
+include ("templates/menu.php");
+include ("templates/admin_edit-domain.php");
+include ("templates/footer.php");
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/edit-mailbox.php
===================================================================
--- trunk/edit-mailbox.php 2007-11-27 23:24:37 UTC (rev 249)
+++ trunk/edit-mailbox.php 2007-12-02 13:59:33 UTC (rev 250)
@@ -14,7 +14,7 @@
*
* File: edit-mailbox.php
* Used to update an existing mailboxes settings.
- * Template File: edit-mailbox.tpl
+ * Template File: edit-mailbox.php
*
* Template Variables:
*
@@ -157,9 +157,9 @@
}
}
-include ("templates/header.tpl");
-include ("templates/menu.tpl");
-include ("templates/edit-mailbox.tpl");
-include ("templates/footer.tpl");
+include ("templates/header.php");
+include ("templates/menu.php");
+include ("templates/edit-mailbox.php");
+include ("templates/footer.php");
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/edit-vacation.php
===================================================================
--- trunk/edit-vacation.php 2007-11-27 23:24:37 UTC (rev 249)
+++ trunk/edit-vacation.php 2007-12-02 13:59:33 UTC (rev 250)
@@ -15,7 +15,7 @@
* File: edit-vacation.php
* Responsible for allowing users to update their vacation status.
*
- * Template File: edit-vacation.tpl
+ * Template File: edit-vacation.php
*
* Template Variables:
*
@@ -191,9 +191,9 @@
$tMessage = $PALANG['pVacation_result_error'];
}
-include ("templates/header.tpl");
-include ("templates/menu.tpl");
-include ("templates/edit-vacation.tpl");
-include ("templates/footer.tpl");
+include ("templates/header.php");
+include ("templates/menu.php");
+include ("templates/edit-vacation.php");
+include ("templates/footer.php");
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/fetchmail.php
===================================================================
--- trunk/fetchmail.php 2007-11-27 23:24:37 UTC (rev 249)
+++ trunk/fetchmail.php 2007-12-02 13:59:33 UTC (rev 250)
@@ -250,10 +250,10 @@
return base64_encode($val);
}
-include ("./templates/header.tpl");
-include ("./templates/menu.tpl");
-include ("./templates/fetchmail.tpl");
-include ("./templates/footer.tpl");
+include ("./templates/header.php");
+include ("./templates/menu.php");
+include ("./templates/fetchmail.php");
+include ("./templates/footer.php");
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/list-admin.php
===================================================================
--- trunk/list-admin.php 2007-11-27 23:24:37 UTC (rev 249)
+++ trunk/list-admin.php 2007-12-02 13:59:33 UTC (rev 250)
@@ -14,7 +14,7 @@
*
* File: list-admin.php
* Lists all administrators
- * Template File: list-admin.tpl
+ * Template File: list-admin.php
*
* Template Variables: -none-
*
@@ -32,9 +32,9 @@
}
}
-include ("templates/header.tpl");
-include ("templates/menu.tpl");
-include ("templates/admin_list-admin.tpl");
-include ("templates/footer.tpl");
+include ("templates/header.php");
+include ("templates/menu.php");
+include ("templates/admin_list-admin.php");
+include ("templates/footer.php");
?>
Modified: trunk/list-domain.php
===================================================================
--- trunk/list-domain.php 2007-11-27 23:24:37 UTC (rev 249)
+++ trunk/list-domain.php 2007-12-02 13:59:33 UTC (rev 250)
@@ -14,7 +14,7 @@
*
* File: list-domain.php
* List all domains as a quick overview.
- * Template File: admin_list-domain.tpl
+ * Template File: admin_list-domain.php
*
* Template Variables:
*
@@ -59,15 +59,15 @@
}
#}
-include ("templates/header.tpl");
-include ("templates/menu.tpl");
+include ("templates/header.php");
+include ("templates/menu.php");
if ($is_superadmin) {
- include ("templates/admin_list-domain.tpl");
+ include ("templates/admin_list-domain.php");
} else {
- include ("templates/overview-get.tpl");
+ include ("templates/overview-get.php");
}
-include ("templates/footer.tpl");
+include ("templates/footer.php");
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/list-virtual.php
===================================================================
--- trunk/list-virtual.php 2007-11-27 23:24:37 UTC (rev 249)
+++ trunk/list-virtual.php 2007-12-02 13:59:33 UTC (rev 250)
@@ -15,7 +15,7 @@
* File: list-virtual.php
* List virtual users for a domain.
*
- * Template File: list-virtual.tpl
+ * Template File: list-virtual.php
*
* Template Variables:
*
@@ -165,10 +165,10 @@
}
-include ("templates/header.tpl");
-include ("templates/menu.tpl");
-include ("templates/list-virtual.tpl");
-include ("templates/footer.tpl");
+include ("templates/header.php");
+include ("templates/menu.php");
+include ("templates/list-virtual.php");
+include ("templates/footer.php");
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/login.php
===================================================================
--- trunk/login.php 2007-11-27 23:24:37 UTC (rev 249)
+++ trunk/login.php 2007-12-02 13:59:33 UTC (rev 250)
@@ -14,7 +14,7 @@
*
* File: login.php
* Authenticates a user, and populates their $_SESSION as appropriate.
- * Template File: login.tpl
+ * Template File: login.php
*
* Template Variables:
*
@@ -43,9 +43,9 @@
if ($_SERVER['REQUEST_METHOD'] == "GET")
{
- include ("./templates/header.tpl");
- include ("./templates/login.tpl");
- include ("./templates/footer.tpl");
+ include ("./templates/header.php");
+ include ("./templates/login.php");
+ include ("./templates/footer.php");
}
if ($_SERVER['REQUEST_METHOD'] == "POST")
@@ -94,8 +94,8 @@
exit(0);
}
- include ("./templates/header.tpl");
- include ("./templates/login.tpl");
- include ("./templates/footer.tpl");
+ include ("./templates/header.php");
+ include ("./templates/login.php");
+ include ("./templates/footer.php");
}
?>
Modified: trunk/main.php
===================================================================
--- trunk/main.php 2007-11-27 23:24:37 UTC (rev 249)
+++ trunk/main.php 2007-12-02 13:59:33 UTC (rev 250)
@@ -14,7 +14,7 @@
*
* File: main.php
* Displays a menu/home page.
- * Template File: main.tpl
+ * Template File: main.php
*
* Template Variables: -none-
*
@@ -27,8 +27,8 @@
authentication_require_role('admin');
-include ("./templates/header.tpl");
-include ("./templates/menu.tpl");
-include ("./templates/main.tpl");
-include ("./templates/footer.tpl");
+include ("./templates/header.php");
+include ("./templates/menu.php");
+include ("./templates/main.php");
+include ("./templates/footer.php");
?>
Modified: trunk/password.php
===================================================================
--- trunk/password.php 2007-11-27 23:24:37 UTC (rev 249)
+++ trunk/password.php 2007-12-02 13:59:33 UTC (rev 250)
@@ -14,7 +14,7 @@
*
* File: password.php
* Allows admins to change their own password.
- * Template File: password.tpl
+ * Template File: password.php
*
* Template Variables:
*
@@ -35,10 +35,10 @@
if ($_SERVER['REQUEST_METHOD'] == "GET")
{
- include ("./templates/header.tpl");
- include ("./templates/menu.tpl");
- include ("./templates/password.tpl");
- include ("./templates/footer.tpl");
+ include ("./templates/header.php");
+ include ("./templates/menu.php");
+ include ("./templates/password.php");
+ include ("./templates/footer.php");
}
if ($_SERVER['REQUEST_METHOD'] == "POST")
@@ -88,9 +88,9 @@
}
}
- include ("./templates/header.tpl");
- include ("./templates/menu.tpl");
- include ("./templates/password.tpl");
- include ("./templates/footer.tpl");
+ include ("./templates/header.php");
+ include ("./templates/menu.php");
+ include ("./templates/password.php");
+ include ("./templates/footer.php");
}
?>
Modified: trunk/search.php
===================================================================
--- trunk/search.php 2007-11-27 23:24:37 UTC (rev 249)
+++ trunk/search.php 2007-12-02 13:59:33 UTC (rev 250)
@@ -14,7 +14,7 @@
*
* File: search.php
* Provides a method for searching for a user/mailbox
- * Template File: search.tpl
+ * Template File: search.php
*
* Template Variables:
*
@@ -116,9 +116,9 @@
}
}
-include ("templates/header.tpl");
-include ("templates/menu.tpl");
-include ("templates/search.tpl");
-include ("templates/footer.tpl");
+include ("templates/header.php");
+include ("templates/menu.php");
+include ("templates/search.php");
+include ("templates/footer.php");
?>
Modified: trunk/sendmail.php
===================================================================
--- trunk/sendmail.php 2007-11-27 23:24:37 UTC (rev 249)
+++ trunk/sendmail.php 2007-12-02 13:59:33 UTC (rev 250)
@@ -14,7 +14,7 @@
*
* File: sendmail.php
* Used to send an email to a user.
- * Template File: sendmail.tpl
+ * Template File: sendmail.php
*
* Template Variables:
*
@@ -74,10 +74,10 @@
}
}
-include ("./templates/header.tpl");
-include ("./templates/menu.tpl");
-include ("./templates/sendmail.tpl");
-include ("./templates/footer.tpl");
+include ("./templates/header.php");
+include ("./templates/menu.php");
+include ("./templates/sendmail.php");
+include ("./templates/footer.php");
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
?>
Modified: trunk/setup.php
===================================================================
--- trunk/setup.php 2007-11-27 23:24:37 UTC (rev 249)
+++ trunk/setup.php 2007-12-02 13:59:33 UTC (rev 250)
@@ -27,7 +27,7 @@
require_once("functions.inc.php");
$CONF['show_header_text'] = 'NO';
-require('templates/header.tpl');
+require('templates/header.php');
?>
<div class='setup'>
Added: trunk/templates/admin_create-admin.php
===================================================================
--- trunk/templates/admin_create-admin.php (rev 0)
+++ trunk/templates/admin_create-admin.php 2007-12-02 13:59:33 UTC (rev 250)
@@ -0,0 +1,51 @@
+<div id="edit_form">
+<form name="create_admin" method="post">
+<table>
+ <tr>
+ <td colspan="3"><h3><?php print $PALANG['pAdminCreate_admin_welcome']; ?></h3></td>
+ </tr>
+ <tr>
+ <td><?php print $PALANG['pAdminCreate_admin_username'] . ":"; ?></td>
+ <td><input class="flat" type="text" name="fUsername" value="<?php print $tUsername; ?>" /></td>
+ <td><?php print $pAdminCreate_admin_username_text; ?></td>
+ </tr>
+ <tr>
+ <td><?php print $PALANG['pAdminCreate_admin_password'] . ":"; ?></td>
+ <td><input class="flat" type="password" name="fPassword" /></td>
+ <td><?php print $pAdminCreate_admin_password_text; ?></td>
+ </tr>
+ <tr>
+ <td><?php print $PALANG['pAdminCreate_admin_password2'] . ":"; ?></td>
+ <td><input class="flat" type="password" name="fPassword2" /></td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td><?php print $PALANG['pAdminCreate_admin_address'] . ":"; ?></td>
+ <td>
+ <select name="fDomains[]" size="10" multiple="multiple">
+ <?php
+ for ($i = 0; $i < sizeof ($list_domains); $i++)
+ {
+ if (in_array ($list_domains[$i], $tDomains))
+ {
+ print "<option value=\"" . $list_domains[$i] . "\" selected=\"selected\">" . $list_domains[$i] . "</option>\n";
+ }
+ else
+ {
+ print "<option value=\"" . $list_domains[$i] . "\">" . $list_domains[$i] . "</option>\n";
+ }
+ }
+ ?>
+ </select>
+ </td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td colspan="3" class="hlp_center"><input class="button" type="submit" name="submit" value="<?php print $PALANG['pAdminCreate_admin_button']; ?>" /></td>
+ </tr>
+ <tr>
+ <td colspan="3" class="standout"><?php print $tMessage; ?></td>
+ </tr>
+</table>
+</form>
+</div>
Deleted: trunk/templates/admin_create-admin.tpl
===================================================================
--- trunk/templates/admin_create-admin.tpl 2007-11-27 23:24:37 UTC (rev 249)
+++ trunk/templates/admin_create-admin.tpl 2007-12-02 13:59:33 UTC (rev 250)
@@ -1,51 +0,0 @@
-<div id="edit_form">
-<form name="create_admin" method="post">
-<table>
- <tr>
- <td colspan="3"><h3><?php print $PALANG['pAdminCreate_admin_welcome']; ?></h3></td>
- </tr>
- <tr>
- <td><?php print $PALANG['pAdminCreate_admin_username'] . ":"; ?></td>
- <td><input class="flat" type="text" name="fUsername" value="<?php print $tUsername; ?>" /></td>
- <td><?php print $pAdminCreate_admin_username_text; ?></td>
- </tr>
- <tr>
- <td><?php print $PALANG['pAdminCreate_admin_password'] . ":"; ?></td>
- <td><input class="flat" type="password" name="fPassword" /></td>
- <td><?php print $pAdminCreate_admin_password_text; ?></td>
- </tr>
- <tr>
- <td><?php print $PALANG['pAdminCreate_admin_password2'] . ":"; ?></td>
- <td><input class="flat" type="password" name="fPassword2" /></td>
- <td> </td>
- </tr>
- <tr>
- <td><?php print $PALANG['pAdminCreate_admin_address'] . ":"; ?></td>
- <td>
- <select name="fDomains[]" size="10" multiple="multiple">
- <?php
- for ($i = 0; $i < sizeof ($list_domains); $i++)
- {
- if (in_array ($list_domains[$i], $tDomains))
- {
- print "<option value=\"" . $list_domains[$i] . "\" selected=\"selected\">" . $list_domains[$i] . "</option>\n";
- }
- else
- {
- print "<option value=\"" . $list_domains[$i] . "\">" . $list_domains[$i] . "</option>\n";
- }
- }
- ?>
- </select>
- </td>
- <td> </td>
- </tr>
- <tr>
- <td colspan="3" class="hlp_center"><input class="button" type="submit" name="submit" value="<?php print $PALANG['pAdminCreate_admin_button']; ?>" /></td>
- </tr>
- <tr>
- <td colspan="3" class="standout"><?php print $tMessage; ?></td>
- </tr>
-</table>
-</form>
-</div>
Added: trunk/templates/admin_create-domain.php
===================================================================
--- trunk/templates/admin_create-domain.php (rev 0)
+++ trunk/templates/admin_create-domain.php 2007-12-02 13:59:33 UTC (rev 250)
@@ -0,0 +1,77 @@
+<div id="edit_form">
+<form name="create_domain" method="post">
+<table>
+ <tr>
+ <td colspan="3"><h3><?php print $PALANG['pAdminCreate_domain_welcome']; ?></h3></td>
+ </tr>
+ <tr>
+ <td><?php print $PALANG['pAdminCreate_domain_domain'] . ":"; ?></td>
+ <td><input class="flat" type="text" name="fDomain" value="<?php print $tDomain; ?>" /></td>
+ <td><?php print $pAdminCreate_domain_domain_text; ?></td>
+ </tr>
+ <tr>
+ <td><?php print $PALANG['pAdminCreate_domain_description'] . ":"; ?></td>
+ <td><input class="flat" type="text" name="fDescription" value="<?php print $tDescription; ?>" /></td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td><?php print $PALANG['pAdminCreate_domain_aliases'] . ":"; ?></td>
+ <td><input class="flat" type="text" name="fAliases" value="<?php print $tAliases; ?>" /></td>
+ <td><?php print $PALANG['pAdminCreate_domain_aliases_text']; ?></td>
+ </tr>
+ <tr>
+ <td><?php print $PALANG['pAdminCreate_domain_mailboxes'] . ":"; ?></td>
+ <td><input class="flat" type="text" name="fMailboxes" value="<?php print $tMailboxes; ?>" /></td>
+ <td><?php print $PALANG['pAdminCreate_domain_mailboxes_text']; ?></td>
+ </tr>
+ <?php if ($CONF['quota'] == 'YES') { ?>
+ <tr>
+ <td><?php print $PALANG['pAdminCreate_domain_maxquota'] . ":"; ?></td>
+ <td><input class="flat" type="text" name="fMaxquota" value="<?php print $tMaxquota; ?>" /></td>
+ <td><?php print $PALANG['pAdminCreate_domain_maxquota_text']; ?></td>
+ </tr>
+ <?php } if ($CONF['transport'] == 'YES') { ?>
+ <tr>
+ <td><?php print $PALANG['pAdminCreate_domain_transport'] . ":"; ?></td>
+ <td><select class="flat" name="fTransport">
+ <?php
+ for ($i = 0; $i < sizeof ($CONF['transport_options'...
[truncated message content] |
|
From: <chr...@us...> - 2007-12-02 19:23:14
|
Revision: 256
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=256&view=rev
Author: christian_boltz
Date: 2007-12-02 11:23:08 -0800 (Sun, 02 Dec 2007)
Log Message:
-----------
common.php
- define('POSTFIXADMIN', 1)
templates/*.php
- check if POSTFIXADMIN is defined to prevent direct access to the
template files
Modified Paths:
--------------
trunk/common.php
trunk/templates/admin_create-admin.php
trunk/templates/admin_create-domain.php
trunk/templates/admin_edit-admin.php
trunk/templates/admin_edit-domain.php
trunk/templates/admin_list-admin.php
trunk/templates/admin_list-domain.php
trunk/templates/admin_search.php
trunk/templates/broadcast-message.php
trunk/templates/create-alias.php
trunk/templates/create-mailbox.php
trunk/templates/edit-alias.php
trunk/templates/edit-mailbox.php
trunk/templates/edit-vacation.php
trunk/templates/fetchmail.php
trunk/templates/footer.php
trunk/templates/header.php
trunk/templates/index.php
trunk/templates/list-virtual.php
trunk/templates/login.php
trunk/templates/main.php
trunk/templates/menu.php
trunk/templates/message.php
trunk/templates/overview-get.php
trunk/templates/password.php
trunk/templates/search.php
trunk/templates/sendmail.php
trunk/templates/users_edit-alias.php
trunk/templates/users_login.php
trunk/templates/users_main.php
trunk/templates/users_menu.php
trunk/templates/users_password.php
trunk/templates/users_vacation.php
trunk/templates/viewlog.php
Modified: trunk/common.php
===================================================================
--- trunk/common.php 2007-12-02 16:54:49 UTC (rev 255)
+++ trunk/common.php 2007-12-02 19:23:08 UTC (rev 256)
@@ -16,6 +16,9 @@
* All pages should include this file - which itself sets up the necessary
* environment and ensures other functions are loaded.
*/
+
+define('POSTFIXADMIN', 1); # checked in included files
+
$incpath = dirname(__FILE__);
(ini_get('magic_quotes_gpc') ? ini_set('magic_quotes_runtime', '0') : '1');
(ini_get('magic_quotes_gpc') ? ini_set('magic_quotes_sybase', '0') : '1');
Modified: trunk/templates/admin_create-admin.php
===================================================================
--- trunk/templates/admin_create-admin.php 2007-12-02 16:54:49 UTC (rev 255)
+++ trunk/templates/admin_create-admin.php 2007-12-02 19:23:08 UTC (rev 256)
@@ -1,3 +1,4 @@
+<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
<div id="edit_form">
<form name="create_admin" method="post">
<table>
Modified: trunk/templates/admin_create-domain.php
===================================================================
--- trunk/templates/admin_create-domain.php 2007-12-02 16:54:49 UTC (rev 255)
+++ trunk/templates/admin_create-domain.php 2007-12-02 19:23:08 UTC (rev 256)
@@ -1,3 +1,4 @@
+<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
<div id="edit_form">
<form name="create_domain" method="post">
<table>
Modified: trunk/templates/admin_edit-admin.php
===================================================================
--- trunk/templates/admin_edit-admin.php 2007-12-02 16:54:49 UTC (rev 255)
+++ trunk/templates/admin_edit-admin.php 2007-12-02 19:23:08 UTC (rev 256)
@@ -1,3 +1,4 @@
+<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
<div id="edit_form">
<form name="alias" method="post">
<table>
Modified: trunk/templates/admin_edit-domain.php
===================================================================
--- trunk/templates/admin_edit-domain.php 2007-12-02 16:54:49 UTC (rev 255)
+++ trunk/templates/admin_edit-domain.php 2007-12-02 19:23:08 UTC (rev 256)
@@ -1,3 +1,4 @@
+<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
<div id="edit_form">
<form name="edit_domain" method="post">
<table>
Modified: trunk/templates/admin_list-admin.php
===================================================================
--- trunk/templates/admin_list-admin.php 2007-12-02 16:54:49 UTC (rev 255)
+++ trunk/templates/admin_list-admin.php 2007-12-02 19:23:08 UTC (rev 256)
@@ -1,3 +1,4 @@
+<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
<?php
if (sizeof ($list_admins) > 0)
{
Modified: trunk/templates/admin_list-domain.php
===================================================================
--- trunk/templates/admin_list-domain.php 2007-12-02 16:54:49 UTC (rev 255)
+++ trunk/templates/admin_list-domain.php 2007-12-02 19:23:08 UTC (rev 256)
@@ -1,3 +1,4 @@
+<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
<div id="overview">
<form name="overview" method="post">
<select name="fUsername" onChange="this.form.submit();">
Modified: trunk/templates/admin_search.php
===================================================================
--- trunk/templates/admin_search.php 2007-12-02 16:54:49 UTC (rev 255)
+++ trunk/templates/admin_search.php 2007-12-02 19:23:08 UTC (rev 256)
@@ -1,3 +1,4 @@
+<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
<?php
require(dirname(__FILE__) . '/search.tpl');
Modified: trunk/templates/broadcast-message.php
===================================================================
--- trunk/templates/broadcast-message.php 2007-12-02 16:54:49 UTC (rev 255)
+++ trunk/templates/broadcast-message.php 2007-12-02 19:23:08 UTC (rev 256)
@@ -1,3 +1,4 @@
+<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
<div id="edit_form">
<form name="broadcast-message" method="post">
<table>
Modified: trunk/templates/create-alias.php
===================================================================
--- trunk/templates/create-alias.php 2007-12-02 16:54:49 UTC (rev 255)
+++ trunk/templates/create-alias.php 2007-12-02 19:23:08 UTC (rev 256)
@@ -1,3 +1,4 @@
+<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
<div id="edit_form">
<form name="alias" method="post">
<table>
Modified: trunk/templates/create-mailbox.php
===================================================================
--- trunk/templates/create-mailbox.php 2007-12-02 16:54:49 UTC (rev 255)
+++ trunk/templates/create-mailbox.php 2007-12-02 19:23:08 UTC (rev 256)
@@ -1,3 +1,4 @@
+<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
<div id="edit_form">
<form name="mailbox" method="post">
<table>
Modified: trunk/templates/edit-alias.php
===================================================================
--- trunk/templates/edit-alias.php 2007-12-02 16:54:49 UTC (rev 255)
+++ trunk/templates/edit-alias.php 2007-12-02 19:23:08 UTC (rev 256)
@@ -1,3 +1,4 @@
+<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
<div id="edit_form">
<form name="alias" method="post">
<table>
Modified: trunk/templates/edit-mailbox.php
===================================================================
--- trunk/templates/edit-mailbox.php 2007-12-02 16:54:49 UTC (rev 255)
+++ trunk/templates/edit-mailbox.php 2007-12-02 19:23:08 UTC (rev 256)
@@ -1,3 +1,4 @@
+<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
<div id="edit_form">
<form name="mailbox" method="post">
<table>
Modified: trunk/templates/edit-vacation.php
===================================================================
--- trunk/templates/edit-vacation.php 2007-12-02 16:54:49 UTC (rev 255)
+++ trunk/templates/edit-vacation.php 2007-12-02 19:23:08 UTC (rev 256)
@@ -1,3 +1,4 @@
+<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
<script type="text/javascript">
function newLocation()
{
Modified: trunk/templates/fetchmail.php
===================================================================
--- trunk/templates/fetchmail.php 2007-12-02 16:54:49 UTC (rev 255)
+++ trunk/templates/fetchmail.php 2007-12-02 19:23:08 UTC (rev 256)
@@ -1,3 +1,4 @@
+<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
<?php
$headers=array();
Modified: trunk/templates/footer.php
===================================================================
--- trunk/templates/footer.php 2007-12-02 16:54:49 UTC (rev 255)
+++ trunk/templates/footer.php 2007-12-02 19:23:08 UTC (rev 256)
@@ -1,3 +1,4 @@
+<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
<div id="footer">
<a target="_blank" href="http://postfixadmin.com/">Postfix Admin <?php print $version; ?></a>
|
Modified: trunk/templates/header.php
===================================================================
--- trunk/templates/header.php 2007-12-02 16:54:49 UTC (rev 255)
+++ trunk/templates/header.php 2007-12-02 19:23:08 UTC (rev 256)
@@ -1,3 +1,4 @@
+<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
<?php
@header ("Expires: Sun, 16 Mar 2003 05:00:00 GMT");
@header ("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT");
Modified: trunk/templates/index.php
===================================================================
--- trunk/templates/index.php 2007-12-02 16:54:49 UTC (rev 255)
+++ trunk/templates/index.php 2007-12-02 19:23:08 UTC (rev 256)
@@ -1,3 +1,4 @@
+<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
<?php
//
// Postfix Admin
Modified: trunk/templates/list-virtual.php
===================================================================
--- trunk/templates/list-virtual.php 2007-12-02 16:54:49 UTC (rev 255)
+++ trunk/templates/list-virtual.php 2007-12-02 19:23:08 UTC (rev 256)
@@ -1,3 +1,4 @@
+<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
<div id="overview">
<form name="overview" method="post">
<select name="fDomain" onChange="this.form.submit();">
Modified: trunk/templates/login.php
===================================================================
--- trunk/templates/login.php 2007-12-02 16:54:49 UTC (rev 255)
+++ trunk/templates/login.php 2007-12-02 19:23:08 UTC (rev 256)
@@ -1,3 +1,4 @@
+<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
<div id="login">
<form name="login" method="post">
<table id="login_table" cellspacing="10">
Modified: trunk/templates/main.php
===================================================================
--- trunk/templates/main.php 2007-12-02 16:54:49 UTC (rev 255)
+++ trunk/templates/main.php 2007-12-02 19:23:08 UTC (rev 256)
@@ -1,3 +1,4 @@
+<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
<div id="main_menu">
<table>
<tr>
Modified: trunk/templates/menu.php
===================================================================
--- trunk/templates/menu.php 2007-12-02 16:54:49 UTC (rev 255)
+++ trunk/templates/menu.php 2007-12-02 19:23:08 UTC (rev 256)
@@ -1,3 +1,4 @@
+<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
<?php
function _menulink ($href, $title, $submenu = "") {
if ($submenu != "") $submenu = "<ul><li><a target='_top' href='$href'>$title</a>$submenu</li></ul>";
Modified: trunk/templates/message.php
===================================================================
--- trunk/templates/message.php 2007-12-02 16:54:49 UTC (rev 255)
+++ trunk/templates/message.php 2007-12-02 19:23:08 UTC (rev 256)
@@ -1 +1,2 @@
+<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
<?php print $tMessage; ?>
Modified: trunk/templates/overview-get.php
===================================================================
--- trunk/templates/overview-get.php 2007-12-02 16:54:49 UTC (rev 255)
+++ trunk/templates/overview-get.php 2007-12-02 19:23:08 UTC (rev 256)
@@ -1,3 +1,4 @@
+<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
<div id="overview">
<form name="overview" method="get">
<select class="flat" name="domain" onChange="this.form.submit();">
Modified: trunk/templates/password.php
===================================================================
--- trunk/templates/password.php 2007-12-02 16:54:49 UTC (rev 255)
+++ trunk/templates/password.php 2007-12-02 19:23:08 UTC (rev 256)
@@ -1,3 +1,4 @@
+<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
<div id="edit_form">
<form name="mailbox" method="post">
<table>
Modified: trunk/templates/search.php
===================================================================
--- trunk/templates/search.php 2007-12-02 16:54:49 UTC (rev 255)
+++ trunk/templates/search.php 2007-12-02 19:23:08 UTC (rev 256)
@@ -1,3 +1,4 @@
+<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
<div id="overview">
<form name="search" method="post" action="search.php">
<table width=750><tr>
Modified: trunk/templates/sendmail.php
===================================================================
--- trunk/templates/sendmail.php 2007-12-02 16:54:49 UTC (rev 255)
+++ trunk/templates/sendmail.php 2007-12-02 19:23:08 UTC (rev 256)
@@ -1,3 +1,4 @@
+<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
<div id="edit_form">
<form name="mailbox" method="post">
<table>
Modified: trunk/templates/users_edit-alias.php
===================================================================
--- trunk/templates/users_edit-alias.php 2007-12-02 16:54:49 UTC (rev 255)
+++ trunk/templates/users_edit-alias.php 2007-12-02 19:23:08 UTC (rev 256)
@@ -1,3 +1,4 @@
+<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
<div id="edit_form">
<form name="alias" method="post">
<table>
Modified: trunk/templates/users_login.php
===================================================================
--- trunk/templates/users_login.php 2007-12-02 16:54:49 UTC (rev 255)
+++ trunk/templates/users_login.php 2007-12-02 19:23:08 UTC (rev 256)
@@ -1,3 +1,4 @@
+<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
<div id="login">
<form name="login" method="post">
<table id="login_table" cellspacing="10">
Modified: trunk/templates/users_main.php
===================================================================
--- trunk/templates/users_main.php 2007-12-02 16:54:49 UTC (rev 255)
+++ trunk/templates/users_main.php 2007-12-02 19:23:08 UTC (rev 256)
@@ -1,3 +1,4 @@
+<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
<div id="main_menu">
<table>
<tr>
Modified: trunk/templates/users_menu.php
===================================================================
--- trunk/templates/users_menu.php 2007-12-02 16:54:49 UTC (rev 255)
+++ trunk/templates/users_menu.php 2007-12-02 19:23:08 UTC (rev 256)
@@ -1,3 +1,4 @@
+<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
<div id="menu">
<ul>
<li><a target="_top" href="<?php print $CONF['user_footer_link']; ?>"><?php print $PALANG['pMenu_main']; ?></a></li>
Modified: trunk/templates/users_password.php
===================================================================
--- trunk/templates/users_password.php 2007-12-02 16:54:49 UTC (rev 255)
+++ trunk/templates/users_password.php 2007-12-02 19:23:08 UTC (rev 256)
@@ -1,3 +1,4 @@
+<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
<div id="edit_form">
<form name="alias" method="post">
<table>
Modified: trunk/templates/users_vacation.php
===================================================================
--- trunk/templates/users_vacation.php 2007-12-02 16:54:49 UTC (rev 255)
+++ trunk/templates/users_vacation.php 2007-12-02 19:23:08 UTC (rev 256)
@@ -1,3 +1,4 @@
+<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
<div id="edit_form">
<form name="vacation" method="post">
<table>
Modified: trunk/templates/viewlog.php
===================================================================
--- trunk/templates/viewlog.php 2007-12-02 16:54:49 UTC (rev 255)
+++ trunk/templates/viewlog.php 2007-12-02 19:23:08 UTC (rev 256)
@@ -1,3 +1,4 @@
+<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
<div id="overview">
<form name="overview" method="post">
<select name="fDomain" onChange="this.form.submit();">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2007-12-28 21:42:06
|
Revision: 275
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=275&view=rev
Author: christian_boltz
Date: 2007-12-28 13:42:09 -0800 (Fri, 28 Dec 2007)
Log Message:
-----------
users/password.php:
- fixed syntax error
https://sourceforge.net/tracker/index.php?func=detail&aid=1852533&group_id=191583&atid=937964
- use correct string for "password too short" message
(see r270 commit message)
en.lang:
- added usage comment on PALANG['pPasswordTooShort']
Modified Paths:
--------------
trunk/languages/en.lang
trunk/users/password.php
Modified: trunk/languages/en.lang
===================================================================
--- trunk/languages/en.lang 2007-12-28 21:27:11 UTC (rev 274)
+++ trunk/languages/en.lang 2007-12-28 21:42:09 UTC (rev 275)
@@ -359,7 +359,7 @@
$PALANG['pStatus_custom'] = 'Delivers to ';
$PALANG['pStatus_popimap'] = 'POP/IMAP ';
-$PALANG['pPasswordTooShort'] = "Password is too short - requires %s characters";
+$PALANG['pPasswordTooShort'] = "Password is too short - requires %s characters"; # usage: flash_error(sprintf($PALANG['pPasswordTooShort'], $CONF['min_password_length']));
$PALANG['pFetchmail_welcome'] = 'Fetch mail for:';
$PALANG['pFetchmail_new_entry'] = 'New entry';
Modified: trunk/users/password.php
===================================================================
--- trunk/users/password.php 2007-12-28 21:27:11 UTC (rev 274)
+++ trunk/users/password.php 2007-12-28 21:42:09 UTC (rev 275)
@@ -48,7 +48,7 @@
if(strlen($fPassword) < $CONF['min_password_length']) {
$error = 1;
- flash_error($PALANG['pPassword_password_too_short_error'];
+ flash_error(sprintf($PALANG['pPasswordTooShort'], $CONF['min_password_length']));
}
$username = $USERID_USERNAME;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2007-12-30 01:32:30
|
Revision: 280
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=280&view=rev
Author: christian_boltz
Date: 2007-12-29 17:32:33 -0800 (Sat, 29 Dec 2007)
Log Message:
-----------
Summary: Added language selector to login form
functions.inc.php:
- function check_language
- new optional parameter $use_post (needed by login.php)
- check for language cookie
- check for $_POST['lang']
- removed substr() call because it made pt-br translation unuseable
- new function language_selector
- returns a HTML dropdown language selector
- new function safecookie
- similar to safeget, but for cookies
templates/login.php, templates/users_login.php:
- display language selector dropdown
login.php, users/login.php:
- check for selected language
- set cookie if user selected non-default language
languages/language.php: (NEW FILE)
- list of supported languages
- language names taken from phpMyAdmin login form
common.php:
- include languages/language.php
Modified Paths:
--------------
trunk/common.php
trunk/functions.inc.php
trunk/login.php
trunk/templates/login.php
trunk/templates/users_login.php
trunk/users/login.php
Added Paths:
-----------
trunk/languages/language.php
Modified: trunk/common.php
===================================================================
--- trunk/common.php 2007-12-29 21:11:54 UTC (rev 279)
+++ trunk/common.php 2007-12-30 01:32:33 UTC (rev 280)
@@ -39,6 +39,7 @@
exit(0);
}
}
+require_once("$incpath/languages/language.php");
require_once("$incpath/functions.inc.php");
require_once("$incpath/languages/" . check_language () . ".lang");
Modified: trunk/functions.inc.php
===================================================================
--- trunk/functions.inc.php 2007-12-29 21:11:54 UTC (rev 279)
+++ trunk/functions.inc.php 2007-12-30 01:32:33 UTC (rev 280)
@@ -142,19 +142,29 @@
// check_language
// Action: checks what language the browser uses
// Call: check_language
+// Parameter: $use_post - set to 1 if $_POST should NOT be read
//
-function check_language ()
+function check_language ($use_post = 1)
{
global $CONF;
$lang = $CONF['default_language'];
$supported_languages = array ('bg', 'ca', 'cn', 'cs', 'da', 'de', 'en', 'es', 'et', 'eu', 'fi', 'fo', 'fr', 'hu', 'is', 'it', 'mk', 'nl', 'nn', 'pl', 'pt-br', 'ru', 'sl', 'sv', 'tr', 'tw');
+ # TODO: use global $supported_languages (from languages/languages.php) instead
+
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
{
$lang_array = preg_split ('/(\s*,\s*)/', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
+ if (safecookie('lang')) {
+ array_unshift($lang_array, safecookie('lang')); # prefer language from cookie
+ }
+ if ( $use_post && safepost('lang')) {
+ array_unshift($lang_array, safepost('lang')); # but prefer $_POST['lang'] even more
+ }
+
for($i = 0; $i < count($lang_array); $i++)
{
$lang_next = $lang_array[$i];
- $lang_next = strtolower(substr(trim($lang_next), 0, 2));
+ $lang_next = strtolower(trim($lang_next));
if(in_array($lang_next, $supported_languages))
{
$lang = $lang_next;
@@ -165,8 +175,31 @@
return $lang;
}
+//
+// language_selector
+// Action: returns a language selector dropdown with the browser (or cookie) language preselected
+// Call: language_selector()
+//
+function language_selector()
+{
+ global $supported_languages; # from languages/languages.php
+
+ $current_lang = check_language();
+ $selector = '<select name="lang" xml:lang="en" dir="ltr">';
+ foreach($supported_languages as $lang => $lang_name) {
+ if ($lang == $current_lang) {
+ $selected = ' selected="selected"';
+ } else {
+ $selected = '';
+ }
+ $selector .= "<option value='$lang'$selected>$lang_name</option>";
+ }
+ $selector .= "</select>";
+ return $selector;
+}
+
//
// check_string
// Action: checks if a string is valid and returns TRUE if this is the case.
@@ -374,7 +407,20 @@
return $retval;
}
+/**
+ * safecookie
+ * @see safeget()
+ * @param String $param
+ * @param String $default (optional)
+ * @return String value from $_COOKIE[$param] or $default
+ */
+function safecookie ($param, $default="") {
+ $retval=$default;
+ if (isset($_COOKIE[$param])) $retval=$_COOKIE[$param];
+ return $retval;
+}
+
//
// get_domain_properties
// Action: Get all the properties of a domain.
Added: trunk/languages/language.php
===================================================================
--- trunk/languages/language.php (rev 0)
+++ trunk/languages/language.php 2007-12-30 01:32:33 UTC (rev 280)
@@ -0,0 +1,37 @@
+<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
+<?php
+# List of supported languages
+$supported_languages = array(
+ 'bg' => 'Български - Bulgarian',
+ 'ca' => 'Català - Catalan',
+ 'cn' => '中文 - Chinese simplified (gb2312)',
+ 'tw' => '中文 - Chinese traditional',
+ 'cs' => 'Česky - Czech',
+ 'da' => 'Dansk - Danish',
+ 'de' => 'Deutsch - German',
+ 'en' => 'English',
+ 'es' => 'Español - Spanish',
+ 'et' => 'Eesti - Estonian',
+ 'eu' => 'Euskara - Basque',
+ 'fi' => 'Suomi - Finnish',
+ 'fo' => 'Faroese',
+ 'fr' => 'Français - French',
+ 'hr' => 'Hrvatski - Croatian',
+ 'hu' => 'Magyar - Hungarian',
+ 'is' => 'Icelandic',
+ 'it' => 'Italiano - Italian',
+ 'lt' => 'Lietuvių - Lithuanian',
+ 'mk' => 'Macedonian - Macedonian',
+ 'nl' => 'Nederlands - Dutch',
+ 'nn' => 'Norsk - Norwegian',
+ 'pl' => 'Polski - Polish',
+ 'pt-br' => 'Português - Brazilian portuguese',
+ 'ru' => 'Русский - Russian',
+ 'sk' => 'Slovenčina - Slovak',
+ 'sl' => 'Slovenščina - Slovenian',
+ 'sv' => 'Svenska - Swedish',
+ 'tr' => 'Türkçe - Turkish',
+);
+
+/* vim: set expandtab ft=php softtabstop=4 tabstop=4 shiftwidth=4: */
+?>
Modified: trunk/login.php
===================================================================
--- trunk/login.php 2007-12-29 21:11:54 UTC (rev 279)
+++ trunk/login.php 2007-12-30 01:32:33 UTC (rev 280)
@@ -25,6 +25,7 @@
*
* fUsername
* fPassword
+ * lang
*/
require_once('common.php');
@@ -54,7 +55,13 @@
$fPassword = '';
if (isset ($_POST['fUsername'])) $fUsername = escape_string ($_POST['fUsername']);
if (isset ($_POST['fPassword'])) $fPassword = escape_string ($_POST['fPassword']);
+ $lang = safepost('lang');
+ if ( $lang != check_language(0) ) { # only set cookie if language selection was changed
+ setcookie('lang', $lang, time() + 60*60*24*30); # language cookie, lifetime 30 days
+ # (language preference cookie is processed even if username and/or password are invalid)
+ }
+
$result = db_query ("SELECT password FROM $table_admin WHERE username='$fUsername' AND active='1'");
if ($result['rows'] == 1)
{
Modified: trunk/templates/login.php
===================================================================
--- trunk/templates/login.php 2007-12-29 21:11:54 UTC (rev 279)
+++ trunk/templates/login.php 2007-12-30 01:32:33 UTC (rev 280)
@@ -14,6 +14,11 @@
<td><input class="flat" type="password" name="fPassword" /></td>
</tr>
<tr>
+ <td colspan="2">
+ <?php echo language_selector(); ?>
+ </td>
+ </tr>
+ <tr>
<td colspan="2" class="hlp_center"><input class="button" type="submit" name="submit" value="<?php print $PALANG['pLogin_button']; ?>" /></td>
</tr>
<tr>
@@ -31,3 +36,4 @@
</script>
</div>
+<?php /* vim: set ft=php expandtab softtabstop=3 tabstop=3 shiftwidth=3: */ ?>
Modified: trunk/templates/users_login.php
===================================================================
--- trunk/templates/users_login.php 2007-12-29 21:11:54 UTC (rev 279)
+++ trunk/templates/users_login.php 2007-12-30 01:32:33 UTC (rev 280)
@@ -14,6 +14,11 @@
<td><input class="flat" type="password" name="fPassword" /></td>
</tr>
<tr>
+ <td colspan="2">
+ <?php echo language_selector(); ?>
+ </td>
+ </tr>
+ <tr>
<td colspan="2" class="hlp_center"><input class="button" type="submit" name="submit" value="<?php print $PALANG['pUsersLogin_button']; ?>" /></td>
</tr>
<tr>
Modified: trunk/users/login.php
===================================================================
--- trunk/users/login.php 2007-12-29 21:11:54 UTC (rev 279)
+++ trunk/users/login.php 2007-12-30 01:32:33 UTC (rev 280)
@@ -25,6 +25,7 @@
*
* fUsername
* fPassword
+ * lang
*/
require_once("../common.php");
@@ -41,7 +42,13 @@
{
$fUsername = escape_string ($_POST['fUsername']);
$fPassword = escape_string ($_POST['fPassword']);
+ $lang = safepost('lang');
+ if ( $lang != check_language(0) ) { # only set cookie if language selection was changed
+ setcookie('lang', $lang, time() + 60*60*24*30); # language cookie, lifetime 30 days
+ # (language preference cookie is processed even if username and/or password are invalid)
+ }
+
$active = db_get_boolean(True);
$query = "SELECT password FROM $table_mailbox WHERE username='$fUsername' AND active=$active";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2007-12-30 18:49:43
|
Revision: 281
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=281&view=rev
Author: christian_boltz
Date: 2007-12-30 10:49:18 -0800 (Sun, 30 Dec 2007)
Log Message:
-----------
templates/menu.php:
- added JS to enable dropdowns in IE
https://sourceforge.net/tracker/?func=detail&atid=937964&aid=1859556&group_id=191583
stylesheet.css:
- dupliated the menu :hover styles as .sfhover for IE
Modified Paths:
--------------
trunk/stylesheet.css
trunk/templates/menu.php
Modified: trunk/stylesheet.css
===================================================================
--- trunk/stylesheet.css 2007-12-30 01:32:33 UTC (rev 280)
+++ trunk/stylesheet.css 2007-12-30 18:49:18 UTC (rev 281)
@@ -102,7 +102,7 @@
border-top: 4px solid #aaaaaa;
}
-#menu li:hover {
+#menu li:hover, #menu li.sfhover {
background: #BFFF00;
}
@@ -113,7 +113,7 @@
border:2px solid white;
border-top:none;
}
-#menu li:hover ul {
+#menu li:hover ul, #menu li.sfhover ul {
left: auto;
}
Modified: trunk/templates/menu.php
===================================================================
--- trunk/templates/menu.php 2007-12-30 01:32:33 UTC (rev 280)
+++ trunk/templates/menu.php 2007-12-30 18:49:18 UTC (rev 281)
@@ -79,5 +79,25 @@
print "</div>";
}
+
+
+# IE can't handle :hover dropdowns correctly. It needs some JS instead.
+?>
+<script type='text/javascript'>
+sfHover = function() {
+ var sfEls = document.getElementById("menu").getElementsByTagName("LI");
+ for (var i=0; i<sfEls.length; i++) {
+ sfEls[i].onmouseover=function() {
+ this.className+=" sfhover";
+ }
+ sfEls[i].onmouseout=function() {
+ this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
+ }
+ }
+}
+if (window.attachEvent) window.attachEvent("onload", sfHover);
+</script>
+
+<?php
/* vim: set ft=php expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Gin...@us...> - 2008-01-19 16:48:09
|
Revision: 297
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=297&view=rev
Author: GingerDog
Date: 2008-01-19 08:48:15 -0800 (Sat, 19 Jan 2008)
Log Message:
-----------
vacation: maintain away message after coming back for next time
Modified Paths:
--------------
trunk/edit-vacation.php
trunk/users/vacation.php
Modified: trunk/edit-vacation.php
===================================================================
--- trunk/edit-vacation.php 2008-01-19 16:47:27 UTC (rev 296)
+++ trunk/edit-vacation.php 2008-01-19 16:48:15 UTC (rev 297)
@@ -84,10 +84,10 @@
if ($_SERVER['REQUEST_METHOD'] == "POST")
{
- $tSubject = safepost('fSubject');
- $fSubject = escape_string ( $tSubject);
- $tBody = safepost('fBody');
- $fBody = escape_string ( $tBody);
+ $tSubject = safepost('fSubject');
+ $fSubject = escape_string ($tSubject);
+ $tBody = safepost('fBody');
+ $fBody = escape_string ($tBody);
$fChange = escape_string (safepost('fChange'));
$fBack = escape_string (safepost('fBack'));
@@ -111,15 +111,13 @@
//if change, remove old one, then perhaps set new one
if (!empty ($fBack) || !empty ($fChange))
{
- //if we find an existing vacation entry, delete it
+ //if we find an existing vacation entry, disable it
$result = db_query("SELECT * FROM $table_vacation WHERE email='$fUsername'");
if ($result['rows'] == 1)
{
- $result = db_query ("DELETE FROM $table_vacation WHERE email='$fUsername'");
- if ($result['rows'] != 1)
- {
- $error = 1;
- }
+ $db_false = db_get_boolean(false);
+ // retain vacation message if possible - i.e disable vacation away-ness.
+ $result = db_query ("UPDATE $table_vacation SET active = $db_false WHERE email='$fUsername'");
$result = db_query ("SELECT * FROM $table_alias WHERE address='$fUsername'");
if ($result['rows'] == 1)
@@ -157,7 +155,16 @@
$goto = $row['goto'];
}
$Active = db_get_boolean(True);
- $result = db_query ("INSERT INTO $table_vacation (email,subject,body,domain,created,active) VALUES ('$fUsername','$fSubject','$fBody','$fDomain',NOW(),$Active)");
+ $notActive = db_get_boolean(False);
+ // I don't think we need to care if the vacation entry is inactive or active.. as long as we don't try and
+ // insert a duplicate
+ $result = db_query("SELECT * FROM $table_vacation WHERE email = '$fUsername'");
+ if($result['rows'] == 1) {
+ $result = db_query("UPDATE $table_vacation SET active = $Active, created = NOW() WHERE email = '$fUsername'");
+ }
+ else {
+ $result = db_query ("INSERT INTO $table_vacation (email,subject,body,domain,created,active) VALUES ('$fUsername','$fSubject','$fBody','$fDomain',NOW(),$Active)");
+ }
if ($result['rows'] != 1)
{
Modified: trunk/users/vacation.php
===================================================================
--- trunk/users/vacation.php 2008-01-19 16:47:27 UTC (rev 296)
+++ trunk/users/vacation.php 2008-01-19 16:48:15 UTC (rev 297)
@@ -84,17 +84,11 @@
// if they've set themselves away OR back, delete any record of vacation emails.
if (!empty ($fBack) || !empty ($fAway))
{
- $result = db_query ("DELETE FROM $table_vacation WHERE email='$USERID_USERNAME'");
- $result2 = db_query ("DELETE FROM $table_vacation_notification WHERE on_vacation='$USERID_USERNAME'");
- if ($result['rows'] != 1)
- {
- $error = 1;
- $tMessage = $PALANG['pUsersVacation_result_error'];
- }
- else
- {
- $tMessage = $PALANG['pUsersVacation_result_success'];
- }
+ $notActive = db_get_boolean(False);
+ // this isn't very good, as $result['rows'] would be 0 if the user had not used vacation stuff before.
+ $result = db_query("UPDATE $table_vacation SET active = $notActive WHERE email='$USERID_USERNAME'");
+ $result = db_query("DELETE FROM $table_vacation_notification WHERE on_vacation='$USERID_USERNAME'");
+ $tMessage = $PALANG['pUsersVacation_result_error'];
// We need to see whether there is already an alias record for the user, or not.
// If not, we create one, else update the existing one.
@@ -146,7 +140,14 @@
$tGoto = $row['goto'];
}
$Active = db_get_boolean(True);
- $result = db_query ("INSERT INTO $table_vacation (email,subject,body,domain,created,active) VALUES ('$USERID_USERNAME','$fSubject','$fBody','$USERID_DOMAIN',NOW(),$Active)");
+ $result = db_query("SELECT * FROM $table_vacation WHERE email = '$USERID_USERNAME'");
+ if($result['rows'] == 1) {
+ $result = db_query("UPDATE $table_vacation SET active = $Active, body = '$fBody', subject = '$fSubject', created = NOW() WHERE email = '$USERID_USERNAME'");
+ }
+ else {
+ $result = db_query ("INSERT INTO $table_vacation (email,subject,body,domain,created,active) VALUES ('$USERID_USERNAME','$fSubject','$fBody','$USERID_DOMAIN',NOW(),$Active)");
+ }
+
if ($result['rows'] != 1)
{
$error = 1;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Gin...@us...> - 2008-02-21 21:43:56
|
Revision: 299
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=299&view=rev
Author: GingerDog
Date: 2008-02-21 13:43:58 -0800 (Thu, 21 Feb 2008)
Log Message:
-----------
applied patch from lenix - theme support for postfixadmin; see http://sourceforge.net/tracker/index.php?func=detail&aid=1898481&group_id=191583&atid=937966 - thank you
Modified Paths:
--------------
trunk/config.inc.php
trunk/images/postfixadmin2.xcf
trunk/index.php
trunk/templates/header.php
Added Paths:
-----------
trunk/css/
trunk/css/default.css
trunk/images/logo-default.png
Removed Paths:
-------------
trunk/stylesheet.css
Modified: trunk/config.inc.php
===================================================================
--- trunk/config.inc.php 2008-01-20 20:28:23 UTC (rev 298)
+++ trunk/config.inc.php 2008-02-21 21:43:58 UTC (rev 299)
@@ -33,10 +33,10 @@
// Postfix Admin Path
// Set the location of your Postfix Admin installation here.
-// You must enter complete url (http://domain.tld/)
+// YOU MUST ENTER THE COMPLETE URL e.g. http://domain.tld/postfixadmin
$CONF['postfix_admin_url'] = '';
-// leave this alone...
+// shouldn't need changing.
$CONF['postfix_admin_path'] = dirname(__FILE__);
// Language config
@@ -312,6 +312,11 @@
// http://www.php.net/manual/en/function.imap-open.php
+// Theme Config
+// Specify your own logo and CSS file
+$CONF['theme_logo'] = 'images/logo-default.png';
+$CONF['theme_css'] = 'css/default.css';
+
// If you want to keep most settings at default values and/or want to ensure
// that future updates work without problems, you can use a separate config
// file (config.local.php) instead of editing this file and override some
Added: trunk/css/default.css
===================================================================
--- trunk/css/default.css (rev 0)
+++ trunk/css/default.css 2008-02-21 21:43:58 UTC (rev 299)
@@ -0,0 +1,296 @@
+body {
+ background: #ffffff;
+ color: #000000;
+ font-family: "BitStream Vera Sans", Verdana, Arial, Helvetica, sans-serif;
+ font-size: 11px;
+ font-weight: normal;
+ text-align: center;
+}
+
+a {
+ text-decoration: none;
+ color: #888888;
+}
+
+a:hover {
+ text-decoration: underline;
+ color: #888888;
+}
+
+a:visited, a:active {
+ color: #888888;
+}
+
+table {
+ /* border-spacing: 0; */
+ /* padding: 0; */
+ border-collapse: collapse; /* for IE */
+}
+
+.button {
+ border: 1px solid #aaaaaa;
+ color: #777777;
+ background: #dddddd;
+ padding: 3px 3px 3px 3px;
+ font-size: 11px;
+}
+
+.button:hover {
+ background: #BCFF36;
+ color: #888888;
+}
+
+.flat {
+ border: 1px solid #888888;
+}
+
+.error_msg {
+ color: #d01313;
+}
+
+.standout {
+ color: maroon;
+ padding: 3px 3px 3px 3px;
+ text-align: center;
+}
+
+#login_header {
+ width: 750px;
+ margin: 0 auto;
+ padding-bottom: 10px;
+ text-align: left;
+}
+
+#login {
+ width: 750px;
+ margin: 0 auto;
+}
+
+#login_table {
+ border-left: 8px solid gray;
+ border-right: 8px solid gray;
+ background: #eeeeee;
+ width: 350px;
+ margin: 0 auto;
+ border-collapse: separate;
+ border-spacing: 10px;
+}
+
+#login_table h4 {
+ font-size: 13px;
+}
+
+#menu {
+ width: 750px;
+ margin: 0 auto;
+ padding-top: 10px;
+ white-space: nowrap;
+}
+
+#menu ul {
+ padding: 0;
+ margin: 0;
+ margin-left:auto;
+ margin-right:auto;
+ list-style: none;
+}
+
+#menu li {
+ float: left;
+ background: #efefef;
+ margin-right: 3px;
+ border-top: 4px solid #aaaaaa;
+}
+
+#menu li:hover, #menu li.sfhover {
+ background: #BFFF00;
+}
+
+#menu li ul {
+ position: absolute;
+ width: auto;
+ left: -999em;
+ border:2px solid white;
+ border-top:none;
+}
+#menu li:hover ul, #menu li.sfhover 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 a:hover {
+ color: #888888;
+}
+
+
+
+#menu li ul li a {
+ padding: 5px 5px 5px 5px;
+}
+
+
+
+#main_menu, #edit_form {
+ width: 750px;
+ margin: 0 auto;
+}
+
+#edit_form table {
+ margin: 0 auto;
+ padding-top: 10px;
+ text-align: left;
+ width: 500px;
+ border: 1px solid #efefef;
+}
+
+#edit_form h3 {
+ text-align: center;
+ font-size: 12px;
+ margin: 0;
+ background: #AFE1A6; /*#b4004a;*/
+ border: 1px solid #bbb;
+ line-height: 25px;
+ color: #555555;
+}
+
+.hlp_center {
+ text-align: center;
+}
+
+.help_text {
+ background: #efefef;
+ border-left: 1px solid #bbbbbb;
+ border-right: 1px solid #bbbbbb;
+ text-align: center;
+ padding-top: 5px;
+ padding-bottom: 5px;
+}
+
+#main_menu table {
+ margin: 0 auto;
+ text-align: left;
+ padding-top: 20px;
+ padding-bottom: 20px;
+}
+
+#main_menu table td {
+ padding-left: 30px;
+ padding-bottom: 5px;
+}
+
+#main_menu a {
+ color: #888888;
+ padding-left: 8px;
+}
+
+#main_menu a:hover {
+ color: #40B33C; /*#CD6A6A;*/
+ text-decoration: none;
+ padding-left: 4px;
+ border-bottom: 1px solid #40B33C;
+ border-left: 4px solid #40B33C;
+}
+
+#overview, #admin_domains, #admin_virtual {
+ width: 750px;
+ margin: 0 auto;
+ background: #AFE1A6; /*#9ACD32;*/
+ border: 1px solid #bbb;
+}
+
+#overview h4, #overview P, #overview FORM, #admin_virtual h4, #admin_virtual P, #admin_virtual FORM {
+ display: inline;
+ padding-right: 10px;
+ line-height: 30px;
+}
+
+#nav_bar {
+ text-align: right;
+ width: 750px;
+ margin: 0 auto;
+}
+
+#alias_table, #mailbox_table, #overview_table, #log_table, #admin_table {
+ width: 750px;
+ margin: 0px auto;
+ border: 1px solid #efefef;
+}
+
+#alias_table .header, #mailbox_table .header, #overview_table .header, #log_table .header, #admin_table .header {
+ line-height: 20px;
+ background: #efefef;
+ color: black;
+}
+
+#alias_table .hilightoff, #mailbox_table .hilightoff, #overview_table .hilightoff, #log_table .hilightoff, #admin_table .hilighoff {
+ background: white;
+}
+
+#alias_table .hilighton, #mailbox_table .hilighton, #overview_table .hilighton, #log_table .hilighton, #admin_table .hilighton {
+ background: #D9FF43; /*#D6FF85;*/ /*#ffdddd;*/
+}
+
+#alias_table tr:hover, #mailbox_table tr:hover, #overview_table tr:hover, #log_table tr:hover, #admin_table tr:hover {
+ background: #D9FF43; /*#D6FF85;*/ /*#ffdddd;*/
+}
+
+
+#alias_table h3, #mailbox_table h3, #overview_table h3, #log_table h3, #admin_table h3 {
+ background: silver;
+ text-align: left;
+ font-size: 12px;
+ font-weight: bold;
+ padding-left: 20px;
+ line-height: 25px;
+ margin: 0;
+}
+
+#footer {
+ width: 750px;
+ margin: 20px auto;
+ border-top: 1px solid #bbbbbb;
+ background: #efefef;
+ color: #999999;
+ line-height: 20px;
+ text-align: left;
+ padding-left: 15px;
+ font-size: 9px;
+}
+
+#footer a {
+ text-decoration: none;
+ color: #999999;
+}
+
+#footer a:hover {
+ text-decoration: underline;
+ color: #777777;
+}
+
+div.setup {
+ width:700px;
+ margin-left:auto;
+ margin-right:auto;
+ text-align: left;
+}
+
+div.setup li {
+ padding-bottom:1em;
+}
Added: trunk/images/logo-default.png
===================================================================
(Binary files differ)
Property changes on: trunk/images/logo-default.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/images/postfixadmin2.xcf
===================================================================
(Binary files differ)
Modified: trunk/index.php
===================================================================
--- trunk/index.php 2008-01-20 20:28:23 UTC (rev 298)
+++ trunk/index.php 2008-02-21 21:43:58 UTC (rev 299)
@@ -35,8 +35,7 @@
<title>Welcome to Postfix Admin</title>
</head>
<body>
- <img id="login_header_logo" src="images/postbox.png" />
- <img id="login_header_logo2" src="images/postfixadmin2.png" />
+ <img id="login_header_logo" src="images/logo-default.png" />
<h1>Welcome to Postfix Admin</h1>
<h2>What is it?</h2>
<p>Postfix Admin is a web based interface to configure and manage a Postfix based email server for many users.</p>
Deleted: trunk/stylesheet.css
===================================================================
--- trunk/stylesheet.css 2008-01-20 20:28:23 UTC (rev 298)
+++ trunk/stylesheet.css 2008-02-21 21:43:58 UTC (rev 299)
@@ -1,296 +0,0 @@
-body {
- background: #ffffff;
- color: #000000;
- font-family: "BitStream Vera Sans", Verdana, Arial, Helvetica, sans-serif;
- font-size: 11px;
- font-weight: normal;
- text-align: center;
-}
-
-a {
- text-decoration: none;
- color: #888888;
-}
-
-a:hover {
- text-decoration: underline;
- color: #888888;
-}
-
-a:visited, a:active {
- color: #888888;
-}
-
-table {
- /* border-spacing: 0; */
- /* padding: 0; */
- border-collapse: collapse; /* for IE */
-}
-
-.button {
- border: 1px solid #aaaaaa;
- color: #777777;
- background: #dddddd;
- padding: 3px 3px 3px 3px;
- font-size: 11px;
-}
-
-.button:hover {
- background: #BCFF36;
- color: #888888;
-}
-
-.flat {
- border: 1px solid #888888;
-}
-
-.error_msg {
- color: #d01313;
-}
-
-.standout {
- color: maroon;
- padding: 3px 3px 3px 3px;
- text-align: center;
-}
-
-#login_header {
- width: 750px;
- margin: 0 auto;
- padding-bottom: 10px;
- text-align: left;
-}
-
-#login {
- width: 750px;
- margin: 0 auto;
-}
-
-#login_table {
- border-left: 8px solid gray;
- border-right: 8px solid gray;
- background: #eeeeee;
- width: 350px;
- margin: 0 auto;
- border-collapse: separate;
- border-spacing: 10px;
-}
-
-#login_table h4 {
- font-size: 13px;
-}
-
-#menu {
- width: 750px;
- margin: 0 auto;
- padding-top: 10px;
- white-space: nowrap;
-}
-
-#menu ul {
- padding: 0;
- margin: 0;
- margin-left:auto;
- margin-right:auto;
- list-style: none;
-}
-
-#menu li {
- float: left;
- background: #efefef;
- margin-right: 3px;
- border-top: 4px solid #aaaaaa;
-}
-
-#menu li:hover, #menu li.sfhover {
- background: #BFFF00;
-}
-
-#menu li ul {
- position: absolute;
- width: auto;
- left: -999em;
- border:2px solid white;
- border-top:none;
-}
-#menu li:hover ul, #menu li.sfhover 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 a:hover {
- color: #888888;
-}
-
-
-
-#menu li ul li a {
- padding: 5px 5px 5px 5px;
-}
-
-
-
-#main_menu, #edit_form {
- width: 750px;
- margin: 0 auto;
-}
-
-#edit_form table {
- margin: 0 auto;
- padding-top: 10px;
- text-align: left;
- width: 500px;
- border: 1px solid #efefef;
-}
-
-#edit_form h3 {
- text-align: center;
- font-size: 12px;
- margin: 0;
- background: #AFE1A6; /*#b4004a;*/
- border: 1px solid #bbb;
- line-height: 25px;
- color: #555555;
-}
-
-.hlp_center {
- text-align: center;
-}
-
-.help_text {
- background: #efefef;
- border-left: 1px solid #bbbbbb;
- border-right: 1px solid #bbbbbb;
- text-align: center;
- padding-top: 5px;
- padding-bottom: 5px;
-}
-
-#main_menu table {
- margin: 0 auto;
- text-align: left;
- padding-top: 20px;
- padding-bottom: 20px;
-}
-
-#main_menu table td {
- padding-left: 30px;
- padding-bottom: 5px;
-}
-
-#main_menu a {
- color: #888888;
- padding-left: 8px;
-}
-
-#main_menu a:hover {
- color: #40B33C; /*#CD6A6A;*/
- text-decoration: none;
- padding-left: 4px;
- border-bottom: 1px solid #40B33C;
- border-left: 4px solid #40B33C;
-}
-
-#overview, #admin_domains, #admin_virtual {
- width: 750px;
- margin: 0 auto;
- background: #AFE1A6; /*#9ACD32;*/
- border: 1px solid #bbb;
-}
-
-#overview h4, #overview P, #overview FORM, #admin_virtual h4, #admin_virtual P, #admin_virtual FORM {
- display: inline;
- padding-right: 10px;
- line-height: 30px;
-}
-
-#nav_bar {
- text-align: right;
- width: 750px;
- margin: 0 auto;
-}
-
-#alias_table, #mailbox_table, #overview_table, #log_table, #admin_table {
- width: 750px;
- margin: 0px auto;
- border: 1px solid #efefef;
-}
-
-#alias_table .header, #mailbox_table .header, #overview_table .header, #log_table .header, #admin_table .header {
- line-height: 20px;
- background: #efefef;
- color: black;
-}
-
-#alias_table .hilightoff, #mailbox_table .hilightoff, #overview_table .hilightoff, #log_table .hilightoff, #admin_table .hilighoff {
- background: white;
-}
-
-#alias_table .hilighton, #mailbox_table .hilighton, #overview_table .hilighton, #log_table .hilighton, #admin_table .hilighton {
- background: #D9FF43; /*#D6FF85;*/ /*#ffdddd;*/
-}
-
-#alias_table tr:hover, #mailbox_table tr:hover, #overview_table tr:hover, #log_table tr:hover, #admin_table tr:hover {
- background: #D9FF43; /*#D6FF85;*/ /*#ffdddd;*/
-}
-
-
-#alias_table h3, #mailbox_table h3, #overview_table h3, #log_table h3, #admin_table h3 {
- background: silver;
- text-align: left;
- font-size: 12px;
- font-weight: bold;
- padding-left: 20px;
- line-height: 25px;
- margin: 0;
-}
-
-#footer {
- width: 750px;
- margin: 20px auto;
- border-top: 1px solid #bbbbbb;
- background: #efefef;
- color: #999999;
- line-height: 20px;
- text-align: left;
- padding-left: 15px;
- font-size: 9px;
-}
-
-#footer a {
- text-decoration: none;
- color: #999999;
-}
-
-#footer a:hover {
- text-decoration: underline;
- color: #777777;
-}
-
-div.setup {
- width:700px;
- margin-left:auto;
- margin-right:auto;
- text-align: left;
-}
-
-div.setup li {
- padding-bottom:1em;
-}
Modified: trunk/templates/header.php
===================================================================
--- trunk/templates/header.php 2008-01-20 20:28:23 UTC (rev 298)
+++ trunk/templates/header.php 2008-02-21 21:43:58 UTC (rev 299)
@@ -12,10 +12,10 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<?php
-if (file_exists (realpath ("./stylesheet.css"))) {
- print "<link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheet.css\" />\n";
-} elseif (file_exists (realpath ("../stylesheet.css"))) {
- print "<link rel=\"stylesheet\" type=\"text/css\" href=\"../stylesheet.css\" />\n";
+if (file_exists (realpath ("../".$CONF['theme_css']))) {
+ print "<link rel=\"stylesheet\" type=\"text/css\" href=\"../".htmlentities($CONF['theme_css'])."\" />\n";
+} else {
+ print "<link rel=\"stylesheet\" type=\"text/css\" href=\"".htmlentities($CONF['theme_css'])."\" />\n";
}
?>
<title>Postfix Admin - <?php print $_SERVER['HTTP_HOST']; ?></title>
@@ -23,14 +23,11 @@
<body>
<div id="login_header">
<?php
-if (file_exists (realpath ("./stylesheet.css")))
+if (file_exists (realpath ("../".$CONF['theme_logo'])))
{
- print "<img id=\"login_header_logo\" src=\"images/postbox.png\" />\n";
- print "<img id=\"login_header_logo2\" src=\"images/postfixadmin2.png\" />\n";
-} elseif (file_exists (realpath ("../stylesheet.css")))
-{
- print "<img id=\"login_header_logo\" src=\"../images/postbox.png\" />\n";
- print "<img id=\"login_header_logo2\" src=\"../images/postfixadmin2.png\" />\n";
+ print "<img id=\"login_header_logo\" src=\"../".htmlentities($CONF['theme_logo'])."\" />\n";
+} else {
+ print "<img id=\"login_header_logo\" src=\"".htmlentities($CONF['theme_logo'])."\" />\n";
}
if (($CONF['show_header_text'] == "YES") and ($CONF['header_text']))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2008-04-06 21:33:31
|
Revision: 317
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=317&view=rev
Author: christian_boltz
Date: 2008-04-06 14:33:30 -0700 (Sun, 06 Apr 2008)
Log Message:
-----------
upgrade.php:
- integrated table creation, based on SVN r1 DATABASE_MYSQL.txt
- added some comments about possible errors that can be ignored
(I'm dreaming of having an error "whitelist" and displaying
all other errors - but not for 2.2 ;-)
DATABASE_MYSQL.TXT
- added up-to-date database setup instructions
- disabled all SQL code (will be deleted later)
Modified Paths:
--------------
trunk/DATABASE_MYSQL.TXT
trunk/upgrade.php
Modified: trunk/DATABASE_MYSQL.TXT
===================================================================
--- trunk/DATABASE_MYSQL.TXT 2008-04-03 22:16:15 UTC (rev 316)
+++ trunk/DATABASE_MYSQL.TXT 2008-04-06 21:33:30 UTC (rev 317)
@@ -2,7 +2,34 @@
# Postfix Admin
# Licensed under GPL for more info check LICENSE.TXT
#
+#
+# To setup the MySQL database, do the following steps:
+# - create a MySQL database
+# CREATE DATABASE postfix;
+# - create a MySQL user that has all permissions on this database:
+# CREATE USER 'postfix'@'localhost' IDENTIFIED BY 'choose_a_password';
+# GRANT ALL PRIVILEGES ON `postfix` . * TO 'postfix'@'localhost';
+# - edit config.inc.php to suit your needs
+# - run upgrade.php to create the needed tables (yes, the filename is chosen
+# badly in this case ;-)
+# - run setup.php
+
+
+
+
+/*
+
+ ***********************************************************************
+ * everything below is probably outdated and should no longer be used. *
+ * Therefore it is commented out ;-) *
+ ***********************************************************************
+
+
+
+
+
+
# This is the complete MySQL database structure for Postfix Admin.
# If you are installing from scratch you can use this file otherwise you
# need to use the TABLE_CHANGES.TXT or TABLE_BACKUP_MX.TXT that comes with Postfix Admin.
Modified: trunk/upgrade.php
===================================================================
--- trunk/upgrade.php 2008-04-03 22:16:15 UTC (rev 316)
+++ trunk/upgrade.php 2008-04-06 21:33:30 UTC (rev 317)
@@ -225,6 +225,8 @@
$result = db_query_parsed("ALTER TABLE $table_domain ADD COLUMN transport VARCHAR(255) AFTER maxquota;", TRUE);
// don't think PGSQL supports 'AFTER transport'
$result = db_query_parsed("ALTER TABLE $table_domain ADD COLUMN backupmx {BOOLEAN} DEFAULT {BOOL_FALSE} AFTER transport;", TRUE);
+ # possible errors that can be ignored:
+ # - Invalid query: Table 'postfix.domain' doesn't exist
}
function upgrade_2_pgsql() {
@@ -265,17 +267,21 @@
ALTER TABLE $table_vacation DROP PRIMARY KEY
ALTER TABLE $table_vacation ADD 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);
- }
+ foreach ($all_sql as $sql) {
+ $result = db_query_parsed($sql, TRUE);
+ }
+ # Possible errors that can be ignored:
+ # - Invalid query: Table 'postfix.*' doesn't exist
}
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);
+ # Possible errors that can be ignored:
+ # - Invalid query: Table 'postfix.domain' doesn't exist
}
/**
@@ -364,6 +370,112 @@
}
/**
+ * create tables
+ * version: Sourceforge SVN r1 of DATABASE_MYSQL.txt
+ * changes compared to DATABASE_MYSQL.txt:
+ * - removed MySQL user and database creation
+ * - removed creation of default superadmin
+ */
+function upgrade_5_mysql() {
+
+ $result = db_query_parsed("
+ CREATE TABLE {IF_NOT_EXISTS} `" . table_by_key('admin') . "` (
+ `username` varchar(255) NOT NULL default '',
+ `password` 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',
+ `active` tinyint(1) NOT NULL default '1',
+ PRIMARY KEY (`username`),
+ KEY username (`username`)
+ ) TYPE=MyISAM COMMENT='Postfix Admin - Virtual Admins';
+ ");
+
+ $result = db_query_parsed("
+ CREATE TABLE {IF_NOT_EXISTS} `" . table_by_key('alias') . "` (
+ `address` varchar(255) NOT NULL default '',
+ `goto` text NOT NULL,
+ `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',
+ `active` tinyint(1) NOT NULL default '1',
+ PRIMARY KEY (`address`),
+ KEY address (`address`)
+ ) TYPE=MyISAM COMMENT='Postfix Admin - Virtual Aliases';
+ ");
+
+ $result = db_query_parsed("
+ CREATE TABLE {IF_NOT_EXISTS} `" . table_by_key('domain') . "` (
+ `domain` varchar(255) NOT NULL default '',
+ `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',
+ `transport` varchar(255) default NULL,
+ `backupmx` tinyint(1) NOT NULL default '0',
+ `created` datetime NOT NULL default '0000-00-00 00:00:00',
+ `modified` datetime NOT NULL default '0000-00-00 00:00:00',
+ `active` tinyint(1) NOT NULL default '1',
+ PRIMARY KEY (`domain`),
+ KEY domain (`domain`)
+ ) TYPE=MyISAM COMMENT='Postfix Admin - Virtual Domains';
+ ");
+
+ $result = db_query_parsed("
+ CREATE TABLE {IF_NOT_EXISTS} `" . table_by_key('domain_admins') . "` (
+ `username` varchar(255) NOT NULL default '',
+ `domain` varchar(255) NOT NULL default '',
+ `created` datetime NOT NULL default '0000-00-00 00:00:00',
+ `active` tinyint(1) NOT NULL default '1',
+ KEY username (`username`)
+ ) TYPE=MyISAM COMMENT='Postfix Admin - Domain Admins';
+ ");
+
+ $result = db_query_parsed("
+ CREATE TABLE {IF_NOT_EXISTS} `" . table_by_key('log') . "` (
+ `timestamp` datetime NOT NULL default '0000-00-00 00:00:00',
+ `username` varchar(255) NOT NULL default '',
+ `domain` varchar(255) NOT NULL default '',
+ `action` varchar(255) NOT NULL default '',
+ `data` varchar(255) NOT NULL default '',
+ KEY timestamp (`timestamp`)
+ ) TYPE=MyISAM COMMENT='Postfix Admin - Log';
+ ");
+
+ $result = db_query_parsed("
+ CREATE TABLE {IF_NOT_EXISTS} `" . table_by_key('mailbox') . "` (
+ `username` varchar(255) NOT NULL default '',
+ `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',
+ `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',
+ `active` tinyint(1) NOT NULL default '1',
+ PRIMARY KEY (`username`),
+ KEY username (`username`)
+ ) TYPE=MyISAM COMMENT='Postfix Admin - Virtual Mailboxes';
+ ");
+
+ $result = db_query_parsed("
+ CREATE TABLE {IF_NOT_EXISTS} `" . table_by_key('vacation') . "` (
+ `email` varchar(255) NOT NULL default '',
+ `subject` varchar(255) NOT NULL default '',
+ `body` text NOT NULL default '',
+ `cache` text NOT NULL default '',
+ `domain` varchar(255) NOT NULL default '',
+ `created` datetime NOT NULL default '0000-00-00 00:00:00',
+ `active` tinyint(1) NOT NULL default '1',
+ PRIMARY KEY (`email`),
+ KEY email (`email`)
+ ) TYPE=MyISAM COMMENT='Postfix Admin - Virtual Vacation';
+ ");
+ # Possible errors that can be ignored:
+ # - (none)
+}
+
+/**
* drop useless indicies (already available as primary key)
*/
function upgrade_79_mysql() { # MySQL only
@@ -443,7 +555,9 @@
* vacation_notification:
- DEFAULT CHARSET and COLLATE should be changed
- change all varchar fields to latin1 (email addresses don't contain utf8 characters)
-
+* charset of equal fields MUST be the same (see bugreport)
+* if necessary, delete the CONSTRAINT before changing field type and create it again
+ http://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key-constraints.html
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Gin...@us...> - 2008-04-10 10:17:20
|
Revision: 324
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=324&view=rev
Author: GingerDog
Date: 2008-04-10 03:17:23 -0700 (Thu, 10 Apr 2008)
Log Message:
-----------
upgrade.php: support creating PG db if it does nto exist; this means DATABASE_PGSQL.TXT is now obsolete
Modified Paths:
--------------
trunk/upgrade.php
Removed Paths:
-------------
trunk/DATABASE_PGSQL.TXT
Deleted: trunk/DATABASE_PGSQL.TXT
===================================================================
--- trunk/DATABASE_PGSQL.TXT 2008-04-10 09:02:37 UTC (rev 323)
+++ trunk/DATABASE_PGSQL.TXT 2008-04-10 10:17:23 UTC (rev 324)
@@ -1,169 +0,0 @@
--- Postfix Admin Release 2.x --
-----------------------------------------------------------
---
--- Copyright (c) 2002 - 2005 High5!
--- Created by: Mischa Peters <mischa at high5 dot net>
---
--- This is the complete database structure for Postfix Admin.
--- If you are installing from scratch you can use this file otherwise you
--- need to use the TABLE_CHANGES.TXT or TABLE_BACKUP_MX.TXT that comes with Postfix Admin.
--- You can find these in DOCUMENTS/
---
--- There are 2 entries for a database user in the file.
--- One you can use for Postfix and one for Postfix Admin.
---
--- You can create the database from the shell with:
--- createuser -P postfix
--- createuser -P postfixadmin
--- createuser -P vacation
--- createdb postfix
--- psql postfix
--- postfix=# \i postfix.sql
--- postfix=# \q
--- exit
---
--- Postfix / PgSQL
-
---
-DROP TABLE admin,alias,domain,domain_admins,log,mailbox CASCADE;
---
-
---
--- Table structure for table domain
---
-CREATE TABLE domain (
- domain character varying(255) NOT NULL,
- description character varying(255) NOT NULL default '',
- aliases integer NOT NULL default 0,
- mailboxes integer NOT NULL default 0,
- maxquota integer NOT NULL default 0,
- quota integer NOT NULL default 0,
- transport character varying(255) default NULL,
- backupmx boolean NOT NULL default false,
- created timestamp with time zone default now(),
- modified timestamp with time zone default now(),
- active boolean NOT NULL default true,
- Constraint "domain_key" Primary Key ("domain")
-);
-CREATE INDEX domain_domain_active ON domain(domain,active);
-COMMENT ON TABLE domain IS 'Postfix Admin - Virtual Domains';
-
---
--- Table structure for table admin
---
-CREATE TABLE "admin" (
- "username" character varying(255) NOT NULL,
- "password" character varying(255) NOT NULL default '',
- "created" timestamp with time zone default now(),
- "modified" timestamp with time zone default now(),
- "active" boolean NOT NULL default true,
- Constraint "admin_key" Primary Key ("username")
-);
-COMMENT ON TABLE admin IS 'Postfix Admin - Virtual Admins';
---
--- Table structure for table alias
---
-CREATE TABLE alias (
- address character varying(255) NOT NULL,
- goto text NOT NULL,
- domain character varying(255) NOT NULL REFERENCES domain,
- created timestamp with time zone default now(),
- modified timestamp with time zone default now(),
- active boolean NOT NULL default true,
- Constraint "alias_key" Primary Key ("address")
-);
-CREATE INDEX alias_address_active ON alias(address,active);
-COMMENT ON TABLE alias IS 'Postfix Admin - Virtual Aliases';
-
---
--- Table structure for table domain_admins
---
-CREATE TABLE domain_admins (
- username character varying(255) NOT NULL,
- domain character varying(255) NOT NULL REFERENCES domain,
- created timestamp with time zone default now(),
- active boolean NOT NULL default true
-);
-COMMENT ON TABLE domain_admins IS 'Postfix Admin - Domain Admins';
-
---
--- Table structure for table log
---
-CREATE TABLE log (
- timestamp timestamp with time zone default now(),
- username character varying(255) NOT NULL default '',
- domain character varying(255) NOT NULL default '',
- action character varying(255) NOT NULL default '',
- data text NOT NULL default ''
-);
-COMMENT ON TABLE log IS 'Postfix Admin - Log';
-
---
--- Table structure for table mailbox
---
-CREATE TABLE mailbox (
- username character varying(255) NOT NULL,
- password character varying(255) NOT NULL default '',
- name character varying(255) NOT NULL default '',
- maildir character varying(255) NOT NULL default '',
- quota integer NOT NULL default 0,
- domain character varying(255) NOT NULL REFERENCES domain,
- created timestamp with time zone default now(),
- modified timestamp with time zone default now(),
- active boolean NOT NULL default true,
- Constraint "mailbox_key" Primary Key ("username")
-);
-CREATE INDEX mailbox_username_active ON mailbox(username,active);
-COMMENT ON TABLE mailbox IS 'Postfix Admin - Virtual Mailboxes';
-
-
-
-GRANT
- SELECT,INSERT,UPDATE,DELETE
-ON
- admin,
- alias,
- domain,
- domain_admins,
- log,
- mailbox
-TO postfixadmin;
-
-GRANT SELECT ON alias,domain,mailbox TO postfix;
-
--- Vacation Stuff ...
-
-DROP TABLE vacation,vacation_notification CASCADE;
-
-CREATE TABLE vacation (
- email character varying(255) PRIMARY KEY,
- subject character varying(255) NOT NULL DEFAULT '',
- body text NOT NULL DEFAULT '',
- cache text NOT NULL DEFAULT '',
- "domain" character varying(255) NOT NULL REFERENCES "domain",
- created timestamp with time zone DEFAULT now(),
- active boolean DEFAULT true NOT NULL
-);
-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)
-);
--- Note: It's important that the primary key constraint on vacation_notification
--- be given a name which includes the '_pkey' substring (default PostgreSQL naming
--- for primary keys). The vacation-script looks for this substring to
--- distinguish between an acceptable and non-acceptable error.
-
-
-GRANT
- SELECT,INSERT,UPDATE,DELETE
-ON
- vacation
-TO postfixadmin;
-
-GRANT SELECT ON vacation TO vacation;
-GRANT SELECT,INSERT,DELETE ON vacation_notification TO vacation;
-
Modified: trunk/upgrade.php
===================================================================
--- trunk/upgrade.php 2008-04-10 09:02:37 UTC (rev 323)
+++ trunk/upgrade.php 2008-04-10 10:17:23 UTC (rev 324)
@@ -97,7 +97,7 @@
if ($current_version >= $target_version) {
# already up to date
- echo "up to date";
+ echo "Database is up to date";
return true;
}
@@ -232,14 +232,135 @@
}
function upgrade_2_pgsql() {
+
+ if(!_pgsql_object_exists(table_by_key('domain'))) {
+ db_query_parsed("
+ CREATE TABLE " . table_by_key('domain') . " (
+ domain character varying(255) NOT NULL,
+ description character varying(255) NOT NULL default '',
+ aliases integer NOT NULL default 0,
+ mailboxes integer NOT NULL default 0,
+ maxquota integer NOT NULL default 0,
+ quota integer NOT NULL default 0,
+ transport character varying(255) default NULL,
+ backupmx boolean NOT NULL default false,
+ created timestamp with time zone default now(),
+ modified timestamp with time zone default now(),
+ active boolean NOT NULL default true,
+ Constraint \"domain_key\" Primary Key (\"domain\")
+ );
+ CREATE INDEX domain_domain_active ON " . table_by_key('domain') . "(domain,active);
+ COMMENT ON TABLE " . table_by_key('domain') . " IS 'Postfix Admin - Virtual Domains';
+ ");
+ }
+ if(!_pgsql_object_exists(table_by_key('admin'))) {
+ db_query_parsed('
+ CREATE TABLE ' . table_by_key("admin") . ' (
+ "username" character varying(255) NOT NULL,
+ "password" character varying(255) NOT NULL default \'\',
+ "created" timestamp with time zone default now(),
+ "modified" timestamp with time zone default now(),
+ "active" boolean NOT NULL default true,
+ Constraint "admin_key" Primary Key ("username")
+ );' . "
+ COMMENT ON TABLE " . table_by_key('admin') . " IS 'Postfix Admin - Virtual Admins';
+ ");
+ }
+
+ if(!_pgsql_object_exists(table_by_key('alias'))) {
+ db_query_parsed('
+ CREATE TABLE ' . table_by_key('alias') . ' (
+ address character varying(255) NOT NULL,
+ goto text NOT NULL,
+ domain character varying(255) NOT NULL REFERENCES domain,
+ created timestamp with time zone default now(),
+ modified timestamp with time zone default now(),
+ active boolean NOT NULL default true,
+ Constraint "alias_key" Primary Key ("address")
+ );
+ CREATE INDEX alias_address_active ON ' . table_by_key('alias') . '(address,active);
+ COMMENT ON TABLE ' . table_by_key('alias') . ' IS \'Postfix Admin - Virtual Aliases\';
+ ');
+ }
+
+ if(!_pgsql_object_exists(table_by_key('domain_admins'))) {
+ db_query_parsed('
+ CREATE TABLE ' . table_by_key('domain_admins') . ' (
+ username character varying(255) NOT NULL,
+ domain character varying(255) NOT NULL REFERENCES domain,
+ created timestamp with time zone default now(),
+ active boolean NOT NULL default true
+ );
+ COMMENT ON TABLE ' . table_by_key('domain_admins') . ' IS \'Postfix Admin - Domain Admins\';
+ ');
+ }
+
+ if(!_pgsql_object_exists(table_by_key('log'))) {
+ db_query_parsed('
+ CREATE TABLE ' . table_by_key('log') . ' (
+ timestamp timestamp with time zone default now(),
+ username character varying(255) NOT NULL default \'\',
+ domain character varying(255) NOT NULL default \'\',
+ action character varying(255) NOT NULL default \'\',
+ data text NOT NULL default \'\'
+ );
+ COMMENT ON TABLE ' . table_by_key('log') . ' IS \'Postfix Admin - Log\';
+ ');
+ }
+
+ if(!_pgsql_object_exists(table_by_key('mailbox'))) {
+ db_query_parsed('
+ CREATE TABLE mailbox (
+ username character varying(255) NOT NULL,
+ password character varying(255) NOT NULL default \'\',
+ name character varying(255) NOT NULL default \'\',
+ maildir character varying(255) NOT NULL default \'\',
+ quota integer NOT NULL default 0,
+ domain character varying(255) NOT NULL REFERENCES domain,
+ created timestamp with time zone default now(),
+ modified timestamp with time zone default now(),
+ active boolean NOT NULL default true,
+ Constraint "mailbox_key" Primary Key ("username")
+ );
+ CREATE INDEX mailbox_username_active ON ' . table_by_key('mailbox') . '(username,active);
+ COMMENT ON TABLE ' . table_by_key('mailbox') . ' IS \'Postfix Admin - Virtual Mailboxes\';
+ ');
+ }
+
+ if(!_pgsql_object_exists(table_by_key('vacation'))) {
+ db_query_parsed('
+ CREATE TABLE ' . table_by_key('vacation') . ' (
+ email character varying(255) PRIMARY KEY,
+ subject character varying(255) NOT NULL DEFAULT \'\',
+ body text NOT NULL DEFAULT \'\',
+ cache text NOT NULL DEFAULT \'\',
+ "domain" character varying(255) NOT NULL REFERENCES "domain",
+ created timestamp with time zone DEFAULT now(),
+ active boolean DEFAULT true NOT NULL
+ );
+ CREATE INDEX vacation_email_active ON ' . table_by_key('vacation') . '(email,active);');
+ }
+
+ if(!_pgsql_object_exists(table_by_key('vacation_notification'))) {
+ db_query_parsed('
+ CREATE TABLE ' . table_by_key('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)
+ );
+ ');
+ }
+
+ // this handles anyone who is upgrading... (and should have no impact on new installees)
$table_domain = table_by_key ('domain');
$result = db_query_parsed("ALTER TABLE $table_domain ADD COLUMN transport VARCHAR(255)", TRUE);
$result = db_query_parsed("ALTER TABLE $table_domain ADD COLUMN backupmx BOOLEAN DEFAULT false", TRUE);
}
function upgrade_3_mysql() {
-# upgrade pre-2.1 database
-# from TABLE_CHANGES.TXT
+ # 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');
@@ -249,26 +370,26 @@
// these will not work on PostgreSQL; syntax is :
// ALTER TABLE foo RENAME f1 TO f2
$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 PRIMARY KEY(email)
- UPDATE $table_vacation SET domain=SUBSTRING_INDEX(email, '@', -1) WHERE email=email;
+ 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 PRIMARY KEY(email)
+ UPDATE $table_vacation SET domain=SUBSTRING_INDEX(email, '@', -1) WHERE email=email;
"));
foreach ($all_sql as $sql) {
@@ -279,7 +400,7 @@
}
function upgrade_4_mysql() { # MySQL only
-# changes between 2.1 and moving to sourceforge
+ # 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);
# Possible errors that can be ignored:
@@ -306,7 +427,7 @@
if(!_pgsql_object_exists('domain_domain_active')) {
$result = db_query_parsed("CREATE INDEX domain_domain_active ON domain(domain,active)");
}
-
+
$result = db_query_parsed("ALTER TABLE $table_domain_admins ALTER COLUMN domain DROP DEFAULT");
$result = db_query_parsed("ALTER TABLE $table_alias ALTER COLUMN address DROP DEFAULT");
$result = db_query_parsed("ALTER TABLE $table_alias ALTER COLUMN domain DROP DEFAULT");
@@ -319,57 +440,57 @@
$result = db_query_parsed("ALTER TABLE $table_domain_admins ALTER COLUMN domain DROP DEFAULT");
$result = db_query_parsed("
- BEGIN;
- ALTER TABLE $table_log RENAME COLUMN data TO data_old;
- ALTER TABLE $table_log ADD COLUMN data text NOT NULL default '';
- UPDATE $table_log SET data = CAST(data_old AS text);
- ALTER TABLE $table_log DROP COLUMN data_old;
- COMMIT;");
+BEGIN;
+ALTER TABLE $table_log RENAME COLUMN data TO data_old;
+ALTER TABLE $table_log ADD COLUMN data text NOT NULL default '';
+UPDATE $table_log SET data = CAST(data_old AS text);
+ALTER TABLE $table_log DROP COLUMN data_old;
+COMMIT;");
- $result = db_query_parsed("ALTER TABLE $table_mailbox ALTER COLUMN username DROP DEFAULT");
- $result = db_query_parsed("ALTER TABLE $table_mailbox ALTER COLUMN domain DROP DEFAULT");
+$result = db_query_parsed("ALTER TABLE $table_mailbox ALTER COLUMN username DROP DEFAULT");
+$result = db_query_parsed("ALTER TABLE $table_mailbox ALTER COLUMN domain DROP DEFAULT");
- $result = db_query_parsed("
- BEGIN;
- ALTER TABLE $table_mailbox RENAME COLUMN domain TO domain_old;
- ALTER TABLE $table_mailbox ADD COLUMN domain varchar(255) REFERENCES domain (domain);
- UPDATE $table_mailbox SET domain = domain_old;
- ALTER TABLE $table_mailbox DROP COLUMN domain_old;
- COMMIT;"
- );
- if(!_pgsql_object_exists('mailbox_username_active')) {
- db_query_parsed('CREATE INDEX mailbox_username_active ON mailbox(username,active)');
- }
+$result = db_query_parsed("
+BEGIN;
+ALTER TABLE $table_mailbox RENAME COLUMN domain TO domain_old;
+ALTER TABLE $table_mailbox ADD COLUMN domain varchar(255) REFERENCES domain (domain);
+UPDATE $table_mailbox SET domain = domain_old;
+ALTER TABLE $table_mailbox DROP COLUMN domain_old;
+COMMIT;"
+);
+if(!_pgsql_object_exists('mailbox_username_active')) {
+ db_query_parsed('CREATE INDEX mailbox_username_active ON mailbox(username,active)');
+}
- $result = db_query_parsed("ALTER TABLE $table_vacation ALTER COLUMN body SET DEFAULT ''");
- if(_pgsql_field_exists($table_vacation, 'cache')) {
- $result = db_query_parsed("ALTER TABLE $table_vacation DROP COLUMN cache");
- }
+$result = db_query_parsed("ALTER TABLE $table_vacation ALTER COLUMN body SET DEFAULT ''");
+if(_pgsql_field_exists($table_vacation, 'cache')) {
+ $result = db_query_parsed("ALTER TABLE $table_vacation DROP COLUMN cache");
+}
- $result = db_query_parsed("
- BEGIN;
- ALTER TABLE $table_vacation RENAME COLUMN domain to domain_old;
- ALTER TABLE $table_vacation ADD COLUMN domain varchar(255) REFERENCES domain;
- UPDATE $table_vacation SET domain = domain_old;
- ALTER TABLE $table_vacation DROP COLUMN domain_old;
- COMMIT;
- ");
+$result = db_query_parsed("
+BEGIN;
+ALTER TABLE $table_vacation RENAME COLUMN domain to domain_old;
+ALTER TABLE $table_vacation ADD COLUMN domain varchar(255) REFERENCES domain;
+UPDATE $table_vacation SET domain = domain_old;
+ALTER TABLE $table_vacation DROP COLUMN domain_old;
+COMMIT;
+");
- if(!_pgsql_object_exists('vacation_email_active')) {
- $result = db_query_parsed("CREATE INDEX vacation_email_active ON vacation(email,active)");
- }
+if(!_pgsql_object_exists('vacation_email_active')) {
+ $result = db_query_parsed("CREATE INDEX vacation_email_active ON vacation(email,active)");
+}
- if(!_pgsql_object_exists('vacation_notification')) {
- $result = db_query_parsed("
- CREATE TABLE vacation_notification (
+if(!_pgsql_object_exists('vacation_notification')) {
+ $result = db_query_parsed("
+ 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)
- );");
- }
+ CONSTRAINT vacation_notification_pkey primary key(on_vacation,notified)
+);");
}
+}
# Possible errors that can be ignored:
@@ -389,97 +510,97 @@
$result = db_query_parsed("
CREATE TABLE {IF_NOT_EXISTS} `" . table_by_key('admin') . "` (
- `username` varchar(255) NOT NULL default '',
- `password` 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',
- `active` tinyint(1) NOT NULL default '1',
- PRIMARY KEY (`username`),
- KEY username (`username`)
- ) TYPE=MyISAM DEFAULT {LATIN1} COMMENT='Postfix Admin - Virtual Admins';
- ");
+ `username` varchar(255) NOT NULL default '',
+ `password` 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',
+ `active` tinyint(1) NOT NULL default '1',
+ PRIMARY KEY (`username`),
+ KEY username (`username`)
+) TYPE=MyISAM DEFAULT {LATIN1} COMMENT='Postfix Admin - Virtual Admins';
+");
- $result = db_query_parsed("
- CREATE TABLE {IF_NOT_EXISTS} `" . table_by_key('alias') . "` (
- `address` varchar(255) NOT NULL default '',
- `goto` text NOT NULL,
- `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',
- `active` tinyint(1) NOT NULL default '1',
- PRIMARY KEY (`address`),
- KEY address (`address`)
+$result = db_query_parsed("
+ CREATE TABLE {IF_NOT_EXISTS} `" . table_by_key('alias') . "` (
+ `address` varchar(255) NOT NULL default '',
+ `goto` text NOT NULL,
+ `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',
+ `active` tinyint(1) NOT NULL default '1',
+ PRIMARY KEY (`address`),
+KEY address (`address`)
) TYPE=MyISAM DEFAULT {LATIN1} COMMENT='Postfix Admin - Virtual Aliases';
- ");
+");
- $result = db_query_parsed("
- CREATE TABLE {IF_NOT_EXISTS} `" . table_by_key('domain') . "` (
- `domain` varchar(255) NOT NULL default '',
- `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',
- `transport` varchar(255) default NULL,
- `backupmx` tinyint(1) NOT NULL default '0',
- `created` datetime NOT NULL default '0000-00-00 00:00:00',
- `modified` datetime NOT NULL default '0000-00-00 00:00:00',
- `active` tinyint(1) NOT NULL default '1',
- PRIMARY KEY (`domain`),
- KEY domain (`domain`)
+$result = db_query_parsed("
+ CREATE TABLE {IF_NOT_EXISTS} `" . table_by_key('domain') . "` (
+ `domain` varchar(255) NOT NULL default '',
+ `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',
+ `transport` varchar(255) default NULL,
+ `backupmx` tinyint(1) NOT NULL default '0',
+ `created` datetime NOT NULL default '0000-00-00 00:00:00',
+ `modified` datetime NOT NULL default '0000-00-00 00:00:00',
+ `active` tinyint(1) NOT NULL default '1',
+ PRIMARY KEY (`domain`),
+KEY domain (`domain`)
) TYPE=MyISAM DEFAULT {LATIN1} COMMENT='Postfix Admin - Virtual Domains';
- ");
+");
- $result = db_query_parsed("
- CREATE TABLE {IF_NOT_EXISTS} `" . table_by_key('domain_admins') . "` (
- `username` varchar(255) NOT NULL default '',
- `domain` varchar(255) NOT NULL default '',
- `created` datetime NOT NULL default '0000-00-00 00:00:00',
- `active` tinyint(1) NOT NULL default '1',
- KEY username (`username`)
- ) TYPE=MyISAM DEFAULT {LATIN1} COMMENT='Postfix Admin - Domain Admins';
- ");
+$result = db_query_parsed("
+ CREATE TABLE {IF_NOT_EXISTS} `" . table_by_key('domain_admins') . "` (
+ `username` varchar(255) NOT NULL default '',
+ `domain` varchar(255) NOT NULL default '',
+ `created` datetime NOT NULL default '0000-00-00 00:00:00',
+ `active` tinyint(1) NOT NULL default '1',
+ KEY username (`username`)
+ ) TYPE=MyISAM DEFAULT {LATIN1} COMMENT='Postfix Admin - Domain Admins';
+");
- $result = db_query_parsed("
- CREATE TABLE {IF_NOT_EXISTS} `" . table_by_key('log') . "` (
- `timestamp` datetime NOT NULL default '0000-00-00 00:00:00',
- `username` varchar(255) NOT NULL default '',
- `domain` varchar(255) NOT NULL default '',
- `action` varchar(255) NOT NULL default '',
- `data` varchar(255) NOT NULL default '',
- KEY timestamp (`timestamp`)
- ) TYPE=MyISAM DEFAULT {LATIN1} COMMENT='Postfix Admin - Log';
- ");
+$result = db_query_parsed("
+ CREATE TABLE {IF_NOT_EXISTS} `" . table_by_key('log') . "` (
+ `timestamp` datetime NOT NULL default '0000-00-00 00:00:00',
+ `username` varchar(255) NOT NULL default '',
+ `domain` varchar(255) NOT NULL default '',
+ `action` varchar(255) NOT NULL default '',
+ `data` varchar(255) NOT NULL default '',
+ KEY timestamp (`timestamp`)
+ ) TYPE=MyISAM DEFAULT {LATIN1} COMMENT='Postfix Admin - Log';
+");
- $result = db_query_parsed("
- CREATE TABLE {IF_NOT_EXISTS} `" . table_by_key('mailbox') . "` (
- `username` varchar(255) NOT NULL default '',
- `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',
- `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',
- `active` tinyint(1) NOT NULL default '1',
- PRIMARY KEY (`username`),
- KEY username (`username`)
+$result = db_query_parsed("
+ CREATE TABLE {IF_NOT_EXISTS} `" . table_by_key('mailbox') . "` (
+ `username` varchar(255) NOT NULL default '',
+ `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',
+ `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',
+ `active` tinyint(1) NOT NULL default '1',
+ PRIMARY KEY (`username`),
+KEY username (`username`)
) TYPE=MyISAM DEFAULT {LATIN1} COMMENT='Postfix Admin - Virtual Mailboxes';
- ");
+");
- $result = db_query_parsed("
- CREATE TABLE {IF_NOT_EXISTS} `" . table_by_key('vacation') . "` (
- `email` varchar(255) NOT NULL default '',
- `subject` varchar(255) NOT NULL default '',
- `body` text NOT NULL default '',
- `cache` text NOT NULL default '',
- `domain` varchar(255...
[truncated message content] |
|
From: <chr...@us...> - 2008-04-25 23:31:14
|
Revision: 344
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=344&view=rev
Author: christian_boltz
Date: 2008-04-25 16:31:21 -0700 (Fri, 25 Apr 2008)
Log Message:
-----------
upgrade.php:
- create fetchmail table (upgrade_344_mysql)
- TODO: create fetchmail table for pgsql (empty function already included ;-)
fetchmail.php:
- removed CREATE TABLE statement - it's now created by upgrade.php
Modified Paths:
--------------
trunk/fetchmail.php
trunk/upgrade.php
Modified: trunk/fetchmail.php
===================================================================
--- trunk/fetchmail.php 2008-04-25 20:35:55 UTC (rev 343)
+++ trunk/fetchmail.php 2008-04-25 23:31:21 UTC (rev 344)
@@ -33,29 +33,6 @@
* - all editable form values, see $fm_struct
*/
-/* new sql table: fetchmail
-
-create table fetchmail(
- id int(11) unsigned not null auto_increment,
- mailbox varchar(255) not null default '',
- src_server varchar(255) not null default '',
- src_auth enum('password','kerberos_v5','kerberos','kerberos_v4','gssapi','cram-md5','otp','ntlm','msn','ssh','any'),
- src_user varchar(255) not null default '',
- src_password varchar(255) not null default '',
- src_folder varchar(255) not null default '',
- 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'),
- extra_options text,
- returned_text text,
- mda varchar(255) not null default '',
- date timestamp(14),
- primary key(id)
-);
-
-*/
-
require_once('common.php');
authentication_require_role('admin');
Modified: trunk/upgrade.php
===================================================================
--- trunk/upgrade.php 2008-04-25 20:35:55 UTC (rev 343)
+++ trunk/upgrade.php 2008-04-25 23:31:21 UTC (rev 344)
@@ -800,3 +800,38 @@
FOREIGN KEY (`on_vacation`) REFERENCES vacation(`email`) ON DELETE CASCADE
");
}
+
+
+/**
+ * Create fetchmail table
+ */
+function upgrade_344_mysql() {
+
+ $table_vacation_notification = table_by_key('vacation_notification');
+
+ db_query_parsed( "
+ create table fetchmail(
+ id int(11) unsigned not null auto_increment,
+ mailbox varchar(255) not null default '',
+ src_server varchar(255) not null default '',
+ src_auth enum('password','kerberos_v5','kerberos','kerberos_v4','gssapi','cram-md5','otp','ntlm','msn','ssh','any'),
+ src_user varchar(255) not null default '',
+ src_password varchar(255) not null default '',
+ src_folder varchar(255) not null default '',
+ 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'),
+ extra_options text,
+ returned_text text,
+ mda varchar(255) not null default '',
+ date timestamp(14),
+ primary key(id)
+ );
+ ");
+}
+
+function upgrade_344_pgsql() {
+ # TODO: create fetchmail table for PgSQL
+}
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Gin...@us...> - 2008-05-21 21:05:44
|
Revision: 363
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=363&view=rev
Author: GingerDog
Date: 2008-05-21 14:05:48 -0700 (Wed, 21 May 2008)
Log Message:
-----------
inital merge of lenix's patch for domain aliasing; I think list-virtual.php needs some attention, but I've run out of time right now; upgrade.php has been updated to create the tables correctly (tested on pgsql and mysql); functionality or php scripts not tested yet
Modified Paths:
--------------
trunk/DOCUMENTS/POSTFIX_CONF.txt
trunk/css/default.css
trunk/delete.php
trunk/edit-active.php
trunk/functions.inc.php
trunk/languages/en.lang
trunk/list-virtual.php
trunk/templates/list-virtual.php
trunk/upgrade.php
Added Paths:
-----------
trunk/templates/create-alias-domain.php
Modified: trunk/DOCUMENTS/POSTFIX_CONF.txt
===================================================================
--- trunk/DOCUMENTS/POSTFIX_CONF.txt 2008-05-21 11:22:09 UTC (rev 362)
+++ trunk/DOCUMENTS/POSTFIX_CONF.txt 2008-05-21 21:05:48 UTC (rev 363)
@@ -9,9 +9,14 @@
Its generally recommended to use proxy as well (which should also appear in
postconf -m) Three main.cf variables are involved:
-virtual_alias_maps = proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_maps.cf
virtual_mailbox_domains = proxy:mysql:/etc/postfix/sql/mysql_virtual_domains_maps.cf
-virtual_mailbox_maps = proxy:mysql:/etc/postfix/sql/mysql_virtual_mailbox_maps.cf
+virtual_alias_maps =
+ proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_maps.cf,
+ proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_maps.cf,
+ proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_catchall_maps.cf
+virtual_mailbox_maps =
+ proxy:mysql:/etc/postfix/sql/mysql_virtual_mailbox_maps.cf,
+ proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_mailbox_maps.cf
Where you chose to store the .cf files doesn't really matter, but they will
have database passwords stored in plain text so they should be readable only
@@ -35,22 +40,35 @@
password = password
hosts = localhost
dbname = postfix
-query = SELECT goto FROM alias WHERE address='%s' AND active = '1'
+query = SELECT goto FROM alias WHERE address='%s' AND active = '1'
#expansion_limit = 100
+mysql_virtual_alias_domain_maps.cf:
+user = postfix
+password = password
+hosts = localhost
+dbname = postfix
+query = SELECT goto FROM alias,alias_domain WHERE alias_domain.alias_domain = '%d' and alias.address = CONCAT('%u', '@', alias_domain.target_domain) AND alias.active = 1
+mysql_virtual_alias_domain_catchall_maps.cf:
+# handles catch-all settings of target-domain
+user = postfix
+password = password
+hosts = localhost
+dbname = postfix
+query = SELECT goto FROM alias,alias_domain WHERE alias_domain.alias_domain = '%d' and alias.address = CONCAT('@', alias_domain.target_domain) AND alias.active = 1
+
mysql_virtual_domains_maps.cf:
user = postfix
password = password
hosts = localhost
dbname = postfix
-query = SELECT domain FROM domain WHERE domain='%u'
+query = SELECT domain FROM domain WHERE domain='%s' AND active = '1'
#query = SELECT domain FROM domain WHERE domain='%s'
#optional query to use when relaying for backup MX
#query = SELECT domain FROM domain WHERE domain='%s' AND backupmx = '0' AND active = '1'
#expansion_limit = 100
-
mysql_virtual_mailbox_maps.cf:
user = postfix
password = password
@@ -59,6 +77,13 @@
query = SELECT CONCAT(domain,'/',maildir) FROM mailbox WHERE username='%s' AND active = '1'
#expansion_limit = 100
+mysql_virtual_alias_domain_mailbox_maps.cf:
+user = postfix
+password = password
+hosts = localhost
+dbname = postfix
+query = SELECT CONCAT(domain,'/',maildir) FROM mailbox,alias_domain WHERE alias_domain.alias_domain = '%d' and mailbox.username = CONCAT('%u', '@', alias_domain.target_domain) AND mailbox.active = 1
+
-------------------------
More information - HowTo docs that use PostfixAdmin
Modified: trunk/css/default.css
===================================================================
--- trunk/css/default.css 2008-05-21 11:22:09 UTC (rev 362)
+++ trunk/css/default.css 2008-05-21 21:05:48 UTC (rev 363)
@@ -110,6 +110,7 @@
position: absolute;
width: auto;
left: -999em;
+ background: #FFFFFF;
border:2px solid white;
border-top:none;
}
@@ -227,32 +228,32 @@
margin: 0 auto;
}
-#alias_table, #mailbox_table, #overview_table, #log_table, #admin_table {
+#alias_domain_table, #alias_table, #mailbox_table, #overview_table, #log_table, #admin_table {
width: 750px;
margin: 0px auto;
border: 1px solid #efefef;
}
-#alias_table .header, #mailbox_table .header, #overview_table .header, #log_table .header, #admin_table .header {
+#alias_domain_table .header, #alias_table .header, #mailbox_table .header, #overview_table .header, #log_table .header, #admin_table .header {
line-height: 20px;
background: #efefef;
color: black;
}
-#alias_table .hilightoff, #mailbox_table .hilightoff, #overview_table .hilightoff, #log_table .hilightoff, #admin_table .hilighoff {
+#alias_domain_table .hilightoff, #alias_table .hilightoff, #mailbox_table .hilightoff, #overview_table .hilightoff, #log_table .hilightoff, #admin_table .hilighoff {
background: white;
}
-#alias_table .hilighton, #mailbox_table .hilighton, #overview_table .hilighton, #log_table .hilighton, #admin_table .hilighton {
+#alias_domain_table .hilighton, #alias_table .hilighton, #mailbox_table .hilighton, #overview_table .hilighton, #log_table .hilighton, #admin_table .hilighton {
background: #D9FF43; /*#D6FF85;*/ /*#ffdddd;*/
}
-#alias_table tr:hover, #mailbox_table tr:hover, #overview_table tr:hover, #log_table tr:hover, #admin_table tr:hover {
+#alias_domain_table tr:hover, #alias_table tr:hover, #mailbox_table tr:hover, #overview_table tr:hover, #log_table tr:hover, #admin_table tr:hover {
background: #D9FF43; /*#D6FF85;*/ /*#ffdddd;*/
}
-#alias_table h3, #mailbox_table h3, #overview_table h3, #log_table h3, #admin_table h3 {
+#alias_domain_table h3, #alias_table h3, #mailbox_table h3, #overview_table h3, #log_table h3, #admin_table h3 {
background: silver;
text-align: left;
font-size: 12px;
Modified: trunk/delete.php
===================================================================
--- trunk/delete.php 2008-05-21 11:22:09 UTC (rev 362)
+++ trunk/delete.php 2008-05-21 21:05:48 UTC (rev 363)
@@ -70,6 +70,8 @@
$result_alias = db_delete ($table_alias,$fWhere,$fDelete);
$result_mailbox = db_delete ($table_mailbox,$fWhere,$fDelete);
$result_log = db_delete ($table_log,$fWhere,$fDelete);
+ $result_alias_domain = db_delete ($table_alias_domain,'alias_domain',$fDelete);
+ $result_target_domain = db_delete ($table_alias_domain,'target_domain',$fDelete);
if ($CONF['vacation'] == "YES")
{
$result_vacation = db_delete ($table_vacation,$fWhere,$fDelete);
@@ -88,6 +90,28 @@
}
} # ($fTable == "domain")
+elseif ($fTable == "alias_domain")
+{
+ if (!check_owner ($SESSID_USERNAME, $fDelete))
+ {
+ $error = 1;
+ $tMessage = $PALANG['pDelete_domain_alias_error'] . "<b>$fDelete</b>!</span>";
+ }
+
+ $result = db_delete ($table_alias_domain,'alias_domain',$fDelete);
+ if (!$result || !alias_domain_postdeletion($fDelete))
+ {
+ $error = 1;
+ $tMessage = $PALANG['pAdminDelete_alias_domain_error'];
+ }
+ else
+ {
+ db_log ($SESSID_USERNAME, $fDelete, 'delete_alias_domain', $fDelete);
+ $url = "list-virtual.php?domain=" . urlencode($_REQUEST['domain']);
+ header ("Location: $url");
+ }
+} # ($fTable == "alias_domain")
+
elseif ($fTable == "alias" or $fTable == "mailbox")
{
Modified: trunk/edit-active.php
===================================================================
--- trunk/edit-active.php 2008-05-21 11:22:09 UTC (rev 362)
+++ trunk/edit-active.php 2008-05-21 21:05:48 UTC (rev 363)
@@ -34,6 +34,7 @@
if ($_SERVER['REQUEST_METHOD'] == "GET")
{
+ if (isset ($_GET['alias_domain'])) $fAliasDomain = escape_string ($_GET['alias_domain']);
if (isset ($_GET['username'])) $fUsername = escape_string ($_GET['username']);
if (isset ($_GET['alias'])) $fAlias = escape_string ($_GET['alias']); else $fAlias = escape_string ($_GET['username']);
if (isset ($_GET['domain'])) $fDomain = escape_string ($_GET['domain']);
@@ -47,6 +48,7 @@
else
{
$setSql=('pgsql'==$CONF['database_type']) ? 'active=NOT active' : 'active=1-active';
+ $setSql.=', modified=NOW()';
if ($fUsername != '')
{
$result = db_query ("UPDATE $table_mailbox SET $setSql WHERE username='$fUsername' AND domain='$fDomain'");
@@ -73,6 +75,19 @@
db_log ($SESSID_USERNAME, $fDomain, 'edit_alias_state', $fAlias);
}
}
+ if ($fAliasDomain != '')
+ {
+ $result = db_query ("UPDATE $table_alias_domain SET $setSql WHERE alias_domain='$fDomain'");
+ if ($result['rows'] != 1)
+ {
+ $error = 1;
+ $tMessage = $PALANG['pEdit_alias_domain_result_error'];
+ }
+ else
+ {
+ db_log ($SESSID_USERNAME, $fDomain, 'edit_alias_domain_state', $fDomain);
+ }
+ }
}
if ($error != 1)
Modified: trunk/functions.inc.php
===================================================================
--- trunk/functions.inc.php 2008-05-21 11:22:09 UTC (rev 362)
+++ trunk/functions.inc.php 2008-05-21 21:05:48 UTC (rev 363)
@@ -1636,10 +1636,14 @@
* Call: db_log (string username, string domain, string action, string data)
* Possible actions are:
* 'create_alias'
+ * 'create_alias_domain'
+ * 'create_mailbox'
* 'delete_alias'
+ * 'delete_alias_domain'
* 'delete_mailbox'
* 'edit_alias'
* 'edit_alias_state'
+ * 'edit_alias_domain_state'
* 'edit_mailbox'
* 'edit_mailbox_state'
* 'edit_password'
@@ -1650,7 +1654,7 @@
global $table_log;
$REMOTE_ADDR = $_SERVER['REMOTE_ADDR'];
- $action_list = array('create_alias', 'delete_alias', 'edit_alias', 'create_mailbox', 'delete_mailbox', 'edit_mailbox', 'edit_alias_state', 'edit_mailbox_state', 'edit_password');
+ $action_list = array('create_alias', 'create_alias_domain', 'delete_alias', 'delete_alias_domain', 'edit_alias', 'create_mailbox', 'delete_mailbox', 'edit_mailbox', 'edit_alias_state', 'edit_alias_domain_state', 'edit_mailbox_state', 'edit_password');
if(!in_array($action, $action_list)) {
die("Invalid log action : $action"); // could do with something better?
@@ -1814,6 +1818,42 @@
}
/*
+ Called after an alias_domain has been deleted in the DBMS.
+ Returns: boolean.
+ */
+function alias_domain_postdeletion($alias_domain)
+{
+ global $CONF;
+ $confpar='alias_domain_postdeletion_script';
+
+ if (!isset($CONF[$confpar]) || empty($CONF[$confpar]))
+ {
+ return true;
+ }
+
+ if (empty($alias_domain))
+ {
+ print '<p>Warning: empty alias_domain parameter.</p>';
+ return false;
+ }
+
+ $cmdarg1=escapeshellarg($alias_domain);
+ $command=$CONF[$confpar]." $cmdarg1";
+ $retval=0;
+ $output=array();
+ $firstline='';
+ $firstline=exec($command,$output,$retval);
+ if (0!=$retval)
+ {
+ error_log("Running $command yielded return value=$retval, first line of output=$firstline");
+ print '<p>WARNING: Problems running alias_domain postdeletion script!</p>';
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/*
Called by mailbox_postcreation() after a mailbox has been
created. Immediately returns, unless configuration indicates
that one or more sub-folders should be created.
@@ -2124,6 +2164,7 @@
$table_admin = table_by_key ('admin');
$table_alias = table_by_key ('alias');
+$table_alias_domain = table_by_key ('alias_domain');
$table_domain = table_by_key ('domain');
$table_domain_admins = table_by_key ('domain_admins');
$table_log = table_by_key ('log');
Modified: trunk/languages/en.lang
===================================================================
--- trunk/languages/en.lang 2008-05-21 11:22:09 UTC (rev 362)
+++ trunk/languages/en.lang 2008-05-21 21:05:48 UTC (rev 363)
@@ -31,6 +31,7 @@
$PALANG['pMenu_main'] = 'Main';
$PALANG['pMenu_overview'] = 'Overview';
$PALANG['pMenu_create_alias'] = 'Add Alias';
+$PALANG['pMenu_create_alias_domain'] = 'Add Alias Domain';
$PALANG['pMenu_create_mailbox'] = 'Add Mailbox';
$PALANG['pMenu_fetchmail'] = 'Fetch Email';
$PALANG['pMenu_sendmail'] = 'Send Email';
@@ -53,16 +54,21 @@
$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_alias_domain_title'] = ':: Domain Aliases';
+$PALANG['pOverview_alias_title'] = ':: Aliases';
$PALANG['pOverview_mailbox_title'] = ':: Mailboxes';
$PALANG['pOverview_button'] = 'Go';
$PALANG['pOverview_welcome'] = 'Overview for ';
+$PALANG['pOverview_alias_domain_aliases'] = 'Alias Domains';
+$PALANG['pOverview_alias_domain_target'] = '%s is an Alias Domain for:';
$PALANG['pOverview_alias_alias_count'] = 'Aliases';
$PALANG['pOverview_alias_mailbox_count'] = 'Mailboxes';
$PALANG['pOverview_alias_address'] = 'From';
$PALANG['pOverview_alias_goto'] = 'To';
$PALANG['pOverview_alias_modified'] = 'Last Modified';
+$PALANG['pOverview_alias_domain_modified'] = 'Last Modified';
$PALANG['pOverview_alias_active'] = 'Active';
+$PALANG['pOverview_alias_domain_active'] = 'Active';
$PALANG['pOverview_alias_edit'] = 'Alias';
$PALANG['and_x_more'] = '[and %s more...]';
$PALANG['pOverview_mailbox_username'] = 'Email';
@@ -76,6 +82,7 @@
$PALANG['pOverview_get_domain'] = 'Domain';
$PALANG['pOverview_get_aliases'] = 'Aliases';
+$PALANG['pOverview_get_alias_domains'] = 'Domain Aliases';
$PALANG['pOverview_get_mailboxes'] = 'Mailboxes';
$PALANG['pOverview_get_quota'] = 'Mailbox Quota (MB)';
$PALANG['pOverview_get_modified'] = 'Last Modified';
@@ -84,8 +91,21 @@
$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_domain_alias_error'] = '<span class="error_msg">This domain is not yours ';
$PALANG['pDelete_alias_error'] = '<span class="error_msg">Unable to delete alias ';
+$PALANG['pCreate_alias_domain_welcome'] = 'Mirror addresses of one of your domains to another.';
+$PALANG['pCreate_alias_domain_alias'] = 'Alias Domain';
+$PALANG['pCreate_alias_domain_alias_text'] = 'The domain that mails come in for.';
+$PALANG['pCreate_alias_domain_target'] = 'Target Domain';
+$PALANG['pCreate_alias_domain_target_text'] = 'The domain where mails should go to.';
+$PALANG['pCreate_alias_domain_active'] = 'Active';
+$PALANG['pCreate_alias_domain_button'] = 'Add Alias Domain';
+$PALANG['pCreate_alias_domain_error1'] = 'You are not allowed to create the chosen configuration.';
+$PALANG['pCreate_alias_domain_error2'] = 'The chosen configuration is invalid, please choose a different one!';
+$PALANG['pCreate_alias_domain_error3'] = 'Database insert failed.';
+$PALANG['pCreate_alias_domain_success'] = 'The domain alias has been added to the alias domain table!';
+
$PALANG['pCreate_alias_welcome'] = 'Create a new alias for your domain.';
$PALANG['pCreate_alias_address'] = 'Alias';
$PALANG['pCreate_alias_address_text_error1'] = '<br /><span class="error_msg">The ALIAS is not valid!</span>';
@@ -98,7 +118,7 @@
$PALANG['pCreate_alias_goto_text_error'] = 'Where the email needs to go.<br /><span class="error_msg">The TO is not valid!</span>';
$PALANG['pCreate_alias_result_error'] = '<span class="error_msg">Unable to add the alias to the alias table!</span>';
$PALANG['pCreate_alias_result_success'] = 'The alias has been added to the alias table!';
-$PALANG['pCreate_alias_catchall_text'] = 'To create a catch-all use an "*" as alias.<br />For domain to domain forwarding use "*@domain.tld" as to.';
+$PALANG['pCreate_alias_catchall_text'] = 'To create a catch-all use an "*" as alias.'; # XXX don't propagate usage of *@target-domain.com for domain-aliasing any longer
$PALANG['pEdit_alias_welcome'] = 'Edit an alias for your domain.<br />One entry per line.';
$PALANG['pEdit_alias_address'] = 'Alias';
@@ -108,6 +128,7 @@
$PALANG['pEdit_alias_goto_text_error1'] = '<span class="error_msg">You didn\'t enter anything at To</span>';
$PALANG['pEdit_alias_goto_text_error2'] = '<span class="error_msg">The email address that you have entered is not valid: ';
$PALANG['pEdit_alias_domain_error'] = '<span class="error_msg">This domain is not yours: ';
+$PALANG['pEdit_alias_domain_result_error'] = '<span class="error_msg">Unable to modify the alias domain!</span>';
$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_button'] = 'Edit Alias';
@@ -180,9 +201,12 @@
$PALANG['pViewlog_action_edit_mailbox'] = 'edit mailbox';
$PALANG['pViewlog_action_edit_mailbox_state'] = 'edit mailbox active';
$PALANG['pViewlog_action_create_alias'] = 'create alias';
+$PALANG['pViewlog_action_create_alias_domain'] = 'create alias domain';
$PALANG['pViewlog_action_delete_alias'] = 'delete alias';
+$PALANG['pViewlog_action_delete_alias_domain'] = 'delete alias domain';
$PALANG['pViewlog_action_edit_alias'] = 'edit alias';
$PALANG['pViewlog_action_edit_alias_state'] = 'edit alias active';
+$PALANG['pViewlog_action_edit_alias_domain_state'] = 'edit alias domain active';
$PALANG['pViewlog_action_edit_password'] = 'change password';
$PALANG['pViewlog_button'] = 'Go';
@@ -260,6 +284,7 @@
$PALANG['pAdminCreate_domain_result_success'] = 'Domain has been added!';
$PALANG['pAdminDelete_domain_error'] = '<span class="error_msg">Unable to remove domain!</span>';
+$PALANG['pAdminDelete_alias_domain_error'] = '<span class="error_msg">Unable to remove domain alias!</span>';
$PALANG['pAdminEdit_domain_welcome'] = 'Edit a domain';
$PALANG['pAdminEdit_domain_domain'] = 'Domain';
Modified: trunk/list-virtual.php
===================================================================
--- trunk/list-virtual.php 2008-05-21 11:22:09 UTC (rev 362)
+++ trunk/list-virtual.php 2008-05-21 21:05:48 UTC (rev 363)
@@ -72,12 +72,54 @@
exit(0);
}
+
+# Alias-Domains
+# first try to get a list of other domains pointing
+# to this currently chosen one (aka. alias domains)
+$query = "SELECT $table_alias_domain.alias_domain,$table_alias_domain.target_domain,$table_alias_domain.modified,$table_alias_domain.active FROM $table_alias_domain WHERE target_domain='$fDomain' ORDER BY $table_alias_domain.alias_domain LIMIT $fDisplay, $page_size";
+if ('pgsql'==$CONF['database_type'])
+{
+ $query = "SELECT alias_domain,target_domain,extract(epoch from modified) as modified,active FROM $table_alias_domain WHERE target_domain='$fDomain' ORDER BY alias_domain 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;
+ }
+ $tAliasDomains[] = $row;
+ }
+}
+# now let's see if the current domain itself is an alias for another domain
+$query = "SELECT $table_alias_domain.alias_domain,$table_alias_domain.target_domain,$table_alias_domain.modified,$table_alias_domain.active FROM $table_alias_domain WHERE alias_domain='$fDomain'";
+if ('pgsql'==$CONF['database_type'])
+{
+ $query = "SELECT alias_domain,target_domain,extract(epoch from modified) as modified,active FROM $table_alias_domain WHERE alias_domain='$fDomain'";
+}
+$result = db_query ($query);
+if ($result['rows'] > 0)
+{
+ if($row = db_array ($result['result']))
+ {
+ if ('pgsql'==$CONF['database_type'])
+ {
+ $row['modified']=gmstrftime('%c %Z',$row['modified']);
+ $row['active']=('t'==$row['active']) ? 1 : 0;
+ }
+ $tTargetDomain = $row;
+ }
+}
+
+
$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)
{
Added: trunk/templates/create-alias-domain.php
===================================================================
--- trunk/templates/create-alias-domain.php (rev 0)
+++ trunk/templates/create-alias-domain.php 2008-05-21 21:05:48 UTC (rev 363)
@@ -0,0 +1,49 @@
+<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
+<div id="edit_form">
+<form name="alias_domain" method="post">
+<table>
+ <tr>
+ <td colspan="3"><h3><?php print $PALANG['pCreate_alias_domain_welcome']; ?></h3></td>
+ </tr>
+ <tr>
+ <td><?php print $PALANG['pCreate_alias_domain_alias'] . ":"; ?></td>
+ <td>
+ <select class="flat" name="alias_domain">
+ <?php
+ foreach ($list_domains as $dom)
+ {
+ if (isset($list_aliases[$dom]) || in_array($dom,$list_aliases)) continue;
+ print "<option value=\"$dom\"".(($fAliasDomain == $dom) ? ' selected' : '').">$dom</option>\n";
+ }
+ ?>
+ </select>
+ <td><?php print $PALANG['pCreate_alias_domain_alias_text']; ?></td>
+ </tr>
+ <tr>
+ <td><?php print $PALANG['pCreate_alias_domain_target'] . ":"; ?></td>
+ <td>
+ <select class="flat" name="target_domain">
+ <?php
+ foreach ($list_domains as $dom)
+ {
+ if (isset($list_aliases[$dom])) continue;
+ print "<option value=\"$dom\"".(($fTargetDomain == $dom) ? ' selected' : '').">$dom</option>\n";
+ }
+ ?>
+ </select>
+ <td><?php print $PALANG['pCreate_alias_domain_target_text']; ?></td>
+ </tr>
+ <tr>
+ <td><?php print $PALANG['pCreate_alias_domain_active'] . ":"; ?></td>
+ <td><input class="flat" type="checkbox" name="active" value="1"<?php if ($fActive) { print ' checked'; } ?> /></td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td colspan="3" class="standout"><?php if ($error) { print '<span class="error_msg">'; } print $tMessage; if ($error) { print '</span>'; } ?></td>
+ </tr>
+ <tr>
+ <td colspan="3" class="hlp_center"><input class="button" type="submit" name="submit" value="<?php print $PALANG['pCreate_alias_domain_button']; ?>" /></td>
+ </tr>
+</table>
+</form>
+</div>
Modified: trunk/templates/list-virtual.php
===================================================================
--- trunk/templates/list-virtual.php 2008-05-21 11:22:09 UTC (rev 362)
+++ trunk/templates/list-virtual.php 2008-05-21 21:05:48 UTC (rev 363)
@@ -1,7 +1,7 @@
<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?>
<div id="overview">
-<form name="overview" method="post">
-<select name="fDomain" onChange="this.form.submit();">
+<form name="overview" method="get">
+<select name="domain" onChange="this.form.submit();">
<?php
$file = 'list-virtual.php';
@@ -71,6 +71,57 @@
}
print "</td></tr></table></div>\n";
+
+if ((sizeof ($tAliasDomains) > 0) || is_array ($tTargetDomain))
+{
+ print "<table id=\"alias_domain_table\">\n";
+ print " <tr>\n";
+ print " <td colspan=\"4\"><h3>" . $PALANG['pOverview_alias_domain_title'] . "</h3></td>";
+ print " </tr>";
+ if(sizeof ($tAliasDomains) > 0)
+ {
+ print " <tr class=\"header\">\n";
+ print " <td>" . sprintf($PALANG['pOverview_alias_domain_aliases'], $fDomain) . "</td>\n";
+ print " <td>" . $PALANG['pOverview_alias_domain_modified'] . "</td>\n";
+ print " <td>" . $PALANG['pOverview_alias_domain_active'] . "</td>\n";
+ print " <td> </td>\n";
+ print " </tr>\n";
+ for ($i = 0; $i < sizeof ($tAliasDomains); $i++)
+ {
+ print " <tr class=\"hilightoff\" onMouseOver=\"className='hilighton';\" onMouseOut=\"className='hilightoff';\">\n";
+ print " <td><a href=\"$file?domain=" . urlencode ($tAliasDomains[$i]['alias_domain']) . "&limit=" . $current_limit . "\">" . $tAliasDomains[$i]['alias_domain'] . "</a></td>\n";
+ print " <td>" . $tAliasDomains[$i]['modified'] . "</td>\n";
+ $active = ($tAliasDomains[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO'];
+ print " <td><a href=\"edit-active.php?alias_domain=true&domain=" . urlencode ($tAliasDomains[$i]['alias_domain']) . "&return=$file" . urlencode ( "?domain=" . $fDomain . "&limit=" . $current_limit) . "\">" . $active . "</a></td>\n";
+ print " <td><a href=\"delete.php?table=alias_domain&delete=" . urlencode ($tAliasDomains[$i]['alias_domain']) . "&domain=$fDomain" . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_alias_domains'] . ": ". $tAliasDomains[$i]['alias_domain'] . "')\">" . $PALANG['del'] . "</a></td>\n";
+ print " </tr>\n";
+ }
+ }
+
+ if(is_array($tTargetDomain))
+ {
+ print " <tr class=\"header\">\n";
+ print " <td>" . sprintf($PALANG['pOverview_alias_domain_target'], $fDomain) . "</td>\n";
+ print " <td>" . $PALANG['pOverview_alias_domain_modified'] . "</td>\n";
+ print " <td>" . $PALANG['pOverview_alias_domain_active'] . "</td>\n";
+ print " <td> </td>\n";
+ print " </tr>\n";
+ print " <tr class=\"hilightoff\" onMouseOver=\"className='hilighton';\" onMouseOut=\"className='hilightoff';\">\n";
+ print " <td><a href=\"$file?domain=" . urlencode ($tTargetDomain['target_domain']) . "&limit=" . $current_limit . "\">" . $tTargetDomain['target_domain'] . "</a></td>\n";
+ print " <td>" . $tTargetDomain['modified'] . "</td>\n";
+ $active = ($tTargetDomain['active'] == 1) ? $PALANG['YES'] : $PALANG['NO'];
+ print " <td><a href=\"edit-active.php?alias_domain=true&domain=" . urlencode ($fDomain) . "&return=$file" . urlencode ( "?domain=" . $fDomain . "&limit=" . $current_limit) . "\">" . $active . "</a></td>\n";
+ print " <td><a href=\"delete.php?table=alias_domain&delete=" . urlencode ($fDomain) . "&domain=" . urlencode ($fDomain) . "\" onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_alias_domains'] . ": " . htmlentities ($fDomain) . "')\">" . $PALANG['del'] . "</a></td>\n";
+ print " </tr>\n";
+
+ }
+ print "</table>\n";
+ if (!is_array($tTargetDomain))
+ {
+ print "<p><a href=\"create-alias-domain.php?target_domain=$fDomain\">" . $PALANG['pMenu_create_alias_domain'] . "</a>\n";
+ }
+}
+
if (sizeof ($tAlias) > 0)
{
print "<table id=\"alias_table\">\n";
Modified: trunk/upgrade.php
===================================================================
--- trunk/upgrade.php 2008-05-21 11:22:09 UTC (rev 362)
+++ trunk/upgrade.php 2008-05-21 21:05:48 UTC (rev 363)
@@ -534,6 +534,52 @@
$result = db_query_parsed("CREATE INDEX alias_address_active ON alias(address,active)");
}
+/**
+ * MySQL only alias_domain table
+ */
+function upgrade_300_mysql() {
+ $table_alias_domain = table_by_key('alias_domain');
+ // i just duplicate stuff from DATABASE_*.TXT over here?
+ if( $CONF['database_type'] == 'pgsql' ) {
+ // check if table already exists, if so, don't recreate it
+ $sql_table_exists =
+ "SELECT relname ".
+ " FROM pg_class ".
+ " WHERE relname = '$table_alias_domain'";
+ $res = db_query( $sql_table_exists );
+ if( $res['rows'] == 0 ) {
+ $sql_table_create =
+ "CREATE TABLE $table_alias_domain ( ".
+ " alias_domain character varying(255) NOT NULL REFERENCES domain(domain) ON DELETE CASCADE, ".
+ " target_domain character varying(255) NOT NULL REFERENCES domain(domain) ON DELETE CASCADE, ".
+ " created timestamp with time zone default now(), ".
+ " modified timestamp with time zone default now(), ".
+ " active boolean NOT NULL default true, ".
+ " Constraint \"alias_domain_pkey\" Primary Key (\"alias_domain\") ".
+ ")";
+ db_query( $sql_table_create );
+ $sql_table_index =
+ "CREATE INDEX alias_domain_active ON $table_alias_domain(alias_domain,active)";
+ db_query( $sql_table_index );
+ $sql_table_comment =
+ "COMMENT ON TABLE $table_alias_domain IS 'Postfix Admin - Domain Aliases'";
+ db_query( $sql_table_comment );
+ }
+ } else { // database-type mysql assumed
+ $sql_table_create =
+ "CREATE TABLE IF NOT EXISTS `$table_alias_domain` ( ".
+ " `alias_domain` varchar(255) NOT NULL default '', ".
+ " `target_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', ".
+ " `active` tinyint(1) NOT NULL default '1', ".
+ " PRIMARY KEY (`alias_domain`), ".
+ " KEY `active` (`active`), ".
+ " KEY `target_domain` (`target_domain`) ".
+ ") TYPE=MyISAM COMMENT='Postfix Admin - Domain Aliases'";
+ db_query( $sql_table_create );
+ }
+}
$result = db_query_parsed("ALTER TABLE $table_domain_admins ALTER COLUMN username DROP DEFAULT");
$result = db_query_parsed("ALTER TABLE $table_domain_admins ALTER COLUMN domain DROP DEFAULT");
@@ -864,3 +910,46 @@
}
}
+/**
+ * Support alias_domain table
+ */
+function upgrade_362_mysql() {
+ # Table structure for table alias_domain
+ #
+ $table_alias_domain = table_by_key('alias_domain');
+ db_query_parsed("
+ CREATE TABLE IF NOT EXISTS $table_alias_domain (
+ `alias_domain` varchar(255) NOT NULL default '',
+ `target_domain` varchar(255) NOT NULL default '',
+ `created` datetime NOT NUL...
[truncated message content] |
|
From: <chr...@us...> - 2008-05-21 22:06:01
|
Revision: 364
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=364&view=rev
Author: christian_boltz
Date: 2008-05-21 15:06:08 -0700 (Wed, 21 May 2008)
Log Message:
-----------
backup.php, config.inc.php:
- added alias_domain table at various places
- also opened https://sourceforge.net/tracker/index.php?func=detail&aid=1969168&group_id=191583&atid=937967
("backup.php should use table list from config")
Modified Paths:
--------------
trunk/backup.php
trunk/config.inc.php
Modified: trunk/backup.php
===================================================================
--- trunk/backup.php 2008-05-21 21:05:48 UTC (rev 363)
+++ trunk/backup.php 2008-05-21 22:06:08 UTC (rev 364)
@@ -75,6 +75,7 @@
$tables = array(
'admin',
'alias',
+ 'alias_domain',
'config',
'domain',
'domain_admins',
Modified: trunk/config.inc.php
===================================================================
--- trunk/config.inc.php 2008-05-21 21:05:48 UTC (rev 363)
+++ trunk/config.inc.php 2008-05-21 22:06:08 UTC (rev 364)
@@ -59,6 +59,7 @@
$CONF['database_tables'] = array (
'admin' => 'admin',
'alias' => 'alias',
+ 'alias_domain' => 'alias_domain',
'config' => 'config',
'domain' => 'domain',
'domain_admins' => 'domain_admins',
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2008-05-25 19:33:38
|
Revision: 369
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=369&view=rev
Author: christian_boltz
Date: 2008-05-25 12:33:43 -0700 (Sun, 25 May 2008)
Log Message:
-----------
create-mailbox.php:
- create subfolders _after_ sending the welcome mail
functions.inc.php:
- sleep(1) before creating subfolders for a newly created mailbox
This fixes subfolder creation when courier is used.
https://sourceforge.net/tracker/?func=detail&atid=937964&aid=1970684&group_id=191583
Modified Paths:
--------------
trunk/create-mailbox.php
trunk/functions.inc.php
Modified: trunk/create-mailbox.php
===================================================================
--- trunk/create-mailbox.php 2008-05-23 11:39:15 UTC (rev 368)
+++ trunk/create-mailbox.php 2008-05-25 19:33:43 UTC (rev 369)
@@ -278,13 +278,6 @@
*/
$tDomain = $fDomain;
- if (create_mailbox_subfolders($fUsername,$fPassword))
- {
- $tMessage = $PALANG['pCreate_mailbox_result_success'] . "<br />($fUsername";
- } else {
- $tMessage = $PALANG['pCreate_mailbox_result_succes_nosubfolders'] . "<br />($fUsername";
- }
-
if ($CONF['generate_password'] == "YES")
{
$tMessage .= " / $fPassword)</br />";
@@ -326,7 +319,15 @@
$tMessage .= "<br />" . $PALANG['pSendmail_result_success'] . "<br />";
}
}
+
+ if (create_mailbox_subfolders($fUsername,$fPassword))
+ {
+ $tMessage = $PALANG['pCreate_mailbox_result_success'] . "<br />($fUsername";
+ } else {
+ $tMessage = $PALANG['pCreate_mailbox_result_succes_nosubfolders'] . "<br />($fUsername";
}
+
+ }
}
}
Modified: trunk/functions.inc.php
===================================================================
--- trunk/functions.inc.php 2008-05-23 11:39:15 UTC (rev 368)
+++ trunk/functions.inc.php 2008-05-25 19:33:43 UTC (rev 369)
@@ -1926,6 +1926,8 @@
$s='{'.$s_host.$s_port.$s_options.'}';
+ sleep(1); # give the mail triggering the mailbox creation a chance to do its job
+
$i=@imap_open($s,$login,$cleartext_password);
if (FALSE==$i)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2008-05-25 21:19:50
|
Revision: 373
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=373&view=rev
Author: christian_boltz
Date: 2008-05-25 14:19:58 -0700 (Sun, 25 May 2008)
Log Message:
-----------
Applied patch from Michiel van Baak (mvanbaak)
https://sourceforge.net/tracker/index.php?func=detail&aid=1923030&group_id=191583&atid=937966
- added quota parameter in mailbox_postcreation() hook
- new hook to update the quota after editing a mailbox
Modifications to the patch:
- made $quota an required parameter in the mailbox_postedit and
mailbox_postcreation functions
- the scripts always get the quota as 4th parameter. In case $quota
is <= 0, it is set to 0.
config.inc.php:
- new option $CONF['mailbox_postedit_script']
edit-mailbox.php:
- call mailbox_postedit() after editing the mailbox
functions.inc.php:
- added $quota parameter to mailbox_postcreation()
- new function mailbox_postedit()
create-mailbox.php:
- added $quota parameter on mailbox_postcreation() call
Modified Paths:
--------------
trunk/config.inc.php
trunk/create-mailbox.php
trunk/edit-mailbox.php
trunk/functions.inc.php
Modified: trunk/config.inc.php
===================================================================
--- trunk/config.inc.php 2008-05-25 20:49:40 UTC (rev 372)
+++ trunk/config.inc.php 2008-05-25 21:19:58 UTC (rev 373)
@@ -282,6 +282,13 @@
// $CONF['mailbox_postcreation_script']='sudo -u courier /usr/local/bin/postfixadmin-mailbox-postcreation.sh';
// Optional:
+// Script to run after alteration of mailboxes.
+// Note that this may fail if PHP is run in "safe mode", or if
+// operating system features (such as SELinux) or limitations
+// prevent the web-server from executing external scripts.
+// $CONF['mailbox_postedit_script']='sudo -u courier /usr/local/bin/postfixadmin-mailbox-postedit.sh';
+
+// Optional:
// Script to run after deletion of mailboxes.
// Note that this may fail if PHP is run in "safe mode", or if
// operating system features (such as SELinux) or limitations
Modified: trunk/create-mailbox.php
===================================================================
--- trunk/create-mailbox.php 2008-05-25 20:49:40 UTC (rev 372)
+++ trunk/create-mailbox.php 2008-05-25 21:19:58 UTC (rev 373)
@@ -263,7 +263,7 @@
*/
$result = db_query ("INSERT INTO $table_mailbox (username,password,name,maildir,quota,domain,created,modified,active) VALUES ('$fUsername','$password','$fName','$maildir','$quota','$fDomain',NOW(),NOW(),'$sqlActive')");
- if ($result['rows'] != 1 || !mailbox_postcreation($fUsername,$fDomain,$maildir))
+ if ($result['rows'] != 1 || !mailbox_postcreation($fUsername,$fDomain,$maildir, $quota))
{
$tDomain = $fDomain;
$tMessage .= $PALANG['pCreate_mailbox_result_error'] . "<br />($fUsername)<br />";
Modified: trunk/edit-mailbox.php
===================================================================
--- trunk/edit-mailbox.php 2008-05-25 20:49:40 UTC (rev 372)
+++ trunk/edit-mailbox.php 2008-05-25 21:19:58 UTC (rev 373)
@@ -153,7 +153,7 @@
$formvars['active']=$sqlActive;
$result = db_update ('mailbox', "username='$fUsername' AND domain='$fDomain'", $formvars, array('modified'));
- if ($result != 1) {
+ if ($result != 1 || !mailbox_postedit($fUsername,$fDomain,$maildir, $quota)) {
$tMessage = $PALANG['pEdit_mailbox_result_error'];
}
else {
Modified: trunk/functions.inc.php
===================================================================
--- trunk/functions.inc.php 2008-05-25 20:49:40 UTC (rev 372)
+++ trunk/functions.inc.php 2008-05-25 21:19:58 UTC (rev 373)
@@ -1713,7 +1713,7 @@
Called after a mailbox has been created in the DBMS.
Returns: boolean.
*/
-function mailbox_postcreation($username,$domain,$maildir)
+function mailbox_postcreation($username,$domain,$maildir,$quota)
{
if (empty($username) || empty($domain) || empty($maildir))
{
@@ -1729,7 +1729,9 @@
$cmdarg1=escapeshellarg($username);
$cmdarg2=escapeshellarg($domain);
$cmdarg3=escapeshellarg($maildir);
- $command=$CONF[$confpar]." $cmdarg1 $cmdarg2 $cmdarg3";
+ if ($quota <= 0) $quota = 0;
+ $cmdarg4=escapeshellarg($quota);
+ $command=$CONF[$confpar]." $cmdarg1 $cmdarg2 $cmdarg3 $cmdarg4";
$retval=0;
$output=array();
$firstline='';
@@ -1745,6 +1747,44 @@
}
/*
+ Called after a mailbox has been altered in the DBMS.
+ Returns: boolean.
+ */
+function mailbox_postedit($username,$domain,$maildir,$quota)
+{
+ if (empty($username) || empty($domain) || empty($maildir))
+ {
+ trigger_error('In '.__FUNCTION__.': empty username, domain and/or maildir parameter',E_USER_ERROR);
+ return FALSE;
+ }
+
+ global $CONF;
+ $confpar='mailbox_postedit_script';
+
+ if (!isset($CONF[$confpar]) || empty($CONF[$confpar])) return TRUE;
+
+ $cmdarg1=escapeshellarg($username);
+ $cmdarg2=escapeshellarg($domain);
+ $cmdarg3=escapeshellarg($maildir);
+ if ($quota <= 0) $quota = 0;
+ $cmdarg4=escapeshellarg($quota);
+ $command=$CONF[$confpar]." $cmdarg1 $cmdarg2 $cmdarg3 $cmdarg4";
+ $retval=0;
+ $output=array();
+ $firstline='';
+ $firstline=exec($command,$output,$retval);
+ if (0!=$retval)
+ {
+ error_log("Running $command yielded return value=$retval, first line of output=$firstline");
+ print '<p>WARNING: Problems running mailbox postedit script!</p>';
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+/*
Called after a mailbox has been deleted in the DBMS.
Returns: boolean.
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|