SF.net SVN: postfixadmin: [151] trunk
Brought to you by:
christian_boltz,
gingerdog
From: <chr...@us...> - 2007-10-11 22:27:23
|
Revision: 151 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=151&view=rev Author: christian_boltz Date: 2007-10-11 15:27:25 -0700 (Thu, 11 Oct 2007) Log Message: ----------- - added fetchmail.php to menu.tpl (only displayed if $CONF['fetchmail'] == 'YES') - shortened german menu text for fetchmail - config.inc.php: - added $CONF['fetchmail'] and $CONF['fetchmail_extra_options'], including a big warning for the latter one. - include config.inc.php at the end if it exists. This can make future updates easier because you don't have to edit config.inc.php itsself. It should also make development easier because you don't need to undo local changes before commiting config.inc.php - fetchmail.tpl: - new array display_fields, contains the list of fields to display in the table. This also solves most "undefined index" warnings. Note: editing fetchmail does not honor $CONF['fetchmail_extra_options'] = 'NO' yet. Modified Paths: -------------- trunk/config.inc.php trunk/languages/de.lang trunk/templates/fetchmail.tpl trunk/templates/menu.tpl Modified: trunk/config.inc.php =================================================================== --- trunk/config.inc.php 2007-10-11 18:58:24 UTC (rev 150) +++ trunk/config.inc.php 2007-10-11 22:27:25 UTC (rev 151) @@ -197,6 +197,15 @@ // If you don't want logging set this to 'NO'; $CONF['logging'] = 'YES'; +// Fetchmail +// If you don't want fetchmail tab set this to 'NO'; +$CONF['fetchmail'] = 'YES'; + +// fetchmail_extra_options allows users to specify any fetchmail options and any MDA +// (it will even accept 'rm -rf /' as MDA!) +// This should be set to NO, except if you *really* trust *all* your users. +$CONF['fetchmail_extra_options'] = 'NO'; + // Header $CONF['show_header_text'] = 'NO'; $CONF['header_text'] = ':: Postfix Admin ::'; @@ -299,6 +308,15 @@ // See also the "Optional flags for names" table at // http://www.php.net/manual/en/function.imap-open.php + +// If you want to keep most settings at default values and/or want to ensure +// that future updates work without problems, you can use a separate config +// file (config.local.php) instead of editing this file and override some +// settings there. +if (file_exists (realpath ("./config.local.php"))) { + include('config.local.php'); +}; + // // END OF CONFIG FILE // Modified: trunk/languages/de.lang =================================================================== --- trunk/languages/de.lang 2007-10-11 18:58:24 UTC (rev 150) +++ trunk/languages/de.lang 2007-10-11 22:27:25 UTC (rev 151) @@ -29,7 +29,7 @@ $PALANG['pMenu_overview'] = 'Überblick'; $PALANG['pMenu_create_alias'] = 'Alias hinzufügen'; $PALANG['pMenu_create_mailbox'] = 'Mailbox hinzufügen'; -$PALANG['pMenu_fetchmail'] = 'E-Mail Abruf bearbeiten'; +$PALANG['pMenu_fetchmail'] = 'E-Mail Abruf'; $PALANG['pMenu_sendmail'] = 'Email versenden'; $PALANG['pMenu_password'] = 'Passwort ändern'; $PALANG['pMenu_viewlog'] = 'Log ansehen'; Modified: trunk/templates/fetchmail.tpl =================================================================== --- trunk/templates/fetchmail.tpl 2007-10-11 18:58:24 UTC (rev 150) +++ trunk/templates/fetchmail.tpl 2007-10-11 22:27:25 UTC (rev 151) @@ -2,12 +2,41 @@ <form name="overview" method="post"> <?php - + +# fields to display in table view +$display_fields=array( + "id", + "mailbox", + "src_server", + "src_auth", + "src_user", +# "src_password", + "src_folder", + "pool_time", + "fetchall", + "keep", + "protocol", +); + +if ($CONF['fetchmail_extra_options'] == 'YES') { + array_push( + $display_fields, + "extra_options", + "mda" + ); +} + +array_push( + $display_fields, + "date", + "returned_text" +); + $headers=array(); - foreach($fm_struct as $row){ - list($editible,$view,$type,$title,$comment)=$row; + foreach($display_fields as $row){ + list($editible,$view,$type,$title,$comment)=$fm_struct[$row]; if ($view){ - $headers[]=$row; + $headers[]=$fm_struct[$row]; } } @@ -30,17 +59,19 @@ } else{ print " <tr class=\"hilightoff\" onMouseOver=\"className='hilighton';\" onMouseOut=\"className='hilightoff';\">\n"; - foreach($row as $key=>$val){ + foreach($display_fields as $key){ + list($editible,$view,$type,$title,$comment)=$fm_struct[$key]; + $val = $row[$key]; if ($view){ $func="_listview_".$type; print " <td nowrap>" . (function_exists($func)?$func($val):$val) . "</td>\n"; } + } print " </tr>\n"; } } - } function fetchmail_edit_row($data=array()){ @@ -153,3 +184,4 @@ <p /> </form> </div> +<?php /* vim: set ft=php expandtab softtabstop=3 tabstop=3 shiftwidth=3: */ ?> Modified: trunk/templates/menu.tpl =================================================================== --- trunk/templates/menu.tpl 2007-10-11 18:58:24 UTC (rev 150) +++ trunk/templates/menu.tpl 2007-10-11 22:27:25 UTC (rev 151) @@ -6,6 +6,9 @@ <li><a target="_top" href="<?php print $url; ?>"><?php print $PALANG['pMenu_create_alias']; ?></a></li> <?php $url = "create-mailbox.php"; if (isset ($_GET['domain'])) $url .= "?domain=" . $_GET['domain']; ?> <li><a target="_top" href="<?php print $url; ?>"><?php print $PALANG['pMenu_create_mailbox']; ?></a></li> + <?php if ($CONF['fetchmail'] == "YES") { ?> + <li><a target="_top" href="fetchmail.php"><?php print $PALANG['pMenu_fetchmail']; ?></a></li> + <?php } ?> <?php if ($CONF['sendmail'] == 'YES') { ?><li><a target="_top" href="sendmail.php"><?php print $PALANG['pMenu_sendmail']; ?></a></li><?php } ?> <?php if ($CONF['vacation'] == "YES") { ?> <li><a target="_top" href="edit-vacation.php"><?php print $PALANG['pUsersMenu_vacation']; ?></a></li> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |