postfixadmin-svn Mailing List for PostfixAdmin (Page 94)
Brought to you by:
christian_boltz,
gingerdog
You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(13) |
Oct
(63) |
Nov
(79) |
Dec
(34) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(15) |
Feb
(8) |
Mar
(8) |
Apr
(44) |
May
(18) |
Jun
(20) |
Jul
(35) |
Aug
(21) |
Sep
(8) |
Oct
(9) |
Nov
(21) |
Dec
(14) |
2009 |
Jan
(53) |
Feb
(13) |
Mar
(36) |
Apr
(40) |
May
(22) |
Jun
(10) |
Jul
(18) |
Aug
(18) |
Sep
(7) |
Oct
(26) |
Nov
(32) |
Dec
(13) |
2010 |
Jan
(6) |
Feb
(7) |
Mar
(12) |
Apr
(2) |
May
(12) |
Jun
(8) |
Jul
(9) |
Aug
(12) |
Sep
(12) |
Oct
(7) |
Nov
(9) |
Dec
(42) |
2011 |
Jan
(10) |
Feb
(35) |
Mar
(43) |
Apr
(39) |
May
(8) |
Jun
(8) |
Jul
(83) |
Aug
(20) |
Sep
(20) |
Oct
(63) |
Nov
(33) |
Dec
(20) |
2012 |
Jan
(28) |
Feb
(3) |
Mar
(1) |
Apr
(37) |
May
(16) |
Jun
(7) |
Jul
(3) |
Aug
|
Sep
|
Oct
(3) |
Nov
(1) |
Dec
(4) |
2013 |
Jan
(6) |
Feb
(16) |
Mar
(9) |
Apr
(11) |
May
(9) |
Jun
(30) |
Jul
(17) |
Aug
(6) |
Sep
(2) |
Oct
(30) |
Nov
(41) |
Dec
(26) |
2014 |
Jan
(16) |
Feb
(20) |
Mar
(5) |
Apr
(4) |
May
(14) |
Jun
(4) |
Jul
(1) |
Aug
|
Sep
(8) |
Oct
(18) |
Nov
(26) |
Dec
|
2015 |
Jan
(4) |
Feb
(9) |
Mar
(12) |
Apr
(26) |
May
(3) |
Jun
(3) |
Jul
(2) |
Aug
|
Sep
(15) |
Oct
(13) |
Nov
|
Dec
(1) |
2016 |
Jan
(1) |
Feb
(5) |
Mar
(4) |
Apr
(3) |
May
(19) |
Jun
|
Jul
|
Aug
(3) |
Sep
(16) |
Oct
(4) |
Nov
(5) |
Dec
(5) |
2017 |
Jan
(1) |
Feb
(8) |
Mar
|
Apr
(7) |
May
(3) |
Jun
(16) |
Jul
(13) |
Aug
(16) |
Sep
(6) |
Oct
(4) |
Nov
(10) |
Dec
(7) |
2018 |
Jan
(16) |
Feb
(17) |
Mar
(11) |
Apr
(13) |
May
(20) |
Jun
(3) |
Jul
(10) |
Aug
|
Sep
(3) |
Oct
(1) |
Nov
(6) |
Dec
(18) |
2019 |
Jan
(18) |
Feb
(31) |
Mar
(4) |
Apr
(4) |
May
(1) |
Jun
(8) |
Jul
(7) |
Aug
(10) |
Sep
(23) |
Oct
(6) |
Nov
(3) |
Dec
(5) |
2020 |
Jan
(10) |
Feb
(18) |
Mar
(34) |
Apr
(19) |
May
(6) |
Jun
(9) |
Jul
|
Aug
(10) |
Sep
(16) |
Oct
(6) |
Nov
(3) |
Dec
(11) |
2021 |
Jan
(118) |
Feb
(22) |
Mar
(13) |
Apr
(12) |
May
(48) |
Jun
(21) |
Jul
(17) |
Aug
(12) |
Sep
(19) |
Oct
(25) |
Nov
(16) |
Dec
(7) |
2022 |
Jan
(6) |
Feb
(7) |
Mar
(14) |
Apr
(4) |
May
|
Jun
(16) |
Jul
(18) |
Aug
(5) |
Sep
(12) |
Oct
(8) |
Nov
(10) |
Dec
(13) |
2023 |
Jan
|
Feb
(3) |
Mar
(2) |
Apr
(1) |
May
(2) |
Jun
(6) |
Jul
(3) |
Aug
(3) |
Sep
(3) |
Oct
(2) |
Nov
(7) |
Dec
(13) |
2024 |
Jan
(8) |
Feb
(6) |
Mar
(5) |
Apr
(10) |
May
(8) |
Jun
(6) |
Jul
(2) |
Aug
(1) |
Sep
(2) |
Oct
(4) |
Nov
(15) |
Dec
(10) |
2025 |
Jan
(3) |
Feb
(12) |
Mar
(3) |
Apr
(7) |
May
(18) |
Jun
(10) |
Jul
(10) |
Aug
(6) |
Sep
(16) |
Oct
(4) |
Nov
|
Dec
|
From: <Gin...@us...> - 2009-07-10 20:58:40
|
Revision: 680 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=680&view=rev Author: GingerDog Date: 2009-07-10 20:58:33 +0000 (Fri, 10 Jul 2009) Log Message: ----------- remove pointless ereg stuff Modified Paths: -------------- trunk/functions.inc.php Modified: trunk/functions.inc.php =================================================================== --- trunk/functions.inc.php 2009-06-30 12:56:30 UTC (rev 679) +++ trunk/functions.inc.php 2009-07-10 20:58:33 UTC (rev 680) @@ -16,12 +16,6 @@ * Contains re-usable code. */ -if (ereg ("functions.inc.php", $_SERVER['PHP_SELF'])) -{ - header ("Location: login.php"); - exit; -} - $version = '2.3 rc5'; /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2009-06-30 13:29:12
|
Revision: 679 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=679&view=rev Author: GingerDog Date: 2009-06-30 12:56:30 +0000 (Tue, 30 Jun 2009) Log Message: ----------- users/password.php: fix minor typo Modified Paths: -------------- trunk/users/password.php Modified: trunk/users/password.php =================================================================== --- trunk/users/password.php 2009-06-29 08:26:35 UTC (rev 678) +++ trunk/users/password.php 2009-06-30 12:56:30 UTC (rev 679) @@ -59,7 +59,7 @@ if ($error != 1) { - $uh = new UserHandleR($username); + $uh = new UserHandler($username); if($uh->change_pass($fPassword_current, $fPassword)) { flash_info($PALANG['pPassword_result_success']); header("Location: main.php"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2009-06-29 08:26:44
|
Revision: 678 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=678&view=rev Author: GingerDog Date: 2009-06-29 08:26:35 +0000 (Mon, 29 Jun 2009) Log Message: ----------- vacation.pl: add patch from Steve - https://sourceforge.net/tracker/?func=detail&aid=2813178&group_id=191583&atid=937967 Modified Paths: -------------- trunk/VIRTUAL_VACATION/vacation.pl Modified: trunk/VIRTUAL_VACATION/vacation.pl =================================================================== --- trunk/VIRTUAL_VACATION/vacation.pl 2009-06-29 07:58:50 UTC (rev 677) +++ trunk/VIRTUAL_VACATION/vacation.pl 2009-06-29 08:26:35 UTC (rev 678) @@ -56,15 +56,18 @@ # Use Log4Perl # Added better testing (and -t option) # +# 2009-06-29 Steve (sbajic/sf.net) +# Add Mail::Sender for SMTP auth + more flexibility +# # Requirements - the following perl modules are required: # DBD::Pg or DBD::mysql -# Mail::Sendmail, Email::Valid MIME::Charset, Log::Log4perl, Log::Dispatch, MIME::EncWords and GetOpt::Std +# Mail::Sender, Email::Valid MIME::Charset, Log::Log4perl, Log::Dispatch, MIME::EncWords and GetOpt::Std # # You may install these via CPAN, or through your package tool. # CPAN: 'perl -MCPAN -e shell', then 'install Module::Whatever' # # On Debian based systems : -# libmail-sendmail-perl +# libmail-sender-perl # libdbd-pg-perl # libemail-valid-perl # libmime-perl @@ -92,7 +95,7 @@ use MIME::EncWords qw(:all); use Email::Valid; use strict; -use Mail::Sendmail; +use Mail::Sender; use Getopt::Std; use Log::Log4perl qw(get_logger :levels); use File::Basename; @@ -119,7 +122,17 @@ # smtp server used to send vacation e-mails our $smtp_server = 'localhost'; +our $smtp_server_port = 25; +# SMTP authentication protocol used for sending. +# Can be 'PLAIN', 'LOGIN', 'CRAM-MD5' or 'NTLM' +# Leave it blank if you don't use authentification +our $smtp_auth = undef; +# username used to login to the server +our $smtp_authid = 'someuser'; +# password used to login to the server +our $smtp_authpwd = 'somepass'; + # Set to 1 to enable logging to syslog. our $syslog = 0; @@ -130,7 +143,7 @@ # 2 = debug + info, 1 = info only, 0 = error only our $log_level = 2; # Whether to log to file or not, 0 = do not write to a log file -our $log_to_file = 1; +our $log_to_file = 0; # notification interval, in seconds # set to 0 to notify only once @@ -386,27 +399,38 @@ my $body = $row[1]; my $from = $email; my $to = $orig_from; - my $vacation_subject = encode_mimewords($subject, 'Encoding'=> 'q', 'Charset'=>'utf-8', 'Field'=>'Subject'); + my %smtp_connection; + %smtp_connection = ( + 'smtp' => $smtp_server, + 'port' => $smtp_server_port, + 'auth' => $smtp_auth, + 'authid' => $smtp_authid, + 'authpwd' => $smtp_authpwd, + 'skip_bad_recipients' => 'true', + 'encoding' => 'Base64', + 'ctype' => 'text/plain; charset=UTF-8', + 'headers' => 'Precedence: junk', + 'headers' => 'X-Loop: Postfix Admin Virtual Vacation', + ); my %mail; + # I believe Mail::Sender qp encodes the subject, so we no longer need to. %mail = ( - 'smtp' => $smtp_server, - 'Subject' => $vacation_subject, - 'From' => $from, - 'To' => $to, - 'MIME-Version' => '1.0', - 'Content-Type' => 'text/plain; charset=UTF-8', - 'Content-Transfer-Encoding' => 'base64', - 'Precedence' => 'junk', - 'X-Loop' => 'Postfix Admin Virtual Vacation', - 'Message' => encode_base64($body) + 'subject' => $subject, + 'from' => $from, + 'to' => $to, + 'msg' => encode_base64($body) ); if($test_mode == 1) { $logger->info("** TEST MODE ** : Vacation response sent to $to from $from subject $subject (not) sent\n"); $logger->info(%mail); return 0; } - sendmail(%mail) or $logger->error("Failed to send vacation response: " . $Mail::Sendmail::error); - $logger->debug("Vacation response sent, Mail::Sendmail said : " . $Mail::Sendmail::log); + $Mail::Sender::NO_X_MAILER = 1; + my $sender = new Mail::Sender({%smtp_connection}); + $sender->Open({%mail}); + $sender->SentLineEnc($body); + $sender->Close() or $logger->error("Failed to send vacation response: " . $sender->{'error_msg'}); + $logger->debug("Vacation response sent to $to, from $from"); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2009-06-29 07:58:54
|
Revision: 677 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=677&view=rev Author: GingerDog Date: 2009-06-29 07:58:50 +0000 (Mon, 29 Jun 2009) Log Message: ----------- vacation.pl: fix https://sourceforge.net/tracker/?func=detail&aid=2796067&group_id=191583&atid=937964 - remove usage of file in /tmp; abort if logfile is not writeable, or we cannot create it Modified Paths: -------------- trunk/VIRTUAL_VACATION/vacation.pl Modified: trunk/VIRTUAL_VACATION/vacation.pl =================================================================== --- trunk/VIRTUAL_VACATION/vacation.pl 2009-06-11 13:56:29 UTC (rev 676) +++ trunk/VIRTUAL_VACATION/vacation.pl 2009-06-29 07:58:50 UTC (rev 677) @@ -87,6 +87,16 @@ # http://dag.wieers.com/home-made/apt/packages.php # +use DBI; +use MIME::Base64; +use MIME::EncWords qw(:all); +use Email::Valid; +use strict; +use Mail::Sendmail; +use Getopt::Std; +use Log::Log4perl qw(get_logger :levels); +use File::Basename; + # ========== begin configuration ========== # IMPORTANT: If you put passwords into this script, then remember @@ -101,8 +111,8 @@ our $db_host = ''; # connection details -our $db_username = 'dg'; -our $db_password = 'gingerdog'; +our $db_username = 'user'; +our $db_password = 'password'; our $db_name = 'postfix'; our $vacation_domain = 'autoreply.example.org'; @@ -115,12 +125,13 @@ # path to logfile, when empty logging is supressed # change to e.g. /dev/null if you want nothing logged. -# if we can't write to this, we try /tmp/vacation.log instead -our $logfile='/var/spool/vacation/vacation.log'; +# if we can't write to this, and $log_to_file is 1 (below) the script will abort. +our $logfile='/var/log/vacation.log'; # 2 = debug + info, 1 = info only, 0 = error only our $log_level = 2; +# Whether to log to file or not, 0 = do not write to a log file +our $log_to_file = 1; - # notification interval, in seconds # set to 0 to notify only once # e.g. 1 day ... @@ -137,18 +148,13 @@ # =========== end configuration =========== -if ( ! -w $logfile ) { - $logfile = "/tmp/vacation.log"; +if($log_to_file == 1) { + if (( ! -w $logfile ) && (! -w dirname($logfile))) { + # Cannot log; no where to write to. + die("Cannot create logfile : $logfile"); + } } -use DBI; -use MIME::Base64; -use MIME::EncWords qw(:all); -use Email::Valid; -use strict; -use Mail::Sendmail; -use Getopt::Std; -use Log::Log4perl qw(get_logger :levels); my ($from, $to, $cc, $replyto , $subject, $messageid, $lastheader, $smtp_sender, $smtp_recipient, %opts, $spam, $test_mode, $logger); @@ -175,16 +181,18 @@ $logger->debug("Test mode enabled"); } else { - # log to file. - my $appender = Log::Log4perl::Appender->new( - 'Log::Dispatch::File', - filename => $logfile, - mode => 'append'); - $logger = get_logger(); - $appender->layout($log_layout); - $logger->add_appender($appender); + if($log_to_file == 1) { + # log to file. + my $appender = Log::Log4perl::Appender->new( + 'Log::Dispatch::File', + filename => $logfile, + mode => 'append'); + $appender->layout($log_layout); + $logger->add_appender($appender); + } + if($syslog == 1) { my $syslog_appender = Log::Log4perl::Appender->new( 'Log::Dispatch::Syslog', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Seb...@us...> - 2009-06-11 13:58:56
|
Revision: 676 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=676&view=rev Author: Sebastian2009 Date: 2009-06-11 13:56:29 +0000 (Thu, 11 Jun 2009) Log Message: ----------- - accidentally deleted header.php Added Paths: ----------- branches/postfixadmin-smarty/templates/header.php Added: branches/postfixadmin-smarty/templates/header.php =================================================================== --- branches/postfixadmin-smarty/templates/header.php (rev 0) +++ branches/postfixadmin-smarty/templates/header.php 2009-06-11 13:56:29 UTC (rev 676) @@ -0,0 +1,62 @@ +<?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"); +@header ("Cache-Control: no-store, no-cache, must-revalidate"); +@header ("Cache-Control: post-check=0, pre-check=0", false); +@header ("Pragma: no-cache"); +@header ("Content-Type: text/html; charset=UTF-8"); +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<?php +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> +</head> +<body> +<div id="login_header"> +<?php +if (file_exists (realpath ("../".$CONF['theme_logo']))) +{ + 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'])) +{ + print "<h2>" . $CONF['header_text'] . "</h2>\n"; +} +?> +</div> + +<?php +if(isset($_SESSION['flash'])) { + if(isset($_SESSION['flash']['info'])) { + echo '<ul class="flash-info">'; + foreach($_SESSION['flash']['info'] as $msg) { + echo "<li>$msg</li>"; + } + echo '</ul>'; + } + if(isset($_SESSION['flash']['error'])) { + echo '<ul class="flash-error">'; + foreach($_SESSION['flash']['error'] as $msg) { + echo "<li>$msg</li>"; + } + echo '</ul>'; + } + /* nuke it from orbit. It's the only way to be sure. */ + $_SESSION['flash'] = array(); +} + +/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Seb...@us...> - 2009-06-08 19:03:08
|
Revision: 675 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=675&view=rev Author: Sebastian2009 Date: 2009-06-08 19:03:06 +0000 (Mon, 08 Jun 2009) Log Message: ----------- sync change in trunk rev. 673 Modified Paths: -------------- branches/postfixadmin-smarty/delete.php Modified: branches/postfixadmin-smarty/delete.php =================================================================== --- branches/postfixadmin-smarty/delete.php 2009-06-08 19:01:03 UTC (rev 674) +++ branches/postfixadmin-smarty/delete.php 2009-06-08 19:03:06 UTC (rev 675) @@ -141,6 +141,7 @@ } $tMessage.=')</span>'; } + db_log ($SESSID_USERNAME, $fDomain, 'delete_mailbox', $fDelete); } $result = db_query("SELECT * FROM $table_vacation WHERE email = '$fDelete' AND domain = '$fDomain'"); if($result['rows'] == 1) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Seb...@us...> - 2009-06-08 19:01:19
|
Revision: 674 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=674&view=rev Author: Sebastian2009 Date: 2009-06-08 19:01:03 +0000 (Mon, 08 Jun 2009) Log Message: ----------- - fix some small bugs in templates, mainly domains not showing in row for domain admin - tweak tables, left-align text - remove php-files from template directory, not needed anymore - get in sync with mainline Modified Paths: -------------- branches/postfixadmin-smarty/css/default.css branches/postfixadmin-smarty/debian/README.Debian branches/postfixadmin-smarty/debian/control branches/postfixadmin-smarty/debian/postfixadmin.postinst branches/postfixadmin-smarty/debian/postfixadmin.prerm branches/postfixadmin-smarty/debian/rules branches/postfixadmin-smarty/edit-mailbox.php branches/postfixadmin-smarty/list-domain.php branches/postfixadmin-smarty/list-virtual.php branches/postfixadmin-smarty/templates/edit-mailbox.tpl branches/postfixadmin-smarty/templates/footer.tpl branches/postfixadmin-smarty/templates/list-virtual.tpl branches/postfixadmin-smarty/templates/motd-users.txt branches/postfixadmin-smarty/templates/motd.txt branches/postfixadmin-smarty/templates/overview-get.tpl Removed Paths: ------------- branches/postfixadmin-smarty/debian/files branches/postfixadmin-smarty/templates/admin_create-admin.php branches/postfixadmin-smarty/templates/admin_create-domain.php branches/postfixadmin-smarty/templates/admin_edit-admin.php branches/postfixadmin-smarty/templates/admin_edit-domain.php branches/postfixadmin-smarty/templates/admin_list-admin.php branches/postfixadmin-smarty/templates/admin_list-domain.php branches/postfixadmin-smarty/templates/admin_search.php branches/postfixadmin-smarty/templates/broadcast-message.php branches/postfixadmin-smarty/templates/create-alias-domain.php branches/postfixadmin-smarty/templates/create-alias.php branches/postfixadmin-smarty/templates/create-mailbox.php branches/postfixadmin-smarty/templates/edit-alias.php branches/postfixadmin-smarty/templates/edit-mailbox.php branches/postfixadmin-smarty/templates/edit-vacation.php branches/postfixadmin-smarty/templates/fetchmail.php branches/postfixadmin-smarty/templates/footer.php branches/postfixadmin-smarty/templates/header.php branches/postfixadmin-smarty/templates/list-virtual.php branches/postfixadmin-smarty/templates/login.php branches/postfixadmin-smarty/templates/main.php branches/postfixadmin-smarty/templates/menu.php branches/postfixadmin-smarty/templates/message.php branches/postfixadmin-smarty/templates/overview-get.php branches/postfixadmin-smarty/templates/password.php branches/postfixadmin-smarty/templates/search.php branches/postfixadmin-smarty/templates/sendmail.php branches/postfixadmin-smarty/templates/users_edit-alias.php branches/postfixadmin-smarty/templates/users_login.php branches/postfixadmin-smarty/templates/users_main.php branches/postfixadmin-smarty/templates/users_menu.php branches/postfixadmin-smarty/templates/users_password.php branches/postfixadmin-smarty/templates/users_vacation.php branches/postfixadmin-smarty/templates/viewlog.php Modified: branches/postfixadmin-smarty/css/default.css =================================================================== --- branches/postfixadmin-smarty/css/default.css 2009-06-08 11:33:16 UTC (rev 673) +++ branches/postfixadmin-smarty/css/default.css 2009-06-08 19:01:03 UTC (rev 674) @@ -98,14 +98,14 @@ font-size: 13px; } -#menu { +#menu, #tabbar { width: 750px; margin: 0 auto; padding-top: 10px; white-space: nowrap; } -#menu ul { +#menu ul, #tabbar ul { padding: 0; margin: 0; margin-left:auto; @@ -113,18 +113,18 @@ list-style: none; } -#menu li { +#menu li, #tabbar li { float: left; background: #efefef; margin-right: 3px; border-top: 4px solid #aaaaaa; } -#menu li:hover, #menu li.sfhover { +#menu li:hover, #menu li.sfhover, #tabbar li:hover, #tabbar li.sfhover { background: #BFFF00; } -#menu li ul { +#menu li ul, #tabbar li ul { position: absolute; width: auto; left: -999em; @@ -132,12 +132,12 @@ border:2px solid white; border-top:none; } -#menu li:hover ul, #menu li.sfhover ul { +#menu li:hover ul, #menu li.sfhover ul, #tabbar li:hover ul, #tabbar li.sfhover ul { left: auto; } -#menu li ul li { +#menu li ul li, #tabbar li ul li { float: none; margin-right: 0px; border-top:2px solid white;; @@ -145,22 +145,20 @@ } - - -#menu a { +#menu a, #tabbar a { display: block; width: auto; padding: 20px 5px 5px 5px; color: #888888; } -#menu a:hover { +#menu a:hover, #tabbar a:hover { color: #888888; } -#menu li ul li a { +#menu li ul li a, #tabbar li ul li a { padding: 5px 5px 5px 5px; } @@ -275,6 +273,10 @@ margin: 0; } +#alias_domain_table td, #alias_table td, #mailbox_table td, #overview_table td, #log_table td, #admin_table td { +text-align : left; +} + #footer { width: 750px; margin: 20px auto; Modified: branches/postfixadmin-smarty/debian/README.Debian =================================================================== --- branches/postfixadmin-smarty/debian/README.Debian 2009-06-08 11:33:16 UTC (rev 673) +++ branches/postfixadmin-smarty/debian/README.Debian 2009-06-08 19:01:03 UTC (rev 674) @@ -19,6 +19,7 @@ - MySQL or PostgreSQL - Courier or Dovecot + Where to get help ================= @@ -28,3 +29,18 @@ - http://postfixadmin.sf.net - #postfixadmin on irc.freenode.net + +How to build this package for Debian/lenny +========================================== + +If you want to build this package for Debian/lenny, you have to execute + + DIST="lenny" dpkg-buildpackage -rfakeroot + +This will include the confd-link.sh script into the package. That script +is included in wwwconfig-common >0.2, but we have an older version in +lenny at the moment. + +We (upstream and myself) want to provide also an lenny ready package, +which will be available via sf.net. Just as an easy way for interested +people which are running lenny. Modified: branches/postfixadmin-smarty/debian/control =================================================================== --- branches/postfixadmin-smarty/debian/control 2009-06-08 11:33:16 UTC (rev 673) +++ branches/postfixadmin-smarty/debian/control 2009-06-08 19:01:03 UTC (rev 674) @@ -10,7 +10,7 @@ Package: postfixadmin Architecture: all -Depends: debconf (>= 0.5), dbconfig-common, wwwconfig-common (>= 0.2.0), apache2 | lighttpd, libapache2-mod-php5 | php5-cgi | php5, php5-imap, php5-mysql | php5-pgsql, mysql-client | postgresql-client, ${misc:Depends} +Depends: debconf (>= 0.5), dbconfig-common, wwwconfig-common, apache2 | lighttpd, libapache2-mod-php5 | php5-cgi | php5, php5-imap, php5-mysql | php5-pgsql, mysql-client | postgresql-client, ${misc:Depends} Recommends: postfix-mysql | postfix-pgsql, mysql-server | postgresql-server Suggests: squirrelmail-postfixadmin, dovecot-common | courier-authlib-mysql | courier-authlib-postgresql Description: Virtual mail hosting interface for Postfix Deleted: branches/postfixadmin-smarty/debian/files =================================================================== --- branches/postfixadmin-smarty/debian/files 2009-06-08 11:33:16 UTC (rev 673) +++ branches/postfixadmin-smarty/debian/files 2009-06-08 19:01:03 UTC (rev 674) @@ -1 +0,0 @@ -postfixadmin_2.3rc3_all.deb admin optional Modified: branches/postfixadmin-smarty/debian/postfixadmin.postinst =================================================================== --- branches/postfixadmin-smarty/debian/postfixadmin.postinst 2009-06-08 11:33:16 UTC (rev 673) +++ branches/postfixadmin-smarty/debian/postfixadmin.postinst 2009-06-08 19:01:03 UTC (rev 674) @@ -16,7 +16,11 @@ linkdestination_apache="../../postfixadmin/apache.conf" linkdestination_lighttpd="../../postfixadmin/lighttpd.conf" linkname="postfixadmin" - . /usr/share/wwwconfig-common/confd-link.sh + if [ -e /usr/share/wwwconfig-common/confd-link.sh ]; then + . /usr/share/wwwconfig-common/confd-link.sh + else + . /usr/share/postfixadmin/confd-link.sh + fi . /usr/share/wwwconfig-common/restart.sh fi Modified: branches/postfixadmin-smarty/debian/postfixadmin.prerm =================================================================== --- branches/postfixadmin-smarty/debian/postfixadmin.prerm 2009-06-08 11:33:16 UTC (rev 673) +++ branches/postfixadmin-smarty/debian/postfixadmin.prerm 2009-06-08 19:01:03 UTC (rev 674) @@ -14,7 +14,11 @@ db_get postfixadmin/reconfigure-webserver servers="$RET" linkname="postfixadmin" - . /usr/share/wwwconfig-common/confd-link.sh + if [ -e /usr/share/wwwconfig-common/confd-link.sh ]; then + . /usr/share/wwwconfig-common/confd-link.sh + else + . /usr/share/postfixadmin/confd-link.sh + fi fi #DEBHELPER# Modified: branches/postfixadmin-smarty/debian/rules =================================================================== --- branches/postfixadmin-smarty/debian/rules 2009-06-08 11:33:16 UTC (rev 673) +++ branches/postfixadmin-smarty/debian/rules 2009-06-08 19:01:03 UTC (rev 674) @@ -28,6 +28,7 @@ dh_install mv debian/postfixadmin/usr/share/postfixadmin/config.inc.php debian/postfixadmin/etc/postfixadmin/config.inc.php find debian/postfixadmin -name .svn | xargs -r rm -r + if test "${DIST}" = "lenny" ; then cp debian/confd-link.sh debian/postfixadmin/usr/share/postfixadmin/; fi # Build architecture-independent files here. binary-indep: build install Modified: branches/postfixadmin-smarty/edit-mailbox.php =================================================================== --- branches/postfixadmin-smarty/edit-mailbox.php 2009-06-08 11:33:16 UTC (rev 673) +++ branches/postfixadmin-smarty/edit-mailbox.php 2009-06-08 19:01:03 UTC (rev 674) @@ -176,6 +176,7 @@ } $smarty->assign ('fUsername', $fUsername); +$smarty->assign ('fPassword', $user_details ['password']); //$smarty->assign ('pEdit_mailbox_username_text', $pEdit_mailbox_username_text); $smarty->assign ('pEdit_mailbox_password_text', $pEdit_mailbox_password_text); $smarty->assign ('tName', htmlspecialchars ($tName,ENT_QUOTES)); @@ -187,6 +188,5 @@ $smarty->assign ('tMessage', $tMessage); $smarty->assign ('smarty_template', 'edit-mailbox'); $smarty->display ('index.tpl'); - /* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */ ?> Modified: branches/postfixadmin-smarty/list-domain.php =================================================================== --- branches/postfixadmin-smarty/list-domain.php 2009-06-08 11:33:16 UTC (rev 673) +++ branches/postfixadmin-smarty/list-domain.php 2009-06-08 19:01:03 UTC (rev 674) @@ -30,6 +30,7 @@ authentication_require_role('admin'); if (authentication_has_role('global-admin')) { +//if (authentication_has_role('admin')) { $list_admins = list_admins (); $is_superadmin = 1; $fUsername = safepost('fUsername', safeget('username')); # prefer POST over GET variable Modified: branches/postfixadmin-smarty/list-virtual.php =================================================================== --- branches/postfixadmin-smarty/list-virtual.php 2009-06-08 11:33:16 UTC (rev 673) +++ branches/postfixadmin-smarty/list-virtual.php 2009-06-08 19:01:03 UTC (rev 674) @@ -382,9 +382,15 @@ $smarty->assign ('boolconf_used_quotas', boolconf('used_quotas')); $smarty->assign ('divide_quota', $divide_quota); $smarty->assign ('tCanAddMailbox', $tCanAddMailbox); +if (isset ($_GET ['tab'])) + $_SESSION ['tab'] = $_GET ['tab']; +//if (empty ($_GET ['tab'])) +// unset ($_SESSION ['tab']); +if (!isset ($_SESSION ['tab'])) + $_SESSION ['tab'] = 'mailbox'; +$smarty->assign ('tab', $_SESSION ['tab']); $smarty->assign ('smarty_template', 'list-virtual'); $smarty->display ('index.tpl'); - /* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ ?> Deleted: branches/postfixadmin-smarty/templates/admin_create-admin.php =================================================================== --- branches/postfixadmin-smarty/templates/admin_create-admin.php 2009-06-08 11:33:16 UTC (rev 673) +++ branches/postfixadmin-smarty/templates/admin_create-admin.php 2009-06-08 19:01:03 UTC (rev 674) @@ -1,52 +0,0 @@ -<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?> -<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: branches/postfixadmin-smarty/templates/admin_create-domain.php =================================================================== --- branches/postfixadmin-smarty/templates/admin_create-domain.php 2009-06-08 11:33:16 UTC (rev 673) +++ branches/postfixadmin-smarty/templates/admin_create-domain.php 2009-06-08 19:01:03 UTC (rev 674) @@ -1,78 +0,0 @@ -<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?> -<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']); $i++) - { - if ($CONF['transport_options'][$i] == $tTransport) - { - print "<option value=\"" . $CONF['transport_options'][$i] . "\" selected>" . $CONF['transport_options'][$i] . "</option>\n"; - } - else - { - print "<option value=\"" . $CONF['transport_options'][$i] . "\">" . $CONF['transport_options'][$i] . "</option>\n"; - } - } - ?> - </select> - </td> - <td><?php print $PALANG['pAdminCreate_domain_transport_text']; ?></td> - </tr> - <?php } ?> - <tr> - <td><?php print $PALANG['pAdminCreate_domain_defaultaliases'] . ":"; ?></td> - <td><?php $checked = ($tDefaultaliases == 'on') ? 'checked=checked' : ''; ?> - <input class="flat" type="checkbox" value='on' name="fDefaultaliases" <?php print $checked; ?> /> - </td> - <td><?php print $PALANG['pAdminCreate_domain_defaultaliases_text']; ?></td> - </tr> - <tr> - <td><?php print $PALANG['pAdminCreate_domain_backupmx'] . ":"; ?></td> - <td><?php $checked = ($tBackupmx == 'on') ? 'checked' : ''; ?> - <input class="flat" type="checkbox" value='on' name="fBackupmx" <?php print $checked; ?> /> - </td> - <td> </td> - </tr> - <tr> - <td colspan="3" class="hlp_center"><input class="button" type="submit" name="submit" value="<?php print $PALANG['pAdminCreate_domain_button']; ?>" /></td> - </tr> - <tr> - <td colspan="3" class="standout"><?php print $tMessage; ?></td> - </tr> -</table> -</form> -</div> Deleted: branches/postfixadmin-smarty/templates/admin_edit-admin.php =================================================================== --- branches/postfixadmin-smarty/templates/admin_edit-admin.php 2009-06-08 11:33:16 UTC (rev 673) +++ branches/postfixadmin-smarty/templates/admin_edit-admin.php 2009-06-08 19:01:03 UTC (rev 674) @@ -1,56 +0,0 @@ -<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?> -<div id="edit_form"> -<form name="alias" method="post"> -<table> - <tr> - <td colspan="3"><h3><?php print $PALANG['pAdminEdit_admin_welcome']; ?></h3></td></tr> - <tr> - <td><?php print $PALANG['pAdminEdit_admin_username']; ?>:</td> - <td><?php print $username; ?></td> - <td> </td> - </tr> - <tr> - <td><?php print $PALANG['pAdminEdit_admin_password']; ?>:</td> - <td><input class="flat" type="password" autocomplete="off" name="fPassword" value=""/></td> - <td><?php print $pAdminEdit_admin_password_text; ?></td> - </tr> - <tr> - <td><?php print $PALANG['pAdminEdit_admin_password2']; ?>:</td> - <td><input class="flat" type="password" name="fPassword2" value="" /></td> - <td> </td> - </tr> - <tr> - <td><?php print $PALANG['pAdminEdit_admin_active']; ?>:</td> - <td><input class="flat" type="checkbox" name="fActive" <?php print (!empty ($tActive)) ? 'checked' : ''; ?> /></td> - <td> </td> - </tr> - <tr> - <td><?php print $PALANG['pAdminEdit_admin_super_admin']; ?>:</td> - <td><input class="flat" type="checkbox" name="fSadmin" <?php print (!empty ($tSadmin)) ? 'checked' : ''; ?> /></td> - <td> </td> - </tr> - <tr> - <td colspan=3 align=center> - <select name="fDomains[]" size="10" multiple="multiple"> - <?php - foreach($tAllDomains as $domain) { - // should escape $domain here to stop xss etc. - $selected = ''; - if (in_array ($domain, $tDomains)) { - $selected = "selected='selected'"; - } - print "<option value='$domain' $selected>$domain</option>\n"; - } - ?> - </select> - </td> - </tr> - <tr> - <td colspan="3" class="hlp_center"><input class="button" type="submit" name="submit" value="<?php print $PALANG['pAdminEdit_admin_button']; ?>" /></td> - </tr> - <tr> - <td colspan="3" class="standout"><?php print $tMessage; ?></td> - </tr> -</table> -</form> -</div> Deleted: branches/postfixadmin-smarty/templates/admin_edit-domain.php =================================================================== --- branches/postfixadmin-smarty/templates/admin_edit-domain.php 2009-06-08 11:33:16 UTC (rev 673) +++ branches/postfixadmin-smarty/templates/admin_edit-domain.php 2009-06-08 19:01:03 UTC (rev 674) @@ -1,76 +0,0 @@ -<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?> -<div id="edit_form"> -<form name="edit_domain" method="post"> -<table> - <tr> - <td colspan="3"><h3><?php print $PALANG['pAdminEdit_domain_welcome']; ?></h3></td> - </tr> - <tr> - <td><?php print $PALANG['pAdminEdit_domain_domain'] . ":"; ?></td> - <td><?php print $domain; ?></td> - <td> </td> - </tr> - <tr> - <td><?php print $PALANG['pAdminEdit_domain_description'] . ":"; ?></td> - <td><input class="flat" type="text" name="fDescription" value="<?php print htmlspecialchars($tDescription, ENT_QUOTES); ?>" /></td> - <td> </td> - </tr> - <tr> - <td><?php print $PALANG['pAdminEdit_domain_aliases'] . ":"; ?></td> - <td><input class="flat" type="text" name="fAliases" value="<?php print $tAliases; ?>" /></td> - <td><?php print $PALANG['pAdminEdit_domain_aliases_text']; ?></td> - </tr> - <tr> - <td><?php print $PALANG['pAdminEdit_domain_mailboxes'] . ":"; ?></td> - <td><input class="flat" type="text" name="fMailboxes" value="<?php print $tMailboxes; ?>" /></td> - <td><?php print $PALANG['pAdminEdit_domain_mailboxes_text']; ?></td> - </tr> - <?php if ($CONF['quota'] == 'YES') { ?> - <tr> - <td><?php print $PALANG['pAdminEdit_domain_maxquota'] . ":"; ?></td> - <td><input class="flat" type="text" name="fMaxquota" value="<?php print $tMaxquota; ?>" /></td> - <td><?php print $PALANG['pAdminEdit_domain_maxquota_text']; ?></td> - </tr> - <?php } if ($CONF['transport'] == 'YES') { ?> - <tr> - <td><?php print $PALANG['pAdminEdit_domain_transport'] . ":"; ?></td> - <td><select class="flat" name="fTransport"> - <?php - for ($i = 0; $i < sizeof ($CONF['transport_options']); $i++) - { - if ($CONF['transport_options'][$i] == $tTransport) - { - print "<option value=\"" . $CONF['transport_options'][$i] . "\" selected>" . $CONF['transport_options'][$i] . "</option>\n"; - } - else - { - print "<option value=\"" . $CONF['transport_options'][$i] . "\">" . $CONF['transport_options'][$i] . "</option>\n"; - } - } - ?> - </select> - </td> - <td><?php print $PALANG['pAdminEdit_domain_transport_text']; ?></td> - </tr> - <?php } ?> - <tr> - <td><?php print $PALANG['pAdminEdit_domain_backupmx'] . ":"; ?></td> - <td><?php $checked = (!empty ($tBackupmx)) ? 'checked=checked' : ''; ?> - <input class="flat" type="checkbox" name="fBackupmx" <?php print $checked; ?> /></td> - <td> </td> - </tr> - <tr> - <td><?php print $PALANG['pAdminEdit_domain_active'] . ":"; ?></td> - <td><?php $checked = (!empty ($tActive)) ? 'checked=checked' : ''; ?> - <input class="flat" type="checkbox" name="fActive" <?php print $checked; ?> /></td> - <td> </td> - </tr> - <tr> - <td colspan="3" class="hlp_center"><input type="submit" class="button" name="submit" value="<?php print $PALANG['pAdminEdit_domain_button']; ?>" /></td> - </tr> - <tr> - <td colspan="3" class="standout"><?php print $tMessage; ?></td> - </tr> -</table> -</form> -</div> Deleted: branches/postfixadmin-smarty/templates/admin_list-admin.php =================================================================== --- branches/postfixadmin-smarty/templates/admin_list-admin.php 2009-06-08 11:33:16 UTC (rev 673) +++ branches/postfixadmin-smarty/templates/admin_list-admin.php 2009-06-08 19:01:03 UTC (rev 674) @@ -1,36 +0,0 @@ -<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?> -<?php -if (sizeof ($list_admins) > 0) -{ - print "<table id=\"admin_table\">\n"; - print " <tr class=\"header\">\n"; - print " <td>" . $PALANG['pAdminList_admin_username'] . "</td>\n"; - print " <td>" . $PALANG['pAdminList_admin_count'] . "</td>\n"; - print " <td>" . $PALANG['pAdminList_admin_modified'] . "</td>\n"; - print " <td>" . $PALANG['pAdminList_admin_active'] . "</td>\n"; - print " <td colspan=\"2\"> </td>\n"; - print " </tr>\n"; - - for ($i = 0; $i < sizeof ($list_admins); $i++) - { - if ((is_array ($list_admins) and sizeof ($list_admins) > 0)) - { - print " <tr class=\"hilightoff\" onMouseOver=\"className='hilighton';\" onMouseOut=\"className='hilightoff';\">\n"; - print " <td><a href=\"list-domain.php?username=" . $list_admins[$i] . "\">" . $list_admins[$i] . "</a></td>"; - if ($admin_properties[$i]['domain_count'] == 'ALL') $admin_properties[$i]['domain_count'] = $PALANG['pAdminEdit_admin_super_admin']; - print " <td>" . $admin_properties[$i]['domain_count'] . "</td>"; - print " <td>" . $admin_properties[$i]['modified'] . "</td>"; - $active = ($admin_properties[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO']; - print " <td><a href=\"edit-active-admin.php?username=" . $list_admins[$i] . "\">" . $active . "</a></td>"; - print " <td><a href=\"edit-admin.php?username=" . $list_admins[$i] . "\">" . $PALANG['edit'] . "</a></td>"; - print " <td><a href=\"delete.php?table=admin&delete=" . $list_admins[$i] . "\" onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pAdminList_admin_username'] . ": " . $list_admins[$i] . "')\">" . $PALANG['del'] . "</a></td>"; - print " </tr>\n"; - } - } - - print "</table>\n"; - print "<p><a href=\"create-admin.php\">" . $PALANG['pAdminMenu_create_admin'] . "</a>\n"; -} - -/* vim: set ft=php expandtab softtabstop=3 tabstop=3 shiftwidth=3: */ -?> Deleted: branches/postfixadmin-smarty/templates/admin_list-domain.php =================================================================== --- branches/postfixadmin-smarty/templates/admin_list-domain.php 2009-06-08 11:33:16 UTC (rev 673) +++ branches/postfixadmin-smarty/templates/admin_list-domain.php 2009-06-08 19:01:03 UTC (rev 674) @@ -1,87 +0,0 @@ -<?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();"> -<?php -if (!empty ($list_admins)) -{ - for ($i = 0; $i < sizeof ($list_admins); $i++) - { - if ($fUsername == $list_admins[$i]) - { - print "<option value=\"" . $list_admins[$i] . "\" selected>" . $list_admins[$i] . "</option>\n"; - } - else - { - print "<option value=\"" . $list_admins[$i] . "\">" . $list_admins[$i] . "</option>\n"; - } - } -} -?> -</select> -<input class="button" type="submit" name="go" value="<?php print $PALANG['pOverview_button']; ?>" /> -</form> -<form name="search" method="post" action="search.php"> -<input type="textbox" name="search" size="10" /> -</form> -</div> - -<?php -if (sizeof ($list_domains) > 0) -{ - print "<table id=\"admin_table\">\n"; - print " <tr class=\"header\">\n"; - print " <td>" . $PALANG['pAdminList_domain_domain'] . "</td>\n"; - print " <td>" . $PALANG['pAdminList_domain_description'] . "</td>\n"; - print " <td>" . $PALANG['pAdminList_domain_aliases'] . "</td>\n"; - print " <td>" . $PALANG['pAdminList_domain_mailboxes'] . "</td>\n"; - if ($CONF['quota'] == 'YES') print " <td>" . $PALANG['pAdminList_domain_maxquota'] . "</td>\n"; - if ($CONF['transport'] == 'YES') print " <td>" . $PALANG['pAdminList_domain_transport'] . "</td>\n"; - print " <td>" . $PALANG['pAdminList_domain_backupmx'] . "</td>\n"; - print " <td>" . $PALANG['pAdminList_domain_modified'] . "</td>\n"; - print " <td>" . $PALANG['pAdminList_domain_active'] . "</td>\n"; - print " <td colspan=\"2\"> </td>\n"; - print " </tr>\n"; - - for ($i = 0; $i < sizeof ($list_domains); $i++) - { - if ((is_array ($list_domains) and sizeof ($list_domains) > 0)) - { - print " <tr class=\"hilightoff\" onMouseOver=\"className='hilighton';\" onMouseOut=\"className='hilightoff';\">\n"; - print "<td><a href=\"list-virtual.php?domain=" . $list_domains[$i] . "\">" . $list_domains[$i] . "</a></td>"; - print "<td>" . $domain_properties[$i]['description'] . "</td>"; - print "<td>" . $domain_properties[$i]['alias_count'] . " / " . $domain_properties[$i]['aliases'] . "</td>"; - print "<td>" . $domain_properties[$i]['mailbox_count'] . " / " . $domain_properties[$i]['mailboxes'] . "</td>"; - if ($CONF['quota'] == 'YES') - { - print " <td>"; - if ($domain_properties[$i]['maxquota'] == 0) - { - print $PALANG['pOverview_unlimited']; - } - elseif ($domain_properties[$i]['maxquota'] < 0) - { - print $PALANG['pOverview_disabled']; - } - else - { - print $domain_properties[$i]['maxquota']; - } - print "</td>\n"; - } - if ($CONF['transport'] == 'YES') print "<td>" . $domain_properties[$i]['transport'] . "</td>"; - $backupmx = ($domain_properties[$i]['backupmx'] == 1) ? $PALANG['YES'] : $PALANG['NO']; - print "<td>$backupmx</td>"; - print "<td>" . $domain_properties[$i]['modified'] . "</td>"; - $active = ($domain_properties[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO']; - print "<td><a href=\"edit-active-domain.php?domain=" . $list_domains[$i] . "\">" . $active . "</a></td>"; - print "<td><a href=\"edit-domain.php?domain=" . $list_domains[$i] . "\">" . $PALANG['edit'] . "</a></td>"; - print "<td><a href=\"delete.php?table=domain&delete=" . $list_domains[$i] . "\" onclick=\"return confirm ('" . $PALANG['confirm_domain'] . $PALANG['pAdminList_admin_domain'] . ": " . $list_domains[$i] . "')\">" . $PALANG['del'] . "</a></td>"; - print "</tr>\n"; - } - } - - print "</table>\n"; -} -echo "<p><a href='create-domain.php'>{$PALANG['pAdminMenu_create_domain']}</a>"; -?> Deleted: branches/postfixadmin-smarty/templates/admin_search.php =================================================================== --- branches/postfixadmin-smarty/templates/admin_search.php 2009-06-08 11:33:16 UTC (rev 673) +++ branches/postfixadmin-smarty/templates/admin_search.php 2009-06-08 19:01:03 UTC (rev 674) @@ -1,111 +0,0 @@ -<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?> -<?php -require(dirname(__FILE__) . '/search.tpl'); - -/* old code, should be deleted after testing the merge with templates/search.php -?> - -<div id="overview"> -<form name="search" method="post" action="search.php"> -<table width=750><tr> -<td> - <h4><?php print $PALANG['pSearch_welcome'] . $fSearch; ?></h4> -</td> -<td> - <?php print $PALANG['pSearch']; ?>:<input type="textbox" name="search"> -</td> -<td align=right><select class="flat" name="fDomain" > -<?php -print "<option value=\"$list_domains[0]\" selected>$list_domains[0]</option>\n"; -for ($i = 1; $i < sizeof ($list_domains); $i++) -{ - print "<option value=\"$list_domains[$i]\">$list_domains[$i]</option>\n"; -} -?> -</select> -<input class="button" type="submit" name="fGo" value="Return to <?php print $PALANG['pAdminMenu_list_virtual']; ?>" /></td> -</tr></table> -</form> -</div> - -<?php -if (sizeof ($tAlias) > 0) -{ - print "<table id=\"alias_table\">\n"; - print " <tr>\n"; - print " <td colspan=\"5\"><h3>".$PALANG['pOverview_alias_title']."</h3></td>"; - print " </tr>"; - print " <tr class=\"header\">\n"; - print " <td>" . $PALANG['pOverview_alias_address'] . "</td>\n"; - print " <td>" . $PALANG['pOverview_alias_goto'] . "</td>\n"; - print " <td>" . $PALANG['pOverview_alias_modified'] . "</td>\n"; - print " <td>" . $PALANG['pOverview_alias_active'] . "</td>\n"; - print " <td colspan=\"2\"> </td>\n"; - print " </tr>\n"; - - for ($i = 0; $i < sizeof ($tAlias); $i++) - { - if ((is_array ($tAlias) and sizeof ($tAlias) > 0)) - { - print " <tr class=\"hilightoff\" onMouseOver=\"className='hilighton';\" onMouseOut=\"className='hilightoff';\">\n"; - print " <td>" . $tAlias[$i]['address'] . "</td>\n"; - print " <td>" . ereg_replace (",", "<br>", $tAlias[$i]['goto']) . "</td>\n"; - print " <td>" . $tAlias[$i]['modified'] . "</td>\n"; - $active = ($tAlias[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO']; - print " <td><a href=\"edit-active.php?alias=" . urlencode ($tAlias[$i]['address']) . "&domain=" . $tAlias[$i]['domain']. "&return=search.php?search=" . urlencode ($fSearch) . "\">" . $active . "</a></td>\n"; - print " <td><a href=\"edit-alias.php?address=" . urlencode ($tAlias[$i]['address']) . "&domain=" . $tAlias[$i]['domain'] . "\">" . $PALANG['edit'] . "</a></td>\n"; - print " <td><a href=\"delete.php?table=alias&delete=" . urlencode ($tAlias[$i]['address']) . "&domain=" . $tAlias[$i]['domain'] . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_aliases'] . ": ". $tAlias[$i]['address'] . "')\">" . $PALANG['del'] . "</a></td>\n"; - print " </tr>\n"; - } - } - - print "</table>\n"; -} - -if (sizeof ($tMailbox) > 0) -{ - print "<table id=\"mailbox_table\">\n"; - print " <tr>\n"; - print " <td colspan=\"7\"><h3>".$PALANG['pOverview_mailbox_title']."</h3></td>"; - print " </tr>"; - print " <tr class=\"header\">\n"; - print " <td>" . $PALANG['pOverview_mailbox_username'] . "</td>\n"; - print " <td>" . $PALANG['pOverview_mailbox_name'] . "</td>\n"; - if ($CONF['quota'] == 'YES') print " <td>" . $PALANG['pOverview_mailbox_quota'] . "</td>\n"; - print " <td>" . $PALANG['pOverview_mailbox_modified'] . "</td>\n"; - print " <td>" . $PALANG['pOverview_mailbox_active'] . "</td>\n"; - if ($CONF['alias_control'] == 'YES') - { - print " <td colspan=\"3\"> </td>\n"; - } - else - { - print " <td colspan=\"2\"> </td>\n"; - } - print " </tr>\n"; - - for ($i = 0; $i < sizeof ($tMailbox); $i++) - { - if ((is_array ($tMailbox) and sizeof ($tMailbox) > 0)) - { - print " <tr class=\"hilightoff\" onMouseOver=\"className='hilighton';\" onMouseOut=\"className='hilightoff';\">\n"; - print " <td>" . $tMailbox[$i]['username'] . "</td>\n"; - print " <td>" . $tMailbox[$i]['name'] . "</td>\n"; - if ($CONF['quota'] == 'YES') print " <td>" . divide_quota ($tMailbox[$i]['quota']) . "</td>\n"; - print " <td>" . $tMailbox[$i]['modified'] . "</td>\n"; - $active = ($tMailbox[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO']; - print " <td><a href=\"edit-active.php?username=" . urlencode ($tMailbox[$i]['username']) . "&domain=" . $tMailbox[$i]['domain'] . "&return=search.php?search=" . urlencode ($fSearch) . "\">" . $active . "</a></td>\n"; - if ($CONF['alias_control'] == 'YES') - { - print " <td><a href=\"edit-alias.php?address=" . urlencode ($tMailbox[$i]['username']) . "&domain=" . $tMailbox[$i]['domain'] . "\">" . $PALANG['pOverview_alias_edit'] . "</a></td>\n"; - } - print " <td><a href=\"edit-mailbox.php?username=" . urlencode ($tMailbox[$i]['username']) . "&domain=" . $tMailbox[$i]['domain'] . "\">" . $PALANG['edit'] . "</a></td>\n"; - print " <td><a href=\"delete.php?table=mailbox&delete=" . urlencode ($tMailbox[$i]['username']) . "&domain=" . $tMailbox[$i]['domain'] . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_mailboxes'] . ": ". $tMailbox[$i]['username'] . "')\">" . $PALANG['del'] . "</a></td>\n"; - print " </tr>\n"; - } - } - print "</table>\n"; -} - -/* */ -?> Deleted: branches/postfixadmin-smarty/templates/broadcast-message.php =================================================================== --- branches/postfixadmin-smarty/templates/broadcast-message.php 2009-06-08 11:33:16 UTC (rev 673) +++ branches/postfixadmin-smarty/templates/broadcast-message.php 2009-06-08 19:01:03 UTC (rev 674) @@ -1,35 +0,0 @@ -<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?> -<div id="edit_form"> -<form name="broadcast-message" method="post"> -<table> - <tr> - <td colspan="3"><h3><?php print $PALANG['pBroadcast_title']; ?></h3></td> - </tr> - <tr> - <td><?php print $PALANG['pBroadcast_from'] . ":"; ?></td> - <td><?php print $CONF['admin_email']; ?></td> - </tr> - <tr> - <td><?php print $PALANG['pBroadcast_name'] . ':'; ?></td> - <td><input class="flat" size="43" type="text" name="name"/></td> - </tr> - <tr> - <td><?php print $PALANG['pBroadcast_subject'] . ":"; ?></td> - <td><input class="flat" size="43" type="text" name="subject"/></td> - </tr> - <tr> - <td><?php print $PALANG['pBroadcast_message'] . ":"; ?></td> - <td><textarea class="flat" cols="40" rows="6" name="message"></textarea></td> - </tr> - <tr> - <td colspan="3" class="hlp_center"> - <?php - if($error == 1){ - echo '<br/><span class="error_msg">'.$PALANG['pBroadcast_error_empty'].'</span><br/><br/>' ; - } - ?> - <input class="button" type="submit" name="submit" value="<?php print $PALANG['pBroadcast_send']; ?>" /></td> - </tr> -</table> -</form> -</div> Deleted: branches/postfixadmin-smarty/templates/create-alias-domain.php =================================================================== --- branches/postfixadmin-smarty/templates/create-alias-domain.php 2009-06-08 11:33:16 UTC (rev 673) +++ branches/postfixadmin-smarty/templates/create-alias-domain.php 2009-06-08 19:01:03 UTC (rev 674) @@ -1,62 +0,0 @@ -<?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> - -<?php -if (count($alias_domains) > 0) { -?> - - <tr> - <td><?php print $PALANG['pCreate_alias_domain_alias'] . ":"; ?></td> - <td> - <select class="flat" name="alias_domain"> - <?php - foreach ($alias_domains as $dom) - { - 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 ($target_domains as $dom) - { - 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> -<?php -} -?> - <tr> - <td colspan="3" class="standout"><?php if ($error) { print '<span class="error_msg">'; } print $tMessage; if ($error) { print '</span>'; } ?></td> - </tr> -<?php -if (count($alias_domains) > 0) { -?> - <tr> - <td colspan="3" class="hlp_center"><input class="button" type="submit" name="submit" value="<?php print $PALANG['pCreate_alias_domain_button']; ?>" /></td> - </tr> -<?php -} -?> -</table> -</form> -</div> -<?php /* vim: set ft=php expandtab softtabstop=3 tabstop=3 shiftwidth=3: */ ?> Deleted: branches/postfixadmin-smarty/templates/create-alias.php =================================================================== --- branches/postfixadmin-smarty/templates/create-alias.php 2009-06-08 11:33:16 UTC (rev 673) +++ branches/postfixadmin-smarty/templates/create-alias.php 2009-06-08 19:01:03 UTC (rev 674) @@ -1,51 +0,0 @@ -<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?> -<div id="edit_form"> -<form name="alias" method="post"> -<table> - <tr> - <td colspan="3"><h3><?php print $PALANG['pCreate_alias_welcome']; ?></h3></td> - </tr> - <tr> - <td><?php print $PALANG['pCreate_alias_address']; ?></td> - <td><input class="flat" type="text" name="fAddress" value="<?php print $tAddress; ?>" /></td> - <td>@ - <select class="flat" name="fDomain"> - <?php - for ($i = 0; $i < sizeof ($list_domains); $i++) - { - if ($tDomain == $list_domains[$i]) - { - print "<option value=\"$list_domains[$i]\" selected>$list_domains[$i]</option>\n"; - } - else - { - print "<option value=\"$list_domains[$i]\">$list_domains[$i]</option>\n"; - } - } - ?> - </select> - <?php print $pCreate_alias_address_text; ?> - </td> - </tr> - <tr> - <td><?php print $PALANG['pCreate_alias_goto'] . ":"; ?></td> - <td><input class="flat" type="text" name="fGoto" value="<?php print $tGoto; ?>" /></td> - <td><?php print $pCreate_alias_goto_text; ?></td> - </tr> - <tr> - <td><?php print $PALANG['pCreate_alias_active'] . ":"; ?></td> - <td><input class="flat" type="checkbox" name="fActive" checked /></td> - <td> </td> - </tr> - <tr> - <td colspan="3" class="hlp_center"><input class="button" type="submit" name="submit" value="<?php print $PALANG['pCreate_alias_button']; ?>" /></td> - </tr> - <tr> - <td colspan="3" class="standout"><?php print $tMessage; ?></td> - </tr> - <tr> - <td colspan="3" class="help_text"><?php print $PALANG['pCreate_alias_catchall_text']; ?></td> - </tr> -</table> -</form> -</div> Deleted: branches/postfixadmin-smarty/templates/create-mailbox.php =================================================================== --- branches/postfixadmin-smarty/templates/create-mailbox.php 2009-06-08 11:33:16 UTC (rev 673) +++ branches/postfixadmin-smarty/templates/create-mailbox.php 2009-06-08 19:01:03 UTC (rev 674) @@ -1,70 +0,0 @@ -<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?> -<div id="edit_form"> -<form name="mailbox" method="post"> -<table> - <tr> - <td colspan="3"><h3><?php print $PALANG['pCreate_mailbox_welcome']; ?></h3></td> - </tr> - <tr> - <td><?php print $PALANG['pCreate_mailbox_username'] . ":"; ?></td> - <td><input class="flat" type="text" name="fUsername" value="<?php print $tUsername; ?>" autocomplete="off"/></td> - <td>@ - <select name="fDomain"> - <?php - for ($i = 0; $i < sizeof ($list_domains); $i++) - { - if ($tDomain == $list_domains[$i]) - { - print "<option value=\"$list_domains[$i]\" selected>$list_domains[$i]</option>\n"; - } - else - { - print "<option value=\"$list_domains[$i]\">$list_domains[$i]</option>\n"; - } - } - ?> - </select> - <?php print $pCreate_mailbox_username_text; ?> - </td> - </tr> - <tr> - <td><?php print $PALANG['pCreate_mailbox_password'] . ":"; ?></td> - <td><input class="flat" type="password" name="fPassword" /></td> - <td><?php print $pCreate_mailbox_password_text; ?></td> - </tr> - <tr> - <td><?php print $PALANG['pCreate_mailbox_password2'] . ":"; ?></td> - <td><input class="flat" type="password" name="fPassword2" /></td> - <td> </td> - </tr> - <tr> - <td><?php print $PALANG['pCreate_mailbox_name'] . ":"; ?></td> - <td><input class="flat" type="text" name="fName" value="<?php print $tName; ?>" /></td> - <td><?php print $pCreate_mailbox_name_text; ?></td> - </tr> - <?php if ($CONF['quota'] == 'YES') { ?> - <tr> - <td><?php print $PALANG['pCreate_mailbox_quota'] . ":"; ?></td> - <td><input class="flat" type="text" name="fQuota" value="<?php print $tQuota; ?>" /></td> - <td><?php print $pCreate_mailbox_quota_text; ?></td> - </tr> - <?php } ?> - <tr> - <td><?php print $PALANG['pCreate_mailbox_active'] . ":"; ?></td> - <td><input class="flat" type="checkbox" name="fActive" checked /></td> - <td> </td> - </tr> - <tr> - <td><?php print $PALANG['pCreate_mailbox_mail'] . ":"; ?></td> - <td><input class="flat" type="checkbox" name="fMail" <?php print (isset($CONF['create_mailbox_subdirs'])) ? '' : 'checked'; ?> /></td> - <td> </td> - </tr> - <tr> - <td colspan="3" class="hlp_center"><input class="button" type="submit" name="submit" value="<?php print $PALANG['pCreate_mailbox_button']; ?>" /></td> - </tr> - <tr> - <td colspan="3" class="standout"><?php print $tMessage; ?></td> - </tr> -</table> -</form> -</div> Deleted: branches/postfixadmin-smarty/templates/edit-alias.php =================================================================== --- branches/postfixadmin-smarty/templates/edit-alias.php 2009-06-08 11:33:16 UTC (rev 673) +++ branches/postfixadmin-smarty/templates/edit-alias.php 2009-06-08 19:01:03 UTC (rev 674) @@ -1,37 +0,0 @@ -<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?> -<div id="edit_form"> -<form name="alias" method="post"> -<table> - <tr> - <td colspan="3"><h3><?php print $PALANG['pEdit_alias_welcome']; ?></h3></td> - </tr> - <tr> - <td><?php print $PALANG['pEdit_alias_address'] . ":"; ?></td> - <td><?php print $fAddress; ?></td> - <td> </td> - </tr> - <tr> - <td><?php print $PALANG['pEdit_alias_goto'] . ":"; ?></td> - <td> -<textarea class="flat" rows="10" cols="60" name="fGoto"> -<?php -$array = preg_split ('/,/', $tGoto); -for ($i = 0 ; $i < sizeof ($array) ; $i++) -{ - if (empty ($array[$i])) continue; - print "$array[$i]\n"; -} -?> -</textarea> - </td> - <td> </td> - </tr> - <tr> - <td colspan="3" class="hlp_center"><input class="button" type="submit" name="submit" value="<?php print $PALANG['pEdit_alias_button']; ?>" /></td> - </tr> - <tr> - <td colspan="3" class="standout"><?php print $tMessage; ?></td> - </tr> -</table> -</form> -</div> Deleted: branches/postfixadmin-smarty/templates/edit-mailbox.php =================================================================== --- branches/postfixadmin-smarty/templates/edit-mailbox.php 2009-06-08 11:33:16 UTC (rev 673) +++ branches/postfixadmin-smarty/templates/edit-mailbox.php 2009-06-08 19:01:03 UTC (rev 674) @@ -1,51 +0,0 @@ -<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?> -<div id="edit_form"> -<form name="mailbox" method="post"> -<table> - <tr> - <td colspan="3"><h3><?php print $PALANG['pEdit_mailbox_welcome']; ?></h3></td> - </tr> - <tr> - <td><?php print $PALANG['pEdit_mailbox_username']; ?></td> - <td><?php print $fUsername; ?></td> - <td><?php print $pEdit_mailbox_username_text; ?></td> - </tr> - <tr> - <td><?php print $PALANG['pEdit_mailbox_password'] . ":"; ?></td> - <td><input class="flat" type="password" name="fPassword" /></td> - <td><?php print $pEdit_mailbox_password_text; ?></td> - </tr> - <tr> - <td><?php print $PALANG['pEdit_mailbox_password2'] . ":"; ?></td> - <td><input class="flat" type="password" name="fPassword2" /></td> - <td> </td> - </tr> - <tr> - <td><?php print $PALANG['pEdit_mailbox_name'] . ":"; ?></td> - <td><input class="flat" type="text" name="fName" value="<?php print htmlspecialchars ($tName,ENT_QUOTES); ?>" /></td> - <td><?php print $pEdit_mailbox_name_text; ?></td> - </tr> - <?php if ($CONF['quota'] == 'YES') { ?> - <tr> - <td><?php print $PALANG['pEdit_mailbox_quota'] . " (max: " . $tMaxquota . "):"; ?></td> - <td><input class="flat" type="text" name="fQuota" value="<?php print $tQuota; ?>" /></td> - <td><?php print $pEdit_mailbox_quota_text; ?></td> - </tr> - <?php } ?> - <tr> - <td><?php print $PALANG['pCreate_mailbox_active'] . ":"; ?></td> - <td><input class="flat" type="checkbox" name="fActive" <?php print (!empty ($tActive)) ? 'checked' : '' ?> /></td> - <td> </td> - </tr> - <tr> - <td colspan="3" class="hlp_center"> - <input class="button" type="submit" name="submit" value="<?php print $PALANG['pEdit_mailbox_button']; ?>" /> - <input class="button" type="submit" name="cancel" value="<?php print $PALANG['exit']; ?>" action="main.php" /> - </td> - </tr> - <tr> - <td colspan="3" class="standout"><?php print $tMessage; ?></td> - </tr> -</table> -</form> -</div> Modified: branches/postfixadmin-smarty/templates/edit-mailbox.tpl =================================================================== --- branches/postfixadmin-smarty/templates/edit-mailbox.tpl 2009-06-08 11:33:16 UTC (rev 673) +++ branches/postfixadmin-smarty/templates/edit-mailbox.tpl 2009-06-08 19:01:03 UTC (rev 674) @@ -11,6 +11,11 @@ <td>{$pEdit_mailbox_username_text}</td> </tr> <tr> + <td>{$PALANG.pPassword_password_current}:</td> + <td>{$fPassword}</td> + <td> </td> + </tr> + <tr> <td>{$PALANG.pEdit_mailbox_password}:</td> <td><input class="flat" type="password" name="fPassword" /></td> <td>{$pEdit_mailbox_password_text}</td> Deleted: branches/postfixadmin-smarty/templates/edit-vacation.php =================================================================== --- branches/postfixadmin-smarty/templates/edit-vacation.php 2009-06-08 11:33:16 UTC (rev 673) +++ branches/postfixadmin-smarty/templates/edit-vacation.php 2009-06-08 19:01:03 UTC (rev 674) @@ -1,45 +0,0 @@ -<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?> -<script type="text/javascript"> -function newLocation() -{ -window.location="<?php print $fCanceltarget; ?>" - -} -</script> -<div id="edit_form"> - -<form name="edit-vacation" method="post" action=''> -<table> - <tr> - <td colspan="3"><h3><?php print $PALANG['pUsersVacation_welcome']; ?></h3></td> - </tr> - <tr> - <td><?php print $PALANG['pUsersLogin_username'] . ":"; ?></td> - <td><?php print $tUseremail; ?></td> - <td> </td> - </tr> - <tr> - <td><?php print $PALANG['pUsersVacation_subject'] . ":"; ?></td> - <td><textarea class="flat" cols="60" name="fSubject" ><?php print htmlentities(stripslashes($tSubject), ENT_QUOTES, 'UTF-8'); ?></textarea></td> - <td> </td> - </tr> - <tr> - <td><?php print $PALANG['pUsersVacation_body'] . ":"; ?></td> - <td><textarea class="flat" rows="10" cols="60" name="fBody" ><?php print htmlentities(stripslashes($tBody), ENT_QUOTES , 'UTF-8'); ?></textarea></td> - <td> </td> - </tr> - <tr> - <td colspan="3" class="hlp_center"> - - <input class="button" type="submit" name="fChange" value="<?php print $PALANG['pEdit_vacation_set']; ?>" /> - <input class="button" type="submit" name="fBack" value="<?php print $PALANG['pEdit_vacation_remove']; ?>" /> - <input class="button" type="button" name="fCancel" value="<?php print $PALANG['exit']; ?>" onclick="newLocation()" /> - </td> - </tr> - - <tr> - <td colspan="3" class="standout"><?php print $tMessage; ?></td> - </tr> -</table> -</form> -</div> Deleted: branches/postfixadmin-smarty/templates/fetchmail.php =================================================================== --- branches/postfixadmin-smarty/templates/fetchmail.php 2009-06-08 11:33:16 UTC (rev 673) +++ branches/postfixadmin-smarty/templates/fetchmail.php 2009-06-08 19:01:03 UTC (rev 674) @@ -1,182 +0,0 @@ -<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?> -<?php - -$headers=array(); -foreach(array_keys($fm_struct) as $row){ - list($editible,$view,$type)=$fm_struct[$row]; - $title = $PALANG['pFetchmail_field_' . $row]; - $comment = $PALANG['pFetchmail_desc_' . $row]; - if ($view){ - $headers[]=array($editible, $view, $type, $title, $comment); - } -} - -if ($edit || $new) { # edit mode - echo '<div id="edit_form">'; - echo '<form name="fetchmail" method="post">'; - print fetchmail_edit_row($formvars); - -} else { # display mode - print '<div id="overview">'; - print '<form name="overview" method="post">'; - print "<table id=\"log_table\" border=0>\n"; - print " <tr>\n"; - print " <td colspan=\"".(sizeof($headers)+2)."\"><h3>".$PALANG['pFetchmail_welcome'].$user_domains."</h3></td>\n"; - print " </tr>\n"; - print " <tr class=\"header\">\n"; - foreach($headers as $row){ - list($editible,$view,$type,$title,$comment)=$row; - print " <td>" . $title . "</td>\n"; - } - print "<td> </td>"; - print "<td> </td>"; - print " </tr>\n"; - - if (sizeof ($tFmail) > 0){ - foreach($tFmail as $row){ - print " <tr class=\"hilightoff\" onMouseOver=\"className='hilighton';\" onMouseOut=\"className='hilightoff';\">\n"; - foreach($row as $key=>$val){ - - if (!isset($fm_struct[$key])) continue; # TODO: not really nice, but avoids undefined index warnings ;-) - list($editible,$view,$type)=$fm_struct[$key]; - if ($view){ - $func="_listview_".$type; - print " <td nowrap>" . (function_exists($func)?$func($val):$val) . "</td>\n"; - } - - } - print "<td><a href=\"fetchmail.php?edit=" . $row['id'] . "\">" . $PALANG['edit'] . "</a></td>"; - print " <td><a href=\"fetchmail.php?delete=" . $row['id'] . "\"onclick=\"return confirm ('" - . $PALANG['confirm'] . $PALANG['pMenu_fetchmail'] . ": ". htmlentities($row['src_user']) . " @ " - . htmlentities($row['src_server']) . "')\">" . $PALANG['del'] . "</a></td>\n"; - print " </tr>\n"; - } - } - print "</table>"; - print "<p />\n"; - print "</form>\n"; - print "</div>\n"; - - print "<p><a href='?new=1'>".$PALANG['pFetchmail_new_entry']."</a></p>\n"; - -} # end display mode - -function fetchmail_edit_row($data=array()){ - global $fm_struct,$fm_defaults,$PALANG; - $id=$data["id"]; - $_id=$data["id"]*100+1; - $ret="<table>"; - $ret .= '<tr><td colspan="3"><h3>' . $PALANG['pMenu_fetchmail'] . '</h3></td></tr>'; - # TODO: $formvars possibly contains db-specific boolean values - # TODO: no problems with MySQL, to be tested with PgSQL - # TODO: undefined values may also occour - foreach($fm_struct as $key=>$struct){ - list($editible,$view,$type)=$struct; - $title = $PALANG['pFetchmail_field_' . $key]; - $comment = $PALANG['pFetchmail_desc_' . $key]; - if ($editible){ - $ret.="<tr><td align=left valign=top><label for=${_id} style='width:20em;'>${title}: </label></td>"; - $ret.="<td align=left style='padding-left:.25em;padding-right:.25em;background-color:white;'>"; - $func="_edit_".$type; - if (! function_exists($func)) - $func="_edit_text"; - $val=isset($data[$key]) - ?$data[$key] - :(! is_array($fm_defaults[$key]) - ?$fm_defaults[$key] - :'' - ); - $fm_defaults_key = ""; if (isset($fm_defaults[$key])) $fm_defaults_key = $fm_defaults[$key]; - $ret.=$func($_id++,$key,$fm_defaults_key,$val); - $ret.="</td><td align=left valign=top><i> ${comment}</i></td></tr>\n"; - } - elseif($view){ - $func="_view_".$type; - $val=isset($data[$key]) - ?(function_exists($func) - ?$func($data[$key]) - :nl2br($data[$key]) - ) - :"--x--"; - $ret.="<tr><td align=left valign=top>${title}: </label></td>"; - $ret.="<td align=left valign=top style='padding-left:.25em;padding-right:.25em;background-color:white;'>".$val; - $ret.="</td><td align=left valign=top><i> ${comment}</i></td></tr>\n"; - } - } - $ret.="<tr><td align=center colspan=3> - <input type=submit name=save value='" . $PALANG['save'] . "'> - <input type=submit name=cancel value='" . $PALANG['cancel'] . "'> - "; - if ($id){ - $ret.="<input type=hidden name=edit value='${id}'>"; - } - $ret.="</td></tr>\n"; - $ret.="</table>\n"; - $ret.="<p />\n"; - $ret.="</form>\n"; - $ret.="</div>\n"; - return $ret; -} - -function _edit_text($id,$key,$def_vals,$val=""){ - $val=htmlspecialchars($val); - return "<input type=text name=${key} id=${id} value='${val}'>"; -} - -function _edit_password($id,$key,$def_vals,$val=""){ - $val=preg_replace("{.}","*",$val); - return "<input type=password name=${key} id=${id} value='${val}'>"; -} - -function _edit_num($id,$key,$def_vals,$val=""){ - $val=(int)($val); - return "<input type=text name=${key} id=${id} value='${val}'>"; -} - -function _edit_bool($id,$key,$def_vals,$val=""){ - $ret="<input type=checkbox name=${key} id=${id}"; - if ($val) - $ret.=" checked"; - $ret.=">"; - return $ret; -} - -function _edit_longtext($id,$key,$def_vals,$val=""){ - $val=htmlspecialchars($val); - return "<textarea name=${key} id=${id} rows=2 style='width:20em;'>${val}</textarea>"; -} - -function _edit_enum($id,$key,$def_vals,$val=""){ - $ret="<select name=${key} id=${id}>"; - foreach($def_vals as $opt_val){ - $ret.="<option"; - if ($opt_val==$val) - $ret.=" selected"; - $ret.=">${opt_val}</option>\n"; - } - $ret.="</select>\n"; - return $ret; -} - -function _listview_id($val){ - return "<a href='?edit=${val}'> ${val} </a>"; -} - -function _listview_bool($val){ - return $val?"+":""; -} - -function _listview_longtext($val){ - return strlen($val)?"Text - ".strlen($val)." chars":"--x--"; -} - -function _listview_text($val){ - return sizeof($val)?$val:"--x--"; -} - -function _listview_password($val){ - return preg_replace("{.}","*",$val); -} - -/* vim: set ft=php expandtab softtabstop=3 tabstop=3 shiftwidth=3: */ -?> Deleted: branches/postfixadmin-smarty/templates/footer.php =================================================================== --- branches/postfixadmin-smarty/templates/footer.php 2009-06-08 11:33:16 UTC (rev 673) +++ branches/postfixadmin-smarty/templates/footer.php 2009-06-08 19:01:03 UTC (rev 674) @@ -1,22 +0,0 @@ -<?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> - | -<?php -if(isset($_SESSION['sessid']['username'])) { - printf($PALANG['pFooter_logged_as'], authentication_get_username()); -} -?> - | -<a target="_blank" href="http://postfixadmin.sf.net/update-check.php?version=<?php print $version; ?>"><?php print $PALANG['check_update']; ?></a> -<?php -if (($CONF['show_footer_text'] == "YES") and ($CONF['footer_link'])) -{ - print " | "; - print "<a href=\"" . $CONF['footer_link'] . "\">" . $CONF['footer_text'] . "</a>\n"; -} - -?> -</div> -</body> -</html> Modified: branches/postfixadmin-smarty/templates/footer.tpl =================================================================== --- branches/postfixadmin-smarty/templates/footer.tpl 2009-06-08 11:33:16 UTC (rev 673) +++ branches/postfixadmin-smarty/templates/footer.tpl 2009-06-08 19:01:03 UTC (rev 674) @@ -27,6 +27,7 @@ $sm... [truncated message content] |
From: <chr...@us...> - 2009-06-08 11:33:46
|
Revision: 673 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=673&view=rev Author: christian_boltz Date: 2009-06-08 11:33:16 +0000 (Mon, 08 Jun 2009) Log Message: ----------- - log mailbox deletion (was only logged as alias deletion before) Note: Mailbox deletion will cause an additional "alias deleted" log entry Modified Paths: -------------- trunk/delete.php Modified: trunk/delete.php =================================================================== --- trunk/delete.php 2009-06-04 21:25:53 UTC (rev 672) +++ trunk/delete.php 2009-06-08 11:33:16 UTC (rev 673) @@ -142,6 +142,7 @@ } $tMessage.=')</span>'; } + db_log ($SESSID_USERNAME, $fDomain, 'delete_mailbox', $fDelete); } $result = db_query("SELECT * FROM $table_vacation WHERE email = '$fDelete' AND domain = '$fDomain'"); if($result['rows'] == 1) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <no...@us...> - 2009-06-04 21:26:02
|
Revision: 672 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=672&view=rev Author: normes Date: 2009-06-04 21:25:53 +0000 (Thu, 04 Jun 2009) Log Message: ----------- We don't need this file in svn, it's a dynamic file which will be created due to the packaging tools. Removed Paths: ------------- trunk/debian/files Deleted: trunk/debian/files =================================================================== --- trunk/debian/files 2009-06-04 21:24:26 UTC (rev 671) +++ trunk/debian/files 2009-06-04 21:25:53 UTC (rev 672) @@ -1 +0,0 @@ -postfixadmin_2.3rc3_all.deb admin optional This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <no...@us...> - 2009-06-04 21:24:47
|
Revision: 671 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=671&view=rev Author: normes Date: 2009-06-04 21:24:26 +0000 (Thu, 04 Jun 2009) Log Message: ----------- Support for lenny packages added. Please have a look at the debian/README.Debian file for more informations. Modified Paths: -------------- trunk/debian/README.Debian trunk/debian/control trunk/debian/postfixadmin.postinst trunk/debian/postfixadmin.prerm trunk/debian/rules Added Paths: ----------- trunk/debian/confd-link.sh Modified: trunk/debian/README.Debian =================================================================== --- trunk/debian/README.Debian 2009-06-01 14:56:29 UTC (rev 670) +++ trunk/debian/README.Debian 2009-06-04 21:24:26 UTC (rev 671) @@ -19,6 +19,7 @@ - MySQL or PostgreSQL - Courier or Dovecot + Where to get help ================= @@ -28,3 +29,18 @@ - http://postfixadmin.sf.net - #postfixadmin on irc.freenode.net + +How to build this package for Debian/lenny +========================================== + +If you want to build this package for Debian/lenny, you have to execute + + DIST="lenny" dpkg-buildpackage -rfakeroot + +This will include the confd-link.sh script into the package. That script +is included in wwwconfig-common >0.2, but we have an older version in +lenny at the moment. + +We (upstream and myself) want to provide also an lenny ready package, +which will be available via sf.net. Just as an easy way for interested +people which are running lenny. Added: trunk/debian/confd-link.sh =================================================================== --- trunk/debian/confd-link.sh (rev 0) +++ trunk/debian/confd-link.sh 2009-06-04 21:24:26 UTC (rev 671) @@ -0,0 +1,86 @@ +#!/bin/sh +# File: confd-link.sh +# Changes: +# 20081109 Norman Messtorff <no...@no...> +# Initial version. +# +# Needs: $servers - the servers to link configurations in. +# $linkname - specify the link name +# $linkdestination_apache - specify the link destination (Apache config) +# $linkdestination_lighttpd - specify the link destination (lighttpd config) +# Description: Linking configurations into Webservers conf.d +# Sets: $status = {error, nothing, linked, removed} +# $error = error message (if $status = error) + +status="nothing" +error="" + +# +# Checking needed settings... +# +if [ -z "$servers" ]; then + status="error" + error="No servers specified in confd-link.sh" +elif [ -z "$linkname" ]; then + status="error" + error="No linkname specified in confd-link.sh" +else + + # + # The link removal part... + # + if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then + for A in $servers ; do + A=${A%,} + # + # lighttpd has no conf.d + # + if [ "$A" = "lighttpd" ]; then + linkpath="/etc/lighttpd/conf-available" + else + linkpath="/etc/$A/conf.d" + fi + + # + # Is it existing and a symbolic link or are we going to do some unwished things? + # + if [ -L $linkpath/$linkname ]; then + if rm -f $linkpath/$linkname 2>&1 ; then + status="removed" + else + status="error" + error="ERROR! Couln't remove $linkpath/$linkname " + fi + else + status="error" + error="ERROR! $linkpath/$linkname is no symbolic link or doesn't exists." + fi + done + else + for A in $servers ; do + A=${A%,} + # + # lighttpd has no conf.d + # + if [ "$A" = "lighttpd" ]; then + linkpath="/etc/lighttpd/conf-available" + linkdestination=$linkdestination_lighttpd + else + linkpath="/etc/$A/conf.d" + linkdestination=$linkdestination_apache + fi + + if [ -d $linkpath ]; then + if ln -s $linkdestination $linkpath/$linkname >/dev/null 2>&1 ; then + status="linked" + else + status="error" + error="ERROR! 'ln -s' returned an error. Could not create link in $linkpath" + fi + else + status="error" + error="ERROR! $linkpath doesn't exists. Could not create link in $linkpath" + fi + done + fi +fi Property changes on: trunk/debian/confd-link.sh ___________________________________________________________________ Added: svn:executable + * Modified: trunk/debian/control =================================================================== --- trunk/debian/control 2009-06-01 14:56:29 UTC (rev 670) +++ trunk/debian/control 2009-06-04 21:24:26 UTC (rev 671) @@ -10,7 +10,7 @@ Package: postfixadmin Architecture: all -Depends: debconf (>= 0.5), dbconfig-common, wwwconfig-common (>= 0.2.0), apache2 | lighttpd, libapache2-mod-php5 | php5-cgi | php5, php5-imap, php5-mysql | php5-pgsql, mysql-client | postgresql-client, ${misc:Depends} +Depends: debconf (>= 0.5), dbconfig-common, wwwconfig-common, apache2 | lighttpd, libapache2-mod-php5 | php5-cgi | php5, php5-imap, php5-mysql | php5-pgsql, mysql-client | postgresql-client, ${misc:Depends} Recommends: postfix-mysql | postfix-pgsql, mysql-server | postgresql-server Suggests: squirrelmail-postfixadmin, dovecot-common | courier-authlib-mysql | courier-authlib-postgresql Description: Virtual mail hosting interface for Postfix Modified: trunk/debian/postfixadmin.postinst =================================================================== --- trunk/debian/postfixadmin.postinst 2009-06-01 14:56:29 UTC (rev 670) +++ trunk/debian/postfixadmin.postinst 2009-06-04 21:24:26 UTC (rev 671) @@ -16,7 +16,11 @@ linkdestination_apache="../../postfixadmin/apache.conf" linkdestination_lighttpd="../../postfixadmin/lighttpd.conf" linkname="postfixadmin" - . /usr/share/wwwconfig-common/confd-link.sh + if [ -e /usr/share/wwwconfig-common/confd-link.sh ]; then + . /usr/share/wwwconfig-common/confd-link.sh + else + . /usr/share/postfixadmin/confd-link.sh + fi . /usr/share/wwwconfig-common/restart.sh fi Modified: trunk/debian/postfixadmin.prerm =================================================================== --- trunk/debian/postfixadmin.prerm 2009-06-01 14:56:29 UTC (rev 670) +++ trunk/debian/postfixadmin.prerm 2009-06-04 21:24:26 UTC (rev 671) @@ -14,7 +14,11 @@ db_get postfixadmin/reconfigure-webserver servers="$RET" linkname="postfixadmin" - . /usr/share/wwwconfig-common/confd-link.sh + if [ -e /usr/share/wwwconfig-common/confd-link.sh ]; then + . /usr/share/wwwconfig-common/confd-link.sh + else + . /usr/share/postfixadmin/confd-link.sh + fi fi #DEBHELPER# Modified: trunk/debian/rules =================================================================== --- trunk/debian/rules 2009-06-01 14:56:29 UTC (rev 670) +++ trunk/debian/rules 2009-06-04 21:24:26 UTC (rev 671) @@ -28,6 +28,7 @@ dh_install mv debian/postfixadmin/usr/share/postfixadmin/config.inc.php debian/postfixadmin/etc/postfixadmin/config.inc.php find debian/postfixadmin -name .svn | xargs -r rm -r + if test "${DIST}" = "lenny" ; then cp debian/confd-link.sh debian/postfixadmin/usr/share/postfixadmin/; fi # Build architecture-independent files here. binary-indep: build install This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-06-01 14:56:38
|
Revision: 670 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=670&view=rev Author: christian_boltz Date: 2009-06-01 14:56:29 +0000 (Mon, 01 Jun 2009) Log Message: ----------- list-domain.php - fix undefined variable warning if no domains exist (globally or for a domain admin) Modified Paths: -------------- trunk/list-domain.php Modified: trunk/list-domain.php =================================================================== --- trunk/list-domain.php 2009-05-31 20:31:04 UTC (rev 669) +++ trunk/list-domain.php 2009-06-01 14:56:29 UTC (rev 670) @@ -72,6 +72,7 @@ "; $result = db_query($query); +$domain_properties = array(); while ($row = db_array ($result['result'])) { $domain_properties[$row['domain']] = $row; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-05-31 20:31:10
|
Revision: 669 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=669&view=rev Author: christian_boltz Date: 2009-05-31 20:31:04 +0000 (Sun, 31 May 2009) Log Message: ----------- INSTALL.txt, UPGRADE.txt: - bumped PHP requirements to >= 5.1.2 BACKUP_MX.txt: - removed version requirements (no need to have them in 3 files) - added note about using reject_unverified_recipient or relay_recipient_maps Modified Paths: -------------- trunk/DOCUMENTS/BACKUP_MX.txt trunk/DOCUMENTS/UPGRADE.txt trunk/INSTALL.TXT Modified: trunk/DOCUMENTS/BACKUP_MX.txt =================================================================== --- trunk/DOCUMENTS/BACKUP_MX.txt 2009-05-30 09:23:42 UTC (rev 668) +++ trunk/DOCUMENTS/BACKUP_MX.txt 2009-05-31 20:31:04 UTC (rev 669) @@ -5,21 +5,16 @@ # Licensed under GPL for more info check GPL-LICENSE.TXT # -REQUIRED!! ----------- -- You are using Postfix 2.0 or higher. -- You are using Apache 1.3.27 / Lighttpd 1.3.15 or higher. -- You are using PHP 4.1 or higher. -- You are using MySQL 3.23 or higher. +Please follow these steps if your mailserver is used as a backup MX for some +(or all) of your domains. +Note: The setup described in this file only checks the domain, not the full +mail address. +You should use "reject_unverified_recipient" in your postfix config or setup +"relay_recipient_maps" with a list of valid mail adresses on the primary mx +to avoid that your backup MX accepts mails for non-existing recipient adresses. +Without this, your backup MX might become a backscatter source. -READ THIS FIRST! ----------------- -When this is an upgrade from Postfix Admin 1.5.4 please read UPGRADE.TXT!! - -More information is available on http://high5.net/howto/ - - 1. Modify main.cf ----------------- In order for Postfix to use MySQL for relay_domains add the following Modified: trunk/DOCUMENTS/UPGRADE.txt =================================================================== --- trunk/DOCUMENTS/UPGRADE.txt 2009-05-30 09:23:42 UTC (rev 668) +++ trunk/DOCUMENTS/UPGRADE.txt 2009-05-31 20:31:04 UTC (rev 669) @@ -9,7 +9,7 @@ ---------- - You are using Postfix 2.0 or higher. - You are using Apache 1.3.27 / Lighttpd 1.3.15 or higher. -- You are using PHP 4.1 or higher. +- You are using PHP 5.1.2 or higher. - You are using MySQL 3.23 or higher OR PostgreSQL v7.4+ Modified: trunk/INSTALL.TXT =================================================================== --- trunk/INSTALL.TXT 2009-05-30 09:23:42 UTC (rev 668) +++ trunk/INSTALL.TXT 2009-05-31 20:31:04 UTC (rev 669) @@ -9,7 +9,7 @@ ---------- - You are using Postfix 2.0 or higher. - You are using Apache 1.3.27 / Lighttpd 1.3.15 or higher. -- You are using PHP 5.X +- You are using PHP 5.1.2 or higher. - You are using MySQL 3.23 or higher (5.x recommended) OR PostgreSQL 7.4 (or higher) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Seb...@us...> - 2009-05-30 09:23:43
|
Revision: 668 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=668&view=rev Author: Sebastian2009 Date: 2009-05-30 09:23:42 +0000 (Sat, 30 May 2009) Log Message: ----------- - get in sync with mainline. Modified Paths: -------------- branches/postfixadmin-smarty/upgrade.php Modified: branches/postfixadmin-smarty/upgrade.php =================================================================== --- branches/postfixadmin-smarty/upgrade.php 2009-05-28 19:47:52 UTC (rev 667) +++ branches/postfixadmin-smarty/upgrade.php 2009-05-30 09:23:42 UTC (rev 668) @@ -229,7 +229,7 @@ if ($CONF['database_type'] == 'mysql' || $CONF['database_type'] == 'mysqli' ) { return "ALTER TABLE $table ADD INDEX `$indexname` ( `$fieldlist` )"; } elseif($CONF['database_type'] == 'pgsql') { - $pgindexname = $table . "_" . $indexname; + $pgindexname = $table . "_" . $indexname . '_idx'; return "CREATE INDEX $pgindexname ON $table($fieldlist);"; # Index names are unique with a DB for PostgreSQL } else { echo "Sorry, unsupported database type " . $conf['database_type']; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2009-05-28 19:48:08
|
Revision: 667 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=667&view=rev Author: GingerDog Date: 2009-05-28 19:47:52 +0000 (Thu, 28 May 2009) Log Message: ----------- try and avoid naming conflicts so put _idx on the end of all postgres indexes Modified Paths: -------------- trunk/upgrade.php Modified: trunk/upgrade.php =================================================================== --- trunk/upgrade.php 2009-05-24 11:12:34 UTC (rev 666) +++ trunk/upgrade.php 2009-05-28 19:47:52 UTC (rev 667) @@ -229,7 +229,7 @@ if ($CONF['database_type'] == 'mysql' || $CONF['database_type'] == 'mysqli' ) { return "ALTER TABLE $table ADD INDEX `$indexname` ( `$fieldlist` )"; } elseif($CONF['database_type'] == 'pgsql') { - $pgindexname = $table . "_" . $indexname; + $pgindexname = $table . "_" . $indexname . '_idx'; return "CREATE INDEX $pgindexname ON $table($fieldlist);"; # Index names are unique with a DB for PostgreSQL } else { echo "Sorry, unsupported database type " . $conf['database_type']; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Seb...@us...> - 2009-05-24 11:12:41
|
Revision: 666 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=666&view=rev Author: Sebastian2009 Date: 2009-05-24 11:12:34 +0000 (Sun, 24 May 2009) Log Message: ----------- - incorporate latest changes from rev 661. Revision Links: -------------- http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=661&view=rev Modified Paths: -------------- branches/postfixadmin-smarty/CHANGELOG.TXT branches/postfixadmin-smarty/functions.inc.php branches/postfixadmin-smarty/list-virtual.php Modified: branches/postfixadmin-smarty/CHANGELOG.TXT =================================================================== --- branches/postfixadmin-smarty/CHANGELOG.TXT 2009-05-24 09:38:23 UTC (rev 665) +++ branches/postfixadmin-smarty/CHANGELOG.TXT 2009-05-24 11:12:34 UTC (rev 666) @@ -11,6 +11,14 @@ # $Id$ +Version 2.3rc5 - 2009/05/20 - SVN r658 +-------------------------------------- + + - Improvements to the setup process + - Far better Debian packaging (we hope!) which should make installation much, much easier. + - Various bug fixes + - Performance enhancements (or we fixed the regressions ...) in domain listing etc. + Version 2.3rc4 - 2009/04/18 - SVN r632 -------------------------------------- Modified: branches/postfixadmin-smarty/functions.inc.php =================================================================== --- branches/postfixadmin-smarty/functions.inc.php 2009-05-24 09:38:23 UTC (rev 665) +++ branches/postfixadmin-smarty/functions.inc.php 2009-05-24 11:12:34 UTC (rev 666) @@ -22,7 +22,7 @@ exit; } -$version = '2.3 rc4'; +$version = '2.3 rc5'; /** * check_session Modified: branches/postfixadmin-smarty/list-virtual.php =================================================================== --- branches/postfixadmin-smarty/list-virtual.php 2009-05-24 09:38:23 UTC (rev 665) +++ branches/postfixadmin-smarty/list-virtual.php 2009-05-24 11:12:34 UTC (rev 666) @@ -154,9 +154,17 @@ if ($CONF['vacation_control_admin'] == 'YES') { if (boolconf('used_quotas')) - $query = "SELECT $table_mailbox.*, $table_vacation.active AS v_active, $table_quota.current FROM $table_mailbox LEFT JOIN $table_vacation ON $table_mailbox.username=$table_vacation.email LEFT JOIN $table_quota ON $table_mailbox.username=$table_quota.username WHERE $table_mailbox.domain='$fDomain' AND $table_quota.path='quota/storage' ORDER BY $table_mailbox.username LIMIT $page_size OFFSET $fDisplay"; + $query = "SELECT $table_mailbox.*, $table_vacation.active AS v_active, $table_quota.current FROM $table_mailbox + LEFT JOIN $table_vacation ON $table_mailbox.username=$table_vacation.email + LEFT JOIN $table_quota ON $table_mailbox.username=$table_quota.username + WHERE $table_mailbox.domain='$fDomain' + ORDER BY $table_mailbox.username LIMIT $page_size OFFSET $fDisplay"; + // AND $table_quota.path='quota/storage' + else - $query = "SELECT $table_mailbox.*, $table_vacation.active AS v_active FROM $table_mailbox LEFT JOIN $table_vacation ON $table_mailbox.username=$table_vacation.email WHERE $table_mailbox.domain='$fDomain' ORDER BY $table_mailbox.username LIMIT $page_size OFFSET $fDisplay"; + $query = "SELECT $table_mailbox.*, $table_vacation.active AS v_active FROM $table_mailbox + LEFT JOIN $table_vacation ON $table_mailbox.username=$table_vacation.email + WHERE $table_mailbox.domain='$fDomain' ORDER BY $table_mailbox.username LIMIT $page_size OFFSET $fDisplay"; } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Seb...@us...> - 2009-05-24 09:38:30
|
Revision: 665 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=665&view=rev Author: Sebastian2009 Date: 2009-05-24 09:38:23 +0000 (Sun, 24 May 2009) Log Message: ----------- - Smarty Update (2.6.24 -> 2.6.25) Modified Paths: -------------- branches/postfixadmin-smarty/smarty/libs/Config_File.class.php branches/postfixadmin-smarty/smarty/libs/Smarty.class.php branches/postfixadmin-smarty/smarty/libs/Smarty_Compiler.class.php Modified: branches/postfixadmin-smarty/smarty/libs/Config_File.class.php =================================================================== --- branches/postfixadmin-smarty/smarty/libs/Config_File.class.php 2009-05-21 13:05:57 UTC (rev 664) +++ branches/postfixadmin-smarty/smarty/libs/Config_File.class.php 2009-05-24 09:38:23 UTC (rev 665) @@ -22,14 +22,14 @@ * sma...@go... * * @link http://www.smarty.net/ - * @version 2.6.24 + * @version 2.6.25 * @copyright Copyright: 2001-2005 New Digital Group, Inc. * @author Andrei Zmievski <an...@ph...> * @access public * @package Smarty */ -/* $Id: Config_File.class.php 3144 2009-05-14 13:18:50Z monte.ohrt $ */ +/* $Id: Config_File.class.php 3149 2009-05-23 20:59:25Z monte.ohrt $ */ /** * Config file reading class Modified: branches/postfixadmin-smarty/smarty/libs/Smarty.class.php =================================================================== --- branches/postfixadmin-smarty/smarty/libs/Smarty.class.php 2009-05-21 13:05:57 UTC (rev 664) +++ branches/postfixadmin-smarty/smarty/libs/Smarty.class.php 2009-05-24 09:38:23 UTC (rev 665) @@ -27,10 +27,10 @@ * @author Monte Ohrt <monte at ohrt dot com> * @author Andrei Zmievski <an...@ph...> * @package Smarty - * @version 2.6.24 + * @version 2.6.25 */ -/* $Id: Smarty.class.php 3146 2009-05-16 23:27:22Z monte.ohrt $ */ +/* $Id: Smarty.class.php 3149 2009-05-23 20:59:25Z monte.ohrt $ */ /** * DIR_SEP isn't used anymore, but third party apps might @@ -107,7 +107,7 @@ /** * When set, smarty does uses this value as error_reporting-level. * - * @var boolean + * @var integer */ var $error_reporting = null; @@ -465,7 +465,7 @@ * * @var string */ - var $_version = '2.6.24'; + var $_version = '2.6.25'; /** * current template inclusion depth @@ -582,7 +582,10 @@ $this->_supers['get'] = $this->request_use_auto_globals ? $_GET : $GLOBALS['HTTP_GET_VARS']; $this->_supers['post'] = $this->request_use_auto_globals ? $_POST : $GLOBALS['HTTP_POST_VARS']; $this->_supers['server'] = $this->request_use_auto_globals ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS']; - $this->_supers['session'] = $this->request_use_auto_globals ? $_SESSION : $GLOBALS['HTTP_SESSION_VARS']; + if(isset($_SESSION)) + $this->_supers['session'] = $this->request_use_auto_globals ? $_SESSION : $GLOBALS['HTTP_SESSION_VARS']; + else + $this->_supers['session'] = array(); $this->_supers['request'] = $this->request_use_auto_globals ? $_REQUEST : $GLOBALS['HTTP_REQUEST_VARS']; $this->_supers['cookies'] = $this->request_use_auto_globals ? $_COOKIE : $GLOBALS['HTTP_COOKIE_VARS']; $this->_supers['env'] = $this->request_use_auto_globals ? $_ENV : $GLOBALS['HTTP_ENV_VARS']; Modified: branches/postfixadmin-smarty/smarty/libs/Smarty_Compiler.class.php =================================================================== --- branches/postfixadmin-smarty/smarty/libs/Smarty_Compiler.class.php 2009-05-21 13:05:57 UTC (rev 664) +++ branches/postfixadmin-smarty/smarty/libs/Smarty_Compiler.class.php 2009-05-24 09:38:23 UTC (rev 665) @@ -21,12 +21,12 @@ * @link http://smarty.php.net/ * @author Monte Ohrt <monte at ohrt dot com> * @author Andrei Zmievski <an...@ph...> - * @version 2.6.24 + * @version 2.6.25 * @copyright 2001-2005 New Digital Group, Inc. * @package Smarty */ -/* $Id: Smarty_Compiler.class.php 3146 2009-05-16 23:27:22Z monte.ohrt $ */ +/* $Id: Smarty_Compiler.class.php 3149 2009-05-23 20:59:25Z monte.ohrt $ */ /** * Template compiling class This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-05-21 13:06:05
|
Revision: 664 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=664&view=rev Author: christian_boltz Date: 2009-05-21 13:05:57 +0000 (Thu, 21 May 2009) Log Message: ----------- config.inc.php: - revert (accidential) changes from r661, this time in the 2.3 rc5 branch Modified Paths: -------------- branches/postfixadmin-2.3rc5/config.inc.php Modified: branches/postfixadmin-2.3rc5/config.inc.php =================================================================== --- branches/postfixadmin-2.3rc5/config.inc.php 2009-05-21 13:03:46 UTC (rev 663) +++ branches/postfixadmin-2.3rc5/config.inc.php 2009-05-21 13:05:57 UTC (rev 664) @@ -29,12 +29,12 @@ * Doing this implies you have changed this file as required. * i.e. configuring database etc; specifying setup.php password etc. */ -$CONF['configured'] = true; +$CONF['configured'] = false; // In order to setup Postfixadmin, you MUST specify a hashed password here. // To create the hash, visit setup.php in a browser and type a password into the field, // on submission it will be echoed out to you as a hashed value. -$CONF['setup_password'] = 'hello'; +$CONF['setup_password'] = 'changeme'; // Postfix Admin Path // Set the location of your Postfix Admin installation here. @@ -52,10 +52,10 @@ // mysql = MySQL 3.23 and 4.0, 4.1 or 5 // mysqli = MySQL 4.1+ // pgsql = PostgreSQL -$CONF['database_type'] = 'pgsql'; -$CONF['database_host'] = 'mysqlserver'; -$CONF['database_user'] = 'dg'; -$CONF['database_password'] = 'gingerdog'; +$CONF['database_type'] = 'mysql'; +$CONF['database_host'] = 'localhost'; +$CONF['database_user'] = 'postfix'; +$CONF['database_password'] = 'postfixadmin'; $CONF['database_name'] = 'postfix'; $CONF['database_prefix'] = ''; @@ -156,7 +156,7 @@ // Quota // When you want to enforce quota for your mailbox users set this to 'YES'. -$CONF['quota'] = 'YES'; +$CONF['quota'] = 'NO'; // You can either use '1024000' or '1048576' $CONF['quota_multiplier'] = '1024000'; @@ -197,7 +197,7 @@ // The reason for this is that when you want catch-all and normal mailboxes // to work you need to have the mailbox replicated in the alias table. // If you want to take control of these aliases as well set this to 'YES'. -$CONF['alias_control'] = 'YES'; +$CONF['alias_control'] = 'NO'; // Alias Control for admins // Set to 'NO' if your domain admins shouldn't be able to edit user aliases. @@ -362,7 +362,7 @@ // See: DOCUMENTATION/DOVECOT.txt // http://wiki.dovecot.org/Quota/Dict // -$CONF['used_quotas'] = 'YES'; +// $CONF['used_quotas'] = 'YES'; // // Normally, the TCP port number does not have to be specified. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-05-21 13:03:56
|
Revision: 663 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=663&view=rev Author: christian_boltz Date: 2009-05-21 13:03:46 +0000 (Thu, 21 May 2009) Log Message: ----------- config.inc.php: - revert (accidential?) changes from r661 (GingerDog, you might want to move your local settings to confic.local.php ;-) Modified Paths: -------------- trunk/config.inc.php Modified: trunk/config.inc.php =================================================================== --- trunk/config.inc.php 2009-05-20 20:26:25 UTC (rev 662) +++ trunk/config.inc.php 2009-05-21 13:03:46 UTC (rev 663) @@ -29,12 +29,12 @@ * Doing this implies you have changed this file as required. * i.e. configuring database etc; specifying setup.php password etc. */ -$CONF['configured'] = true; +$CONF['configured'] = false; // In order to setup Postfixadmin, you MUST specify a hashed password here. // To create the hash, visit setup.php in a browser and type a password into the field, // on submission it will be echoed out to you as a hashed value. -$CONF['setup_password'] = 'hello'; +$CONF['setup_password'] = 'changeme'; // Postfix Admin Path // Set the location of your Postfix Admin installation here. @@ -52,10 +52,10 @@ // mysql = MySQL 3.23 and 4.0, 4.1 or 5 // mysqli = MySQL 4.1+ // pgsql = PostgreSQL -$CONF['database_type'] = 'pgsql'; -$CONF['database_host'] = 'mysqlserver'; -$CONF['database_user'] = 'dg'; -$CONF['database_password'] = 'gingerdog'; +$CONF['database_type'] = 'mysql'; +$CONF['database_host'] = 'localhost'; +$CONF['database_user'] = 'postfix'; +$CONF['database_password'] = 'postfixadmin'; $CONF['database_name'] = 'postfix'; $CONF['database_prefix'] = ''; @@ -156,7 +156,7 @@ // Quota // When you want to enforce quota for your mailbox users set this to 'YES'. -$CONF['quota'] = 'YES'; +$CONF['quota'] = 'NO'; // You can either use '1024000' or '1048576' $CONF['quota_multiplier'] = '1024000'; @@ -197,7 +197,7 @@ // The reason for this is that when you want catch-all and normal mailboxes // to work you need to have the mailbox replicated in the alias table. // If you want to take control of these aliases as well set this to 'YES'. -$CONF['alias_control'] = 'YES'; +$CONF['alias_control'] = 'NO'; // Alias Control for admins // Set to 'NO' if your domain admins shouldn't be able to edit user aliases. @@ -362,7 +362,7 @@ // See: DOCUMENTATION/DOVECOT.txt // http://wiki.dovecot.org/Quota/Dict // -$CONF['used_quotas'] = 'YES'; +// $CONF['used_quotas'] = 'YES'; // // Normally, the TCP port number does not have to be specified. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2009-05-20 20:26:34
|
Revision: 662 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=662&view=rev Author: GingerDog Date: 2009-05-20 20:26:25 +0000 (Wed, 20 May 2009) Log Message: ----------- branch for 2.3rc5 Added Paths: ----------- branches/postfixadmin-2.3rc5/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2009-05-20 20:24:35
|
Revision: 661 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=661&view=rev Author: GingerDog Date: 2009-05-20 20:24:23 +0000 (Wed, 20 May 2009) Log Message: ----------- lets try and get rc5 up and around Modified Paths: -------------- trunk/CHANGELOG.TXT trunk/config.inc.php trunk/functions.inc.php trunk/list-virtual.php Modified: trunk/CHANGELOG.TXT =================================================================== --- trunk/CHANGELOG.TXT 2009-05-18 12:57:05 UTC (rev 660) +++ trunk/CHANGELOG.TXT 2009-05-20 20:24:23 UTC (rev 661) @@ -11,6 +11,14 @@ # $Id$ +Version 2.3rc5 - 2009/05/20 - SVN r658 +-------------------------------------- + + - Improvements to the setup process + - Far better Debian packaging (we hope!) which should make installation much, much easier. + - Various bug fixes + - Performance enhancements (or we fixed the regressions ...) in domain listing etc. + Version 2.3rc4 - 2009/04/18 - SVN r632 -------------------------------------- Modified: trunk/config.inc.php =================================================================== --- trunk/config.inc.php 2009-05-18 12:57:05 UTC (rev 660) +++ trunk/config.inc.php 2009-05-20 20:24:23 UTC (rev 661) @@ -29,12 +29,12 @@ * Doing this implies you have changed this file as required. * i.e. configuring database etc; specifying setup.php password etc. */ -$CONF['configured'] = false; +$CONF['configured'] = true; // In order to setup Postfixadmin, you MUST specify a hashed password here. // To create the hash, visit setup.php in a browser and type a password into the field, // on submission it will be echoed out to you as a hashed value. -$CONF['setup_password'] = 'changeme'; +$CONF['setup_password'] = 'hello'; // Postfix Admin Path // Set the location of your Postfix Admin installation here. @@ -52,10 +52,10 @@ // mysql = MySQL 3.23 and 4.0, 4.1 or 5 // mysqli = MySQL 4.1+ // pgsql = PostgreSQL -$CONF['database_type'] = 'mysql'; -$CONF['database_host'] = 'localhost'; -$CONF['database_user'] = 'postfix'; -$CONF['database_password'] = 'postfixadmin'; +$CONF['database_type'] = 'pgsql'; +$CONF['database_host'] = 'mysqlserver'; +$CONF['database_user'] = 'dg'; +$CONF['database_password'] = 'gingerdog'; $CONF['database_name'] = 'postfix'; $CONF['database_prefix'] = ''; @@ -156,7 +156,7 @@ // Quota // When you want to enforce quota for your mailbox users set this to 'YES'. -$CONF['quota'] = 'NO'; +$CONF['quota'] = 'YES'; // You can either use '1024000' or '1048576' $CONF['quota_multiplier'] = '1024000'; @@ -197,7 +197,7 @@ // The reason for this is that when you want catch-all and normal mailboxes // to work you need to have the mailbox replicated in the alias table. // If you want to take control of these aliases as well set this to 'YES'. -$CONF['alias_control'] = 'NO'; +$CONF['alias_control'] = 'YES'; // Alias Control for admins // Set to 'NO' if your domain admins shouldn't be able to edit user aliases. @@ -362,7 +362,7 @@ // See: DOCUMENTATION/DOVECOT.txt // http://wiki.dovecot.org/Quota/Dict // -// $CONF['used_quotas'] = 'YES'; +$CONF['used_quotas'] = 'YES'; // // Normally, the TCP port number does not have to be specified. Modified: trunk/functions.inc.php =================================================================== --- trunk/functions.inc.php 2009-05-18 12:57:05 UTC (rev 660) +++ trunk/functions.inc.php 2009-05-20 20:24:23 UTC (rev 661) @@ -22,7 +22,7 @@ exit; } -$version = '2.3 rc4'; +$version = '2.3 rc5'; /** * check_session Modified: trunk/list-virtual.php =================================================================== --- trunk/list-virtual.php 2009-05-18 12:57:05 UTC (rev 660) +++ trunk/list-virtual.php 2009-05-20 20:24:23 UTC (rev 661) @@ -154,9 +154,16 @@ if ($CONF['vacation_control_admin'] == 'YES') { if (boolconf('used_quotas')) - $query = "SELECT $table_mailbox.*, $table_vacation.active AS v_active, $table_quota.current FROM $table_mailbox LEFT JOIN $table_vacation ON $table_mailbox.username=$table_vacation.email LEFT JOIN $table_quota ON $table_mailbox.username=$table_quota.username WHERE $table_mailbox.domain='$fDomain' AND $table_quota.path='quota/storage' ORDER BY $table_mailbox.username LIMIT $page_size OFFSET $fDisplay"; + $query = "SELECT $table_mailbox.*, $table_vacation.active AS v_active, $table_quota.current FROM $table_mailbox + LEFT JOIN $table_vacation ON $table_mailbox.username=$table_vacation.email + LEFT JOIN $table_quota ON $table_mailbox.username=$table_quota.username + WHERE $table_mailbox.domain='$fDomain' + ORDER BY $table_mailbox.username LIMIT $page_size OFFSET $fDisplay"; +// AND $table_quota.path='quota/storage' else - $query = "SELECT $table_mailbox.*, $table_vacation.active AS v_active FROM $table_mailbox LEFT JOIN $table_vacation ON $table_mailbox.username=$table_vacation.email WHERE $table_mailbox.domain='$fDomain' ORDER BY $table_mailbox.username LIMIT $page_size OFFSET $fDisplay"; + $query = "SELECT $table_mailbox.*, $table_vacation.active AS v_active FROM $table_mailbox + LEFT JOIN $table_vacation ON $table_mailbox.username=$table_vacation.email + WHERE $table_mailbox.domain='$fDomain' ORDER BY $table_mailbox.username LIMIT $page_size OFFSET $fDisplay"; } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Seb...@us...> - 2009-05-18 12:57:14
|
Revision: 660 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=660&view=rev Author: Sebastian2009 Date: 2009-05-18 12:57:05 +0000 (Mon, 18 May 2009) Log Message: ----------- Update Smarty version (2.6.22 -> 2.6.24) Added Paths: ----------- branches/postfixadmin-smarty/smarty/libs/ branches/postfixadmin-smarty/smarty/libs/Config_File.class.php branches/postfixadmin-smarty/smarty/libs/Smarty.class.php branches/postfixadmin-smarty/smarty/libs/Smarty_Compiler.class.php branches/postfixadmin-smarty/smarty/libs/debug.tpl branches/postfixadmin-smarty/smarty/libs/internals/ branches/postfixadmin-smarty/smarty/libs/internals/core.assemble_plugin_filepath.php branches/postfixadmin-smarty/smarty/libs/internals/core.assign_smarty_interface.php branches/postfixadmin-smarty/smarty/libs/internals/core.create_dir_structure.php branches/postfixadmin-smarty/smarty/libs/internals/core.display_debug_console.php branches/postfixadmin-smarty/smarty/libs/internals/core.get_include_path.php branches/postfixadmin-smarty/smarty/libs/internals/core.get_microtime.php branches/postfixadmin-smarty/smarty/libs/internals/core.get_php_resource.php branches/postfixadmin-smarty/smarty/libs/internals/core.is_secure.php branches/postfixadmin-smarty/smarty/libs/internals/core.is_trusted.php branches/postfixadmin-smarty/smarty/libs/internals/core.load_plugins.php branches/postfixadmin-smarty/smarty/libs/internals/core.load_resource_plugin.php branches/postfixadmin-smarty/smarty/libs/internals/core.process_cached_inserts.php branches/postfixadmin-smarty/smarty/libs/internals/core.process_compiled_include.php branches/postfixadmin-smarty/smarty/libs/internals/core.read_cache_file.php branches/postfixadmin-smarty/smarty/libs/internals/core.rm_auto.php branches/postfixadmin-smarty/smarty/libs/internals/core.rmdir.php branches/postfixadmin-smarty/smarty/libs/internals/core.run_insert_handler.php branches/postfixadmin-smarty/smarty/libs/internals/core.smarty_include_php.php branches/postfixadmin-smarty/smarty/libs/internals/core.write_cache_file.php branches/postfixadmin-smarty/smarty/libs/internals/core.write_compiled_include.php branches/postfixadmin-smarty/smarty/libs/internals/core.write_compiled_resource.php branches/postfixadmin-smarty/smarty/libs/internals/core.write_file.php branches/postfixadmin-smarty/smarty/libs/plugins/ branches/postfixadmin-smarty/smarty/libs/plugins/block.textformat.php branches/postfixadmin-smarty/smarty/libs/plugins/compiler.assign.php branches/postfixadmin-smarty/smarty/libs/plugins/function.assign_debug_info.php branches/postfixadmin-smarty/smarty/libs/plugins/function.config_load.php branches/postfixadmin-smarty/smarty/libs/plugins/function.counter.php branches/postfixadmin-smarty/smarty/libs/plugins/function.cycle.php branches/postfixadmin-smarty/smarty/libs/plugins/function.debug.php branches/postfixadmin-smarty/smarty/libs/plugins/function.eval.php branches/postfixadmin-smarty/smarty/libs/plugins/function.fetch.php branches/postfixadmin-smarty/smarty/libs/plugins/function.html_checkboxes.php branches/postfixadmin-smarty/smarty/libs/plugins/function.html_image.php branches/postfixadmin-smarty/smarty/libs/plugins/function.html_options.php branches/postfixadmin-smarty/smarty/libs/plugins/function.html_radios.php branches/postfixadmin-smarty/smarty/libs/plugins/function.html_select_date.php branches/postfixadmin-smarty/smarty/libs/plugins/function.html_select_time.php branches/postfixadmin-smarty/smarty/libs/plugins/function.html_table.php branches/postfixadmin-smarty/smarty/libs/plugins/function.mailto.php branches/postfixadmin-smarty/smarty/libs/plugins/function.math.php branches/postfixadmin-smarty/smarty/libs/plugins/function.popup.php branches/postfixadmin-smarty/smarty/libs/plugins/function.popup_init.php branches/postfixadmin-smarty/smarty/libs/plugins/modifier.capitalize.php branches/postfixadmin-smarty/smarty/libs/plugins/modifier.cat.php branches/postfixadmin-smarty/smarty/libs/plugins/modifier.count_characters.php branches/postfixadmin-smarty/smarty/libs/plugins/modifier.count_paragraphs.php branches/postfixadmin-smarty/smarty/libs/plugins/modifier.count_sentences.php branches/postfixadmin-smarty/smarty/libs/plugins/modifier.count_words.php branches/postfixadmin-smarty/smarty/libs/plugins/modifier.date_format.php branches/postfixadmin-smarty/smarty/libs/plugins/modifier.debug_print_var.php branches/postfixadmin-smarty/smarty/libs/plugins/modifier.default.php branches/postfixadmin-smarty/smarty/libs/plugins/modifier.escape.php branches/postfixadmin-smarty/smarty/libs/plugins/modifier.indent.php branches/postfixadmin-smarty/smarty/libs/plugins/modifier.lower.php branches/postfixadmin-smarty/smarty/libs/plugins/modifier.needle.php branches/postfixadmin-smarty/smarty/libs/plugins/modifier.nl2br.php branches/postfixadmin-smarty/smarty/libs/plugins/modifier.regex_replace.php branches/postfixadmin-smarty/smarty/libs/plugins/modifier.replace.php branches/postfixadmin-smarty/smarty/libs/plugins/modifier.spacify.php branches/postfixadmin-smarty/smarty/libs/plugins/modifier.string_format.php branches/postfixadmin-smarty/smarty/libs/plugins/modifier.strip.php branches/postfixadmin-smarty/smarty/libs/plugins/modifier.strip_tags.php branches/postfixadmin-smarty/smarty/libs/plugins/modifier.truncate.php branches/postfixadmin-smarty/smarty/libs/plugins/modifier.upper.php branches/postfixadmin-smarty/smarty/libs/plugins/modifier.wordwrap.php branches/postfixadmin-smarty/smarty/libs/plugins/outputfilter.trimwhitespace.php branches/postfixadmin-smarty/smarty/libs/plugins/shared.escape_special_chars.php branches/postfixadmin-smarty/smarty/libs/plugins/shared.make_timestamp.php Added: branches/postfixadmin-smarty/smarty/libs/Config_File.class.php =================================================================== --- branches/postfixadmin-smarty/smarty/libs/Config_File.class.php (rev 0) +++ branches/postfixadmin-smarty/smarty/libs/Config_File.class.php 2009-05-18 12:57:05 UTC (rev 660) @@ -0,0 +1,393 @@ +<?php + +/** + * Config_File class. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * For questions, help, comments, discussion, etc., please join the + * Smarty mailing list. Send a blank e-mail to + * sma...@go... + * + * @link http://www.smarty.net/ + * @version 2.6.24 + * @copyright Copyright: 2001-2005 New Digital Group, Inc. + * @author Andrei Zmievski <an...@ph...> + * @access public + * @package Smarty + */ + +/* $Id: Config_File.class.php 3144 2009-05-14 13:18:50Z monte.ohrt $ */ + +/** + * Config file reading class + * @package Smarty + */ +class Config_File { + /**#@+ + * Options + * @var boolean + */ + /** + * Controls whether variables with the same name overwrite each other. + */ + var $overwrite = true; + + /** + * Controls whether config values of on/true/yes and off/false/no get + * converted to boolean values automatically. + */ + var $booleanize = true; + + /** + * Controls whether hidden config sections/vars are read from the file. + */ + var $read_hidden = true; + + /** + * Controls whether or not to fix mac or dos formatted newlines. + * If set to true, \r or \r\n will be changed to \n. + */ + var $fix_newlines = true; + /**#@-*/ + + /** @access private */ + var $_config_path = ""; + var $_config_data = array(); + /**#@-*/ + + /** + * Constructs a new config file class. + * + * @param string $config_path (optional) path to the config files + */ + function Config_File($config_path = NULL) + { + if (isset($config_path)) + $this->set_path($config_path); + } + + + /** + * Set the path where configuration files can be found. + * + * @param string $config_path path to the config files + */ + function set_path($config_path) + { + if (!empty($config_path)) { + if (!is_string($config_path) || !file_exists($config_path) || !is_dir($config_path)) { + $this->_trigger_error_msg("Bad config file path '$config_path'"); + return; + } + if(substr($config_path, -1) != DIRECTORY_SEPARATOR) { + $config_path .= DIRECTORY_SEPARATOR; + } + + $this->_config_path = $config_path; + } + } + + + /** + * Retrieves config info based on the file, section, and variable name. + * + * @param string $file_name config file to get info for + * @param string $section_name (optional) section to get info for + * @param string $var_name (optional) variable to get info for + * @return string|array a value or array of values + */ + function get($file_name, $section_name = NULL, $var_name = NULL) + { + if (empty($file_name)) { + $this->_trigger_error_msg('Empty config file name'); + return; + } else { + $file_name = $this->_config_path . $file_name; + if (!isset($this->_config_data[$file_name])) + $this->load_file($file_name, false); + } + + if (!empty($var_name)) { + if (empty($section_name)) { + return $this->_config_data[$file_name]["vars"][$var_name]; + } else { + if(isset($this->_config_data[$file_name]["sections"][$section_name]["vars"][$var_name])) + return $this->_config_data[$file_name]["sections"][$section_name]["vars"][$var_name]; + else + return array(); + } + } else { + if (empty($section_name)) { + return (array)$this->_config_data[$file_name]["vars"]; + } else { + if(isset($this->_config_data[$file_name]["sections"][$section_name]["vars"])) + return (array)$this->_config_data[$file_name]["sections"][$section_name]["vars"]; + else + return array(); + } + } + } + + + /** + * Retrieves config info based on the key. + * + * @param $file_name string config key (filename/section/var) + * @return string|array same as get() + * @uses get() retrieves information from config file and returns it + */ + function &get_key($config_key) + { + list($file_name, $section_name, $var_name) = explode('/', $config_key, 3); + $result = &$this->get($file_name, $section_name, $var_name); + return $result; + } + + /** + * Get all loaded config file names. + * + * @return array an array of loaded config file names + */ + function get_file_names() + { + return array_keys($this->_config_data); + } + + + /** + * Get all section names from a loaded file. + * + * @param string $file_name config file to get section names from + * @return array an array of section names from the specified file + */ + function get_section_names($file_name) + { + $file_name = $this->_config_path . $file_name; + if (!isset($this->_config_data[$file_name])) { + $this->_trigger_error_msg("Unknown config file '$file_name'"); + return; + } + + return array_keys($this->_config_data[$file_name]["sections"]); + } + + + /** + * Get all global or section variable names. + * + * @param string $file_name config file to get info for + * @param string $section_name (optional) section to get info for + * @return array an array of variables names from the specified file/section + */ + function get_var_names($file_name, $section = NULL) + { + if (empty($file_name)) { + $this->_trigger_error_msg('Empty config file name'); + return; + } else if (!isset($this->_config_data[$file_name])) { + $this->_trigger_error_msg("Unknown config file '$file_name'"); + return; + } + + if (empty($section)) + return array_keys($this->_config_data[$file_name]["vars"]); + else + return array_keys($this->_config_data[$file_name]["sections"][$section]["vars"]); + } + + + /** + * Clear loaded config data for a certain file or all files. + * + * @param string $file_name file to clear config data for + */ + function clear($file_name = NULL) + { + if ($file_name === NULL) + $this->_config_data = array(); + else if (isset($this->_config_data[$file_name])) + $this->_config_data[$file_name] = array(); + } + + + /** + * Load a configuration file manually. + * + * @param string $file_name file name to load + * @param boolean $prepend_path whether current config path should be + * prepended to the filename + */ + function load_file($file_name, $prepend_path = true) + { + if ($prepend_path && $this->_config_path != "") + $config_file = $this->_config_path . $file_name; + else + $config_file = $file_name; + + ini_set('track_errors', true); + $fp = @fopen($config_file, "r"); + if (!is_resource($fp)) { + $this->_trigger_error_msg("Could not open config file '$config_file'"); + return false; + } + + $contents = ($size = filesize($config_file)) ? fread($fp, $size) : ''; + fclose($fp); + + $this->_config_data[$config_file] = $this->parse_contents($contents); + return true; + } + + /** + * Store the contents of a file manually. + * + * @param string $config_file file name of the related contents + * @param string $contents the file-contents to parse + */ + function set_file_contents($config_file, $contents) + { + $this->_config_data[$config_file] = $this->parse_contents($contents); + return true; + } + + /** + * parse the source of a configuration file manually. + * + * @param string $contents the file-contents to parse + */ + function parse_contents($contents) + { + if($this->fix_newlines) { + // fix mac/dos formatted newlines + $contents = preg_replace('!\r\n?!', "\n", $contents); + } + + $config_data = array(); + $config_data['sections'] = array(); + $config_data['vars'] = array(); + + /* reference to fill with data */ + $vars =& $config_data['vars']; + + /* parse file line by line */ + preg_match_all('!^.*\r?\n?!m', $contents, $match); + $lines = $match[0]; + for ($i=0, $count=count($lines); $i<$count; $i++) { + $line = $lines[$i]; + if (empty($line)) continue; + + if ( substr($line, 0, 1) == '[' && preg_match('!^\[(.*?)\]!', $line, $match) ) { + /* section found */ + if (substr($match[1], 0, 1) == '.') { + /* hidden section */ + if ($this->read_hidden) { + $section_name = substr($match[1], 1); + } else { + /* break reference to $vars to ignore hidden section */ + unset($vars); + $vars = array(); + continue; + } + } else { + $section_name = $match[1]; + } + if (!isset($config_data['sections'][$section_name])) + $config_data['sections'][$section_name] = array('vars' => array()); + $vars =& $config_data['sections'][$section_name]['vars']; + continue; + } + + if (preg_match('/^\s*(\.?\w+)\s*=\s*(.*)/s', $line, $match)) { + /* variable found */ + $var_name = rtrim($match[1]); + if (strpos($match[2], '"""') === 0) { + /* handle multiline-value */ + $lines[$i] = substr($match[2], 3); + $var_value = ''; + while ($i<$count) { + if (($pos = strpos($lines[$i], '"""')) === false) { + $var_value .= $lines[$i++]; + } else { + /* end of multiline-value */ + $var_value .= substr($lines[$i], 0, $pos); + break; + } + } + $booleanize = false; + + } else { + /* handle simple value */ + $var_value = preg_replace('/^([\'"])(.*)\1$/', '\2', rtrim($match[2])); + $booleanize = $this->booleanize; + + } + $this->_set_config_var($vars, $var_name, $var_value, $booleanize); + } + /* else unparsable line / means it is a comment / means ignore it */ + } + return $config_data; + } + + /**#@+ @access private */ + /** + * @param array &$container + * @param string $var_name + * @param mixed $var_value + * @param boolean $booleanize determines whether $var_value is converted to + * to true/false + */ + function _set_config_var(&$container, $var_name, $var_value, $booleanize) + { + if (substr($var_name, 0, 1) == '.') { + if (!$this->read_hidden) + return; + else + $var_name = substr($var_name, 1); + } + + if (!preg_match("/^[a-zA-Z_]\w*$/", $var_name)) { + $this->_trigger_error_msg("Bad variable name '$var_name'"); + return; + } + + if ($booleanize) { + if (preg_match("/^(on|true|yes)$/i", $var_value)) + $var_value = true; + else if (preg_match("/^(off|false|no)$/i", $var_value)) + $var_value = false; + } + + if (!isset($container[$var_name]) || $this->overwrite) + $container[$var_name] = $var_value; + else { + settype($container[$var_name], 'array'); + $container[$var_name][] = $var_value; + } + } + + /** + * @uses trigger_error() creates a PHP warning/error + * @param string $error_msg + * @param integer $error_type one of + */ + function _trigger_error_msg($error_msg, $error_type = E_USER_WARNING) + { + trigger_error("Config_File error: $error_msg", $error_type); + } + /**#@-*/ +} + +?> Added: branches/postfixadmin-smarty/smarty/libs/Smarty.class.php =================================================================== --- branches/postfixadmin-smarty/smarty/libs/Smarty.class.php (rev 0) +++ branches/postfixadmin-smarty/smarty/libs/Smarty.class.php 2009-05-18 12:57:05 UTC (rev 660) @@ -0,0 +1,1978 @@ +<?php + +/** + * Project: Smarty: the PHP compiling template engine + * File: Smarty.class.php + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * For questions, help, comments, discussion, etc., please join the + * Smarty mailing list. Send a blank e-mail to + * sma...@go... + * + * @link http://www.smarty.net/ + * @copyright 2001-2005 New Digital Group, Inc. + * @author Monte Ohrt <monte at ohrt dot com> + * @author Andrei Zmievski <an...@ph...> + * @package Smarty + * @version 2.6.24 + */ + +/* $Id: Smarty.class.php 3146 2009-05-16 23:27:22Z monte.ohrt $ */ + +/** + * DIR_SEP isn't used anymore, but third party apps might + */ +if(!defined('DIR_SEP')) { + define('DIR_SEP', DIRECTORY_SEPARATOR); +} + +/** + * set SMARTY_DIR to absolute path to Smarty library files. + * if not defined, include_path will be used. Sets SMARTY_DIR only if user + * application has not already defined it. + */ + +if (!defined('SMARTY_DIR')) { + define('SMARTY_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR); +} + +if (!defined('SMARTY_CORE_DIR')) { + define('SMARTY_CORE_DIR', SMARTY_DIR . 'internals' . DIRECTORY_SEPARATOR); +} + +define('SMARTY_PHP_PASSTHRU', 0); +define('SMARTY_PHP_QUOTE', 1); +define('SMARTY_PHP_REMOVE', 2); +define('SMARTY_PHP_ALLOW', 3); + +/** + * @package Smarty + */ +class Smarty +{ + /**#@+ + * Smarty Configuration Section + */ + + /** + * The name of the directory where templates are located. + * + * @var string + */ + var $template_dir = 'templates'; + + /** + * The directory where compiled templates are located. + * + * @var string + */ + var $compile_dir = 'templates_c'; + + /** + * The directory where config files are located. + * + * @var string + */ + var $config_dir = 'configs'; + + /** + * An array of directories searched for plugins. + * + * @var array + */ + var $plugins_dir = array('plugins'); + + /** + * If debugging is enabled, a debug console window will display + * when the page loads (make sure your browser allows unrequested + * popup windows) + * + * @var boolean + */ + var $debugging = false; + + /** + * When set, smarty does uses this value as error_reporting-level. + * + * @var boolean + */ + var $error_reporting = null; + + /** + * This is the path to the debug console template. If not set, + * the default one will be used. + * + * @var string + */ + var $debug_tpl = ''; + + /** + * This determines if debugging is enable-able from the browser. + * <ul> + * <li>NONE => no debugging control allowed</li> + * <li>URL => enable debugging when SMARTY_DEBUG is found in the URL.</li> + * </ul> + * @link http://www.foo.dom/index.php?SMARTY_DEBUG + * @var string + */ + var $debugging_ctrl = 'NONE'; + + /** + * This tells Smarty whether to check for recompiling or not. Recompiling + * does not need to happen unless a template or config file is changed. + * Typically you enable this during development, and disable for + * production. + * + * @var boolean + */ + var $compile_check = true; + + /** + * This forces templates to compile every time. Useful for development + * or debugging. + * + * @var boolean + */ + var $force_compile = false; + + /** + * This enables template caching. + * <ul> + * <li>0 = no caching</li> + * <li>1 = use class cache_lifetime value</li> + * <li>2 = use cache_lifetime in cache file</li> + * </ul> + * @var integer + */ + var $caching = 0; + + /** + * The name of the directory for cache files. + * + * @var string + */ + var $cache_dir = 'cache'; + + /** + * This is the number of seconds cached content will persist. + * <ul> + * <li>0 = always regenerate cache</li> + * <li>-1 = never expires</li> + * </ul> + * + * @var integer + */ + var $cache_lifetime = 3600; + + /** + * Only used when $caching is enabled. If true, then If-Modified-Since headers + * are respected with cached content, and appropriate HTTP headers are sent. + * This way repeated hits to a cached page do not send the entire page to the + * client every time. + * + * @var boolean + */ + var $cache_modified_check = false; + + /** + * This determines how Smarty handles "<?php ... ?>" tags in templates. + * possible values: + * <ul> + * <li>SMARTY_PHP_PASSTHRU -> print tags as plain text</li> + * <li>SMARTY_PHP_QUOTE -> escape tags as entities</li> + * <li>SMARTY_PHP_REMOVE -> remove php tags</li> + * <li>SMARTY_PHP_ALLOW -> execute php tags</li> + * </ul> + * + * @var integer + */ + var $php_handling = SMARTY_PHP_PASSTHRU; + + /** + * This enables template security. When enabled, many things are restricted + * in the templates that normally would go unchecked. This is useful when + * untrusted parties are editing templates and you want a reasonable level + * of security. (no direct execution of PHP in templates for example) + * + * @var boolean + */ + var $security = false; + + /** + * This is the list of template directories that are considered secure. This + * is used only if {@link $security} is enabled. One directory per array + * element. {@link $template_dir} is in this list implicitly. + * + * @var array + */ + var $secure_dir = array(); + + /** + * These are the security settings for Smarty. They are used only when + * {@link $security} is enabled. + * + * @var array + */ + var $security_settings = array( + 'PHP_HANDLING' => false, + 'IF_FUNCS' => array('array', 'list', + 'isset', 'empty', + 'count', 'sizeof', + 'in_array', 'is_array', + 'true', 'false', 'null'), + 'INCLUDE_ANY' => false, + 'PHP_TAGS' => false, + 'MODIFIER_FUNCS' => array('count'), + 'ALLOW_CONSTANTS' => false, + 'ALLOW_SUPER_GLOBALS' => true + ); + + /** + * This is an array of directories where trusted php scripts reside. + * {@link $security} is disabled during their inclusion/execution. + * + * @var array + */ + var $trusted_dir = array(); + + /** + * The left delimiter used for the template tags. + * + * @var string + */ + var $left_delimiter = '{'; + + /** + * The right delimiter used for the template tags. + * + * @var string + */ + var $right_delimiter = '}'; + + /** + * The order in which request variables are registered, similar to + * variables_order in php.ini E = Environment, G = GET, P = POST, + * C = Cookies, S = Server + * + * @var string + */ + var $request_vars_order = 'EGPCS'; + + /** + * Indicates wether $HTTP_*_VARS[] (request_use_auto_globals=false) + * are uses as request-vars or $_*[]-vars. note: if + * request_use_auto_globals is true, then $request_vars_order has + * no effect, but the php-ini-value "gpc_order" + * + * @var boolean + */ + var $request_use_auto_globals = true; + + /** + * Set this if you want different sets of compiled files for the same + * templates. This is useful for things like different languages. + * Instead of creating separate sets of templates per language, you + * set different compile_ids like 'en' and 'de'. + * + * @var string + */ + var $compile_id = null; + + /** + * This tells Smarty whether or not to use sub dirs in the cache/ and + * templates_c/ directories. sub directories better organized, but + * may not work well with PHP safe mode enabled. + * + * @var boolean + * + */ + var $use_sub_dirs = false; + + /** + * This is a list of the modifiers to apply to all template variables. + * Put each modifier in a separate array element in the order you want + * them applied. example: <code>array('escape:"htmlall"');</code> + * + * @var array + */ + var $default_modifiers = array(); + + /** + * This is the resource type to be used when not specified + * at the beginning of the resource path. examples: + * $smarty->display('file:index.tpl'); + * $smarty->display('db:index.tpl'); + * $smarty->display('index.tpl'); // will use default resource type + * {include file="file:index.tpl"} + * {include file="db:index.tpl"} + * {include file="index.tpl"} {* will use default resource type *} + * + * @var array + */ + var $default_resource_type = 'file'; + + /** + * The function used for cache file handling. If not set, built-in caching is used. + * + * @var null|string function name + */ + var $cache_handler_func = null; + + /** + * This indicates which filters are automatically loaded into Smarty. + * + * @var array array of filter names + */ + var $autoload_filters = array(); + + /**#@+ + * @var boolean + */ + /** + * This tells if config file vars of the same name overwrite each other or not. + * if disabled, same name variables are accumulated in an array. + */ + var $config_overwrite = true; + + /** + * This tells whether or not to automatically booleanize config file variables. + * If enabled, then the strings "on", "true", and "yes" are treated as boolean + * true, and "off", "false" and "no" are treated as boolean false. + */ + var $config_booleanize = true; + + /** + * This tells whether hidden sections [.foobar] are readable from the + * tempalates or not. Normally you would never allow this since that is + * the point behind hidden sections: the application can access them, but + * the templates cannot. + */ + var $config_read_hidden = false; + + /** + * This tells whether or not automatically fix newlines in config files. + * It basically converts \r (mac) or \r\n (dos) to \n + */ + var $config_fix_newlines = true; + /**#@-*/ + + /** + * If a template cannot be found, this PHP function will be executed. + * Useful for creating templates on-the-fly or other special action. + * + * @var string function name + */ + var $default_template_handler_func = ''; + + /** + * The file that contains the compiler class. This can a full + * pathname, or relative to the php_include path. + * + * @var string + */ + var $compiler_file = 'Smarty_Compiler.class.php'; + + /** + * The class used for compiling templates. + * + * @var string + */ + var $compiler_class = 'Smarty_Compiler'; + + /** + * The class used to load config vars. + * + * @var string + */ + var $config_class = 'Config_File'; + +/**#@+ + * END Smarty Configuration Section + * There should be no need to touch anything below this line. + * @access private + */ + /** + * where assigned template vars are kept + * + * @var array + */ + var $_tpl_vars = array(); + + /** + * stores run-time $smarty.* vars + * + * @var null|array + */ + var $_smarty_vars = null; + + /** + * keeps track of sections + * + * @var array + */ + var $_sections = array(); + + /** + * keeps track of foreach blocks + * + * @var array + */ + var $_foreach = array(); + + /** + * keeps track of tag hierarchy + * + * @var array + */ + var $_tag_stack = array(); + + /** + * configuration object + * + * @var Config_file + */ + var $_conf_obj = null; + + /** + * loaded configuration settings + * + * @var array + */ + var $_config = array(array('vars' => array(), 'files' => array())); + + /** + * md5 checksum of the string 'Smarty' + * + * @var string + */ + var $_smarty_md5 = 'f8d698aea36fcbead2b9d5359ffca76f'; + + /** + * Smarty version number + * + * @var string + */ + var $_version = '2.6.24'; + + /** + * current template inclusion depth + * + * @var integer + */ + var $_inclusion_depth = 0; + + /** + * for different compiled templates + * + * @var string + */ + var $_compile_id = null; + + /** + * text in URL to enable debug mode + * + * @var string + */ + var $_smarty_debug_id = 'SMARTY_DEBUG'; + + /** + * debugging information for debug console + * + * @var array + */ + var $_smarty_debug_info = array(); + + /** + * info that makes up a cache file + * + * @var array + */ + var $_cache_info = array(); + + /** + * default file permissions + * + * @var integer + */ + var $_file_perms = 0644; + + /** + * default dir permissions + * + * @var integer + */ + var $_dir_perms = 0771; + + /** + * registered objects + * + * @var array + */ + var $_reg_objects = array(); + + /** + * table keeping track of plugins + * + * @var array + */ + var $_plugins = array( + 'modifier' => array(), + 'function' => array(), + 'block' => array(), + 'compiler' => array(), + 'prefilter' => array(), + 'postfilter' => array(), + 'outputfilter' => array(), + 'resource' => array(), + 'insert' => array()); + + + /** + * cache serials + * + * @var array + */ + var $_cache_serials = array(); + + /** + * name of optional cache include file + * + * @var string + */ + var $_cache_include = null; + + /** + * indicate if the current code is used in a compiled + * include + * + * @var string + */ + var $_cache_including = false; + + /** + * array of super globals internally + * + * @var array + */ + var $_supers = array(); + + + /**#@-*/ + /** + * The class constructor. + */ + function Smarty() + { + $this->assign('SCRIPT_NAME', isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] + : @$GLOBALS['HTTP_SERVER_VARS']['SCRIPT_NAME']); + + $this->_supers['get'] = $this->request_use_auto_globals ? $_GET : $GLOBALS['HTTP_GET_VARS']; + $this->_supers['post'] = $this->request_use_auto_globals ? $_POST : $GLOBALS['HTTP_POST_VARS']; + $this->_supers['server'] = $this->request_use_auto_globals ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS']; + $this->_supers['session'] = $this->request_use_auto_globals ? $_SESSION : $GLOBALS['HTTP_SESSION_VARS']; + $this->_supers['request'] = $this->request_use_auto_globals ? $_REQUEST : $GLOBALS['HTTP_REQUEST_VARS']; + $this->_supers['cookies'] = $this->request_use_auto_globals ? $_COOKIE : $GLOBALS['HTTP_COOKIE_VARS']; + $this->_supers['env'] = $this->request_use_auto_globals ? $_ENV : $GLOBALS['HTTP_ENV_VARS']; + + } + + /** + * assigns values to template variables + * + * @param array|string $tpl_var the template variable name(s) + * @param mixed $value the value to assign + */ + function assign($tpl_var, $value = null) + { + if (is_array($tpl_var)){ + foreach ($tpl_var as $key => $val) { + if ($key != '') { + $this->_tpl_vars[$key] = $val; + } + } + } else { + if ($tpl_var != '') + $this->_tpl_vars[$tpl_var] = $value; + } + } + + /** + * assigns values to template variables by reference + * + * @param string $tpl_var the template variable name + * @param mixed $value the referenced value to assign + */ + function assign_by_ref($tpl_var, &$value) + { + if ($tpl_var != '') + $this->_tpl_vars[$tpl_var] = &$value; + } + + /** + * appends values to template variables + * + * @param array|string $tpl_var the template variable name(s) + * @param mixed $value the value to append + */ + function append($tpl_var, $value=null, $merge=false) + { + if (is_array($tpl_var)) { + // $tpl_var is an array, ignore $value + foreach ($tpl_var as $_key => $_val) { + if ($_key != '') { + if(!@is_array($this->_tpl_vars[$_key])) { + settype($this->_tpl_vars[$_key],'array'); + } + if($merge && is_array($_val)) { + foreach($_val as $_mkey => $_mval) { + $this->_tpl_vars[$_key][$_mkey] = $_mval; + } + } else { + $this->_tpl_vars[$_key][] = $_val; + } + } + } + } else { + if ($tpl_var != '' && isset($value)) { + if(!@is_array($this->_tpl_vars[$tpl_var])) { + settype($this->_tpl_vars[$tpl_var],'array'); + } + if($merge && is_array($value)) { + foreach($value as $_mkey => $_mval) { + $this->_tpl_vars[$tpl_var][$_mkey] = $_mval; + } + } else { + $this->_tpl_vars[$tpl_var][] = $value; + } + } + } + } + + /** + * appends values to template variables by reference + * + * @param string $tpl_var the template variable name + * @param mixed $value the referenced value to append + */ + function append_by_ref($tpl_var, &$value, $merge=false) + { + if ($tpl_var != '' && isset($value)) { + if(!@is_array($this->_tpl_vars[$tpl_var])) { + settype($this->_tpl_vars[$tpl_var],'array'); + } + if ($merge && is_array($value)) { + foreach($value as $_key => $_val) { + $this->_tpl_vars[$tpl_var][$_key] = &$value[$_key]; + } + } else { + $this->_tpl_vars[$tpl_var][] = &$value; + } + } + } + + + /** + * clear the given assigned template variable. + * + * @param string $tpl_var the template variable to clear + */ + function clear_assign($tpl_var) + { + if (is_array($tpl_var)) + foreach ($tpl_var as $curr_var) + unset($this->_tpl_vars[$curr_var]); + else + unset($this->_tpl_vars[$tpl_var]); + } + + + /** + * Registers custom function to be used in templates + * + * @param string $function the name of the template function + * @param string $function_impl the name of the PHP function to register + */ + function register_function($function, $function_impl, $cacheable=true, $cache_attrs=null) + { + $this->_plugins['function'][$function] = + array($function_impl, null, null, false, $cacheable, $cache_attrs); + + } + + /** + * Unregisters custom function + * + * @param string $function name of template function + */ + function unregister_function($function) + { + unset($this->_plugins['function'][$function]); + } + + /** + * Registers object to be used in templates + * + * @param string $object name of template object + * @param object &$object_impl the referenced PHP object to register + * @param null|array $allowed list of allowed methods (empty = all) + * @param boolean $smarty_args smarty argument format, else traditional + * @param null|array $block_functs list of methods that are block format + */ + function register_object($object, &$object_impl, $allowed = array(), $smarty_args = true, $block_methods = array()) + { + settype($allowed, 'array'); + settype($smarty_args, 'boolean'); + $this->_reg_objects[$object] = + array(&$object_impl, $allowed, $smarty_args, $block_methods); + } + + /** + * Unregisters object + * + * @param string $object name of template object + */ + function unregister_object($object) + { + unset($this->_reg_objects[$object]); + } + + + /** + * Registers block function to be used in templates + * + * @param string $block name of template block + * @param string $block_impl PHP function to register + */ + function register_block($block, $block_impl, $cacheable=true, $cache_attrs=null) + { + $this->_plugins['block'][$block] = + array($block_impl, null, null, false, $cacheable, $cache_attrs); + } + + /** + * Unregisters block function + * + * @param string $block name of template function + */ + function unregister_block($block) + { + unset($this->_plugins['block'][$block]); + } + + /** + * Registers compiler function + * + * @param string $function name of template function + * @param string $function_impl name of PHP function to register + */ + function register_compiler_function($function, $function_impl, $cacheable=true) + { + $this->_plugins['compiler'][$function] = + array($function_impl, null, null, false, $cacheable); + } + + /** + * Unregisters compiler function + * + * @param string $function name of template function + */ + function unregister_compiler_function($function) + { + unset($this->_plugins['compiler'][$function]); + } + + /** + * Registers modifier to be used in templates + * + * @param string $modifier name of template modifier + * @param string $modifier_impl name of PHP function to register + */ + function register_modifier($modifier, $modifier_impl) + { + $this->_plugins['modifier'][$modifier] = + array($modifier_impl, null, null, false); + } + + /** + * Unregisters modifier + * + * @param string $modifier name of template modifier + */ + function unregister_modifier($modifier) + { + unset($this->_plugins['modifier'][$modifier]); + } + + /** + * Registers a resource to fetch a template + * + * @param string $type name of resource + * @param array $functions array of functions to handle resource + */ + function register_resource($type, $functions) + { + if (count($functions)==4) { + $this->_plugins['resource'][$type] = + array($functions, false); + + } elseif (count($functions)==5) { + $this->_plugins['resource'][$type] = + array(array(array(&$functions[0], $functions[1]) + ,array(&$functions[0], $functions[2]) + ,array(&$functions[0], $functions[3]) + ,array(&$functions[0], $functions[4])) + ,false); + + } else { + $this->trigger_error("malformed function-list for '$type' in register_resource"); + + } + } + + /** + * Unregisters a resource + * + * @param string $type name of resource + */ + function unregister_resource($type) + { + unset($this->_plugins['resource'][$type]); + } + + /** + * Registers a prefilter function to apply + * to a template before compiling + * + * @param callback $function + */ + function register_prefilter($function) + { + $this->_plugins['prefilter'][$this->_get_filter_name($function)] + = array($function, null, null, false); + } + + /** + * Unregisters a prefilter function + * + * @param callback $function + */ + function unregister_prefilter($function) + { + unset($this->_plugins['prefilter'][$this->_get_filter_name($function)]); + } + + /** + * Registers a postfilter function to apply + * to a compiled template after compilation + * + * @param callback $function + */ + function register_postfilter($function) + { + $this->_plugins['postfilter'][$this->_get_filter_name($function)] + = array($function, null, null, false); + } + + /** + * Unregisters a postfilter function + * + * @param callback $function + */ + function unregister_postfilter($function) + { + unset($this->_plugins['postfilter'][$this->_get_filter_name($function)]); + } + + /** + * Registers an output filter function to apply + * to a template output + * + * @param callback $function + */ + function register_outputfilter($function) + { + $this->_plugins['outputfilter'][$this->_get_filter_name($function)] + = array($function, null, null, false); + } + + /** + * Unregisters an outputfilter function + * + * @param callback $function + */ + function unregister_outputfilter($function) + { + unset($this->_plugins['outputfilter'][$this->_get_filter_name($function)]); + } + + /** + * load a filter of specified type and name + * + * @param string $type filter type + * @param string $name filter name + */ + function load_filter($type, $name) + { + switch ($type) { + case 'output': + $_params = array('plugins' => array(array($type . 'filter', $name, null, null, false))); + require_once(SMARTY_CORE_DIR . 'core.load_plugins.php'); + smarty_core_load_plugins($_params, $this); + break; + + case 'pre': + case 'post': + if (!isset($this->_plugins[$type . 'filter'][$name])) + $this->_plugins[$type . 'filter'][$name] = false; + break; + } + } + + /** + * clear cached content for the given template and cache id + * + * @param string $tpl_file name of template file + * @param string $cache_id name of cache_id + * @param string $compile_id name of compile_id + * @param string $exp_time expiration time + * @return boolean + */ + function clear_cache($tpl_file = null, $cache_id = null, $compile_id = null, $exp_time = null) + { + + if (!isset($compile_id)) + $compile_id = $this->compile_id; + + if (!isset($tpl_file)) + $compile_id = null; + + $_auto_id = $this->_get_auto_id($cache_id, $compile_id); + + if (!empty($this->cache_handler_func)) { + return call_user_func_array($this->cache_handler_func, + array('clear', &$this, &$dummy, $tpl_file, $cache_id, $compile_id, $exp_time)); + } else { + $_params = array('auto_base' => $this->cache_dir, + 'auto_source' => $tpl_file, + 'auto_id' => $_auto_id, + 'exp_time' => $exp_time); + require_once(SMARTY_CORE_DIR . 'core.rm_auto.php'); + return smarty_core_rm_auto($_params, $this); + } + + } + + + /** + * clear the entire contents of cache (all templates) + * + * @param string $exp_time expire time + * @return boolean results of {@link smarty_core_rm_auto()} + */ + function clear_all_cache($exp_time = null) + { + return $this->clear_cache(null, null, null, $exp_time); + } + + + /** + * test to see if valid cache exists for this template + * + * @param string $tpl_file name of template file + * @param string $cache_id + * @param string $compile_id + * @return string|false results of {@link _read_cache_file()} + */ + function is_cached($tpl_file, $cache_id = null, $compile_id = null) + { + if (!$this->caching) + return false; + + if (!isset($compile_id)) + $compile_id = $this->compile_id; + + $_params = array( + 'tpl_file' => $tpl_file, + 'cache_id' => $cache_id, + 'compile_id' => $compile_id + ); + require_once(SMARTY_CORE_DIR . 'core.read_cache_file.php'); + return smarty_core_read_cache_file($_params, $this); + } + + + /** + * clear all the assigned template variables. + * + */ + function clear_all_assign() + { + $this->_tpl_vars = array(); + } + + /** + * clears compiled version of specified template resource, + * or all compiled template files if one is not specified. + * This function is for advanced use only, not normally needed. + * + * @param string $tpl_file + * @param string $compile_id + * @param string $exp_time + * @return boolean results of {@link smarty_core_rm_auto()} + */ + function clear_compiled_tpl($tpl_file = null, $compile_id = null, $exp_time = null) + { + if (!isset($compile_id)) { + $compile_id = $this->compile_id; + } + $_params = array('auto_base' => $this->compile_dir, + 'auto_source' => $tpl_file, + 'auto_id' => $compile_id, + 'exp_time' => $exp_time, + 'extensions' => array('.inc', '.php')); + require_once(SMARTY_CORE_DIR . 'core.rm_auto.php'); + return smarty_core_rm_auto($_params, $this); + } + + /** + * Checks whether requested template exists. + * + * @param string $tpl_file + * @return boolean + */ + function template_exists($tpl_file) + { + $_params = array('resource_name' => $tpl_file, 'quiet'=>true, 'get_source'=>false); + return $this->_fetch_resource_info($_params); + } + + /** + * Returns an array containing template variables + * + * @param string $name + * @param string $type + * @return array + */ + function &get_template_vars($name=null) + { + if(!isset($name)) { + return $this->_tpl_vars; + } elseif(isset($this->_tpl_vars[$name])) { + return $this->_tpl_vars[$name]; + } else { + // var non-existant, return valid reference + $_tmp = null; + return $_tmp; + } + } + + /** + * Returns an array containing config variables + * + * @param string $name + * @param string $type + * @return array + */ + function &get_config_vars($name=null) + { + if(!isset($name) && is_array($this->_config[0])) { + return $this->_config[0]['vars']; + } else if(isset($this->_config[0]['vars'][$name])) { + return $this->_config[0]['vars'][$name]; + } else { + // var non-existant, return valid reference + $_tmp = null; + return $_tmp; + } + } + + /** + * trigger Smarty error + * + * @param string $error_msg + * @param integer $error_type + */ + function trigger_error($error_msg, $error_type = E_USER_WARNING) + { + trigger_error("Smarty error: $error_msg", $error_type); + } + + + /** + * executes & displays the template results + * + * @param string $resource_name + * @param string $cache_id + * @param string $compile_id + */ + function display($resource_name, $cache_id = null, $compile_id = null) + { + $this->fetch($resource_name, $cache_id, $compile_id, true); + } + + /** + * executes & returns or displays the template results + * + * @param string $resource_name + * @param string $cache_id + * @param string $compile_id + * @param boolean $display + */ + function fetch($resource_name, $cache_id = null, $compile_id = null, $display = false) + { + static $_cache_info = array(); + + $_smarty_old_error_level = $this->debugging ? error_reporting() : error_reporting(isset($this->error_reporting) + ? $this->error_reporting : error_reporting() & ~E_NOTICE); + + if (!$this->debugging && $this->debugging_ctrl == 'URL') { + $_query_string = $this->request_use_auto_globals ? $_SERVER['QUERY_STRING'] : $GLOBALS['HTTP_SERVER_VARS']['QUERY_STRING']; + if (@strstr($_query_string, $this->_smarty_debug_id)) { + if (@strstr($_query_string, $this->_smarty_debug_id . '=on')) { + // enable debugging for this browser session + @setcookie('SMARTY_DEBUG', true); + $this->debugging = true; + } elseif (@strstr($_query_string, $this->_smarty_debug_id . '=off')) { + // disable debugging for this browser session + @setcookie('SMARTY_DEBUG', false); + $this->debugging = false; + } else { + // enable debugging for this page + $this->debugging = true; + } + } else { + $this->debugging = (bool)($this->request_use_auto_globals ? @$_COOKIE['SMARTY_DEBUG'] : @$GLOBALS['HTTP_COOKIE_VARS']['SMARTY_DEBUG']); + } + } + + if ($this->debugging) { + // capture time for debugging info + $_params = array(); + require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); + $_debug_start_time = smarty_core_get_microtime($_params, $this); + $this->_smarty_debug_info[] = array('type' => 'template', + 'filename' => $resource_name, + 'depth' => 0); + $_included_tpls_idx = count($this->_smarty_debug_info) - 1; + } + + if (!isset($compile_id)) { + $compile_id = $this->compile_id; + } + + $this->_compile_id = $compile_id; + $this->_inclusion_depth = 0; + + if ($this->caching) { + // save old cache_info, initialize cache_info + array_push($_cache_info, $this->_cache_info); + $this->_cache_info = array(); + $_params = array( + 'tpl_file' => $resource_name, + 'cache_id' => $cache_id, + 'compile_id' => $compile_id, + 'results' => null + ); + require_once(SMARTY_CORE_DIR . 'core.read_cache_file.php'); + if (smarty_core_read_cache_file($_params, $this)) { + $_smarty_results = $_params['results']; + if (!empty($this->_cache_info['insert_tags'])) { + $_params = array('plugins' => $this->_cache_info['insert_tags']); + require_once(SMARTY_CORE_DIR . 'core.load_plugins.php'); + smarty_core_load_plugins($_params, $this); + $_params = array('results' => $_smarty_results); + require_once(SMARTY_CORE_DIR . 'core.process_cached_inserts.php'); + $_smarty_results = smarty_core_process_cached_inserts($_params, $this); + } + if (!empty($this->_cache_info['cache_serials'])) { + $_params = array('results' => $_smarty_results); + require_once(SMARTY_CORE_DIR . 'core.process_compiled_include.php'); + $_smarty_results = smarty_core_process_compiled_include($_params, $this); + } + + + if ($display) { + if ($this->debugging) + { + // capture time for debugging info + $_params = array(); + require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); + $this->_smarty_debug_info[$_included_tpls_idx]['exec_time'] = smarty_core_get_microtime($_params, $this) - $_debug_start_time; + require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php'); + $_smarty_results .= smarty_core_display_debug_console($_params, $this); + } + if ($this->cache_modified_check) { + $_server_vars = ($this->request_use_auto_globals) ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS']; + $_last_modified_date = @substr($_server_vars['HTTP_IF_MODIFIED_SINCE'], 0, strpos($_server_vars['HTTP_IF_MODIFIED_SINCE'], 'GMT') + 3); + $_gmt_mtime = gmdate('D, d M Y H:i:s', $this->_cache_info['timestamp']).' GMT'; + if (@count($this->_cache_info['insert_tags']) == 0 + && !$this->_cache_serials + && $_gmt_mtime == $_last_modified_date) { + if (php_sapi_name()=='cgi') + header('Status: 304 Not Modified'); + else + header('HTTP/1.1 304 Not Modified'); + + } else { + header('Last-Modified: '.$_gmt_mtime); + echo $_smarty_results; + } + } else { + echo $_smarty_results; + } + error_reporting($_smarty_old_error_level); + // restore initial cache_info + $this->_cache_info = array_pop($_cache_info); + return true; + } else { + error_reporting($_smarty_old_error_level); + // restore initial cache_info + $this->_cache_info = array_pop($_cache_info); + return $_smarty_results; + } + } else { + $this->_cache_info['template'][$resource_name] = true; + if ($this->cache_modified_check && $display) { + header('Last-Modified: '.gmdate('D, d M Y H:i:s', time()).' GMT'); + } + } + } + + // load filters that are marked as autoload + if (count($this->autoload_filters)) { + foreach ($this->autoload_filters as $_filter_type => $_filters) { + foreach ($_filters as $_filter) { + $this->load_filter($_filter_type, $_filter); + } + } + } + + $_smarty_compile_path = $this->_get_compile_path($resource_name); + + // if we just need to display the results, don't perform output + // buffering - for speed + $_cache_including = $this->_cache_including; + $this->_cache_including = false; + if ($display && !$this->caching && count($this->_plugins['outputfilter']) == 0) { + i... [truncated message content] |
From: <Seb...@us...> - 2009-05-18 12:54:25
|
Revision: 659 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=659&view=rev Author: Sebastian2009 Date: 2009-05-18 12:54:17 +0000 (Mon, 18 May 2009) Log Message: ----------- Removed Paths: ------------- branches/postfixadmin-smarty/smarty/libs/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Seb...@us...> - 2009-05-18 12:47:33
|
Revision: 658 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=658&view=rev Author: Sebastian2009 Date: 2009-05-18 12:47:27 +0000 (Mon, 18 May 2009) Log Message: ----------- get in sync from mainline. Modified Paths: -------------- branches/postfixadmin-smarty/ADDITIONS/cleanupdirs.pl branches/postfixadmin-smarty/CHANGELOG.TXT branches/postfixadmin-smarty/DOCUMENTS/UPGRADE.txt branches/postfixadmin-smarty/INSTALL.TXT branches/postfixadmin-smarty/broadcast-message.php branches/postfixadmin-smarty/common.php branches/postfixadmin-smarty/config.inc.php branches/postfixadmin-smarty/create-alias-domain.php branches/postfixadmin-smarty/create-alias.php branches/postfixadmin-smarty/debian/changelog branches/postfixadmin-smarty/debian/control branches/postfixadmin-smarty/debian/copyright branches/postfixadmin-smarty/debian/rules branches/postfixadmin-smarty/delete.php branches/postfixadmin-smarty/edit-active.php branches/postfixadmin-smarty/edit-alias.php branches/postfixadmin-smarty/functions.inc.php branches/postfixadmin-smarty/index.php branches/postfixadmin-smarty/languages/nb.lang branches/postfixadmin-smarty/list-domain.php branches/postfixadmin-smarty/list-virtual.php branches/postfixadmin-smarty/login.php branches/postfixadmin-smarty/setup.php branches/postfixadmin-smarty/templates/admin_list-domain.tpl branches/postfixadmin-smarty/upgrade.php branches/postfixadmin-smarty/users/vacation.php Added Paths: ----------- branches/postfixadmin-smarty/debian/TODO branches/postfixadmin-smarty/debian/apache.conf branches/postfixadmin-smarty/debian/lighttpd.conf branches/postfixadmin-smarty/debian/postfixadmin.config branches/postfixadmin-smarty/debian/postfixadmin.docs branches/postfixadmin-smarty/debian/postfixadmin.examples branches/postfixadmin-smarty/debian/postfixadmin.install branches/postfixadmin-smarty/debian/postfixadmin.links branches/postfixadmin-smarty/debian/postfixadmin.postinst branches/postfixadmin-smarty/debian/postfixadmin.postrm branches/postfixadmin-smarty/debian/postfixadmin.prerm branches/postfixadmin-smarty/debian/templates branches/postfixadmin-smarty/debian/watch Removed Paths: ------------- branches/postfixadmin-smarty/debian/apache-conf branches/postfixadmin-smarty/debian/docs Modified: branches/postfixadmin-smarty/ADDITIONS/cleanupdirs.pl =================================================================== --- branches/postfixadmin-smarty/ADDITIONS/cleanupdirs.pl 2009-05-14 19:16:00 UTC (rev 657) +++ branches/postfixadmin-smarty/ADDITIONS/cleanupdirs.pl 2009-05-18 12:47:27 UTC (rev 658) @@ -42,13 +42,21 @@ use Getopt::Long; ### change settings as needed, see notes above ################################# -my $root_path = "/home/vmail"; -my $logfile = "/var/log/removed_maildirs.log"; -my $db_hostname = "localhost"; -my $db_port = "3306"; -my $db_database = "postfix"; -my $db_username = "someuser"; -my $db_password = "somepass"; +our $root_path = "/home/vmail"; +our $logfile = "/var/log/removed_maildirs.log"; +our $db_hostname = "localhost"; +our $db_port = "3306"; # this script currently supports MySQL only +our $db_database = "postfix"; +our $db_username = "someuser"; +our $db_password = "somepass"; + +# instead of changing this script, you can put your settings to /etc/mail/postfixadmin/cleanupdirs.conf +# just use perl syntax there to fill the variables listed above (without the "our" keyword). Example: +# $db_username = 'mail'; +if (-f "/etc/mail/postfixadmin/cleanupdirs.conf") { + require "/etc/mail/postfixadmin/cleanupdirs.conf"; +} + ################################################################################ ### begin program ############################################################## @@ -63,6 +71,7 @@ or die "Unable to access directory '$root_path' ($!)"; foreach my $domain_dir (sort readdir DOMAINDIR) { next if $domain_dir =~ /^\./; # skip dotted dirs + next if (! -d "$root_path/$domain_dir"); # skip everything that is not a directory my $full_domain_dir = "$root_path/$domain_dir"; opendir USERDIR, $full_domain_dir or die "Unable to access directory '$full_domain_dir' ($!)"; Modified: branches/postfixadmin-smarty/CHANGELOG.TXT =================================================================== --- branches/postfixadmin-smarty/CHANGELOG.TXT 2009-05-14 19:16:00 UTC (rev 657) +++ branches/postfixadmin-smarty/CHANGELOG.TXT 2009-05-18 12:47:27 UTC (rev 658) @@ -11,6 +11,23 @@ # $Id$ +Version 2.3rc4 - 2009/04/18 - SVN r632 +-------------------------------------- + + - *Security fix* - on upgrade setup.php is restored; allowing a malicious + user to create their own superadmin account. We've removed the requirement to delete + setup.php, and instead a new config parameter (setup_password) is used to protect access + to this page. Password is encrypted, and setup.php can be used to generate the initial value. + - Fix undefined variables problem(s) + - Fix PostgreSQL date timestamp issues... + +Version 2.3rc3 - 2009/04/06 - SVN r611 +-------------------------------------- + + - Minor improvements to the Debian packaging, expect more soon + - Assorted bug fixes + - Partial support for per-user fetchmail.pl support + Version 2.3rc2 - 2009/02/03 - SVN r593 -------------------------------------- Modified: branches/postfixadmin-smarty/DOCUMENTS/UPGRADE.txt =================================================================== --- branches/postfixadmin-smarty/DOCUMENTS/UPGRADE.txt 2009-05-14 19:16:00 UTC (rev 657) +++ branches/postfixadmin-smarty/DOCUMENTS/UPGRADE.txt 2009-05-18 12:47:27 UTC (rev 658) @@ -43,7 +43,7 @@ Make sure that you are in your WWW directory and then unarchive the Postfix Admin archive (whatever the filename is): - $ tar -zxvf postfixadmin-2.2.tgz + $ tar -zxvf postfixadmin-X.X.tgz 3. Change permissions @@ -66,28 +66,32 @@ Comparing config.inc.php with your previous using "diff" might save you some time. +You can use a config.local.php file to contain your local settings - these will override any +defined in config.inc.php -5. Perform appropriate database upgrades +5. Run setup.php ---------------------------------------- +Access setup.php through a web browser. + +It will attempt to upgrade your database, and also allow you to create a superadmin user. + +From version 2.3, you need to specify a setup_password in config.inc.php - +setup.php should guide you through this process. If you do not have a setup_password, type one +into the form, and setup.php will echo out the hashed value (which needs to go into config.inc.php). +The setup_password removes the requirement for you to delete setup.php, and also closes a security hole. + Since version 2.2 of Postfixadmin, setup.php can perform the needed database updates automatically . -Open setup.php in your browser to update your database scheme. - If you update from 2.1 or older, also create a superadmin account using setup.php. Note that admin/ has been merged into the main directory. Login with the superadmin account to setup domains and domain admins. -6. Delete setup.php -------------------- -Delete setup.php - it allown non-authorized users to create a superadmin -account! - -7. Done +6. Done ------- This is all that is needed. Fire up your browser and go to the site that you specified to host Postfix Admin. Modified: branches/postfixadmin-smarty/INSTALL.TXT =================================================================== --- branches/postfixadmin-smarty/INSTALL.TXT 2009-05-14 19:16:00 UTC (rev 657) +++ branches/postfixadmin-smarty/INSTALL.TXT 2009-05-18 12:47:27 UTC (rev 658) @@ -104,14 +104,13 @@ The setup.php script will attempt to create the database structure (or upgrade it if you're coming from a previous version). -Assuming everything is OK you can create the admin user using the form displayed. +Assuming everything is OK you can specify a password (which you'll +need to use setup.php again in the future); when you submit the form, +the hashed value (which you need to enter into config.inc.php is echoed +out - with appropriate instructions on what to do with it). -Once you submit the form, all that's left to do is to delete "setup.php" +create the admin user using the form displayed. -e.g. - -mv setup.php setup.php.disabled - 5. Use PostfixAdmin ------------------- @@ -122,4 +121,7 @@ ------------------- As of March 2007, PostfixAdmin moved to SourceForge. For the forum posts and source updates, see: + https://sourceforge.net/projects/postfixadmin + +There is also #postfixadmin on irc.freenode.net. Modified: branches/postfixadmin-smarty/broadcast-message.php =================================================================== --- branches/postfixadmin-smarty/broadcast-message.php 2009-05-14 19:16:00 UTC (rev 657) +++ branches/postfixadmin-smarty/broadcast-message.php 2009-05-18 12:47:27 UTC (rev 658) @@ -45,9 +45,11 @@ } else { - $q = 'select username from mailbox union '. - 'select goto from alias '. - 'where goto not in (select username from mailbox)'; + $table_mailbox = table_by_key('mailbox'); + $table_alias = table_by_key('alias'); + + $q = "select username from $table_mailbox union select goto from $table_alias " . + "where goto not in (select username from $table_mailbox)"; $result = db_query ($q); if ($result['rows'] > 0) Modified: branches/postfixadmin-smarty/common.php =================================================================== --- branches/postfixadmin-smarty/common.php 2009-05-14 19:16:00 UTC (rev 657) +++ branches/postfixadmin-smarty/common.php 2009-05-18 12:47:27 UTC (rev 658) @@ -40,12 +40,6 @@ if($CONF['configured'] == FALSE) { die("Please edit config.inc.php - change \$CONF['configured'] to true after setting your database settings"); } - if(!isset($CONF['setup_password'])) { - die("You must have a \$CONF['setup_password'] defined - this allows authenticated access to setup.php"); - } - if($CONF['setup_password'] == 'changeme') { - die("You must specify a password in config.inc.php (\$CONF['setup_password']) in order to access setup.php"); - } } Modified: branches/postfixadmin-smarty/config.inc.php =================================================================== --- branches/postfixadmin-smarty/config.inc.php 2009-05-14 19:16:00 UTC (rev 657) +++ branches/postfixadmin-smarty/config.inc.php 2009-05-18 12:47:27 UTC (rev 658) @@ -31,7 +31,9 @@ */ $CONF['configured'] = false; -// In order to setup Postfixadmin, you MUST change the password below. +// In order to setup Postfixadmin, you MUST specify a hashed password here. +// To create the hash, visit setup.php in a browser and type a password into the field, +// on submission it will be echoed out to you as a hashed value. $CONF['setup_password'] = 'changeme'; // Postfix Admin Path // Set the location of your Postfix Admin installation here. @@ -298,8 +300,11 @@ // - add the corresponding color to show_custom_colors $CONF['show_custom_domains']=array("subdomain.domain.ext","domain2.ext"); $CONF['show_custom_colors']=array("lightgreen","lightblue"); +// If you use a recipient_delimiter in your postfix config, you can also honor it when aliases are checked. +// Example: $CONF['recipient_delimiter'] = "+"; +// Set to "" to disable this check. +$CONF['recipient_delimiter'] = ""; - // Optional: // Script to run after creation of mailboxes. // Note that this may fail if PHP is run in "safe mode", or if @@ -379,7 +384,7 @@ // that future updates work without problems, you can use a separate config // file (config.local.php) instead of editing this file and override some // settings there. -if (file_exists(dirname(__FILE__) . '/config.local.php')) { # for / +if (file_exists(dirname(__FILE__) . '/config.local.php')) { include(dirname(__FILE__) . '/config.local.php'); } Modified: branches/postfixadmin-smarty/create-alias-domain.php =================================================================== --- branches/postfixadmin-smarty/create-alias-domain.php 2009-05-14 19:16:00 UTC (rev 657) +++ branches/postfixadmin-smarty/create-alias-domain.php 2009-05-18 12:47:27 UTC (rev 658) @@ -38,6 +38,8 @@ exit; } +$fAliasDomain = ''; +$fTargetDomain= ''; $username = authentication_get_username(); $SESSID_USERNAME = $username; if(authentication_has_role('global-admin')) { Modified: branches/postfixadmin-smarty/create-alias.php =================================================================== --- branches/postfixadmin-smarty/create-alias.php 2009-05-14 19:16:00 UTC (rev 657) +++ branches/postfixadmin-smarty/create-alias.php 2009-05-18 12:47:27 UTC (rev 658) @@ -117,15 +117,14 @@ $fAddress = "@" . escape_string ($_POST['fDomain']); } - $append_alias = false; - $result = db_query ("SELECT * FROM $table_alias WHERE address='$fAddress'"); if ($result['rows'] == 1) { - $append_alias = true; + $error = 1; $tAddress = escape_string ($_POST['fAddress']); $tGoto = $fGoto; $tDomain = $fDomain; + $pCreate_alias_address_text = $PALANG['pCreate_alias_address_text_error2']; } if ($fActive == "on") { @@ -135,29 +134,13 @@ $sqlActive = db_get_boolean(False); } - $success = false; - /* Alias (or mailbox) already present, let's add the destination to that row */ - if ($append_alias) { + if ($error != 1) { if (preg_match('/^\*@(.*)$/', $fGoto, $match)) { $fGoto = "@" . $match[1]; } - $array = db_array ($result['result']); - - $values ['goto'] = $array['goto'] . ',' . $fGoto; - $result = db_update ($table_alias, "address = '$fAddress'", $values, array ('modified')); - $success = ($result == 1); - - } elseif ($error != 1) { - if (preg_match('/^\*@(.*)$/', $fGoto, $match)) { - $fGoto = "@" . $match[1]; - } - $result = db_query ("INSERT INTO $table_alias (address,goto,domain,created,modified,active) VALUES ('$fAddress','$fGoto','$fDomain',NOW(),NOW(),'$sqlActive')"); - $success = ($result['rows'] == 1); - } - - if (! $success) { + if ($result['rows'] != 1) { $tDomain = $fDomain; $tMessage = $PALANG['pCreate_alias_result_error'] . "<br />($fAddress -> $fGoto)<br />\n"; } @@ -168,6 +151,7 @@ $tMessage = $PALANG['pCreate_alias_result_success'] . "<br />($fAddress -> $fGoto)<br />\n"; } } +} $smarty->assign ('tAddress', $tAddress); $smarty->assign ('select_options', select_options ($list_domains, array ($tDomain))); Added: branches/postfixadmin-smarty/debian/TODO =================================================================== --- branches/postfixadmin-smarty/debian/TODO (rev 0) +++ branches/postfixadmin-smarty/debian/TODO 2009-05-18 12:47:27 UTC (rev 658) @@ -0,0 +1,4 @@ + * Do all necessary things automatically (maybe with dbconfig?) (database, setp password...) + * DebTags + * dbconfig: DOCUMENTS/SECURITY.txt + * include postfix configuration templates Deleted: branches/postfixadmin-smarty/debian/apache-conf =================================================================== --- branches/postfixadmin-smarty/debian/apache-conf 2009-05-14 19:16:00 UTC (rev 657) +++ branches/postfixadmin-smarty/debian/apache-conf 2009-05-18 12:47:27 UTC (rev 658) @@ -1,5 +0,0 @@ -# BEGIN FOR POSTFIXADMIN - -Alias /postfixadmin /usr/share/postfixadmin - -# END FOR POSTFIXADMIN Added: branches/postfixadmin-smarty/debian/apache.conf =================================================================== --- branches/postfixadmin-smarty/debian/apache.conf (rev 0) +++ branches/postfixadmin-smarty/debian/apache.conf 2009-05-18 12:47:27 UTC (rev 658) @@ -0,0 +1,5 @@ +# BEGIN FOR POSTFIXADMIN + +Alias /postfixadmin /usr/share/postfixadmin + +# END FOR POSTFIXADMIN Modified: branches/postfixadmin-smarty/debian/changelog =================================================================== --- branches/postfixadmin-smarty/debian/changelog 2009-05-14 19:16:00 UTC (rev 657) +++ branches/postfixadmin-smarty/debian/changelog 2009-05-18 12:47:27 UTC (rev 658) @@ -1,106 +1,6 @@ -postfixadmin (2.3rc2) unstable; urgency=low +postfixadmin (2.3rc5) unstable; urgency=low - * Subversion revision 593 - * Add model directory to .deb etc. - * Updated ChangeLog + * Initial release (Closes: #247225) - -- David Goodwin <dav...@pa...> Thu, 19 Mar 2009 19:50:00 +0000 + -- Norman Messtorff <no...@no...> Sat, 09 May 2009 22:36:26 +0200 -postfixadmin (2.3rc1) unstable; urgency=low - - * Subversion revision 587 - * New XmlRpc API for integration with 3rd party web mail clients. - * Various bug fixes - * Translation patches - * Addition of dovecotpw support - - -- David Goodwin <dav...@pa...> Wed, 18 Mar 2009 19:52:00 +0000 - -postfixadmin (2.3beta) unstable; urgency=low - - * Subversion revision 533 - * Fixes for MySQL upgrade issues - * Improved vacation.pl (renotification options, use SMTP headers, better - logging, optional external config file) - * Improved fetchmail.pl - * Domain aliases - new implementation should reduce backscatter etc. - * translation updates - * Added domain-postcreation script support - * Enhanced mailbox table to make it easier for people to customise where mailboxes live - * and much more - - -- David Goodwin <dav...@pa...> Sat, 17 Jan 2009 20:06:00 +0000 - -postfixadmin (2.2.1.1) unstable; urgency=low - - * Subversion revision 412 (from branches/postfixadmin-2.2.1) - * THIS IS EFFECTIVELY THE SAME AS 2.2.1 (which should probably be ignored) - - -- David Goodwin <dav...@pa...> Wed, 23 Jul 2008 12:37:00 +0000 - -postfixadmin (2.2.1) unstable; urgency=low - - * Various bug fixes (MySQL charset issue(s)) - * Updated translations (pl, bg, ru, nb, tw etc) - * added quota parameter to mailbox_postcreation hook - * new hook to update the quota after editing a mailbox - ($CONF['mailbox_postedit_script']) - * fixed subfolder creation order and timing - * allow smtp server to be specified in vacation.pl - * fixed MySQL charset issues - * several small bugfixes - * Norwegian (bokmal) translation added - * Updated translations (pl, bg, ru, nb, tw etc) - * Subversion revision 408 - - -- David Goodwin <dav...@pa...> Mon, 21 Jul 2008 22:44:00 +0000 -postfixadmin (2.2.0) unstable; urgency=low - - * 2.2.0 Released. - * Fix fetchmail script to work with PostgreSQL - * Fix fetchmail table creation in MySQL and PostgreSQL - * Documentation fixups - * Subversion revision 356 - - -- David Goodwin <dav...@pa...> Thu, 29 Apr 2008 15:47:00 +0000 - -postfixadmin (2.2.0-rc5) unstable; urgency=low - - * Fix MySQL installation issues (schema not being created!) - * Fix MySQL vacation_notification timestamp issue - * SVN revision: 340 - - -- David Goodwin <dav...@pa...> Wed, 23 Apr 2008 16:27:00 +0000 - -postfixadmin (2.2.0-1rc4) unstable; urgency=low - - * Removal of standalone database schema files (see upgrade.php) - * Various bug fixes - * Better/Move documentation on installation - * setup.php/upgrade.php works for PostgreSQL and MySQL - * MySQL Unicode problems fixed - * I think this is effectively v2.2.0 - * SVN revision: 336 - - -- David Goodwin <dav...@pa...> Sun, 20 Apr 2008 20:19:00 +0000 - -postfixadmin (2.2.0-1rc3) unstable; urgency=low - - * Various bug fixes - - -- David Goodwin <dav...@pa...> Thu, 28 Feb 2008 12:00:00 +0000 - -postfixadmin (2.2.0-1rc2) unstable; urgency=low - - * Improved CSS - * Improved upgrade procedure (should work for PGSQL) (see upgrade.php) - * Various bug fixes - - -- David Goodwin <dav...@pa...> Sat, 29 Dec 2007 21:14:00 +0000 - -postfixadmin (2.2.0-1rc1) unstable; urgency=low - - * Initial Release (via dpkg) - - -- David Goodwin <dav...@pa...> Sun, 04 Nov 2007 15:36:00 +0000 - Modified: branches/postfixadmin-smarty/debian/control =================================================================== --- branches/postfixadmin-smarty/debian/control 2009-05-14 19:16:00 UTC (rev 657) +++ branches/postfixadmin-smarty/debian/control 2009-05-18 12:47:27 UTC (rev 658) @@ -1,8 +1,8 @@ Source: postfixadmin Section: admin Priority: optional -Maintainer: David Goodwin <dav...@pa...> -Build-Depends: debhelper (>= 7) +Maintainer: Norman Messtorff <no...@no...> +Build-Depends: debhelper (>= 7), po-debconf, quilt (>= 0.46) Standards-Version: 3.8.1 Homepage: http://postfixadmin.sourceforge.net XS-Vcs-Svn: https://postfixadmin.svn.sourceforge.net/svnroot/postfixadmin/trunk @@ -10,19 +10,16 @@ Package: postfixadmin Architecture: all -Depends: apache2 | httpd, libapache2-mod-php5 | libapache-mod-php5 | php5-cgi | php5, ${misc:Depends} -Recommends: -Suggests: postfix, postgresql-server, mysql-server, squirrelmail, squirrelmail-postfixadmin, courier-imap, dovecot-imapd +Depends: debconf (>= 0.5), dbconfig-common, wwwconfig-common (>= 0.2.0), apache2 | lighttpd, libapache2-mod-php5 | php5-cgi | php5, php5-imap, php5-mysql | php5-pgsql, mysql-client | postgresql-client, ${misc:Depends} +Recommends: postfix-mysql | postfix-pgsql, mysql-server | postgresql-server +Suggests: squirrelmail-postfixadmin, dovecot-common | courier-authlib-mysql | courier-authlib-postgresql Description: Virtual mail hosting interface for Postfix Postfixadmin is a web interface to managing virtual users and domains - for a Postfix mailserver. The web interface is written in PHP. - Postfixadmin allows administrators to delegate handling a domain to domain - administrators. - Postfixadmin allows users to login and change their own settings (e.g. forward, - vacation, password etc). - Postfixadmin also includes support for virtual vacation support - - this requires Perl and various CPAN modules to be installed. - See included vacation.pl for further details. - . - Homepage: http://postfixadmin.sf.net/ - + for a Postfix mail transport agent. The web interface is written in PHP. + It supports Virtual mailboxes, aliases, forwarders and vacation. + . + Allows administrators to delegate the handling of domains to the + domain administrators. Allows users to login and change their own + settings (e.g. forwarders, vacation, passwords etc). + . + Provides easy integration into dovecot, courier or cyrus. Modified: branches/postfixadmin-smarty/debian/copyright =================================================================== --- branches/postfixadmin-smarty/debian/copyright 2009-05-14 19:16:00 UTC (rev 657) +++ branches/postfixadmin-smarty/debian/copyright 2009-05-18 12:47:27 UTC (rev 658) @@ -3,28 +3,33 @@ It was downloaded from subversion, via http://postfixadmin.sf.net -Upstream Authors: The PostfixAdmin Development Team <pos...@li...> +Upstream Authors: + The PostfixAdmin Development Team <pos...@li...> + Copyright: Copyright (C) 2007 The Postfixadmin Project Team - This program is free software; you can redistribute it and/or modify +License: + + This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - This program is distributed in the hope that it will be useful, + This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software + along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA -On Debian GNU/Linux systems, the complete text of the GNU General Public -License can be found in the `/usr/share/common-licenses' directory. +On Debian GNU/Linux systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL-2' + The Debian packaging of Postfixadmin is licensed under the same terms as Postfixadmin itself. Deleted: branches/postfixadmin-smarty/debian/docs =================================================================== --- branches/postfixadmin-smarty/debian/docs 2009-05-14 19:16:00 UTC (rev 657) +++ branches/postfixadmin-smarty/debian/docs 2009-05-18 12:47:27 UTC (rev 658) @@ -1,6 +0,0 @@ -VIRTUAL_VACATION -DOCUMENTS -ADDITIONS -LICENSE.TXT -INSTALL.TXT -GPL-LICENSE.TXT Added: branches/postfixadmin-smarty/debian/lighttpd.conf =================================================================== --- branches/postfixadmin-smarty/debian/lighttpd.conf (rev 0) +++ branches/postfixadmin-smarty/debian/lighttpd.conf 2009-05-18 12:47:27 UTC (rev 658) @@ -0,0 +1,4 @@ +# Alias for Postfixadmin +alias.url += ( + "/postfixadmin" => "/usr/share/postfixadmin", +) Added: branches/postfixadmin-smarty/debian/postfixadmin.config =================================================================== --- branches/postfixadmin-smarty/debian/postfixadmin.config (rev 0) +++ branches/postfixadmin-smarty/debian/postfixadmin.config 2009-05-18 12:47:27 UTC (rev 658) @@ -0,0 +1,15 @@ +#!/bin/sh +set -e + +. /usr/share/debconf/confmodule +db_version 2.0 +db_input high postfixadmin/reconfigure-webserver || true +db_go || true + +if [ -f /usr/share/dbconfig-common/dpkg/config ]; then + # we support mysql and pgsql + dbc_dbtypes="mysql, pgsql" + + . /usr/share/dbconfig-common/dpkg/config + dbc_go postfixadmin $@ +fi Added: branches/postfixadmin-smarty/debian/postfixadmin.docs =================================================================== --- branches/postfixadmin-smarty/debian/postfixadmin.docs (rev 0) +++ branches/postfixadmin-smarty/debian/postfixadmin.docs 2009-05-18 12:47:27 UTC (rev 658) @@ -0,0 +1,5 @@ +DOCUMENTS +CHANGELOG.TXT +GPL-LICENSE.TXT +INSTALL.TXT +LICENSE.TXT Added: branches/postfixadmin-smarty/debian/postfixadmin.examples =================================================================== --- branches/postfixadmin-smarty/debian/postfixadmin.examples (rev 0) +++ branches/postfixadmin-smarty/debian/postfixadmin.examples 2009-05-18 12:47:27 UTC (rev 658) @@ -0,0 +1,2 @@ +ADDITIONS +VIRTUAL_VACATION Added: branches/postfixadmin-smarty/debian/postfixadmin.install =================================================================== --- branches/postfixadmin-smarty/debian/postfixadmin.install (rev 0) +++ branches/postfixadmin-smarty/debian/postfixadmin.install 2009-05-18 12:47:27 UTC (rev 658) @@ -0,0 +1,12 @@ +*.php usr/share/postfixadmin +admin usr/share/postfixadmin +css usr/share/postfixadmin +images usr/share/postfixadmin +languages usr/share/postfixadmin +model usr/share/postfixadmin +motd.txt usr/share/postfixadmin +motd-users.txt usr/share/postfixadmin +templates usr/share/postfixadmin +users usr/share/postfixadmin +debian/apache.conf etc/postfixadmin +debian/lighttpd.conf etc/postfixadmin Added: branches/postfixadmin-smarty/debian/postfixadmin.links =================================================================== --- branches/postfixadmin-smarty/debian/postfixadmin.links (rev 0) +++ branches/postfixadmin-smarty/debian/postfixadmin.links 2009-05-18 12:47:27 UTC (rev 658) @@ -0,0 +1 @@ +etc/postfixadmin/config.inc.php usr/share/postfixadmin/config.inc.php Added: branches/postfixadmin-smarty/debian/postfixadmin.postinst =================================================================== --- branches/postfixadmin-smarty/debian/postfixadmin.postinst (rev 0) +++ branches/postfixadmin-smarty/debian/postfixadmin.postinst 2009-05-18 12:47:27 UTC (rev 658) @@ -0,0 +1,25 @@ +#!/bin/bash +set -e + +if [ "$1" = "configure" ]; then + . /usr/share/debconf/confmodule + db_version 2.0 + dbc_generate_include='template:/etc/postfixadmin/config.inc.php' + dbc_generate_include_owner='root:www-data' + dbc_generate_include_perms='640' + dbc_generate_include_args="-U -o template_infile=/usr/share/postfixadmin/config.inc.php" + . /usr/share/dbconfig-common/dpkg/postinst + dbc_go postfixadmin $@ + db_get postfixadmin/reconfigure-webserver + servers="$RET" + restart="$servers" + linkdestination_apache="../../postfixadmin/apache.conf" + linkdestination_lighttpd="../../postfixadmin/lighttpd.conf" + linkname="postfixadmin" + . /usr/share/wwwconfig-common/confd-link.sh + . /usr/share/wwwconfig-common/restart.sh +fi + +#DEBHELPER# + +exit 0 Added: branches/postfixadmin-smarty/debian/postfixadmin.postrm =================================================================== --- branches/postfixadmin-smarty/debian/postfixadmin.postrm (rev 0) +++ branches/postfixadmin-smarty/debian/postfixadmin.postrm 2009-05-18 12:47:27 UTC (rev 658) @@ -0,0 +1,26 @@ +#!/bin/sh +set -e + +if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then + if [ -f /usr/share/debconf/confmodule ]; then + . /usr/share/debconf/confmodule + db_version 2.0 + + # restart the webserver only if we know which one was configured. + if db_get postfixadmin/reconfigure-webserver; then + servers="$RET" + restart=$servers + linkname="postfixadmin" + . /usr/share/wwwconfig-common/restart.sh + fi + + if [ -f /usr/share/dbconfig-common/dpkg/postrm ]; then + . /usr/share/dbconfig-common/dpkg/postrm + dbc_go postfixadmin $@ + fi + fi +fi + +#DEBHELPER# + +exit 0 Added: branches/postfixadmin-smarty/debian/postfixadmin.prerm =================================================================== --- branches/postfixadmin-smarty/debian/postfixadmin.prerm (rev 0) +++ branches/postfixadmin-smarty/debian/postfixadmin.prerm 2009-05-18 12:47:27 UTC (rev 658) @@ -0,0 +1,20 @@ +#!/bin/sh +set -e + +. /usr/share/debconf/confmodule + +if [ -f /usr/share/dbconfig-common/dpkg/prerm ]; then + . /usr/share/dbconfig-common/dpkg/prerm + dbc_go postfixadmin $@ +fi + +if [ -f /usr/share/debconf/confmodule ]; then + . /usr/share/debconf/confmodule + db_version 2.0 + db_get postfixadmin/reconfigure-webserver + servers="$RET" + linkname="postfixadmin" + . /usr/share/wwwconfig-common/confd-link.sh +fi + +#DEBHELPER# Modified: branches/postfixadmin-smarty/debian/rules =================================================================== --- branches/postfixadmin-smarty/debian/rules 2009-05-14 19:16:00 UTC (rev 657) +++ branches/postfixadmin-smarty/debian/rules 2009-05-18 12:47:27 UTC (rev 658) @@ -4,16 +4,21 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 +include /usr/share/quilt/quilt.make + build: build-stamp -build-stamp: + +build-stamp: $(QUILT_STAMPFN) dh_testdir + #dh_testroot touch build-stamp -clean: + +clean: unpatch dh_testdir dh_testroot - rm -f build-stamp dh_clean + debconf-updatepo install: build dh_testdir @@ -21,33 +26,20 @@ dh_prep dh_installdirs dh_install - cp motd* debian/postfixadmin/usr/share/postfixadmin - cp *.php debian/postfixadmin/usr/share/postfixadmin mv debian/postfixadmin/usr/share/postfixadmin/config.inc.php debian/postfixadmin/etc/postfixadmin/config.inc.php - ln -s /etc/postfixadmin/config.inc.php debian/postfixadmin/usr/share/postfixadmin/config.inc.php - perl -p -i -e "s#$$CONF\['postfix_admin_path'\] = dirname\(__FILE__\)#$$CONF\['postfix_admin_path'\] = '/usr/share/postfixadmin'#" debian/postfixadmin/etc/postfixadmin/config.inc.php - cp -a model debian/postfixadmin/usr/share/postfixadmin - cp -a admin debian/postfixadmin/usr/share/postfixadmin - cp -a images debian/postfixadmin/usr/share/postfixadmin - cp -a languages debian/postfixadmin/usr/share/postfixadmin - cp -a templates debian/postfixadmin/usr/share/postfixadmin - cp -a users debian/postfixadmin/usr/share/postfixadmin - cp css/default.css debian/postfixadmin/usr/share/postfixadmin/css - cp debian/apache-conf debian/postfixadmin/etc/apache2/conf.d/postfixadmin find debian/postfixadmin -name .svn | xargs -r rm -r # Build architecture-independent files here. binary-indep: build install dh_testdir dh_testroot - dh_installdebconf + dh_installchangelogs + dh_installdebconf dh_installdocs -X.svn - dh_installexamples - dh_installman - dh_installcron + dh_installexamples -X.svn dh_link dh_compress - dh_fixperms -X/var + dh_fixperms dh_installdeb dh_gencontrol dh_md5sums Added: branches/postfixadmin-smarty/debian/templates =================================================================== --- branches/postfixadmin-smarty/debian/templates (rev 0) +++ branches/postfixadmin-smarty/debian/templates 2009-05-18 12:47:27 UTC (rev 658) @@ -0,0 +1,6 @@ +Template: postfixadmin/reconfigure-webserver +Type: multiselect +Choices: apache2, apache, apache-ssl, apache-perl, lighttpd +_Description: Web server to reconfigure automatically: + Please choose the web server that should be automatically configured + to run postfixadmin. Added: branches/postfixadmin-smarty/debian/watch =================================================================== --- branches/postfixadmin-smarty/debian/watch (rev 0) +++ branches/postfixadmin-smarty/debian/watch 2009-05-18 12:47:27 UTC (rev 658) @@ -0,0 +1,2 @@ +version=3 +http://sf.net/postfixadmin/postfixadmin-(.*)\.tar\.gz Modified: branches/postfixadmin-smarty/delete.php =================================================================== --- branches/postfixadmin-smarty/delete.php 2009-05-14 19:16:00 UTC (rev 657) +++ branches/postfixadmin-smarty/delete.php 2009-05-18 12:47:27 UTC (rev 658) @@ -43,57 +43,6 @@ $error=0; -/** - * delete_alias - * Action: Delete an alias - * @param String $alias- alias to delete. - * @param String $domain - domain of the alias - * @param boolean $force_delete - deletes the alias from the table if true, - * checks if the alias is real and act accordlying if false. - * Default is false. - * @return String username (e.g. fo...@ex...) - */ -function delete_alias ($alias, $domain, $force_delete = false) -{ - global $table_alias, $table_mailbox; - $real_alias = true; - - if (! $force_delete) - { - $result = db_query ("SELECT 1 FROM $table_mailbox - WHERE username='$alias' AND domain='$domain'"); - if ($result['rows'] != 0) - { - /* If the alias is a real mailbox as well, remove all its real aliases and keep - * only the address */ - $real_alias = false; - } - } - - if ($force_delete or $real_alias) - { - $result = db_query ("DELETE FROM $table_alias WHERE address='$alias' AND domain='$domain'"); - } - else - { - $result = db_query ("UPDATE $table_alias SET goto='$alias',modified=NOW() - WHERE address='$alias' AND domain='$domain'"); - } - - if ($result['rows'] != 1) - { - $tMessage = $PALANG['pDelete_delete_error'] . "<b>$alias</b> (alias)!</span>"; - - return false; - } - else - { - db_log ($SESSID_USERNAME, $fDomain, 'delete_alias', $fDelete); - } - - return true; -} - if ($fTable == "admin") { authentication_require_role('global-admin'); @@ -149,7 +98,7 @@ } } # ($fTable == "alias_domain") -elseif ($fTable == "mailbox") +elseif ($fTable == "alias" or $fTable == "mailbox") { if (!check_owner ($SESSID_USERNAME, $fDomain)) @@ -165,10 +114,12 @@ else { if ($CONF['database_type'] == "pgsql") db_query('BEGIN'); - - $error = delete_alias ($fDelete, $fDomain, $force_delete = true) ? 0 : 1; - if (! $error) - { + /* there may be no aliases to delete */ + $result = db_query("SELECT * FROM $table_alias WHERE address = '$fDelete' AND domain = '$fDomain'"); + if($result['rows'] == 1) { + $result = db_query ("DELETE FROM $table_alias WHERE address='$fDelete' AND domain='$fDomain'"); + db_log ($SESSID_USERNAME, $fDomain, 'delete_alias', $fDelete); + } /* is there a mailbox? if do delete it from orbit; it's the only way to be sure */ $result = db_query ("SELECT * FROM $table_mailbox WHERE username='$fDelete' AND domain='$fDomain'"); if ($result['rows'] == 1) @@ -204,22 +155,10 @@ header ("Location: list-virtual.php?domain=$fDomain"); exit; } else { - $tMessage = $PALANG['pDelete_delete_error'] . "<b>$fDelete</b> (physical mail)!</span>"; + $tMessage .= $PALANG['pDelete_delete_error'] . "<b>$fDelete</b> (physical mail)!</span>"; if ($CONF['database_type'] == "pgsql") db_query('ROLLBACK'); } - } # ($fTable == "mailbox") } -elseif ($fTable == "alias") { - $error = delete_alias ($fDelete, $fDomain) ? 0 : 1; - - if ($error != 1) - { - header ("Location: list-virtual.php?domain=$fDomain"); - exit; - } else { - $tMessage = $PALANG['pDelete_delete_error'] . "<b>$fDelete</b> (alias)!</span>"; - } -} else { flash_error($PALANG['invalid_parameter']); Modified: branches/postfixadmin-smarty/edit-active.php =================================================================== --- branches/postfixadmin-smarty/edit-active.php 2009-05-14 19:16:00 UTC (rev 657) +++ branches/postfixadmin-smarty/edit-active.php 2009-05-18 12:47:27 UTC (rev 658) @@ -32,6 +32,12 @@ authentication_require_role('admin'); $SESSID_USERNAME = authentication_get_username(); +$fAliasDomain = ''; +$fUsername = ''; +$fAlias = ''; +$fDomain = ''; +$fReturn = ''; + if ($_SERVER['REQUEST_METHOD'] == "GET") { if (isset ($_GET['alias_domain'])) $fAliasDomain = escape_string ($_GET['alias_domain']); Modified: branches/postfixadmin-smarty/edit-alias.php =================================================================== --- branches/postfixadmin-smarty/edit-alias.php 2009-05-14 19:16:00 UTC (rev 657) +++ branches/postfixadmin-smarty/edit-alias.php 2009-05-18 12:47:27 UTC (rev 658) @@ -38,19 +38,37 @@ die("Check config.inc.php - domain administrators do not have the ability to edit user's aliases (alias_control_admin)"); } -if ($_SERVER['REQUEST_METHOD'] == "GET") -{ - if (isset ($_GET['address'])) $fAddress = escape_string ($_GET['address']); - if (isset ($_GET['domain'])) $fDomain = escape_string ($_GET['domain']); +/* retrieve existing alias record for the user first... may be via GET or POST */ - if (check_owner ($SESSID_USERNAME, $fDomain) || authentication_has_role('global-admin')) +if(isset($_GET['address']) && isset($_GET['domain'])) { + $fAddress = escape_string($_GET['address']); + $fDomain = escape_string($_GET['domain']); +} +elseif(isset($_POST['address']) && isset($_POST['domain'])) { + $fAddress = escape_string($_POST['address']); + $fDomain = escape_string($_POST['domain']); +} +else { + die("Required parameters not present"); +} + +/* Check the user is able to edit the domain's aliases */ + + if(!check_owner($SESSID_USERNAME, $fDomain) && !authentication_has_role('global-admin')) { + die("You lack permission to do this. yes."); + } + + $table_alias = table_by_key('alias'); + $alias_list = array(); + $orig_alias_list = array(); $result = db_query ("SELECT * FROM $table_alias WHERE address='$fAddress' AND domain='$fDomain'"); if ($result['rows'] == 1) { $row = db_array ($result['result']); $tGoto = $row['goto']; - + $orig_alias_list = explode(',', $tGoto); + $alias_list = $orig_alias_list; //. if we are not a global admin, and special_alias_control is NO, hide the alias that's the mailbox name. if($CONF['special_alias_control'] == 'NO' && !authentication_has_role('global-admin')) { @@ -58,35 +76,31 @@ $result = db_query ("SELECT * FROM $table_mailbox WHERE username='$fAddress' AND domain='$fDomain'"); if ($result['rows'] == 1) { - $tGoto = preg_replace ('/\s*,*\s*' . $fAddress . '\s*,*\s*/', '', $tGoto); - } + $alias_list = array(); // empty it, repopulated again below + foreach($orig_alias_list as $alias) { + if(strtolower($alias) == strtolower($fAddress)) { + // mailbox address is dropped if they don't have special_alias_control enabled, and/or not a global-admin + } + else { + $alias_list[] = $alias; + } + } } - } } - else - { - $tMessage = $PALANG['pEdit_alias_address_error']; - } } +else { + die("Invalid alias / domain combination"); +} if ($_SERVER['REQUEST_METHOD'] == "POST") { $pEdit_alias_goto = $PALANG['pEdit_alias_goto']; - if (isset ($_GET['address'])) $fAddress = escape_string ($_GET['address']); - $fAddress = strtolower ($fAddress); - if (isset ($_GET['domain'])) $fDomain = escape_string ($_GET['domain']); if (isset ($_POST['fGoto'])) $fGoto = escape_string ($_POST['fGoto']); $fGoto = strtolower ($fGoto); - if (! (check_owner ($SESSID_USERNAME, $fDomain) || authentication_has_role('global-admin')) ) + if (!check_alias_owner ($SESSID_USERNAME, $fAddress)) { - $error = 1; - $tGoto = $_POST['fGoto']; - $tMessage = $PALANG['pEdit_alias_domain_error'] . "$fDomain</span>"; - } - elseif (!check_alias_owner ($SESSID_USERNAME, $fAddress)) - { $error = 1; $tGoto = $fGoto; $tMessage = $PALANG['pEdit_alias_result_error']; @@ -105,40 +119,39 @@ $tMessage = $PALANG['pEdit_alias_goto_text_error1']; } + $new_aliases = array(); if ($error != 1) { - $array = preg_split ('/,/', $goto); + $new_aliases = explode(',', $goto); } - else - { - $array = array(); - } + $new_aliases = array_unique($new_aliases); - for ($i = 0; $i < sizeof ($array); $i++) { - if (in_array ("$array[$i]", $CONF['default_aliases'])) continue; - if (empty ($array[$i])) continue; # TODO: should never happen - remove after 2.2 release - if (!check_email ($array[$i])) + foreach($new_aliases as $address) { + if (in_array($address, $CONF['default_aliases'])) continue; + if (empty($address)) continue; # TODO: should never happen - remove after 2.2 release + if (!check_email($address)) { $error = 1; $tGoto = $goto; - $tMessage = $PALANG['pEdit_alias_goto_text_error2'] . "$array[$i]</span>"; + $tMessage = $PALANG['pEdit_alias_goto_text_error2'] . "$address</span>"; } } $result = db_query ("SELECT * FROM $table_mailbox WHERE username='$fAddress' AND domain='$fDomain'"); - /* The alias has a real mailbox as well, prepend $goto with it */ if ($result['rows'] == 1) { - // ensure mailbox alias exists... if they're a domain admin, and they're not allowed to... if($CONF['alias_control_admin'] == 'NO' && !authentication_has_role('global-admin')) { - $array[] = $fAddress; + // if original record had a mailbox alias, so ensure the updated one does too. + if(in_array($orig_alias_list, $fAddress)) { + $new_aliases[] = $fAddress; + } } } // duplicates suck, mmkay.. - $array = array_unique($array); + $new_aliases = array_unique($new_aliases); - $goto = implode(',', $array); + $goto = implode(',', $new_aliases); if ($error != 1) { @@ -152,7 +165,7 @@ { db_log ($SESSID_USERNAME, $fDomain, 'edit_alias', "$fAddress -> $goto"); - header ("Location: list-virtual.php?domain=$fDomain"); + header ("Location: list-virtual.php?domain=$fDomain"); exit; } } @@ -162,6 +175,8 @@ $fDomain = htmlentities($fDomain, ENT_QUOTES); $array = preg_split ('/,/', $tGoto); +// TOCHECK +$array = $alias_list; $smarty->assign ('fAddress', $fAddress); $smarty->assign ('array', $array); Modified: branches/postfixadmin-smarty/functions.inc.php =================================================================== --- branches/postfixadmin-smarty/functions.inc.php 2009-05-14 19:16:00 UTC (rev 657) +++ branches/postfixadmin-smarty/functions.inc.php 2009-05-18 12:47:27 UTC (rev 658) @@ -22,7 +22,7 @@ exit; } -$version = '2.3 rc2'; +$version = '2.3 rc4'; /** * check_session @@ -431,13 +431,7 @@ global $table_alias, $table_mailbox, $table_domain; $list = array (); - $result = db_query ("SELECT COUNT(*) FROM $table_alias - LEFT JOIN $table_mailbox ON $table_alias.address=$table_mailbox.username - WHERE ($table_alias.domain='$domain' AND $table_mailbox.maildir IS NULL) - OR - ($table_alias.domain='$domain' - AND $table_alias.goto LIKE '%,%' - AND $table_mailbox.maildir IS NOT NULL)"); + $result = db_query ("SELECT COUNT(*) FROM $table_alias WHERE domain='$domain'"); $row = db_row ($result['result']); $list['alias_count'] = $row[0]; @@ -449,7 +443,7 @@ $result = db_query ("SELECT SUM(quota) FROM $table_mailbox WHERE domain='$domain'"); $row = db_row ($result['result']); $list['quota_sum'] = $row[0]; - $list['alias_count'] = $list['alias_count']; + $list['alias_count'] = $list['alias_count'] - $list['mailbox_count']; $list['alias_pgindex']=array (); $list['mbox_pgindex']=array (); @@ -471,10 +465,6 @@ FROM $table_alias LEFT JOIN $table_mailbox ON $table_alias.address=$table_mailbox.username WHERE ($table_alias.domain='$domain' AND $table_mailbox.maildir IS NULL) - OR - ($table_alias.domain='$domain' - AND $table_alias.goto LIKE '%,%' - AND $table_mailbox.maildir IS NOT NULL) ORDER BY $table_alias.address LIMIT $limitSql"; $result = db_query ("$query"); $row = db_array ($result['result']); @@ -487,10 +477,6 @@ FROM $table_alias LEFT JOIN $table_mailbox ON $table_alias.address=$table_mailbox.username WHERE ($table_alias.domain='$domain' AND $table_mailbox.maildir IS NULL) - OR - ($table_alias.domain='$domain' - AND $table_alias.goto LIKE '%,%' - AND $table_mailbox.maildir IS NOT NULL) ORDER BY $table_alias.address LIMIT $limitSql"; $result = db_query ("$query"); $row = db_array ($result['result']); @@ -2140,7 +2126,13 @@ while ( ($g=array_pop($gotos)) && $stat_ok ) { $stat_catchall = substr($g,strpos($g,"@")); - $stat_result = db_query ("SELECT address FROM $table_alias WHERE address = '$g' OR address = '$stat_catchall'"); + $stat_delimiter = ""; + if (!empty($CONF['recipient_delimiter'])) { + $delimiter = preg_quote($CONF['recipient_delimiter'], "/"); + $stat_delimiter = preg_replace('/' .$delimiter. '[^' .$delimiter. ']*@/', "@", $g); + $stat_delimiter = "OR address = '$stat_delimiter'"; + } + $stat_result = db_query ("SELECT address FROM $table_alias WHERE address = '$g' OR address = '$stat_catchall' $stat_delimiter"); if ($stat_result['rows'] == 0) { $stat_ok = 0; @@ -2183,8 +2175,15 @@ // POP/IMAP CHECK if ( $CONF['show_popimap'] == 'YES' ) { + $stat_delimiter = ""; + if (!empty($CONF['recipient_delimiter'])) { + $delimiter = preg_quote($CONF['recipient_delimiter'], "/"); + $stat_delimiter = preg_replace('/' .$delimiter. '[^' .$delimiter. '@]*@/', "@", $stat_goto); + $stat_delimiter = ',' . $stat_delimiter; + } + //if the address passed in appears in its own goto field, its POP/IMAP - if ( preg_match ('/,' . $show_alias . ',/', ',' . $stat_goto . ',') ) + if ( preg_match ('/,' . $show_alias . ',/', ',' . $stat_goto . $stat_delimiter . ',') ) { $stat_string .= "<span style='background-color:" . $CONF['show_popimap_color'] . "'>" . $CONF['show_status_text'] . "</span> "; Modified: branches/postfixadmin-smarty/index.php =================================================================== --- branches/postfixadmin-smarty/index.php 2009-05-14 19:16:00 UTC (rev 657) +++ branches/postfixadmin-smarty/index.php 2009-05-18 12:47:27 UTC (rev 658) @@ -23,7 +23,7 @@ $CONF['configured'] = FALSE; @include_once('config.inc.php'); # hide error message because only $CONF['configured'] is checked here -if (!file_exists (realpath ("./setup.php")) || $CONF['configured'] == 'I_know_the_risk_of_not_deleting_setup.php') +if ( $CONF['configured'] === TRUE ) { header ("Location: login.php"); exit; Modified: branches/postfixadmin-smarty/languages/nb.lang =================================================================== --- branches/postfixadmin-smarty/languages/nb.lang 2009-05-14 19:16:00 UTC (rev 657) +++ branches/postfixadmin-smarty/languages/nb.lang 2009-05-18 12:47:27 UTC (rev 658) @@ -4,7 +4,7 @@ // Language file Norwegian (bokmål) // by Odd Henriksen // -// Last updated: 2009-01-24 / Odd Henriksen +// Last updated: 2009-04-19 / Odd Henriksen // $PALANG['YES'] = 'JA'; @@ -24,7 +24,7 @@ $PALANG['pLogin_username'] = 'Brukernavn (e-postadresse)'; $PALANG['pLogin_password'] = 'Passord'; $PALANG['pLogin_button'] = 'Logg inn'; -$PALANG['pLogin_failed'] = 'Your email address or password are not correct.'; # XXX +$PALANG['pLogin_failed'] = 'E-postadressen eller passordet er ikke korrekt.'; $PALANG['pLogin_login_users'] = 'Vanlige brukere kan klikke her for å gå til brukerseksjonen.'; $PALANG['pMenu_main'] = 'Hoved'; @@ -339,10 +339,10 @@ $PALANG['pUsersVacation_welcome_text'] = 'Du har allerede et autosvar aktivert!'; $PALANG['pUsersVacation_subject'] = 'Emne'; $PALANG['pUsersVacation_subject_text'] = 'Fraværsmelding'; -$PALANG['pUsersVacation_body'] = 'Meldingstekst'; # XXX text changed to 'Message' +$PALANG['pUsersVacation_body'] = 'Meldingstekst'; $PALANG['pUsersVacation_body_text'] = <<<EOM -Jeg er utilgjengelig fra <date> til <date>. -Dersom det gjelder noe viktig kan du kontakte <contact person>. +Jeg er utilgjengelig fra (dato) til (dato). +Dersom det gjelder noe viktig kan du kontakte (kontaktperson). EOM; $PALANG['pUsersVacation_button_away'] = 'Merk meg som fraværende'; $PALANG['pUsersVacation_button_back'] = 'Merk meg som tilstede'; Modified: branches/postfixadmin-smarty/list-domain.php =================================================================== --- branches/postfixadmin-smarty/list-domain.php 2009-05-14 19:16:00 UTC (rev 657) +++ branches/postfixadmin-smarty/list-domain.php 2009-05-18 12:47:27 UTC (rev 658) @@ -40,33 +40,60 @@ $fUsername = ""; } +$list_all_domains = 0; if (isset($admin_properties) && $admin_properties['domain_count'] == 'ALL') { # list all domains for superadmins - $list_domains = list_domains (); + $list_all_domains = 1; } elseif (!empty($fUsername)) { $list_domains = list_domains_for_admin ($fUsername); } elseif ($is_superadmin) { - $list_domains = list_domains (); + $list_all_domains = 1; } else { $list_domains = list_domains_for_admin(authentication_get_username()); } -if (!empty ($list_domains)) -{ - for ($i = 0; $i < sizeof ($list_domains); $i++) - { - $domain_properties [$i] = get_domain_properties ($list_domains[$i]); +if ($list_all_domains == 1) { + $where = " WHERE domain.domain != 'ALL' "; # TODO: the ALL dummy domain is annoying... +} else { + $list_domains = escape_string($list_domains); + $where = " WHERE domain.domain IN ('" . join("','", $list_domains) . "') "; +} - $domain_properties [$i]['name'] = $list_domains [$i]; - $domain_properties [$i]['backupmx'] = ($domain_properties [$i]['backupmx'] == 1) ? $PALANG ['YES'] : $PALANG ['NO']; - $domain_properties [$i]['active'] = ($domain_properties [$i]['active'] == 1) ? $PALANG ['YES'] : $PALANG ['NO']; - - $domain_properties [$i]['maxquota'] = eval_size ($domain_properties [$i]['maxquota']); - $domain_properties [$i]['aliases'] = eval_size ($domain_properties [$i]['aliases']); - $domain_properties [$i]['mailboxes'] = eval_size ($domain_properties [$i]['mailboxes']); - } +# fetch domain data and number of mailboxes +# (PgSQL requires the extensive GROUP BY statement, https://sourceforge.net/forum/message.php?msg_id=7386240) +$query = " + SELECT domain.* , COUNT( DISTINCT mailbox.username ) AS mailbox_count + FROM domain + LEFT JOIN mailbox ON domain.domain = mailbox.domain + $where + GROUP BY domain.domain, domain.description, domain.aliases, domain.mailboxes, + domain.maxquota, domain.quota, domain.transport, domain.backupmx, domain.created, + domain.modified, domain.active + ORDER BY domain.domain + "; +$result = db_query($query); + +while ($row = db_array ($result['result'])) { + $domain_properties[$row['domain']] = $row; } -#} +# fetch number of aliases +# doing this separate is much faster than doing it in one "big" query +$query = " + SELECT domain.domain, COUNT( DISTINCT alias.address ) AS alias_count + FROM domain + LEFT JOIN alias ON domain.domain = alias.domain + $where + GROUP BY domain.domain + ORDER BY domain.domain + "; + +$result = db_query($query); + +while ($row = db_array ($result['result'])) { + # add number of aliases to $domain_properties array. mailbox aliases do not count. + $domain_properties [$row['domain']] ['alias_count'] = $row['alias_count'] - $domain_properties [$row['domain']] ['mailbox_count']; +} + $smarty->assign ('domain_properties', $domain_properties); if ($is_superadmin) { Modified: branches/postfixadmin-smarty/list-virtual.php =================================================================== --- branches/postfixadmin-smarty/list-virtual.php 2009-05-14 19:16:00 UTC (rev 657) +++ branches/postfixadmin-smarty/list-virtual.php 2009-05-18 12:47:27 UTC (rev 658) @@ -123,22 +123,15 @@ $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) - OR - ($table_alias.domain='$fDomain' - AND $table_alias.goto LIKE '%,%' - AND $table_mailbox.maildir IS NOT NULL) ORDER BY $table_alias.address LIMIT $fDisplay, $page_size"; - if ('pgsql'==$CONF['database_type']) { $query = "SELECT address, goto, - modified, + 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 - AND $table_alias.goto NOT LIKE '%,%') + 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); @@ -148,16 +141,12 @@ { if ('pgsql'==$CONF['database_type']) { - $row['modified']=gmstrftime('%c %Z',$row['modified']); + //. at least in my database, $row['modified'] already looks like : 2009-04-11 21:38:10.75586+01, + // while gmstrftime expects an integer value. strtotime seems happy though. + //$row['modified']=gmstrftime('%c %Z',$row['modified']); + $row['modified'] = date('Y-m-d H:i', strtotime($row['modified'])); $row['active']=('t'==$row['active']) ? 1 : 0; } - - /* Has a real mailbox as well? Remove the address from $row['goto'] in order to edit just the real aliases */ - if (strstr ($row['goto'], ',') != FALSE) - { - $row['goto'] = preg_replace ('/\s*,*\s*' . $row['address'] . '\s*,*\s*/', '', $row['goto']); - } - $tAlias[] = $row; } } @@ -186,9 +175,9 @@ { if ('pgsql'==$CONF['database_type']) { - //var_dump($row); - $row['created']=gmstrftime('%c %Z',strtotime($row['created'])); - $row['modified']=gmstrftime('%c %Z',strtotime($row['modified'])); + // XXX + $row['modified'] = date('Y-m-d H:i', strtotime($row['modified'])); + $row['created'] = date('Y-m-d H:i', strtotime($row['created'])); $row['active']=('t'==$row['active']) ? 1 : 0; if($row['v_active'] == NULL) { $row['v_active'] = 'f'; @@ -389,5 +378,5 @@ $smarty->display ('index.tpl'); -/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */ +/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ ?> Modified: branches/postfixadmin-smarty/login.php =================================================================== --- branches/postfixadmin-smarty/login.php 2009-05-14 19:16:00 UTC (rev 657) +++ branches/postfixadmin-smarty/login.php 2009-05-18 12:47:27 UTC (rev 658) @@ -31,15 +31,11 @@ require_once('common.php'); # force user to delete setup.php (allows creation of superadmins!) -if (isset($CONF['configured']) && $CONF['configured'] == 'I_know_the_risk_of_not_deleting_setup.php') { - } - else - { - if($CONF['configured'] !== true) { + if($CONF['configured'] !== true) { print "Installation not yet configured; please edit config.inc.php"; exit; } -} + $smarty->assign ('language_selector', language_selector()); if ($_SERVER['REQUEST_METHOD'] == "GET") Modified: branches/postfixadmin-smarty/setup.php =================================================================== --- branches/postfixadmin-smarty/setup.php 2009-05-14 19:16:00 UTC (rev 657) +++ branches/postfixadmin-smarty/setup.php 2009-05-18 12:47:27 UTC (rev 658) @@ -23,7 +23,7 @@ * Form POST \ GET Variables: -none- */ -require_once("common.php"); +require_once('common.php'); $CONF['show_header_text'] = 'NO'; $CONF['theme_logo'] = 'images/logo-default.png'; @@ -71,7 +71,7 @@ } else { - print "<li><b>Unable to check for PHP version. (missing function: phpversion())</b></li>\n"; + print "<li><b>Unable to check for PHP version. (missing function: phpversion())</b></li>\n"; } // @@ -79,13 +79,13 @@ // if ($f_apache_get_version == 1) { - print "<li>" . apache_get_version() . "</li>\n"; + print "<li>" . apache_get_version() . "</li>\n"; } else { - # not running on Apache. - # However postfixadmin _is_ running, so obviously we are on a supported webserver ;-)) - # No need to confuse the user with a warning. + # not running on Apache. + # However postfixadmin _is_ running, so obviously we are on a supported webserver ;-)) + # No need to confuse the user with a warning. } print "</ul>"; @@ -97,18 +97,18 @@ // if ($f_get_magic_quotes_gpc == 1) { - if (get_magic_quotes_gpc () == 0) - { - print "<li>Magic Quotes: Disabled - OK</li>\n"; - } - else - { - print "<li><b>Warning: Magic Quotes: ON (internal workaround used)</b></li>\n"; - } + if (get_magic_quotes_gpc () == 0) + { + print "<li>Magic Quotes: Disabled - OK</li>\n"; + } + else + { + print "<li><b>Warning: Magic Quotes: ON (internal workaround used)</b></li>\n"; + } } else { - print "<li><b>Unable to check for Magic Quotes. (missing function: get_magic_quotes_gpc())</b></li>\n"; + print "<li><b>Unable to check for Magic Quotes. (missing function: get_magic_quotes_gpc())</b></li>\n"; } // @@ -117,27 +117,27 @@ $config_loaded = 0; if ($file_config == 1) { - print "<li>Depends on: presence config.inc.php - OK</li>\n"; - require_once('config.inc.php'); - $config_loaded = 1; + print "<li>Depends on: presence config.inc.php - OK</li>\n"; + require_once('config.... [truncated message content] |
From: <chr...@us...> - 2009-05-14 19:16:17
|
Revision: 657 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=657&view=rev Author: christian_boltz Date: 2009-05-14 19:16:00 +0000 (Thu, 14 May 2009) Log Message: ----------- functions.inc.php: - gen_show_status(): honor recipient_delimiter in POP/IMAP check Modified Paths: -------------- trunk/functions.inc.php Modified: trunk/functions.inc.php =================================================================== --- trunk/functions.inc.php 2009-05-13 22:07:30 UTC (rev 656) +++ trunk/functions.inc.php 2009-05-14 19:16:00 UTC (rev 657) @@ -2174,8 +2174,15 @@ // POP/IMAP CHECK if ( $CONF['show_popimap'] == 'YES' ) { + $stat_delimiter = ""; + if (!empty($CONF['recipient_delimiter'])) { + $delimiter = preg_quote($CONF['recipient_delimiter'], "/"); + $stat_delimiter = preg_replace('/' .$delimiter. '[^' .$delimiter. '@]*@/', "@", $stat_goto); + $stat_delimiter = ',' . $stat_delimiter; + } + //if the address passed in appears in its own goto field, its POP/IMAP - if ( preg_match ('/,' . $show_alias . ',/', ',' . $stat_goto . ',') ) + if ( preg_match ('/,' . $show_alias . ',/', ',' . $stat_goto . $stat_delimiter . ',') ) { $stat_string .= "<span style='background-color:" . $CONF['show_popimap_color'] . "'>" . $CONF['show_status_text'] . "</span> "; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-05-13 22:07:40
|
Revision: 656 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=656&view=rev Author: christian_boltz Date: 2009-05-13 22:07:30 +0000 (Wed, 13 May 2009) Log Message: ----------- templates/list-virtual.php: - fix mixed up unlimited vs. disabled https://sourceforge.net/tracker/?func=detail&aid=2790969&group_id=191583&atid=937964 Modified Paths: -------------- trunk/templates/list-virtual.php Modified: trunk/templates/list-virtual.php =================================================================== --- trunk/templates/list-virtual.php 2009-05-12 22:19:39 UTC (rev 655) +++ trunk/templates/list-virtual.php 2009-05-13 22:07:30 UTC (rev 656) @@ -6,14 +6,13 @@ $file = 'list-virtual.php'; +if ($limit['aliases'] < 0) $limit['aliases'] = $PALANG['pOverview_disabled']; +if ($limit['mailboxes'] < 0) $limit['mailboxes'] = $PALANG['pOverview_disabled']; +if ($limit['maxquota'] < 0) $limit['maxquota'] = $PALANG['pOverview_disabled']; +if ($limit['aliases'] == 0) $limit['aliases'] = $PALANG['pOverview_unlimited']; +if ($limit['mailboxes'] == 0) $limit['mailboxes'] = $PALANG['pOverview_unlimited']; +if ($limit['maxquota'] == 0) $limit['maxquota'] = $PALANG['pOverview_unlimited']; -if ($limit['aliases'] == 0) $limit['aliases'] = $PALANG['pOverview_disabled']; -if ($limit['mailboxes'] == 0) $limit['mailboxes'] = $PALANG['pOverview_disabled']; -if ($limit['maxquota'] == 0) $limit['maxquota'] = $PALANG['pOverview_disabled']; -if ($limit['aliases'] < 0) $limit['aliases'] = $PALANG['pOverview_unlimited']; -if ($limit['mailboxes'] < 0) $limit['mailboxes'] = $PALANG['pOverview_unlimited']; -if ($limit['maxquota'] < 0) $limit['maxquota'] = $PALANG['pOverview_unlimited']; - for ($i = 0; $i < sizeof ($list_domains); $i++) { if ($fDomain == $list_domains[$i]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |