postfixadmin-svn Mailing List for PostfixAdmin (Page 114)
Brought to you by:
christian_boltz,
gingerdog
You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(13) |
Oct
(63) |
Nov
(79) |
Dec
(34) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(15) |
Feb
(8) |
Mar
(8) |
Apr
(44) |
May
(18) |
Jun
(20) |
Jul
(35) |
Aug
(21) |
Sep
(8) |
Oct
(9) |
Nov
(21) |
Dec
(14) |
2009 |
Jan
(53) |
Feb
(13) |
Mar
(36) |
Apr
(40) |
May
(22) |
Jun
(10) |
Jul
(18) |
Aug
(18) |
Sep
(7) |
Oct
(26) |
Nov
(32) |
Dec
(13) |
2010 |
Jan
(6) |
Feb
(7) |
Mar
(12) |
Apr
(2) |
May
(12) |
Jun
(8) |
Jul
(9) |
Aug
(12) |
Sep
(12) |
Oct
(7) |
Nov
(9) |
Dec
(42) |
2011 |
Jan
(10) |
Feb
(35) |
Mar
(43) |
Apr
(39) |
May
(8) |
Jun
(8) |
Jul
(83) |
Aug
(20) |
Sep
(20) |
Oct
(63) |
Nov
(33) |
Dec
(20) |
2012 |
Jan
(28) |
Feb
(3) |
Mar
(1) |
Apr
(37) |
May
(16) |
Jun
(7) |
Jul
(3) |
Aug
|
Sep
|
Oct
(3) |
Nov
(1) |
Dec
(4) |
2013 |
Jan
(6) |
Feb
(16) |
Mar
(9) |
Apr
(11) |
May
(9) |
Jun
(30) |
Jul
(17) |
Aug
(6) |
Sep
(2) |
Oct
(30) |
Nov
(41) |
Dec
(26) |
2014 |
Jan
(16) |
Feb
(20) |
Mar
(5) |
Apr
(4) |
May
(14) |
Jun
(4) |
Jul
(1) |
Aug
|
Sep
(8) |
Oct
(18) |
Nov
(26) |
Dec
|
2015 |
Jan
(4) |
Feb
(9) |
Mar
(12) |
Apr
(26) |
May
(3) |
Jun
(3) |
Jul
(2) |
Aug
|
Sep
(15) |
Oct
(13) |
Nov
|
Dec
(1) |
2016 |
Jan
(1) |
Feb
(5) |
Mar
(4) |
Apr
(3) |
May
(19) |
Jun
|
Jul
|
Aug
(3) |
Sep
(16) |
Oct
(4) |
Nov
(5) |
Dec
(5) |
2017 |
Jan
(1) |
Feb
(8) |
Mar
|
Apr
(7) |
May
(3) |
Jun
(16) |
Jul
(13) |
Aug
(16) |
Sep
(6) |
Oct
(4) |
Nov
(10) |
Dec
(7) |
2018 |
Jan
(16) |
Feb
(17) |
Mar
(11) |
Apr
(13) |
May
(20) |
Jun
(3) |
Jul
(10) |
Aug
|
Sep
(3) |
Oct
(1) |
Nov
(6) |
Dec
(18) |
2019 |
Jan
(18) |
Feb
(31) |
Mar
(4) |
Apr
(4) |
May
(1) |
Jun
(8) |
Jul
(7) |
Aug
(10) |
Sep
(23) |
Oct
(6) |
Nov
(3) |
Dec
(5) |
2020 |
Jan
(10) |
Feb
(18) |
Mar
(34) |
Apr
(19) |
May
(6) |
Jun
(9) |
Jul
|
Aug
(10) |
Sep
(16) |
Oct
(6) |
Nov
(3) |
Dec
(11) |
2021 |
Jan
(118) |
Feb
(22) |
Mar
(13) |
Apr
(12) |
May
(48) |
Jun
(21) |
Jul
(17) |
Aug
(12) |
Sep
(19) |
Oct
(25) |
Nov
(16) |
Dec
(7) |
2022 |
Jan
(6) |
Feb
(7) |
Mar
(14) |
Apr
(4) |
May
|
Jun
(16) |
Jul
(18) |
Aug
(5) |
Sep
(12) |
Oct
(8) |
Nov
(10) |
Dec
(13) |
2023 |
Jan
|
Feb
(3) |
Mar
(2) |
Apr
(1) |
May
(2) |
Jun
(6) |
Jul
(3) |
Aug
(3) |
Sep
(3) |
Oct
(2) |
Nov
(7) |
Dec
(13) |
2024 |
Jan
(8) |
Feb
(6) |
Mar
(5) |
Apr
(10) |
May
(8) |
Jun
(6) |
Jul
(2) |
Aug
(1) |
Sep
(2) |
Oct
(4) |
Nov
(15) |
Dec
(10) |
2025 |
Jan
(3) |
Feb
(12) |
Mar
(3) |
Apr
(7) |
May
(18) |
Jun
(10) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <Gin...@us...> - 2007-10-09 16:23:07
|
Revision: 143 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=143&view=rev Author: GingerDog Date: 2007-10-09 09:23:09 -0700 (Tue, 09 Oct 2007) Log Message: ----------- fix edit-admin to not use the db password to pre-populate the field - as per emails with Christian Boltz Modified Paths: -------------- trunk/admin/edit-admin.php trunk/templates/admin_edit-admin.tpl Modified: trunk/admin/edit-admin.php =================================================================== --- trunk/admin/edit-admin.php 2007-10-09 16:19:41 UTC (rev 142) +++ trunk/admin/edit-admin.php 2007-10-09 16:23:09 UTC (rev 143) @@ -71,24 +71,25 @@ // has the password changed? $originalPassword = $admin_details['password']; - if($fPassword != $originalPassword) { - // if it has, ensure both fields are the same... - if ($fPassword == $fPassword2) - { - if(strlen($fPassword) >= $CONF['min_password_length']) { - $fPassword = pacrypt($fPassword); + if($fPassword != '') { + if($fPassword != $originalPassword) { + // if it has, ensure both fields are the same... + if ($fPassword == $fPassword2) + { + if(strlen($fPassword) >= $CONF['min_password_length']) { + $fPassword = pacrypt($fPassword); + } + else { + $error = 1; + flash_error(sprintf($PALANG['pPasswordTooShort'], $CONF['min_password_length'])); + } } else { $error = 1; - flash_error(sprintf($PALANG['pPasswordTooShort'], $CONF['min_password_length'])); + $pAdminEdit_admin_password_text = $PALANG['pAdminEdit_admin_password_text_error']; } } - else { - $error = 1; - $pAdminEdit_admin_password_text = $PALANG['pAdminEdit_admin_password_text_error']; - } } - $fDomains = array(); if (array_key_exists('fDomains', $_POST)) $fDomains = escape_string ($_POST['fDomains']); if ($error != 1) Modified: trunk/templates/admin_edit-admin.tpl =================================================================== --- trunk/templates/admin_edit-admin.tpl 2007-10-09 16:19:41 UTC (rev 142) +++ trunk/templates/admin_edit-admin.tpl 2007-10-09 16:23:09 UTC (rev 143) @@ -4,27 +4,27 @@ <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 $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="<?php echo $tPassword; ?>"/></td> + <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" /></td> + <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><?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><?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> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2007-10-09 16:19:40
|
Revision: 142 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=142&view=rev Author: GingerDog Date: 2007-10-09 09:19:41 -0700 (Tue, 09 Oct 2007) Log Message: ----------- common.php: caps change in headeR Modified Paths: -------------- trunk/common.php Modified: trunk/common.php =================================================================== --- trunk/common.php 2007-10-07 23:24:14 UTC (rev 141) +++ trunk/common.php 2007-10-09 16:19:41 UTC (rev 142) @@ -29,7 +29,7 @@ require_once("$incpath/config.inc.php"); if(isset($CONF['configured'])) { if($CONF['configured'] == FALSE) { - headeR("Location: setup.php"); + header("Location: setup.php"); exit(0); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-07 23:24:12
|
Revision: 141 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=141&view=rev Author: christian_boltz Date: 2007-10-07 16:24:14 -0700 (Sun, 07 Oct 2007) Log Message: ----------- - DATABASE_*.TXT: Do no longer create default superadmin ad...@do...d, this is now done via setup.php Modified Paths: -------------- trunk/DATABASE_MYSQL.TXT trunk/DATABASE_PGSQL.TXT Modified: trunk/DATABASE_MYSQL.TXT =================================================================== --- trunk/DATABASE_MYSQL.TXT 2007-10-07 23:12:07 UTC (rev 140) +++ trunk/DATABASE_MYSQL.TXT 2007-10-07 23:24:14 UTC (rev 141) @@ -150,8 +150,3 @@ FOREIGN KEY (on_vacation) REFERENCES vacation(email) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci TYPE=InnoDB COMMENT='Postfix Admin - Virtual Vacation Notifications'; -# -# -# superadmin user & password (login: ad...@do...d, password: admin) -INSERT INTO domain_admins (username, domain, active) VALUES ('ad...@do...d','ALL','1'); -INSERT INTO admin (username, password, active) VALUES ('ad...@do...d','$1$0fec9189$bgI6ncWrldPOsXnkUBIjl1','1'); Modified: trunk/DATABASE_PGSQL.TXT =================================================================== --- trunk/DATABASE_PGSQL.TXT 2007-10-07 23:12:07 UTC (rev 140) +++ trunk/DATABASE_PGSQL.TXT 2007-10-07 23:24:14 UTC (rev 141) @@ -167,9 +167,3 @@ GRANT SELECT ON vacation TO vacation; GRANT SELECT,INSERT,DELETE ON vacation_notification TO vacation; --- --- --- superadmin user & password (login: ad...@do...d, password: admin) -INSERT INTO domain (domain) VALUES ('ALL'); -INSERT INTO domain_admins (username, domain, active) VALUES ('ad...@do...d','ALL','1'); -INSERT INTO admin (username, password, active) VALUES ('ad...@do...d','$1$0fec9189$bgI6ncWrldPOsXnkUBIjl1','1'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-07 23:12:05
|
Revision: 140 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=140&view=rev Author: christian_boltz Date: 2007-10-07 16:12:07 -0700 (Sun, 07 Oct 2007) Log Message: ----------- - initial version of fetchmail support (by Viktor Gotwig,info AT symateam.de) (see postfixadmin-devel mailinglist for detailed description and known problems, subject "fetchmail support") - encoded some german umlauts as htmlentities Modified Paths: -------------- trunk/languages/de.lang trunk/languages/en.lang Added Paths: ----------- trunk/fetchmail.php trunk/templates/fetchmail.tpl Added: trunk/fetchmail.php =================================================================== --- trunk/fetchmail.php (rev 0) +++ trunk/fetchmail.php 2007-10-07 23:12:07 UTC (rev 140) @@ -0,0 +1,174 @@ +<?php +/** + * Postfix Admin + * + * LICENSE + * This source file is subject to the GPL license that is bundled with + * this package in the file LICENSE.TXT. + * + * Further details on the project are available at : + * http://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: fetchmail.php + * Responsible for setting up fetchmail + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * Template Variables: + * + * TODO + * + * Form POST \ GET Variables: + * + * TODO + */ + +/* new sql table: fetchmail + +create table fetchmail( + id int(11) unsigned not null auto_increment, + mailbox varchar(255) not null default '', + src_server varchar(255) not null default '', + src_auth enum('password','kerberos_v5','kerberos','kerberos_v4','gssapi','cram-md5','otp','ntlm','msn','ssh','any'), + src_user varchar(255) not null default '', + src_password varchar(255) not null default '', + src_folder varchar(255) not null default '', + pool_time int(11) unsigned not null default 10, + fetchall tinyint(1) unsigned not null default 0, + keep tinyint(1) unsigned not null default 0, + protocol enum('POP3','IMAP','POP2','ETRN','AUTO'), + extra_options text, + returned_text text, + mda varchar(255) not null default '', + date timestamp(14), + primary key(id) +); + +*/ + +require_once('common.php'); + +authentication_require_role('admin'); + +$fm_struct=array( // list($editible,$view,$type,$title,$comment) + "id" =>array(0,1,'id', 'ID','Record ID'), + "mailbox" =>array(1,1,'enum', 'Mailbox','Local mailbox'), + "src_server" =>array(1,1,'text', 'Server','Remote Server'), + "src_auth" =>array(1,1,'enum', 'Auth Type','Mostly password'), + "src_user" =>array(1,1,'text', 'User','Remote User'), + "src_password" =>array(1,1,'password', 'Password','Remote Password'), + "src_folder" =>array(1,1,'text', 'Folder','Remote Folder'), + "pool_time" =>array(1,1,'num', 'Poll','Poll Time (min)'), + "fetchall" =>array(1,1,'bool', 'Fetch All','Retrieve both old (seen) and new messages'), + "keep" =>array(1,1,'bool', 'Keep','Keep retrieved messages on the remote mailserver'), + "protocol" =>array(1,1,'enum', 'Protocol','Protocol to use'), + "extra_options" =>array(1,1,'longtext', 'Extra Options','Extra fetchmail Options'), + "mda" =>array(1,1,'longtext', 'MDA','Mail Delivery Agent'), + "date" =>array(0,1,'text', 'Date','Date of last pooling/configuration change'), + "returned_text" =>array(0,1,'longtext', 'Returned Text','Text message from last pooling'), +); + +$SESSID_USERNAME = authentication_get_username(); +if (!$SESSID_USERNAME ) + exit; + +$fm_defaults=array( + "id" =>0, + "mailbox" => array($SESSID_USERNAME), + "pool_time" =>10, + "src_auth" => + array('password','kerberos_v5','kerberos','kerberos_v4','gssapi','cram-md5','otp','ntlm','msn','ssh','any'), + "protocol" => + array('POP3','IMAP','POP2','ETRN','AUTO'), +); + + +$list_domains = list_domains_for_admin ($SESSID_USERNAME); +$user_domains=implode("','",array_values($list_domains)); +$sql="SELECT username FROM mailbox WHERE domain in ('".$user_domains."')"; + +$res = db_query ($sql); +if ($res['rows'] > 0){ + $fm_defaults["mailbox"]=array(); + while ($name = db_array ($res['result'])){ + $fm_defaults["mailbox"][] = $name["username"]; + } +} +else{ + $fm_defaults["mailbox"]=array(); + $fm_defaults["mailbox"][]=$SESSID_USERNAME; +} + +$new=$_REQUEST["new"]; +$edit=(int)$_REQUEST["edit"]; +$delete=$_REQUEST["delete"]; +$save=$_REQUEST["save"]; +$cancel=$_REQUEST["cancel"]; + +if ($cancel){ + $edit=0; +} +elseif($edit && $save){ + $_vals=array(); + foreach($fm_struct as $key=>$row){ + list($editible,$view,$type,$title,$comment)=$row; + if ($editible){ + $func="_inp_".$type; + $val=$_REQUEST[$key]; + if ($type!="password" || substr($val,0,1)!="*"){ + $_vals[]=$key."='".mysql_escape_string( + function_exists($func) + ?$func($val) + :$val)."'"; + } + } + } + $sql="UPDATE fetchmail SET ".implode(",",$_vals).",returned_text='' WHERE id=".$edit; + $res= db_query ($sql); +} +elseif($delete){ + db_query ("delete from fetchmail WHERE id=".$edit); +} +elseif ($new){ + $_keys=array(); + $_vals=array(); + foreach($fm_defaults as $key=>$val){ + $_keys[]=$key; + $_vals[]="'".(is_array($val)?$val[0]:mysql_escape_string($val))."'"; + } + $sql="INSERT fetchmail (".implode(",",$_keys).") VALUES (".implode(",",$_vals).")"; + $res= db_query ($sql); + $sql="SELECT id FROM fetchmail order by id desc limit 1"; + $res= db_query ($sql); + list($edit)=mysql_fetch_row($res['result']); +} + +$res = db_query ("SELECT ".implode(",",array_keys($fm_struct))." FROM fetchmail order by id desc"); +if ($res['rows'] > 0){ + while ($row = db_array ($res['result'])){ + $tFmail[] = $row; + } +} + +function _inp_num($val){ + return (int)($val); +} + +function _inp_bool($val){ + return $val?1:0; +} + +function _inp_password($val){ + return base64_encode($val); +} + + include ("./templates/header.tpl"); + include ("./templates/menu.tpl"); + include ("./templates/fetchmail.tpl"); + include ("./templates/footer.tpl"); + +?> Modified: trunk/languages/de.lang =================================================================== --- trunk/languages/de.lang 2007-10-07 19:52:40 UTC (rev 139) +++ trunk/languages/de.lang 2007-10-07 23:12:07 UTC (rev 140) @@ -25,6 +25,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_sendmail'] = 'Email versenden'; $PALANG['pMenu_password'] = 'Passwort ändern'; $PALANG['pMenu_viewlog'] = 'Log ansehen'; @@ -32,7 +33,7 @@ $PALANG['pMain_welcome'] = 'Willkommen zu Postfix Admin!'; $PALANG['pMain_overview'] = 'Listet Ihre Aliase und Mailboxen auf. Sie können sie hier editieren und löschen.'; -$PALANG['pMain_create_alias'] = 'Fügt einen neuen Alias für Ihre Domain hinzu.'; +$PALANG['pMain_create_alias'] = 'Fügt einen neuen Alias für Ihre Domain hinzu.'; $PALANG['pMain_create_mailbox'] = 'Legt eine neue Mailbox für Ihre Domain an.'; $PALANG['pMain_sendmail'] = 'Versenden Sie eine Email.'; $PALANG['pMain_password'] = 'Ändern Sie Ihr Admin-Passwort.'; @@ -280,24 +281,28 @@ $PALANG['pUsersVacation_subject_text'] = 'Ich bin weg...'; $PALANG['pUsersVacation_body'] = 'Text'; $PALANG['pUsersVacation_body_text'] = <<<EOM -Ich bin vom <date> bis <date> nicht zu Hause / im Büro. -In dringenden Fällen setzen Sie sich bitte mit <contact person> in Verbindung. -Vielen Dank für Ihr Verständniss. +Ich bin vom <date> bis <date> nicht zu Hause / im Büro. +In dringenden Fällen setzen Sie sich bitte mit <contact person> in Verbindung. +Vielen Dank für Ihr Verständnis. EOM; $PALANG['pUsersVacation_button_away'] = 'Ich gehe weg'; $PALANG['pUsersVacation_button_back'] = 'Ich bin zurück'; $PALANG['pUsersVacation_result_error'] = '<span class="error_msg">Konnte Ihre Automatische Antwort nicht einstellen!</span>'; $PALANG['pUsersVacation_result_success'] = 'Ihre Automatische Antwort wurde gelöscht!'; -$PALANG['pCreate_dbLog_createmailbox'] = 'Mailbox hinzufügen'; -$PALANG['pCreate_dbLog_createalias'] = 'Alias hinzufügen'; -$PALANG['pDelete_dbLog_deletealias'] = 'Alias löschen'; -$PALANG['pDelete_dbLog_deletemailbox'] = 'Mailbox löschen'; +$PALANG['pCreate_dbLog_createmailbox'] = 'Mailbox hinzufügen'; +$PALANG['pCreate_dbLog_createalias'] = 'Alias hinzuü\xBCgen'; +$PALANG['pDelete_dbLog_deletealias'] = 'Alias lüschen'; +$PALANG['pDelete_dbLog_deletemailbox'] = 'Mailbox löschen'; -$PALANG['pEdit_dbLog_editactive'] = 'Aktiv-Status ändern'; +$PALANG['pEdit_dbLog_editactive'] = 'Aktiv-Status ändern'; $PALANG['pEdit_dbLog_editalias'] = 'Alias bearbeiten'; $PALANG['pEdit_dbLog_editmailbox'] = 'Mailbox bearbeiten'; $PALANG['pSearch'] = 'suche'; $PALANG['pSearch_welcome'] = 'Suche nach: '; + +$PALANG['pFetchmail_welcome'] = 'E-Mail Abruf für: '; +$PALANG['pFetchmail_new_entry'] = 'Neuer Eintrag'; + ?> Modified: trunk/languages/en.lang =================================================================== --- trunk/languages/en.lang 2007-10-07 19:52:40 UTC (rev 139) +++ trunk/languages/en.lang 2007-10-07 23:12:07 UTC (rev 140) @@ -28,6 +28,7 @@ $PALANG['pMenu_overview'] = 'Overview'; $PALANG['pMenu_create_alias'] = 'Add Alias'; $PALANG['pMenu_create_mailbox'] = 'Add Mailbox'; +$PALANG['pMenu_fetchmail'] = 'Fetch Email'; $PALANG['pMenu_sendmail'] = 'Send Email'; $PALANG['pMenu_password'] = 'Password'; $PALANG['pMenu_viewlog'] = 'View Log'; @@ -354,4 +355,8 @@ $PALANG['pStatus_popimap'] = 'POP/IMAP '; $PALANG['pPasswordTooShort'] = "Password is too short - requires %s characters"; + +$PALANG['pFetchmail_welcome'] = 'Fetch mail for:'; +$PALANG['pFetchmail_new_entry'] = 'New entry'; + ?> Added: trunk/templates/fetchmail.tpl =================================================================== --- trunk/templates/fetchmail.tpl (rev 0) +++ trunk/templates/fetchmail.tpl 2007-10-07 23:12:07 UTC (rev 140) @@ -0,0 +1,155 @@ +<div id="overview"> +<form name="overview" method="post"> + +<?php + + $headers=array(); + foreach($fm_struct as $row){ + list($editible,$view,$type,$title,$comment)=$row; + if ($view){ + $headers[]=$row; + } + } + + print "<table id=\"log_table\" border=0>\n"; + print " <tr>\n"; + print " <td colspan=\"".(sizeof($headers)-1)."\"><h3>".$PALANG['pFetchmail_welcome'].$user_domains."</h3></td>\n"; + print " <td align=right><a href='?new=1'>>> ".$PALANG['pFetchmail_new_entry']."</a></td>\n"; + print " </tr>\n"; + print " <tr class=\"header\">\n"; + foreach($headers as $row){ + list($editible,$view,$type,$title,$comment)=$row; + print " <td>" . $title . "</td>\n"; + } + print " </tr>\n"; + + if (sizeof ($tFmail) > 0){ + foreach($tFmail as $row){ + if ($edit && $edit==$row["id"]){ + print "<tr><td colspan=".sizeof($headers).">".fetchmail_edit_row($row)."</td></tr>\n"; + } + else{ + print " <tr class=\"hilightoff\" onMouseOver=\"className='hilighton';\" onMouseOut=\"className='hilightoff';\">\n"; + foreach($row as $key=>$val){ + list($editible,$view,$type,$title,$comment)=$fm_struct[$key]; + if ($view){ + $func="_listview_".$type; + print " <td nowrap>" . (function_exists($func)?$func($val):$val) . "</td>\n"; + } + } + print " </tr>\n"; + } + } + + } + +function fetchmail_edit_row($data=array()){ + global $fm_struct,$fm_defaults; + $id=$data["id"]; + $_id=$data["id"]*100+1; + $ret="<table cellspacing=1 cellpadding=0 border=0 width=100%>"; + foreach($fm_struct as $key=>$struct){ + list($editible,$view,$type,$title,$comment)=$struct; + if ($editible){ + $ret.="<tr><td align=left valign=top><label for=${_id} style='width:20em;'>${title}: </label></td>"; + $ret.="<td align=left style='padding-left:.25em;padding-right:.25em;background-color:white;'>"; + $func="_edit_".$type; + if (! function_exists($func)) + $func="_edit_text"; + $val=isset($data[$key]) + ?$data[$key] + :(! is_array($fm_defaults[$key]) + ?$fm_defaults[$key] + :'' + ); + $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=left><input type=submit name=cancel value='Abbrechen'></td><td align=right><input type=submit name=save value='Save'></td><td align=right><input type=submit name=delete value='Delete'>"; + if ($id){ + $ret.="<input type=hidden name=edit value='${id}'>"; + } + $ret.="</td></tr>\n"; + $ret.="</table>\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); +} + + +?> +</table> +<p /> +</form> +</div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-07 19:52:36
|
Revision: 139 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=139&view=rev Author: christian_boltz Date: 2007-10-07 12:52:40 -0700 (Sun, 07 Oct 2007) Log Message: ----------- - always convert maildir name to lovercase - fixes https://sourceforge.net/tracker/index.php?func=detail&aid=1783149&group_id=191583&atid=937964 Modified Paths: -------------- trunk/create-mailbox.php Modified: trunk/create-mailbox.php =================================================================== --- trunk/create-mailbox.php 2007-10-07 19:16:48 UTC (rev 138) +++ trunk/create-mailbox.php 2007-10-07 19:52:40 UTC (rev 139) @@ -168,7 +168,7 @@ } else { - $maildir = $fDomain . "/" . escape_string ($_POST['fUsername']) . "/"; + $maildir = $fDomain . "/" . escape_string (strtolower($_POST['fUsername'])) . "/"; } } else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-07 19:16:44
|
Revision: 138 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=138&view=rev Author: christian_boltz Date: 2007-10-07 12:16:48 -0700 (Sun, 07 Oct 2007) Log Message: ----------- - escape_string(): preserve array keys when escaping arrays Modified Paths: -------------- trunk/functions.inc.php Modified: trunk/functions.inc.php =================================================================== --- trunk/functions.inc.php 2007-10-07 17:49:50 UTC (rev 137) +++ trunk/functions.inc.php 2007-10-07 19:16:48 UTC (rev 138) @@ -287,8 +287,8 @@ // Note, the array keys are not cleaned. if(is_array($string)) { $clean = array(); - foreach($string as $row) { - $clean[] = escape_string($row); + foreach(array_keys($string) as $row) { + $clean[$row] = escape_string($string[$row]); } return $clean; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-07 17:49:46
|
Revision: 137 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=137&view=rev Author: christian_boltz Date: 2007-10-07 10:49:50 -0700 (Sun, 07 Oct 2007) Log Message: ----------- - force user to delete setup.php (which allows creation of superadmins now!) Note: Developers can use $CONF['configured'] == 'I_know_the_risk_of_not_deleting_setup.php' to avoid deletion of setup.php after every "svn up". WARNING: THIS ALLOWS NON-AUTHENTIFICATED USERS TO CREATE SUPERADMIN ACCOUNTS! Use this setting only on development systems, where the database is not used by postfix. Modified Paths: -------------- trunk/index.php trunk/login.php Modified: trunk/index.php =================================================================== --- trunk/index.php 2007-10-07 17:41:29 UTC (rev 136) +++ trunk/index.php 2007-10-07 17:49:50 UTC (rev 137) @@ -21,7 +21,9 @@ * Form POST \ GET Variables: -none- */ -if (!file_exists (realpath ("./setup.php"))) +$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') { header ("Location: login.php"); exit; Modified: trunk/login.php =================================================================== --- trunk/login.php 2007-10-07 17:41:29 UTC (rev 136) +++ trunk/login.php 2007-10-07 17:49:50 UTC (rev 137) @@ -28,6 +28,19 @@ */ require_once('common.php'); + +# force user to delete setup.php (allows creation of superadmins!) +if (file_exists (realpath ("./setup.php"))) { + if (is_string($CONF['configured']) && $CONF['configured'] == 'I_know_the_risk_of_not_deleting_setup.php') + { + } + else + { + print "Please delete setup.php before using Postfix Admin!"; + exit; + } +} + if ($_SERVER['REQUEST_METHOD'] == "GET") { include ("./templates/header.tpl"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-07 17:41:28
|
Revision: 136 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=136&view=rev Author: christian_boltz Date: 2007-10-07 10:41:29 -0700 (Sun, 07 Oct 2007) Log Message: ----------- - read config.inc.php earlier to make the check for $CONF['configured'] == FALSE work Modified Paths: -------------- trunk/common.php Modified: trunk/common.php =================================================================== --- trunk/common.php 2007-10-07 17:23:29 UTC (rev 135) +++ trunk/common.php 2007-10-07 17:41:29 UTC (rev 136) @@ -26,13 +26,13 @@ header("Location: setup.php"); exit(0); } +require_once("$incpath/config.inc.php"); if(isset($CONF['configured'])) { if($CONF['configured'] == FALSE) { headeR("Location: setup.php"); exit(0); } } -require_once("$incpath/config.inc.php"); require_once("$incpath/functions.inc.php"); require_once("$incpath/languages/" . check_language () . ".lang"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-07 17:23:32
|
Revision: 135 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=135&view=rev Author: christian_boltz Date: 2007-10-07 10:23:29 -0700 (Sun, 07 Oct 2007) Log Message: ----------- - setup.php now has a "create superadmin" form - completely reworked HTML code in setup.php - moved admin creation code from create_admin.php to functions.php, function create_admin - several related changes in functions.inc.php: - use table_by_key() directly instead of the cached variables (which are empty if config.inc.php was not read before functions.php) - add an additional (optional) parameter $setup to db_connect, changed many die(msg) calls to $error_message .= msg. If $setup is given, the return value is array($link, $error_text) instead of $link - db_connect now checks for invalid $CONF['database_type'] Modified Paths: -------------- trunk/functions.inc.php trunk/setup.php trunk/stylesheet.css Modified: trunk/functions.inc.php =================================================================== --- trunk/functions.inc.php 2007-10-05 08:58:36 UTC (rev 134) +++ trunk/functions.inc.php 2007-10-07 17:23:29 UTC (rev 135) @@ -737,9 +737,7 @@ // function admin_exist ($username) { - global $table_admin; - - $result = db_query ("SELECT 1 FROM $table_admin WHERE username='$username'"); + $result = db_query ("SELECT 1 FROM " . table_by_key ('admin') . " WHERE username='$username'"); if ($result['rows'] != 1) { return false; @@ -1236,66 +1234,88 @@ "; - -// -// db_connect -// Action: Makes a connection to the database if it doesn't exist -// Call: db_connect () -// -function db_connect () +/** + * db_connect + * Action: Makes a connection to the database if it doesn't exist + * Call: db_connect () + * Optional parameter: $setup = TRUE, used by setup.php + * + * Return value: + * a) without $setup or $setup == 0 + * - $link - the database connection -OR- + * - call die() in case of connection problems + * b) with $setup == TRUE + * array($link, $error_text); + */ +function db_connect ($setup = 0) { global $CONF; global $DEBUG_TEXT; + if ($setup != 0) $DEBUG_TEXT = ''; + $error_text = ''; + $link = 0; if ($CONF['database_type'] == "mysql") { if (function_exists ("mysql_connect")) { - $link = @mysql_connect ($CONF['database_host'], $CONF['database_user'], $CONF['database_password']) or die ("<p />DEBUG INFORMATION:<br />Connect: " . mysql_error () . "$DEBUG_TEXT"); - @mysql_query("SET CHARACTER SET utf8",$link); - @mysql_query("SET COLLATION_CONNECTION='utf8_general_ci'",$link); - $succes = @mysql_select_db ($CONF['database_name'], $link) or die ("<p />DEBUG INFORMATION:<br />MySQL Select Database: " . mysql_error () . "$DEBUG_TEXT"); + $link = @mysql_connect ($CONF['database_host'], $CONF['database_user'], $CONF['database_password']) or $error_text .= ("<p />DEBUG INFORMATION:<br />Connect: " . mysql_error () . "$DEBUG_TEXT"); + if ($link) { + @mysql_query("SET CHARACTER SET utf8",$link); + @mysql_query("SET COLLATION_CONNECTION='utf8_general_ci'",$link); + $succes = @mysql_select_db ($CONF['database_name'], $link) or $error_text .= ("<p />DEBUG INFORMATION:<br />MySQL Select Database: " . mysql_error () . "$DEBUG_TEXT"); + } } else { - print "<p />DEBUG INFORMATION:<br />MySQL 3.x / 4.0 functions not available!<br />database_type = 'mysql' in config.inc.php, are you using a different database? $DEBUG_TEXT"; - die(); + $error_text .= "<p />DEBUG INFORMATION:<br />MySQL 3.x / 4.0 functions not available!<br />database_type = 'mysql' in config.inc.php, are you using a different database? $DEBUG_TEXT"; } } - - if ($CONF['database_type'] == "mysqli") + elseif ($CONF['database_type'] == "mysqli") { if (function_exists ("mysqli_connect")) { - $link = @mysqli_connect ($CONF['database_host'], $CONF['database_user'], $CONF['database_password']) or die ("<p />DEBUG INFORMATION:<br />Connect: " . mysqli_connect_error () . "$DEBUG_TEXT"); - @mysqli_query($link,"SET CHARACTER SET utf8"); - @mysqli_query($link,"SET COLLATION_CONNECTION='utf8_general_ci'"); - $success = @mysqli_select_db ($link, $CONF['database_name']) or die ("<p />DEBUG INFORMATION:<br />MySQLi Select Database: " . mysqli_error ($link) . "$DEBUG_TEXT"); + $link = @mysqli_connect ($CONF['database_host'], $CONF['database_user'], $CONF['database_password']) or $error_text .= ("<p />DEBUG INFORMATION:<br />Connect: " . mysqli_connect_error () . "$DEBUG_TEXT"); + if ($link) { + @mysqli_query($link,"SET CHARACTER SET utf8"); + @mysqli_query($link,"SET COLLATION_CONNECTION='utf8_general_ci'"); + $success = @mysqli_select_db ($link, $CONF['database_name']) or $error_text .= ("<p />DEBUG INFORMATION:<br />MySQLi Select Database: " . mysqli_error ($link) . "$DEBUG_TEXT"); + } } else { - print "<p />DEBUG INFORMATION:<br />MySQL 4.1 functions not available!<br />database_type = 'mysqli' in config.inc.php, are you using a different database? $DEBUG_TEXT"; - die(); + $error_text .= "<p />DEBUG INFORMATION:<br />MySQL 4.1 functions not available!<br />database_type = 'mysqli' in config.inc.php, are you using a different database? $DEBUG_TEXT"; } } - - if ($CONF['database_type'] == "pgsql") + elseif ($CONF['database_type'] == "pgsql") { if (function_exists ("pg_pconnect")) { $connect_string = "host=" . $CONF['database_host'] . " dbname=" . $CONF['database_name'] . " user=" . $CONF['database_user'] . " password=" . $CONF['database_password']; - $link = @pg_pconnect ($connect_string) or die ("<p />DEBUG INFORMATION:<br />Connect: failed to connect to database. $DEBUG_TEXT"); - pg_set_client_encoding($link, 'UNICODE'); + $link = @pg_pconnect ($connect_string) or $error_text .= ("<p />DEBUG INFORMATION:<br />Connect: failed to connect to database. $DEBUG_TEXT"); + if ($link) pg_set_client_encoding($link, 'UNICODE'); } else { - print "<p />DEBUG INFORMATION:<br />PostgreSQL functions not available!<br />database_type = 'pgsql' in config.inc.php, are you using a different database? $DEBUG_TEXT"; - die(); + $error_text .= "<p />DEBUG INFORMATION:<br />PostgreSQL functions not available!<br />database_type = 'pgsql' in config.inc.php, are you using a different database? $DEBUG_TEXT"; } } + else + { + $error_text = "<p />DEBUG INFORMATION:<br />Invalid \$CONF['database_type']! Please fix your config.inc.php! $DEBUG_TEXT"; + } - if ($link) + if ($setup) { + return array($link, $error_text); + } + elseif ($error_text != "") + { + print $error_text; + die(); + } + elseif ($link) + { return $link; } else @@ -1846,7 +1866,107 @@ return $stat_string; } +/* + Called by create-admin.php and setup.php + Returns: + array( + 'error' => 0, # 0 on success, otherwise > 0 + 'tMessage' => '', # success / failure message + 'pAdminCreate_admin_username_text' => '', # help text / error message for username + 'pAdminCreate_admin_password_text' => '' # error message for username + ) + */ + +function create_admin($fUsername, $fPassword, $fPassword2, $fDomains, $no_generate_password=0) +{ + global $PALANG; + global $CONF; + $error = 0; + $tMessage = ''; + $pAdminCreate_admin_username_text = ''; + $pAdminCreate_admin_password_text = ''; + + if (!check_email ($fUsername)) + { + $error = 1; + $pAdminCreate_admin_username_text = $PALANG['pAdminCreate_admin_username_text_error1']; + } + + if (empty ($fUsername) or admin_exist ($fUsername)) + { + $error = 1; + $pAdminCreate_admin_username_text = $PALANG['pAdminCreate_admin_username_text_error2']; + } + + if (empty ($fPassword) or empty ($fPassword2) or ($fPassword != $fPassword2)) + { + if (empty ($fPassword) and empty ($fPassword2) and $CONF['generate_password'] == "YES" && $no_generate_password == 0) + { + $fPassword = generate_password (); + } + else + { + $error = 1; + $pAdminCreate_admin_username_text = $PALANG['pAdminCreate_admin_username_text']; + $pAdminCreate_admin_password_text = $PALANG['pAdminCreate_admin_password_text_error']; + } + } + + if ($error != 1) + { + $password = pacrypt($fPassword); + $pAdminCreate_admin_username_text = $PALANG['pAdminCreate_admin_username_text']; + + $result = db_query ("INSERT INTO " . table_by_key('admin') . " (username,password,created,modified) VALUES ('$fUsername','$password',NOW(),NOW())"); + if ($result['rows'] != 1) + { + $tMessage = $PALANG['pAdminCreate_admin_result_error'] . "<br />($fUsername)<br />"; + } + else + { + if (!empty ($fDomains[0])) + { + for ($i = 0; $i < sizeof ($fDomains); $i++) + { + $domain = $fDomains[$i]; + $result = db_query ("INSERT INTO " . table_by_key ('domain_admins') . " (username,domain,created) VALUES ('$fUsername','$domain',NOW())"); + } + } + $tMessage = $PALANG['pAdminCreate_admin_result_success'] . "<br />($fUsername"; + if ($CONF['generate_password'] == "YES" && $no_generate_password == 0) + { + $tMessage .= " / $fPassword)</br />"; + } + else + { + if ($CONF['show_password'] == "YES" && $no_generate_password == 0) + { + $tMessage .= " / $fPassword)</br />"; + } + else + { + $tMessage .= ")</br />"; + } + } + } + } + + # TODO: should we log creation, editing and deletion of admins? + # Note: needs special handling in viewlog, because domain is empty + # db_log ($SESSID_USERNAME, '', 'create_admin', "$fUsername"); + + return array( + $error, + $tMessage, + $pAdminCreate_admin_username_text, + $pAdminCreate_admin_password_text + ); + + +} + + $table_admin = table_by_key ('admin'); $table_alias = table_by_key ('alias'); $table_domain = table_by_key ('domain'); Modified: trunk/setup.php =================================================================== --- trunk/setup.php 2007-10-05 08:58:36 UTC (rev 134) +++ trunk/setup.php 2007-10-07 17:23:29 UTC (rev 135) @@ -22,17 +22,19 @@ * * Form POST \ GET Variables: -none- */ + +require_once("languages/en.lang"); +require_once("functions.inc.php"); + +$CONF['show_header_text'] = 'NO'; +require('templates/header.tpl'); ?> -<html> -<head> -<title>Postfix Admin Setup Checker</title> -</head> -<body> -<img id="login_header_logo" src="images/postbox.png" /> -<img id="login_header_logo" src="images/postfixadmin2.png" /> -<h2>Postfix Admin Setup Checker 1.0.0</h2> -Running software:<br /> -<p /> + +<div class='setup'> +<h2>Postfix Admin Setup Checker</h2> + +<p>Running software: +<ul> <?php // // Check for availablilty functions @@ -57,29 +59,28 @@ { if (phpversion() < 5) $phpversion = 4; if (phpversion() >= 5) $phpversion = 5; - print "- PHP version " . phpversion () . "<br />\n"; + print "<li>PHP version " . phpversion () . "\n"; } else { - print "<li><b>Unable to check for PHP version. (missing function: phpversion())</b><br />\n"; + print "<li><b>Unable to check for PHP version. (missing function: phpversion())</b>\n"; } -print "<p />\n"; // // Check for Apache version // if ($f_apache_get_version == 1) { - print "- " . apache_get_version() . "<br /><p />\n"; + print "<li>" . apache_get_version() . "\n"; } else { - print "<li><b>Unable to check for Apache version. (missing function: apache_get_version())</b><br />\n"; + print "<li><b>Unable to check for Apache version. (missing function: apache_get_version())</b>\n"; } -print "<p />\n"; -print "Checking for dependencies:<br />\n"; -print "<p />\n"; +print "</ul>"; +print "<p>Checking for dependencies:\n"; +print "<ul>\n"; // // Check for Magic Quotes @@ -88,26 +89,27 @@ { if (get_magic_quotes_gpc () == 0) { - print "- Magic Quotes: Disabled - OK<br /><p />\n"; + print "<li>Magic Quotes: Disabled - OK\n"; } else { - print "<li><b>Warning: Magic Quotes: ON (internal workaround used)</b><br /><p />\n"; + print "<li><b>Warning: Magic Quotes: ON (internal workaround used)</b>\n"; } } else { - print "<li><b>Unable to check for Magic Quotes. (missing function: get_magic_quotes_gpc())</b><br />\n"; + print "<li><b>Unable to check for Magic Quotes. (missing function: get_magic_quotes_gpc())</b>\n"; } -print "<p />\n"; - // // Check for config.inc.php // +$config_loaded = 0; if ($file_config == 1) { - print "- Depends on: presence config.inc.php - OK<br />\n"; + print "<li>Depends on: presence config.inc.php - OK\n"; + require_once('config.inc.php'); + $config_loaded = 1; } else { @@ -117,7 +119,6 @@ print "<pre>% cp config.inc.php.sample config.inc.php</pre>\n"; $error =+ 1; } -print "<p />\n"; // // Check if there is support for at least 1 database @@ -150,9 +151,8 @@ // if ($f_mysql_connect == 1) { - print "- Depends on: MySQL 3.23, 4.0 - OK<br />\n"; + print "<li>Depends on: MySQL 3.23, 4.0 - OK\n"; } -print "<p />\n"; // // MySQL 4.1 functions @@ -161,26 +161,45 @@ { if ($f_mysqli_connect == 1) { - print "- Depends on: MySQL 4.1 - OK (change the database_type in config.inc.php!!)<br />\n"; + print "<li>Depends on: MySQL 4.1 - OK\n"; + if ( !($config_loaded && $CONF['database_type'] == 'mysqli') ) { + print "(change the database_type to 'mysqli' in config.inc.php!!)\n"; + } } } -print "<p />\n"; // // PostgreSQL functions // if ($f_pg_connect == 1) { - print "- Depends on: PostgreSQL - OK (change the database_type in config.inc.php!!)<br />\n"; + print "<li>Depends on: PostgreSQL - OK \n"; + if ( !($config_loaded && $CONF['database_type'] == 'pgsql') ) { + print "(change the database_type to 'pgsql' in config.inc.php!!)\n"; + } } -print "<p />\n"; // +// Database connection +// +if ($config_loaded) { + list ($link, $error_text) = db_connect(TRUE); + if ($error_text == "") { + print "<li>Testing database connection - OK"; + } else { + print "<li><b>Error: Can't connect to database</b><br />\n"; + print "Please edit the \$CONF['database_*'] parameters in config.inc.php.\n"; + print "$error_text\n"; + $error ++; + } +} + +// // Session functions // if ($f_session_start == 1) { - print "- Depends on: session - OK<br />\n"; + print "<li>Depends on: session - OK\n"; } else { @@ -192,14 +211,13 @@ print "% portinstall php$phpversion-session</pre>\n"; $error =+ 1; } -print "<p />\n"; // // PCRE functions // if ($f_preg_match == 1) { - print "- Depends on: pcre - OK<br />\n"; + print "<li>Depends on: pcre - OK\n"; } else { @@ -211,15 +229,81 @@ print "% portinstall php$phpversion-pcre</pre>\n"; $error =+ 1; } -print "<p />\n"; -if ($error == 0) +print "</ul>"; + +if ($error != 0) { - print "Everything seems fine... you are ready to rock & roll!</br>\n"; + print "<p><b>Please fix the errors listed above.</b></p>"; +} +else +{ + print "<p>Everything seems fine... you are ready to rock & roll!</p>\n"; + + $pAdminCreate_admin_username_text = $PALANG['pAdminCreate_admin_username_text']; + $pAdminCreate_admin_password_text = ""; + $tUsername = ''; + $tMessage = ''; + + + if ($_SERVER['REQUEST_METHOD'] == "POST") + { + if (isset ($_POST['fUsername'])) $fUsername = escape_string ($_POST['fUsername']); + if (isset ($_POST['fPassword'])) $fPassword = escape_string ($_POST['fPassword']); + if (isset ($_POST['fPassword2'])) $fPassword2 = escape_string ($_POST['fPassword2']); + + list ($error, $tMessage, $pAdminCreate_admin_username_text, $pAdminCreate_admin_password_text) = create_admin($fUsername, $fPassword, $fPassword2, array('ALL'), TRUE); + if ($error != 0) { + if (isset ($_POST['fUsername'])) $tUsername = escape_string ($_POST['fUsername']); + } else { + print "<p><b>$tMessage</b></p>"; + echo "<p><b>You can now log in to Postfix Admin.</b></p>"; + } + } + + if ($_SERVER['REQUEST_METHOD'] == "GET" || $error != 0) + { + ?> + +<div id="edit_form"> +<form name="create_admin" method="post"> +<table> + <tr> + <td colspan="3"><h3>Create superadmin account</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 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> + + <?php + } + print "<b>Make sure you delete this setup.php file!</b><br />\n"; print "Also check the config.inc.php file for any settings that you might need to change!<br />\n"; print "Click here to go to the <a href=\"admin\">admin section</a> (make sure that your .htaccess is setup properly)\n"; } ?> +</div> </body> </html> Modified: trunk/stylesheet.css =================================================================== --- trunk/stylesheet.css 2007-10-05 08:58:36 UTC (rev 134) +++ trunk/stylesheet.css 2007-10-07 17:23:29 UTC (rev 135) @@ -21,10 +21,6 @@ color: #888888; } -ul { - padding-left: 0px; -} - table { // border-spacing: 0; // padding: 0; @@ -250,4 +246,13 @@ color: #777777; } +div.setup { + width:700px; + margin-left:auto; + margin-right:auto; + text-align: left; +} +div.setup li { + padding-bottom:1em; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2007-10-05 08:58:36
|
Revision: 134 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=134&view=rev Author: GingerDog Date: 2007-10-05 01:58:36 -0700 (Fri, 05 Oct 2007) Log Message: ----------- convert-passwd-to-postfixadmin.pl: initial attempt; wrote due to request by plip0 on irc Added Paths: ----------- trunk/ADDITIONS/convert-passwd-to-postfixadmin.pl Added: trunk/ADDITIONS/convert-passwd-to-postfixadmin.pl =================================================================== --- trunk/ADDITIONS/convert-passwd-to-postfixadmin.pl (rev 0) +++ trunk/ADDITIONS/convert-passwd-to-postfixadmin.pl 2007-10-05 08:58:36 UTC (rev 134) @@ -0,0 +1,41 @@ +#!/usr/bin/perl -w +# +# Postfix Admin +# +# LICENSE +# This source file is subject to the GPL license that is bundled with +# this package in the file LICENSE.TXT. +# +# Further details on the project are available at : +# http://www.postfixadmin.com or http://postfixadmin.sf.net +# +# @version $Id$ +# @license GNU GPL v2 or later. +# +# +# Really crude attempt at taking all users from a local +# passwd file (/etc/shadow) and creating postfixadmin mailboxes for them. +# +# The script outputs some SQL, which you need to then insert into your database +# as appropriate. +# +# Notes: +# 1) Change $mydomain and $true as required. +# 2) Ideally it should parse /etc/passwd, or call the getpw()? function and +# populate someone's name if known. +# 3) There's plenty of room for improvement. +# +# Original author: David Goodwin <david at palepurple-co-uk> - 2007/10/05. +# +use strict; + +open(FH, '</etc/shadow') or die ('Cannot open shadow file; you need to be root - ' . $!); +my $mydomain = "test.com"; +my $true = "t"; # t for pgsql; 1 for mysql +foreach(<FH>) { + my ($username, $password) = split(':', $_); + next if $password eq '!'; + next if $password eq '*'; + my $maildir = "$username\@$mydomain/"; + print "insert into mailbox (username, password, domain, active, maildir) values ('$username', '$password', '$mydomain', $true, '$maildir');\n"; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-05 00:05:33
|
Revision: 133 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=133&view=rev Author: christian_boltz Date: 2007-10-04 17:05:31 -0700 (Thu, 04 Oct 2007) Log Message: ----------- - fix: do not remove . and .. (thanks rschetterer!) - added support for domain subdir style layouts and lots of error checks (thanks abatie!) - added exit status check after archiving mailbox before calling rmtree - references: - https://sourceforge.net/tracker/index.php?func=detail&aid=1750088&group_id=191583&atid=937964 - http://www.rdrop.com/files/mailbox_remover.pl Modified Paths: -------------- trunk/ADDITIONS/mailbox_remover.pl Modified: trunk/ADDITIONS/mailbox_remover.pl =================================================================== --- trunk/ADDITIONS/mailbox_remover.pl 2007-10-04 14:58:38 UTC (rev 132) +++ trunk/ADDITIONS/mailbox_remover.pl 2007-10-05 00:05:31 UTC (rev 133) @@ -3,64 +3,122 @@ # by Petr Znojemsky (c) 2004 # Mailbox remover 0.1a 23/10/2004 - the very first version for MySQL # removes maildirs from disk when they are not found in a database -# Run program and read the $logfile before uncommenting the "rmtree" line! +# +# Added subdir support and pause --- Alan Batie 2007 +# Lists directories to be deleted then pauses for 5 seconds for chance to abort +# $Id: mbox_remover,v 1.4 2007/07/12 22:11:09 alan Exp alan $ +# # All your maildirs or other directories could be accidentally removed. # Use it at own risk. No warranties! +use strict; use DBI; use File::Path; ########## # Set these variables according to your configuration -$maildir_path="/var/mail/virtual/"; -$logfile="/var/log/mail/removed_maildirs"; +# when mailboxes are removed, save their tarballs here +my $archdir="/var/archive/mailboxes"; + +# expected to support z option, tweak invocation if you want different +my $archcmd="/usr/bin/tar"; + +# trailing slash not needed +my $maildir_path="/var/mail"; +# find out if we need to check subdirs for mailboxes or just maildir_path +# $CONF['domain_path'] = 'YES'; +my $pfadmin_config="/usr/local/www/postfixadmin/config.inc.php"; + # database information -$host="localhost"; -$port="3306"; -$userid="postfix"; -$passwd="postfix"; -$db="postfix"; +my $host="localhost"; +my $port="3306"; +my $userid="dbuser"; +my $passwd="dbpw"; +my $db="dbname"; ############ -$connectionInfo="DBI:mysql:database=$db;$host:$port"; +my $connectionInfo="DBI:mysql:database=$db;$host:$port"; # make connection to database -$dbh = DBI->connect($connectionInfo,$userid,$passwd); +my $dbh = DBI->connect($connectionInfo,$userid,$passwd); # prepare and execute query -$query = "SELECT username FROM mailbox"; -$sth = $dbh->prepare($query); +my $query = "SELECT maildir FROM mailbox"; +my $sth = $dbh->prepare($query); $sth->execute(); + # assign fields to variables -$sth->bind_columns(\$username); -# output computer list to the browser +my ($db_maildir, %db_maildirs); +$sth->bind_columns(\$db_maildir); + +# load up directory list while($sth->fetch()) { -push(@usernames, $username); + $db_maildirs{$db_maildir} = 1; } + $sth->finish(); # disconnect from database $dbh->disconnect; -# store maildir list to @directories -opendir(DIRHANDLE, $maildir_path) || die "Cannot open dir $maildir_path: $!"; -foreach $name (sort readdir(DIRHANDLE)) -{ - push (@directories, $name); +# +# find out if we need to check subdirs for mailboxes or just maildir_path +# $CONF['domain_path'] = 'YES'; +# +my $use_subdirs = 0; +open(CONFIG, "<$pfadmin_config") || die "Can't open '$pfadmin_config': $!\n"; +while(<CONFIG>) { + if (/\$CONF\['domain_path'\] *= *'([^']*)'/) { + $use_subdirs = ($1 =~ /yes/i); + } } -closedir(DIRHANDLE); -# eliminate "." and ".." from the maildir list -($dot, $doubledot, @directories) = @directories; +close(CONFIG); +# store maildir list to %directories +# key is path, value is username to use in archive file +my %directories; +opendir(DIR, $maildir_path) || die "Cannot open dir $maildir_path: $!\n"; +foreach my $name (readdir(DIR)) { + next if ($name eq '.' || $name eq '..' || ! -d "$maildir_path/$name"); + if ($use_subdirs) { + opendir(SUBDIR, "$maildir_path/$name") || die "Cannot open dir $maildir_path/$name: $!\n"; + foreach my $subname (readdir(SUBDIR)) { + next if ($subname eq '.' || $subname eq '..' || ! -d "$maildir_path/$name/$subname"); + # db entry has trailing slash... + if (!defined($db_maildirs{"$name/$subname/"})) { + print "marking $maildir_path/$name/$subname for deletion.\n"; + $directories{"$name/$subname"} = "$name-$subname"; + } + } + closedir(SUBDIR); + } else { + # db entry has trailing slash... + if (!defined($db_maildirs{"$name/"})) { + print "marking $maildir_path/$name for deletion.\n"; + $directories{"$name"} = $name; + } + } +} +closedir(DIR); + +print "Ctrl-C in 5 seconds to abort before removal starts...\n"; +sleep 5; + +my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); +# yyyymmddhhmm +my $tstamp = sprintf("%04d%02d%02d%02d%02d", $year+1900, $mon+1, $mday, $hour, $min); + # compare two arrays and erase maildirs not found in database -foreach $maildir (@directories) -{ - if ((grep { $_ eq $maildir} @usernames)==0) - { - # username not found, delete maildir. - # Please read $logfile before uncommenting following line! - # rmtree($maildir_path.$maildir); - open(INFO, ">>$logfile") || die "Cannot write to the logfile: $logfile."; - print INFO localtime()." Maildir ".$maildir_path.$maildir." has been deleted.\n"; - close(INFO); - } +chdir $maildir_path || die "Can't change to maildir '$maildir_path': $!\n";; +my @args; +foreach my $maildir (keys(%directories)) { + my $archive = "$archdir/$directories{$maildir}-$tstamp.tgz"; + # quick permissions check + open(TOUCH, ">$archive") || die "Can't create archive file $archive: $!\n"; + close(TOUCH); + print "Archiving $maildir\n"; + @args = ($archcmd, "cvzf", $archive, $maildir); + system(@args) == 0 or die "Creating archive for $maildir failed: $?" + + rmtree($maildir); + print localtime() . " $maildir has been deleted.\n"; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2007-10-04 14:58:34
|
Revision: 132 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=132&view=rev Author: GingerDog Date: 2007-10-04 07:58:38 -0700 (Thu, 04 Oct 2007) Log Message: ----------- languages/en.lang: pPasswordTooShort added Modified Paths: -------------- trunk/languages/en.lang Modified: trunk/languages/en.lang =================================================================== --- trunk/languages/en.lang 2007-10-04 14:58:11 UTC (rev 131) +++ trunk/languages/en.lang 2007-10-04 14:58:38 UTC (rev 132) @@ -352,4 +352,6 @@ $PALANG['pStatus_undeliverable'] = 'maybe UNDELIVERABLE '; $PALANG['pStatus_custom'] = 'Delivers to '; $PALANG['pStatus_popimap'] = 'POP/IMAP '; + +$PALANG['pPasswordTooShort'] = "Password is too short - requires %s characters"; ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2007-10-04 14:58:10
|
Revision: 131 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=131&view=rev Author: GingerDog Date: 2007-10-04 07:58:11 -0700 (Thu, 04 Oct 2007) Log Message: ----------- try and stop ff from autocompleting the field; put the encrypted password in the field... Modified Paths: -------------- trunk/templates/admin_edit-admin.tpl Modified: trunk/templates/admin_edit-admin.tpl =================================================================== --- trunk/templates/admin_edit-admin.tpl 2007-10-04 14:57:39 UTC (rev 130) +++ trunk/templates/admin_edit-admin.tpl 2007-10-04 14:58:11 UTC (rev 131) @@ -10,7 +10,7 @@ </tr> <tr> <td><?php print $PALANG['pAdminEdit_admin_password'] . ":"; ?></td> - <td><input class="flat" type="password" name="fPassword" value="<?= $fPassword; ?>"/></td> + <td><input class="flat" type="password" autocomplete="off" name="fPassword" value="<?php echo $tPassword; ?>"/></td> <td><?php print $pAdminEdit_admin_password_text; ?></td> </tr> <tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2007-10-04 14:57:35
|
Revision: 130 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=130&view=rev Author: GingerDog Date: 2007-10-04 07:57:39 -0700 (Thu, 04 Oct 2007) Log Message: ----------- common.php: ensure $CONF["configured"] is not false Modified Paths: -------------- trunk/common.php Modified: trunk/common.php =================================================================== --- trunk/common.php 2007-10-04 14:57:04 UTC (rev 129) +++ trunk/common.php 2007-10-04 14:57:39 UTC (rev 130) @@ -26,6 +26,12 @@ header("Location: setup.php"); exit(0); } +if(isset($CONF['configured'])) { + if($CONF['configured'] == FALSE) { + headeR("Location: setup.php"); + exit(0); + } +} require_once("$incpath/config.inc.php"); require_once("$incpath/functions.inc.php"); require_once("$incpath/languages/" . check_language () . ".lang"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2007-10-04 14:57:05
|
Revision: 129 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=129&view=rev Author: GingerDog Date: 2007-10-04 07:57:04 -0700 (Thu, 04 Oct 2007) Log Message: ----------- edit-admin.php: i think this fixes the outstanding problems, but I get horrible problems if firefox is allowed to remember passwords etc - is there a good way of disabling this behaviour beyond autocomplete="off" ? Modified Paths: -------------- trunk/admin/edit-admin.php Modified: trunk/admin/edit-admin.php =================================================================== --- trunk/admin/edit-admin.php 2007-10-04 13:53:45 UTC (rev 128) +++ trunk/admin/edit-admin.php 2007-10-04 14:57:04 UTC (rev 129) @@ -37,103 +37,115 @@ authentication_require_role('global-admin'); +$error = 1; +if(isset($_GET['username'])) { + $username = escape_string ($_GET['username']); + $result = db_query("SELECT * FROM $table_admin WHERE username = '$username'"); + if($result['rows'] == 1) { + $admin_details = db_array($result['result']); + $error = 0; + } +} +if($error == 1){ + flash_error($PALANG['pAdminEdit_admin_result_error']); + header("Location: list-admin.php"); + exit(0); +} +// we aren't ensuring the password is longer than x characters, should we? if ($_SERVER['REQUEST_METHOD'] == "POST") { - $fPassword = ''; - $fPassword2 = ''; - if(isset ($_GET['username'])) $username = escape_string ($_GET['username']); + $fPassword = ''; + $fPassword2 = ''; + if(isset ($_POST['fPassword'])) $fPassword = escape_string ($_POST['fPassword']); + if(isset ($_POST['fPassword2'])) $fPassword2 = escape_string ($_POST['fPassword2']); - if(isset ($_POST['fPassword'])) $fPassword = escape_string ($_POST['fPassword']); - if(isset ($_POST['fPassword2'])) $fPassword2 = escape_string ($_POST['fPassword2']); - if ($fPassword != $fPassword2) - { - $error = 1; - $pAdminEdit_admin_password_text = $PALANG['pAdminEdit_admin_password_text_error']; - } + $fActive=(isset($_POST['fActive'])) ? escape_string ($_POST['fActive']) : FALSE; + $fSadmin=(isset($_POST['fSadmin'])) ? escape_string ($_POST['fSadmin']) : FALSE; - $fActive=(isset($_POST['fActive'])) ? escape_string ($_POST['fActive']) : FALSE; - $fSadmin=(isset($_POST['fSadmin'])) ? escape_string ($_POST['fSadmin']) : FALSE; + $fDomains = false; + if (isset ($_POST['fDomains'])) $fDomains = $_POST['fDomains']; - $fDomains = false; - if (isset ($_POST['fDomains'])) $fDomains = $_POST['fDomains']; + $tAllDomains = list_domains (); - $tAllDomains = list_domains (); + // has the password changed? + $originalPassword = $admin_details['password']; + if($fPassword != $originalPassword) { + // if it has, ensure both fields are the same... + if ($fPassword == $fPassword2) + { + if(strlen($fPassword) >= $CONF['min_password_length']) { + $fPassword = pacrypt($fPassword); + } + else { + $error = 1; + flash_error(sprintf($PALANG['pPasswordTooShort'], $CONF['min_password_length'])); + } + } + else { + $error = 1; + $pAdminEdit_admin_password_text = $PALANG['pAdminEdit_admin_password_text_error']; + } + } - $result = db_query("SELECT * FROM $table_admin WHERE username = '$username'"); - if($result['rows'] != 1) { - die("Invalid username for admin user"); - } - $admin_details = db_array($result['result']); - $originalPassword = $admin_details['password']; - // has the password changed? - if($fPassword != $originalPassword) { - if(!empty($_POST['fPassword2'])) { - $fPassword = pacrypt($fPassword); - } - } + $fDomains = array(); + if (array_key_exists('fDomains', $_POST)) $fDomains = escape_string ($_POST['fDomains']); + if ($error != 1) + { + if ($fActive == "on") { + $sqlActive = db_get_boolean(True); + } + else { + $sqlActive = db_get_boolean(False); + } - $tActive = $fActive; - $fDomains = array(); - if (array_key_exists('fDomains', $_POST)) $tDomains = escape_string ($_POST['fDomains']); - if ($error != 1) - { - if ($fActive == "on") { - $sqlActive = db_get_boolean(True); - } - else { - $sqlActive = db_get_boolean(False); - } + $result = db_query ("UPDATE $table_admin SET modified=NOW(),active='$sqlActive',password='$fPassword' WHERE username='$username'"); - $password_query = ''; - if ($fPassword != '') { # do not change password to empty one - $password_query = ", password='$fPassword'"; - } - $result = db_query ("UPDATE $table_admin SET modified=NOW(),active='$sqlActive' $password_query WHERE username='$username'"); + if ($fSadmin == "on") $fSadmin = 'ALL'; - if ($fSadmin == "on") $fSadmin = 'ALL'; + // delete everything, and put it back later on.. + db_query("DELETE FROM $table_domain_admins WHERE username = '$username'"); + if($fSadmin == 'ALL') { + $fDomains = array('ALL'); + } - // delete everything, and put it back later on.. - db_query("DELETE FROM $table_domain_admins WHERE username = '$username'"); - if($fSadmin == 'ALL') { - $fDomains = array('ALL'); - } - - foreach($fDomains as $domain) - { - $result = db_query ("INSERT INTO $table_domain_admins (username,domain,created) VALUES ('$username','$domain',NOW())"); - } - flash_info($PALANG['pAdminEdit_admin_result_success']); - } - else { - flash_error($PALANG['pAdminEdit_admin_result_error']); - } - header("Location: list-admin.php"); + foreach($fDomains as $domain) + { + $result = db_query ("INSERT INTO $table_domain_admins (username,domain,created) VALUES ('$username','$domain',NOW())"); + } + flash_info($PALANG['pAdminEdit_admin_result_success']); + header("Location: list-admin.php"); + exit(0); + } + else { + flash_error($PALANG['pAdminEdit_admin_result_error']); + } } -else { // GET request. - if (isset($_GET['username'])) $username = escape_string ($_GET['username']); +if (isset($_GET['username'])) $username = escape_string ($_GET['username']); - # TODO: read "active" state from database and tick on the checkbox for active admins +$tAllDomains = list_domains(); +$tDomains = list_domains_for_admin ($username); +$tActive = ''; +$tPassword = $admin_details['password']; - $tAllDomains = list_domains(); - $tDomains = list_domains_for_admin ($username); +if($admin_details['active'] == 't' || $admin_details['active'] == 1) { + $tActive = $admin_details['active']; +} +$tSadmin = '0'; +$result = db_query ("SELECT * FROM $table_domain_admins WHERE username='$username'"); +// could/should be multiple matches to query; +if ($result['rows'] >= 1) { + $result = $result['result']; + while($row = db_array($result)) { + if ($row['domain'] == 'ALL') { + $tSadmin = '1'; + $tDomains = array(); /* empty the list, they're an admin */ + } + } +} - $tSadmin = '0'; - $result = db_query ("SELECT * FROM $table_domain_admins WHERE username='$username'"); - // could/should be multiple matches to query; - if ($result['rows'] >= 1) { - $result = $result['result']; - while($row = db_array($result)) { - if ($row['domain'] == 'ALL') { - $tSadmin = '1'; - $tDomains = array(); /* empty the list, they're an admin */ - } - } - } - - include ("../templates/header.tpl"); - include ("../templates/admin_menu.tpl"); - include ("../templates/admin_edit-admin.tpl"); - include ("../templates/footer.tpl"); -} +include ("../templates/header.tpl"); +include ("../templates/admin_menu.tpl"); +include ("../templates/admin_edit-admin.tpl"); +include ("../templates/footer.tpl"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2007-10-04 13:53:43
|
Revision: 128 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=128&view=rev Author: GingerDog Date: 2007-10-04 06:53:45 -0700 (Thu, 04 Oct 2007) Log Message: ----------- config.inc.php: renamed from config.inc.php.sample; added variable that needs disabling for site to work Added Paths: ----------- trunk/config.inc.php Removed Paths: ------------- trunk/config.inc.php.sample Copied: trunk/config.inc.php (from rev 127, trunk/config.inc.php.sample) =================================================================== --- trunk/config.inc.php (rev 0) +++ trunk/config.inc.php 2007-10-04 13:53:45 UTC (rev 128) @@ -0,0 +1,305 @@ +<?php +/** + * Postfix Admin + * + * LICENSE + * This source file is subject to the GPL license that is bundled with + * this package in the file LICENSE.TXT. + * + * Further details on the project are available at : + * http://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: config.inc.php + * Contains configuration options. + */ + +if (ereg ("config.inc.php", $_SERVER['PHP_SELF'])) +{ + header ("Location: login.php"); + exit; +} + +/***************************************************************** + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + * The following line needs commenting out or removing before the + * application will run! + * Doing this implies you have changed this file as required. + */ +$CONF['configured'] = false; + + +// Postfix Admin Path +// Set the location of your Postfix Admin installation here. +// You must enter complete url (http://domain.tld/) and full path (/var/www/postfixadmin) +$CONF['postfix_admin_url'] = ''; +$CONF['postfix_admin_path'] = dirname(__FILE__); + +// Language config +// Language files are located in './languages'. +$CONF['default_language'] = 'en'; + +// Database Config +// mysql = MySQL 3.23 and 4.0 +// mysqli = MySQL 4.1 +// pgsql = PostgreSQL +$CONF['database_type'] = 'mysql'; +$CONF['database_host'] = 'localhost'; +$CONF['database_user'] = 'postfixadmin'; +$CONF['database_password'] = 'postfixadmin'; +$CONF['database_name'] = 'postfix'; +$CONF['database_prefix'] = ''; + +// Here, if you need, you can customize table names. +$CONF['database_prefix'] = ''; +$CONF['database_tables'] = array ( + 'admin' => 'admin', + 'alias' => 'alias', + 'domain' => 'domain', + 'domain_admins' => 'domain_admins', + 'log' => 'log', + 'mailbox' => 'mailbox', + 'vacation' => 'vacation', + 'vacation_notification' => 'vacation_notification', +); + +// Site Admin +// Define the Site Admins email address below. +// This will be used to send emails from to create mailboxes. +$CONF['admin_email'] = 'pos...@ch...d'; + +// Mail Server +// Hostname (FQDN) of your mail server. +// This is used to send email to Postfix in order to create mailboxes. +$CONF['smtp_server'] = 'localhost'; +$CONF['smtp_port'] = '25'; + +// Encrypt +// In what way do you want the passwords to be crypted? +// md5crypt = internal postfix admin md5 +// system = whatever you have set as your PHP system default +// cleartext = clear text passwords (ouch!) +$CONF['encrypt'] = 'md5crypt'; + +// Minimum length required for passwords. Postfixadmin will not +// allow users to set passwords which are shorter than this value. +$CONF['min_password_length'] = 5; + +// Generate Password +// Generate a random password for a mailbox or admin and display it. +// If you want to automagically generate paswords set this to 'YES'. +$CONF['generate_password'] = 'NO'; + +// Show Password +// Always show password after adding a mailbox or admin. +// If you want to always see what password was set set this to 'YES'. +$CONF['show_password'] = 'NO'; + +// Page Size +// Set the number of entries that you would like to see +// in one page. +$CONF['page_size'] = '10'; + +// Default Aliases +// The default aliases that need to be created for all domains. +$CONF['default_aliases'] = array ( + 'abuse' => 'ab...@ch...d', + 'hostmaster' => 'hos...@ch...d', + 'postmaster' => 'pos...@ch...d', + 'webmaster' => 'web...@ch...d' +); + +// Mailboxes +// If you want to store the mailboxes per domain set this to 'YES'. +// Example: /usr/local/virtual/domain.tld/use...@do...d +$CONF['domain_path'] = 'NO'; +// If you don't want to have the domain in your mailbox set this to 'NO'. +// Example: /usr/local/virtual/domain.tld/username +$CONF['domain_in_mailbox'] = 'YES'; + +// Default Domain Values +// Specify your default values below. Quota in MB. +$CONF['aliases'] = '10'; +$CONF['mailboxes'] = '10'; +$CONF['maxquota'] = '10'; + +// Quota +// When you want to enforce quota for your mailbox users set this to 'YES'. +$CONF['quota'] = 'NO'; +// You can either use '1024000' or '1048576' +$CONF['quota_multiplier'] = '1024000'; + +// Transport +// If you want to define additional transport options for a domain set this to 'YES'. +// Read the transport file of the Postfix documentation. +$CONF['transport'] = 'NO'; +// Transport options +// If you want to define additional transport options put them in array below. +$CONF['transport_options'] = array ( + 'virtual', // for virtual accounts + 'local', // for system accounts + 'relay' // for backup mx +); +// Transport default +// You should define default transport. It must be in array above. +$CONF['transport_default'] = 'virtual'; + +// Virtual Vacation +// If you want to use virtual vacation for you mailbox users set this to 'YES'. +// NOTE: Make sure that you install the vacation module. http://high5.net/postfixadmin/ +$CONF['vacation'] = 'NO'; +// This is the autoreply domain that you will need to set in your Postfix +// transport maps to handle virtual vacations. It does not need to be a +// real domain (i.e. you don't need to setup DNS for it). +$CONF['vacation_domain'] = 'autoreply.change-this-to-your.domain.tld'; + +// Vacation Control +// If you want users to take control of vacation set this to 'YES'. +// TODO: not implemented +$CONF['vacation_control'] ='YES'; + +// Vacation Control for admins +// Set to 'YES' if your domain admins should be able to edit user vacation. +$CONF['vacation_control_admin'] = 'YES'; + +// Alias Control +// Postfix Admin inserts an alias in the alias table for every mailbox it creates. +// The reason for this is that when you want catch-all and normal mailboxes +// to work you need to have the mailbox replicated in the alias table. +// If you want to take control of these aliases as well set this to 'YES'. +$CONF['alias_control'] = 'NO'; + +// Alias Control for admins +// Set to 'NO' if your domain admins shouldn't be able to edit user aliases. +$CONF['alias_control_admin'] = 'NO'; + +// Special Alias Control +// Set to 'NO' if your domain admins shouldn't be able to edit default aliases. +$CONF['special_alias_control'] = 'NO'; + +// Alias Goto Field Limit +// Set the max number of entries that you would like to see +// in one 'goto' field in overview, the rest will be hidden and "[and X more...]" will be added. +// '0' means no limits. +$CONF['alias_goto_limit'] = '0'; + +// Backup +// If you don't want backup tab set this to 'NO'; +$CONF['backup'] = 'YES'; + +// Send Mail +// If you don't want sendmail tab set this to 'NO'; +$CONF['sendmail'] = 'YES'; + +// Logging +// If you don't want logging set this to 'NO'; +$CONF['logging'] = 'YES'; + +// Header +$CONF['show_header_text'] = 'NO'; +$CONF['header_text'] = ':: Postfix Admin ::'; + +// link to display under 'Main' menu when logged in as a user. +$CONF['user_footer_link'] = "http://change-this-to-your.domain.tld/main"; + +// Footer +// Below information will be on all pages. +// If you don't want the footer information to appear set this to 'NO'. +$CONF['show_footer_text'] = 'YES'; +$CONF['footer_text'] = 'Return to change-this-to-your.domain.tld'; +$CONF['footer_link'] = 'http://change-this-to-your.domain.tld'; + +// Welcome Message +// This message is send to every newly created mailbox. +// Change the text between EOM. +$CONF['welcome_text'] = <<<EOM +Hi, + +Welcome to your new account. +EOM; + +// When creating mailboxes, check that the domain-part of the +// address is legal by performing a name server look-up. +$CONF['emailcheck_resolve_domain']='YES'; + + +// Optional: +// Analyze alias gotos and display a colored block in the first column +// indicating if an alias or mailbox appears to deliver to a non-existent +// account. Also, display indications, for POP/IMAP mailboxes and +// for custom destinations (such as mailboxes that forward to a UNIX shell +// account or mail that is sent to a MS exchange server, or any other +// domain or subdomain you use) +// See http://www.w3schools.com/html/html_colornames.asp for a list of +// color names available on most browsers + +//set to YES to enable this feature +$CONF['show_status']='NO'; +//display a guide to what these colors mean +$CONF['show_status_key']='NO'; +// 'show_status_text' will be displayed with the background colors +// associated with each status, you can customize it here +$CONF['show_status_text']=' '; +// show_undeliverable is useful if most accounts are delivered to this +// postfix system. If many aliases and mailboxes are forwarded +// elsewhere, you will probably want to disable this. +$CONF['show_undeliverable']='NO'; +$CONF['show_undeliverable_color']='tomato'; +$CONF['show_undeliverable_exceptions']=array("unixmail.domain.ext","exchangeserver.domain.ext","gmail.com"); +$CONF['show_popimap']='NO'; +$CONF['show_popimap_color']='darkgrey'; +// set 'show_custom_count' to 0 to disable custom indicators +$CONF['show_custom_count']=2; +$CONF['show_custom_domains']=array("subdomain.domain.ext","domain2.ext"); +$CONF['show_custom_colors']=array("lightgreen","lightblue"); + + +// Optional: +// Script to run after creation of mailboxes. +// Note that this may fail if PHP is run in "safe mode", or if +// operating system features (such as SELinux) or limitations +// prevent the web-server from executing external scripts. +// $CONF['mailbox_postcreation_script']='sudo -u courier /usr/local/bin/postfixadmin-mailbox-postcreation.sh'; + +// Optional: +// Script to run after deletion of mailboxes. +// Note that this may fail if PHP is run in "safe mode", or if +// operating system features (such as SELinux) or limitations +// prevent the web-server from executing external scripts. +// $CONF['mailbox_postdeletion_script']='sudo -u courier /usr/local/bin/postfixadmin-mailbox-postdeletion.sh'; + +// Optional: +// Script to run after deletion of domains. +// Note that this may fail if PHP is run in "safe mode", or if +// operating system features (such as SELinux) or limitations +// prevent the web-server from executing external scripts. +// $CONF['domain_postdeletion_script']='sudo -u courier /usr/local/bin/postfixadmin-domain-postdeletion.sh'; + +// Optional: +// Sub-folders which should automatically be created for new users. +// The sub-folders will also be subscribed to automatically. +// Will only work with IMAP server which implement sub-folders. +// Will not work with POP3. +// If you define create_mailbox_subdirs, then the +// create_mailbox_subdirs_host must also be defined. +// +// $CONF['create_mailbox_subdirs']=array('Spam'); +// $CONF['create_mailbox_subdirs_host']='localhost'; +// +// Normally, the TCP port number does not have to be specified. +// $CONF['create_mailbox_subdirs_hostport']=143; +// +// If you have trouble connecting to the IMAP-server, then specify +// a value for $CONF['create_mailbox_subdirs_hostoptions']. These +// are some examples to experiment with: +// $CONF['create_mailbox_subdirs_hostoptions']=array('notls'); +// $CONF['create_mailbox_subdirs_hostoptions']=array('novalidate-cert','norsh'); +// See also the "Optional flags for names" table at +// http://www.php.net/manual/en/function.imap-open.php + +// +// END OF CONFIG FILE +// +?> Deleted: trunk/config.inc.php.sample =================================================================== --- trunk/config.inc.php.sample 2007-10-04 07:34:10 UTC (rev 127) +++ trunk/config.inc.php.sample 2007-10-04 13:53:45 UTC (rev 128) @@ -1,292 +0,0 @@ -<?php -/** - * Postfix Admin - * - * LICENSE - * This source file is subject to the GPL license that is bundled with - * this package in the file LICENSE.TXT. - * - * Further details on the project are available at : - * http://www.postfixadmin.com or http://postfixadmin.sf.net - * - * @version $Id$ - * @license GNU GPL v2 or later. - * - * File: config.inc.php - * Contains configuration options. - */ - -if (ereg ("config.inc.php", $_SERVER['PHP_SELF'])) -{ - header ("Location: login.php"); - exit; -} - -// Postfix Admin Path -// Set the location of your Postfix Admin installation here. -// You must enter complete url (http://domain.tld/) and full path (/var/www/postfixadmin) -$CONF['postfix_admin_url'] = ''; -$CONF['postfix_admin_path'] = dirname(__FILE__); - -// Language config -// Language files are located in './languages'. -$CONF['default_language'] = 'en'; - -// Database Config -// mysql = MySQL 3.23 and 4.0 -// mysqli = MySQL 4.1 -// pgsql = PostgreSQL -$CONF['database_type'] = 'mysql'; -$CONF['database_host'] = 'localhost'; -$CONF['database_user'] = 'postfixadmin'; -$CONF['database_password'] = 'postfixadmin'; -$CONF['database_name'] = 'postfix'; -$CONF['database_prefix'] = ''; - -// Here, if you need, you can customize table names. -$CONF['database_prefix'] = ''; -$CONF['database_tables'] = array ( - 'admin' => 'admin', - 'alias' => 'alias', - 'domain' => 'domain', - 'domain_admins' => 'domain_admins', - 'log' => 'log', - 'mailbox' => 'mailbox', - 'vacation' => 'vacation', - 'vacation_notification' => 'vacation_notification', -); - -// Site Admin -// Define the Site Admins email address below. -// This will be used to send emails from to create mailboxes. -$CONF['admin_email'] = 'pos...@ch...d'; - -// Mail Server -// Hostname (FQDN) of your mail server. -// This is used to send email to Postfix in order to create mailboxes. -$CONF['smtp_server'] = 'localhost'; -$CONF['smtp_port'] = '25'; - -// Encrypt -// In what way do you want the passwords to be crypted? -// md5crypt = internal postfix admin md5 -// system = whatever you have set as your PHP system default -// cleartext = clear text passwords (ouch!) -$CONF['encrypt'] = 'md5crypt'; - -// Generate Password -// Generate a random password for a mailbox or admin and display it. -// If you want to automagically generate paswords set this to 'YES'. -$CONF['generate_password'] = 'NO'; - -// Show Password -// Always show password after adding a mailbox or admin. -// If you want to always see what password was set set this to 'YES'. -$CONF['show_password'] = 'NO'; - -// Page Size -// Set the number of entries that you would like to see -// in one page. -$CONF['page_size'] = '10'; - -// Default Aliases -// The default aliases that need to be created for all domains. -$CONF['default_aliases'] = array ( - 'abuse' => 'ab...@ch...d', - 'hostmaster' => 'hos...@ch...d', - 'postmaster' => 'pos...@ch...d', - 'webmaster' => 'web...@ch...d' -); - -// Mailboxes -// If you want to store the mailboxes per domain set this to 'YES'. -// Example: /usr/local/virtual/domain.tld/use...@do...d -$CONF['domain_path'] = 'NO'; -// If you don't want to have the domain in your mailbox set this to 'NO'. -// Example: /usr/local/virtual/domain.tld/username -$CONF['domain_in_mailbox'] = 'YES'; - -// Default Domain Values -// Specify your default values below. Quota in MB. -$CONF['aliases'] = '10'; -$CONF['mailboxes'] = '10'; -$CONF['maxquota'] = '10'; - -// Quota -// When you want to enforce quota for your mailbox users set this to 'YES'. -$CONF['quota'] = 'NO'; -// You can either use '1024000' or '1048576' -$CONF['quota_multiplier'] = '1024000'; - -// Transport -// If you want to define additional transport options for a domain set this to 'YES'. -// Read the transport file of the Postfix documentation. -$CONF['transport'] = 'NO'; -// Transport options -// If you want to define additional transport options put them in array below. -$CONF['transport_options'] = array ( - 'virtual', // for virtual accounts - 'local', // for system accounts - 'relay' // for backup mx -); -// Transport default -// You should define default transport. It must be in array above. -$CONF['transport_default'] = 'virtual'; - -// Virtual Vacation -// If you want to use virtual vacation for you mailbox users set this to 'YES'. -// NOTE: Make sure that you install the vacation module. http://high5.net/postfixadmin/ -$CONF['vacation'] = 'NO'; -// This is the autoreply domain that you will need to set in your Postfix -// transport maps to handle virtual vacations. It does not need to be a -// real domain (i.e. you don't need to setup DNS for it). -$CONF['vacation_domain'] = 'autoreply.change-this-to-your.domain.tld'; - -// Vacation Control -// If you want users to take control of vacation set this to 'YES'. -// TODO: not implemented -$CONF['vacation_control'] ='YES'; - -// Vacation Control for admins -// Set to 'YES' if your domain admins should be able to edit user vacation. -$CONF['vacation_control_admin'] = 'YES'; - -// Alias Control -// Postfix Admin inserts an alias in the alias table for every mailbox it creates. -// The reason for this is that when you want catch-all and normal mailboxes -// to work you need to have the mailbox replicated in the alias table. -// If you want to take control of these aliases as well set this to 'YES'. -$CONF['alias_control'] = 'NO'; - -// Alias Control for admins -// Set to 'NO' if your domain admins shouldn't be able to edit user aliases. -$CONF['alias_control_admin'] = 'NO'; - -// Special Alias Control -// Set to 'NO' if your domain admins shouldn't be able to edit default aliases. -$CONF['special_alias_control'] = 'NO'; - -// Alias Goto Field Limit -// Set the max number of entries that you would like to see -// in one 'goto' field in overview, the rest will be hidden and "[and X more...]" will be added. -// '0' means no limits. -$CONF['alias_goto_limit'] = '0'; - -// Backup -// If you don't want backup tab set this to 'NO'; -$CONF['backup'] = 'YES'; - -// Send Mail -// If you don't want sendmail tab set this to 'NO'; -$CONF['sendmail'] = 'YES'; - -// Logging -// If you don't want logging set this to 'NO'; -$CONF['logging'] = 'YES'; - -// Header -$CONF['show_header_text'] = 'NO'; -$CONF['header_text'] = ':: Postfix Admin ::'; - -// link to display under 'Main' menu when logged in as a user. -$CONF['user_footer_link'] = "http://change-this-to-your.domain.tld/main"; - -// Footer -// Below information will be on all pages. -// If you don't want the footer information to appear set this to 'NO'. -$CONF['show_footer_text'] = 'YES'; -$CONF['footer_text'] = 'Return to change-this-to-your.domain.tld'; -$CONF['footer_link'] = 'http://change-this-to-your.domain.tld'; - -// Welcome Message -// This message is send to every newly created mailbox. -// Change the text between EOM. -$CONF['welcome_text'] = <<<EOM -Hi, - -Welcome to your new account. -EOM; - -// When creating mailboxes, check that the domain-part of the -// address is legal by performing a name server look-up. -$CONF['emailcheck_resolve_domain']='YES'; - - -// Optional: -// Analyze alias gotos and display a colored block in the first column -// indicating if an alias or mailbox appears to deliver to a non-existent -// account. Also, display indications, for POP/IMAP mailboxes and -// for custom destinations (such as mailboxes that forward to a UNIX shell -// account or mail that is sent to a MS exchange server, or any other -// domain or subdomain you use) -// See http://www.w3schools.com/html/html_colornames.asp for a list of -// color names available on most browsers - -//set to YES to enable this feature -$CONF['show_status']='NO'; -//display a guide to what these colors mean -$CONF['show_status_key']='NO'; -// 'show_status_text' will be displayed with the background colors -// associated with each status, you can customize it here -$CONF['show_status_text']=' '; -// show_undeliverable is useful if most accounts are delivered to this -// postfix system. If many aliases and mailboxes are forwarded -// elsewhere, you will probably want to disable this. -$CONF['show_undeliverable']='NO'; -$CONF['show_undeliverable_color']='tomato'; -$CONF['show_undeliverable_exceptions']=array("unixmail.domain.ext","exchangeserver.domain.ext","gmail.com"); -$CONF['show_popimap']='NO'; -$CONF['show_popimap_color']='darkgrey'; -// set 'show_custom_count' to 0 to disable custom indicators -$CONF['show_custom_count']=2; -$CONF['show_custom_domains']=array("subdomain.domain.ext","domain2.ext"); -$CONF['show_custom_colors']=array("lightgreen","lightblue"); - - -// Optional: -// Script to run after creation of mailboxes. -// Note that this may fail if PHP is run in "safe mode", or if -// operating system features (such as SELinux) or limitations -// prevent the web-server from executing external scripts. -// $CONF['mailbox_postcreation_script']='sudo -u courier /usr/local/bin/postfixadmin-mailbox-postcreation.sh'; - -// Optional: -// Script to run after deletion of mailboxes. -// Note that this may fail if PHP is run in "safe mode", or if -// operating system features (such as SELinux) or limitations -// prevent the web-server from executing external scripts. -// $CONF['mailbox_postdeletion_script']='sudo -u courier /usr/local/bin/postfixadmin-mailbox-postdeletion.sh'; - -// Optional: -// Script to run after deletion of domains. -// Note that this may fail if PHP is run in "safe mode", or if -// operating system features (such as SELinux) or limitations -// prevent the web-server from executing external scripts. -// $CONF['domain_postdeletion_script']='sudo -u courier /usr/local/bin/postfixadmin-domain-postdeletion.sh'; - -// Optional: -// Sub-folders which should automatically be created for new users. -// The sub-folders will also be subscribed to automatically. -// Will only work with IMAP server which implement sub-folders. -// Will not work with POP3. -// If you define create_mailbox_subdirs, then the -// create_mailbox_subdirs_host must also be defined. -// -// $CONF['create_mailbox_subdirs']=array('Spam'); -// $CONF['create_mailbox_subdirs_host']='localhost'; -// -// Normally, the TCP port number does not have to be specified. -// $CONF['create_mailbox_subdirs_hostport']=143; -// -// If you have trouble connecting to the IMAP-server, then specify -// a value for $CONF['create_mailbox_subdirs_hostoptions']. These -// are some examples to experiment with: -// $CONF['create_mailbox_subdirs_hostoptions']=array('notls'); -// $CONF['create_mailbox_subdirs_hostoptions']=array('novalidate-cert','norsh'); -// See also the "Optional flags for names" table at -// http://www.php.net/manual/en/function.imap-open.php - -// -// END OF CONFIG FILE -// -?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2007-10-04 07:34:07
|
Revision: 127 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=127&view=rev Author: GingerDog Date: 2007-10-04 00:34:10 -0700 (Thu, 04 Oct 2007) Log Message: ----------- vacation.pl: patch from kope (via forum post at http://sourceforge.net/forum/forum.php?thread_id=1837942&forum_id=676076) - Thankyou Modified Paths: -------------- trunk/VIRTUAL_VACATION/vacation.pl Modified: trunk/VIRTUAL_VACATION/vacation.pl =================================================================== --- trunk/VIRTUAL_VACATION/vacation.pl 2007-10-04 00:01:07 UTC (rev 126) +++ trunk/VIRTUAL_VACATION/vacation.pl 2007-10-04 07:34:10 UTC (rev 127) @@ -315,13 +315,15 @@ # Take headers apart while (<STDIN>) { last if (/^$/); - if (/^\s+(.*)/ and $lastheader) { $$lastheader .= " $1"; } - if (/^from:\s+(.*)\n$/i) { $from = $1; $lastheader = \$from; } - if (/^to:\s+(.*)\n$/i) { $to = $1; $lastheader = \$to; } - if (/^cc:\s+(.*)\n$/i) { $cc = $1; $lastheader = \$cc; } - if (/^message-id:\s+(.*)\n$/i) { $messageid = $1; $lastheader = \$messageid; } - if (/^precedence:\s+(bulk|list|junk)/i) { exit (0); } - if (/^x-loop:\s+postfix\ admin\ virtual\ vacation/i) { exit (0); } + if (/^\s+(.*)/ and $lastheader) { $$lastheader .= " $1"; } + elsif (/^from:\s+(.*)\n$/i) { $from = $1; $lastheader = \$from; } + elsif (/^to:\s+(.*)\n$/i) { $to = $1; $lastheader = \$to; } + elsif (/^cc:\s+(.*)\n$/i) { $cc = $1; $lastheader = \$cc; } + elsif (/^subject:\s+(.*)\n$/i) { $subject = $1; $lastheader = \$subject; } + elsif (/^message-id:\s+(.*)\n$/i) { $messageid = $1; $lastheader = \$messageid; } + elsif (/^precedence:\s+(bulk|list|junk)/i) { exit (0); } + elsif (/^x-loop:\s+postfix\ admin\ virtual\ vacation/i) { exit (0); } + else {$lastheader = "" ; } } # If either From: or To: are not set, exit This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-04 00:01:17
|
Revision: 126 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=126&view=rev Author: christian_boltz Date: 2007-10-03 17:01:07 -0700 (Wed, 03 Oct 2007) Log Message: ----------- - merge admin/search.php into search.php - merge GET and POST code - admin/search.php still has the old code commented out @pgsql users: please test the search - I can't promise that everything works. There are several TODOs / open questions regarding pgsql in search.php currently... Modified Paths: -------------- trunk/admin/search.php trunk/search.php Modified: trunk/admin/search.php =================================================================== --- trunk/admin/search.php 2007-10-03 22:55:01 UTC (rev 125) +++ trunk/admin/search.php 2007-10-04 00:01:07 UTC (rev 126) @@ -30,6 +30,9 @@ require_once('../common.php'); +require_once('../search.php'); + +/* authentication_require_role('global-admin'); $tAlias = array(); @@ -97,7 +100,7 @@ include ("../templates/header.tpl"); include ("../templates/admin_menu.tpl"); - include ("../templates/admin_search.tpl"); + include ("../templates/search.tpl"); include ("../templates/footer.tpl"); } @@ -169,8 +172,9 @@ include ("../templates/header.tpl"); include ("../templates/admin_menu.tpl"); - include ("../templates/admin_search.tpl"); + include ("../templates/search.tpl"); include ("../templates/footer.tpl"); } +*/ /* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */ ?> Modified: trunk/search.php =================================================================== --- trunk/search.php 2007-10-03 22:55:01 UTC (rev 125) +++ trunk/search.php 2007-10-04 00:01:07 UTC (rev 126) @@ -46,63 +46,8 @@ if ($_SERVER['REQUEST_METHOD'] == "GET") { if (isset ($_GET['search'])) $fSearch = escape_string ($_GET['search']); - - if ($CONF['alias_control_admin'] == "YES") - { - $query = "SELECT $table_alias.address,$table_alias.goto,$table_alias.modified,$table_alias.domain,$table_alias.active FROM $table_alias WHERE $table_alias.address LIKE '%$fSearch%' OR $table_alias.goto LIKE '%$fSearch%' ORDER BY $table_alias.address"; - } - else - { - $query = "SELECT $table_alias.address,$table_alias.goto,$table_alias.modified,$table_alias.domain,$table_alias.active FROM $table_alias LEFT JOIN $table_mailbox ON $table_alias.address=$table_mailbox.username WHERE $table_alias.address LIKE '%$fSearch%' AND $table_mailbox.maildir IS NULL ORDER BY $table_alias.address"; - } - - $result = db_query ($query); - if ($result['rows'] > 0) - { - while ($row = db_array ($result['result'])) - { - if (check_owner ($SESSID_USERNAME, $row['domain'])) - { - if ('pgsql'==$CONF['database_type']) - { - $row['modified']=gmstrftime('%c %Z',$row['modified']); - $row['active']=('t'==$row['active']) ? 1 : 0; - } - $tAlias[] = $row; - } - } - } - - if ($CONF['vacation_control_admin'] == 'YES') - { - $query = ("SELECT $table_mailbox.*, $table_vacation.active AS v_active FROM $table_mailbox LEFT JOIN $table_vacation ON $table_mailbox.username=$table_vacation.email WHERE $table_mailbox.username LIKE '%$fSearch%' OR $table_mailbox.name LIKE '%$fSearch%' ORDER BY $table_mailbox.username"); - } - else - { - $query = "SELECT * FROM $table_mailbox WHERE username LIKE '%$fSearch%' OR name LIKE '%$fSearch%' ORDER BY username"; - } - - $result = db_query ($query); - if ($result['rows'] > 0) - { - while ($row = db_array ($result['result'])) - { - if (check_owner ($SESSID_USERNAME, $row['domain'])) - { - if ('pgsql'==$CONF['database_type']) - { - $row['modified']=gmstrftime('%c %Z',$row['modified']); - $row['active']=('t'==$row['active']) ? 1 : 0; - } - $tMailbox[] = $row; - } - } - } - - include ("./templates/header.tpl"); - include ("./templates/menu.tpl"); - include ("./templates/search.tpl"); - include ("./templates/footer.tpl"); + if (isset ($_GET['fGo'])) $fGo = escape_string ($_GET['fGo']); + if (isset ($_GET['fDomain'])) $fDomain = escape_string ($_GET['domain']); } if ($_SERVER['REQUEST_METHOD'] == "POST") @@ -110,8 +55,9 @@ if (isset ($_POST['search'])) $fSearch = escape_string ($_POST['search']); if (isset ($_POST['fGo'])) $fGo = escape_string ($_POST['fGo']); if (isset ($_POST['fDomain'])) $fDomain = escape_string ($_POST['fDomain']); +} - if (empty ($fSearch) && !empty ($fGo)) + if (empty ($fSearch) /* && !empty ($fGo) */) { if (authentication_has_role('global-admin')) { @@ -123,7 +69,6 @@ } } - if ($CONF['alias_control_admin'] == "YES") { $query = "SELECT $table_alias.address,$table_alias.goto,$table_alias.modified,$table_alias.domain,$table_alias.active FROM $table_alias WHERE $table_alias.address LIKE '%$fSearch%' OR $table_alias.goto LIKE '%$fSearch%' ORDER BY $table_alias.address"; @@ -138,47 +83,71 @@ { while ($row = db_array ($result['result'])) { - if (check_owner ($SESSID_USERNAME, $row['domain'])) + if (check_owner ($SESSID_USERNAME, $row['domain']) || authentication_has_role('global-admin')) { if ('pgsql'==$CONF['database_type']) { $row['modified']=gmstrftime('%c %Z',$row['modified']); $row['active']=('t'==$row['active']) ? 1 : 0; - } + } $tAlias[] = $row; } } } + +/* + + */ if ($CONF['vacation_control_admin'] == 'YES') { $query = ("SELECT $table_mailbox.*, $table_vacation.active AS v_active FROM $table_mailbox LEFT JOIN $table_vacation ON $table_mailbox.username=$table_vacation.email WHERE $table_mailbox.username LIKE '%$fSearch%' OR $table_mailbox.name LIKE '%$fSearch%' ORDER BY $table_mailbox.username"); + # TODO: special query for pgsql needed? } else { $query = "SELECT * FROM $table_mailbox WHERE username LIKE '%$fSearch%' OR name LIKE '%$fSearch%' ORDER BY username"; + /* TODO: special query for pgsql really needed? + if ('pgsql'==$CONF['database_type']) + { + $query = "SELECT *,extract(epoch from created) as uts_created,extract(epoch from modified) as uts_modified FROM $table_mailbox WHERE username LIKE '%$fSearch%' OR name LIKE '%$fSearch%' ORDER BY username"; + } + */ } - $result = db_query ("$query"); + $result = db_query ($query); if ($result['rows'] > 0) { while ($row = db_array ($result['result'])) { - if (check_owner ($SESSID_USERNAME, $row['domain'])) + if (check_owner ($SESSID_USERNAME, $row['domain']) || authentication_has_role('global-admin')) { if ('pgsql'==$CONF['database_type']) { + $row['created']=gmstrftime('%c %Z',$row['created']); $row['modified']=gmstrftime('%c %Z',$row['modified']); + # TODO: code from admin/search.php + # $row['created']=gmstrftime('%c %Z',$row['uts_created']); + # $row['modified']=gmstrftime('%c %Z',$row['uts_modified']); $row['active']=('t'==$row['active']) ? 1 : 0; - } + # TODO: code from admin/search.php + # unset($row['uts_created']); + # unset($row['uts_modified']); + } $tMailbox[] = $row; } } } - include ("./templates/header.tpl"); - include ("./templates/menu.tpl"); - include ("./templates/search.tpl"); - include ("./templates/footer.tpl"); +include ("$incpath/templates/header.tpl"); + +if (authentication_has_role('global-admin')) { + include ("$incpath/templates/admin_menu.tpl"); +} else { + include ("$incpath/templates/menu.tpl"); } + +include ("$incpath/templates/search.tpl"); +include ("$incpath/templates/footer.tpl"); + ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-03 22:54:57
|
Revision: 125 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=125&view=rev Author: christian_boltz Date: 2007-10-03 15:55:01 -0700 (Wed, 03 Oct 2007) Log Message: ----------- - added 'create admin' link Modified Paths: -------------- trunk/templates/admin_list-admin.tpl Modified: trunk/templates/admin_list-admin.tpl =================================================================== --- trunk/templates/admin_list-admin.tpl 2007-10-03 22:49:19 UTC (rev 124) +++ trunk/templates/admin_list-admin.tpl 2007-10-03 22:55:01 UTC (rev 125) @@ -28,5 +28,8 @@ } print "</table>\n"; + print "<p><a href=\"create-admin.php\">" . $PALANG['pAdminMenu_create_admin'] . "</a>\n"; } + +/* vim: set ft=php expandtab softtabstop=3 tabstop=3 shiftwidth=3: */ ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-03 22:49:17
|
Revision: 124 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=124&view=rev Author: christian_boltz Date: 2007-10-03 15:49:19 -0700 (Wed, 03 Oct 2007) Log Message: ----------- - fix: unlimited is 0, not -1 - remove debugging code Modified Paths: -------------- trunk/admin/list-virtual.php Modified: trunk/admin/list-virtual.php =================================================================== --- trunk/admin/list-virtual.php 2007-10-03 22:41:01 UTC (rev 123) +++ trunk/admin/list-virtual.php 2007-10-03 22:49:19 UTC (rev 124) @@ -138,20 +138,17 @@ if($active == 't' || $active == 1) { $backup_mx = $limit['backupmx']; if($backup_mx == 'f' || $backup_mx == 0) { - if($limit['aliases'] == -1) { + if($limit['aliases'] == 0) { $tCanAddAlias = true; } elseif($limit['alias_count'] < $limit['aliases']) { $tCanAddAlias = true; - echo 'xxx2'; } - if($limit['mailboxes'] == -1) { + if($limit['mailboxes'] == 0) { $tCanAddMailbox = true; - echo 'xxx3'; } elseif($limit['mailbox_count'] < $limit['mailboxes']) { $tCanAddMailbox = true; - echo 'xxx4'; } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-03 22:40:58
|
Revision: 123 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=123&view=rev Author: christian_boltz Date: 2007-10-03 15:41:01 -0700 (Wed, 03 Oct 2007) Log Message: ----------- fix password handling: - always check if password == password2 (even if password2 is empty) - skip changing password if new password is empty. Reasons: - empty passwords are insecure - editing an admin does not always mean to edit the password. One might edit the allowed domains without even knowing the password of the edited admin. Modified Paths: -------------- trunk/admin/edit-admin.php Modified: trunk/admin/edit-admin.php =================================================================== --- trunk/admin/edit-admin.php 2007-10-03 00:55:55 UTC (rev 122) +++ trunk/admin/edit-admin.php 2007-10-03 22:41:01 UTC (rev 123) @@ -40,13 +40,19 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") { - $fPassword = 'x'; - $fPassword = 'y'; + $fPassword = ''; + $fPassword2 = ''; if(isset ($_GET['username'])) $username = escape_string ($_GET['username']); if(isset ($_POST['fPassword'])) $fPassword = escape_string ($_POST['fPassword']); if(isset ($_POST['fPassword2'])) $fPassword2 = escape_string ($_POST['fPassword2']); + if ($fPassword != $fPassword2) + { + $error = 1; + $pAdminEdit_admin_password_text = $PALANG['pAdminEdit_admin_password_text_error']; + } + $fActive=(isset($_POST['fActive'])) ? escape_string ($_POST['fActive']) : FALSE; $fSadmin=(isset($_POST['fSadmin'])) ? escape_string ($_POST['fSadmin']) : FALSE; @@ -64,19 +70,13 @@ // has the password changed? if($fPassword != $originalPassword) { if(!empty($_POST['fPassword2'])) { - if ($fPassword != $fPassword2) - { - $error = 1; - $pAdminEdit_admin_password_text = $PALANG['pAdminEdit_admin_password_text_error']; - } - else { - $fPassword = pacrypt($fPassword); - } + $fPassword = pacrypt($fPassword); } } $tActive = $fActive; - $tDomains = escape_string ($_POST['fDomains']); + $fDomains = array(); + if (array_key_exists('fDomains', $_POST)) $tDomains = escape_string ($_POST['fDomains']); if ($error != 1) { if ($fActive == "on") { @@ -86,9 +86,12 @@ $sqlActive = db_get_boolean(False); } + $password_query = ''; + if ($fPassword != '') { # do not change password to empty one + $password_query = ", password='$fPassword'"; + } + $result = db_query ("UPDATE $table_admin SET modified=NOW(),active='$sqlActive' $password_query WHERE username='$username'"); - $result = db_query ("UPDATE $table_admin SET modified=NOW(),active='$sqlActive', password='$fPassword' WHERE username='$username'"); - if ($fSadmin == "on") $fSadmin = 'ALL'; // delete everything, and put it back later on.. @@ -111,6 +114,8 @@ else { // GET request. if (isset($_GET['username'])) $username = escape_string ($_GET['username']); + # TODO: read "active" state from database and tick on the checkbox for active admins + $tAllDomains = list_domains(); $tDomains = list_domains_for_admin ($username); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-03 00:55:51
|
Revision: 122 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=122&view=rev Author: christian_boltz Date: 2007-10-02 17:55:55 -0700 (Tue, 02 Oct 2007) Log Message: ----------- - workaround for undefined variables (needed after template merge) Modified Paths: -------------- trunk/overview.php Modified: trunk/overview.php =================================================================== --- trunk/overview.php 2007-10-03 00:51:47 UTC (rev 121) +++ trunk/overview.php 2007-10-03 00:55:55 UTC (rev 122) @@ -62,6 +62,9 @@ if (check_owner ($SESSID_USERNAME, $fDomain)) { + $tCanAddAlias = 1; # TODO: workaround for undefined variable + $tCanAddMailbox = 1; # TODO: workaround for undefined variable + $query = "SELECT $table_alias.address,$table_alias.goto,$table_alias.modified,$table_alias.active FROM $table_alias LEFT JOIN $table_mailbox ON $table_alias.address=$table_mailbox.username WHERE $table_alias.domain='$fDomain' AND $table_mailbox.maildir IS NULL ORDER BY $table_alias.address LIMIT $limitSql"; if ('pgsql'==$CONF['database_type']) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-03 00:51:44
|
Revision: 121 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=121&view=rev Author: christian_boltz Date: 2007-10-02 17:51:47 -0700 (Tue, 02 Oct 2007) Log Message: ----------- - merge admin_list-virtual.tpl into overview.tpl - deleted admin_list-virtual.tpl - admin/list-virtual.php now uses overview.tpl template Modified Paths: -------------- trunk/admin/list-virtual.php trunk/templates/overview.tpl Removed Paths: ------------- trunk/templates/admin_list-virtual.tpl Modified: trunk/admin/list-virtual.php =================================================================== --- trunk/admin/list-virtual.php 2007-10-02 23:31:47 UTC (rev 120) +++ trunk/admin/list-virtual.php 2007-10-03 00:51:47 UTC (rev 121) @@ -15,7 +15,7 @@ * File: list-virtual.php * List virtual users for a domain. * - * Template File: admin_list-virtual.tpl + * Template File: overview.tpl * * Template Variables: * @@ -160,7 +160,7 @@ include ("../templates/header.tpl"); include ("../templates/admin_menu.tpl"); -include ("../templates/admin_list-virtual.tpl"); +include ("../templates/overview.tpl"); include ("../templates/footer.tpl"); /* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */ Deleted: trunk/templates/admin_list-virtual.tpl =================================================================== --- trunk/templates/admin_list-virtual.tpl 2007-10-02 23:31:47 UTC (rev 120) +++ trunk/templates/admin_list-virtual.tpl 2007-10-03 00:51:47 UTC (rev 121) @@ -1,259 +0,0 @@ -<div id="admin_virtual"> -<form name="overview" method="post"> -<select name="fDomain" onChange="this.form.submit();"> -<?php -for ($i = 0; $i < sizeof ($list_domains); $i++) -{ - if ($fDomain == $list_domains[$i]) - { - print "<option value=\"$list_domains[$i]\" selected>$list_domains[$i]</option>\n"; - } - else - { - print "<option value=\"$list_domains[$i]\">$list_domains[$i]</option>\n"; - } -} -?> -</select> -<input type="hidden" name="limit" value="0" /> -<input type="submit" name="go" value="<?php print $PALANG['pAdminList_virtual_button']; ?>" /> -</form> -<h4><?php print $PALANG['pAdminList_virtual_welcome'] . $fDomain; ?></h4> -<p><?php print $PALANG['pAdminList_virtual_alias_alias_count'] . ": " . $limit['alias_count'] . " / " . $limit['aliases']; ?></p> -<p><?php print $PALANG['pAdminList_virtual_alias_mailbox_count'] . ": " . $limit['mailbox_count'] . " / " . $limit['mailboxes']; ?></p> -<form name="search" method="post" action="search.php"><?php print $PALANG['pSearch']; ?>: -<input type="textbox" name="search" size="10" /> -</form> -</div> - -<div id="nav_bar"> - <table width=730><colgroup span="1"><col width="550"></col></colgroup> - <tr><td align=left > -<?php -if ($limit['alias_pgindex_count'] ) print "<b>".$PALANG['pOverview_alias_title']."</b>  "; -($tDisplay_back_show == 1) ? $highlight_at = $tDisplay_back / $CONF['page_size'] + 1 : $highlight_at = 0; -$current_limit=$highlight_at * $CONF['page_size']; -for ($i = 0; $i < $limit['alias_pgindex_count']; $i++) -{ - if ( $i == $highlight_at ) - { - print "<a href=\"list-virtual.php?domain=$fDomain&limit=" . $i * $CONF['page_size'] . "\"><b>" . $limit['alias_pgindex'][$i] . "</b></a>\n"; - } - else - { - print "<a href=\"list-virtual.php?domain=$fDomain&limit=" . $i * $CONF['page_size'] . "\">" . $limit['alias_pgindex'][$i] . "</a>\n"; - } -} -print "</td><td valign=middle align=right>"; - -if ($tDisplay_back_show == 1) -{ - print "<a href=\"list-virtual.php?domain=$fDomain&limit=$tDisplay_back\"><img border=\"0\" src=\"../images/arrow-l.png\" title=\"" . $PALANG['pOverview_left_arrow'] . "\" alt=\"" . $PALANG['pOverview_left_arrow'] . "\" /></a>\n"; -} -if ($tDisplay_up_show == 1) -{ - print "<a href=\"list-virtual.php?domain=$fDomain&limit=0\"><img border=\"0\" src=\"../images/arrow-u.png\" title=\"" . $PALANG['pOverview_up_arrow'] . "\" alt=\"" . $PALANG['pOverview_up_arrow'] . "\" /></a>\n"; -} -if ($tDisplay_next_show == 1) -{ - print "<a href=\"list-virtual.php?domain=$fDomain&limit=$tDisplay_next\"><img border=\"0\" src=\"../images/arrow-r.png\" title=\"" . $PALANG['pOverview_right_arrow'] . "\" alt=\"" . $PALANG['pOverview_right_arrow'] . "\" /></a>\n"; -} -print "</td></tr></table></div>\n"; - - -if (sizeof ($tAlias) > 0) -{ - print "<table id=\"alias_table\">\n"; - print " <tr>\n"; - print " <td colspan=\"6\"><h3>" . $PALANG['pOverview_alias_title'] . "</h3></td>"; - print " </tr>"; - print " <tr class=\"header\">\n"; - if ($CONF['show_status'] == 'YES') { print "<td></td>\n"; } - print " <td>" . $PALANG['pAdminList_virtual_alias_address'] . "</td>\n"; - print " <td>" . $PALANG['pAdminList_virtual_alias_goto'] . "</td>\n"; - print " <td>" . $PALANG['pAdminList_virtual_alias_modified'] . "</td>\n"; - print " <td>" . $PALANG['pAdminList_virtual_alias_active'] . "</td>\n"; - print " <td colspan=\"2\"> </td>\n"; - print " </tr>\n"; - - for ($i = 0; $i < sizeof ($tAlias); $i++) - { - if ((is_array ($tAlias) and sizeof ($tAlias) > 0)) - { - print " <tr class=\"hilightoff\" onMouseOver=\"className='hilighton';\" onMouseOut=\"className='hilightoff';\">\n"; - if ($CONF['show_status'] == 'YES') - { - print " <td>" . gen_show_status($tAlias[$i]['address']) . "</td>\n"; - } - - print " <td>" . $tAlias[$i]['address'] . "</td>\n"; - if ($CONF['alias_goto_limit'] > 0) { - print " <td>" . ereg_replace (",", "<br>", preg_replace('/^(([^,]+,){'.$CONF['alias_goto_limit'].'})[^,]+,.*/','$1[and '. (substr_count ($tAlias[$i]['goto'], ',') - $CONF['alias_goto_limit'] + 1) .' more...]',$tAlias[$i]['goto'])) . "</td>\n"; - } else { - print " <td>" . ereg_replace (",", "<br>", $tAlias[$i]['goto']) . "</td>\n"; - } - print " <td>" . $tAlias[$i]['modified'] . "</td>\n"; - $active = ($tAlias[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO']; - print " <td><a href=\"edit-active.php?alias=" . urlencode ($tAlias[$i]['address']) . "&domain=$fDomain&return=list-virtual.php?domain=$fDomain" . urlencode ("&limit=" . $current_limit) . "\">" . $active . "</a></td>\n"; - print " <td><a href=\"edit-alias.php?address=" . urlencode ($tAlias[$i]['address']) . "&domain=$fDomain" . "\">" . $PALANG['edit'] . "</a></td>\n"; - print " <td><a href=\"delete.php?table=alias" . "&delete=" . urlencode ($tAlias[$i]['address']) . "&domain=$fDomain" . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_aliases'] . ": ". $tAlias[$i]['address'] . "')\">" . $PALANG['del'] . "</a></td>\n"; - print " </tr>\n"; - } - } - print "</table>\n"; -} -if($tCanAddAlias) { - print "<p><a href=\"create-alias.php?domain=$fDomain\">" . $PALANG['pMenu_create_alias'] . "</a>\n"; -} - - print "<div id=\"nav_bar\"><a name=\"MidArrow\" /a>\n<table width=730><colgroup span=\"1\"> <col width=\"550\"></col></colgroup> <tr><td align=left >"; - if ( $limit['mbox_pgindex_count'] ) print "<b>".$PALANG['pOverview_mailbox_title']."</b>  "; - ($tDisplay_back_show == 1) ? $highlight_at = $tDisplay_back / $CONF['page_size'] + 1 : $highlight_at = 0; - for ($i = 0; $i < $limit['mbox_pgindex_count']; $i++) - { - if ( $i == $highlight_at ) - { - print "<a href=\"list-virtual.php?domain=$fDomain&limit=" . $i * $CONF['page_size'] . "#MidArrow\"><b>" . $limit['mbox_pgindex'][$i] . "</b></a>\n"; - } - else - { - print "<a href=\"list-virtual.php?domain=$fDomain&limit=" . $i * $CONF['page_size'] . "#MidArrow\">" . $limit['mbox_pgindex'][$i] . "</a>\n"; - } - } - print "</td><td valign=middle align=right>"; - - -if ($tDisplay_back_show == 1) -{ - print "<a href=\"list-virtual.php?domain=$fDomain&limit=$tDisplay_back#MidArrow\"><img border=\"0\" src=\"../images/arrow-l.png\" title=\"" . $PALANG['pOverview_left_arrow'] . "\" alt=\"" . $PALANG['pOverview_left_arrow'] . "\" /></a>\n"; -} -if ($tDisplay_up_show == 1) -{ - print "<a href=\"list-virtual.php?domain=$fDomain&limit=0#MidArrow\"><img border=\"0\" src=\"../images/arrow-u.png\" title=\"" . $PALANG['pOverview_up_arrow'] . "\" alt=\"" . $PALANG['pOverview_up_arrow'] . "\" /></a>\n"; -} -if ($tDisplay_next_show == 1) -{ - print "<a href=\"list-virtual.php?domain=$fDomain&limit=$tDisplay_next#MidArrow\"><img border=\"0\" src=\"../images/arrow-r.png\" title=\"" . $PALANG['pOverview_right_arrow'] . "\" alt=\"" . $PALANG['pOverview_right_arrow'] . "\" /></a>\n"; -} -print "</td></tr></table></div>\n"; - - -if (sizeof ($tMailbox) > 0) -{ - print "<table id=\"mailbox_table\">\n"; - print " <tr>\n"; - print " <td colspan=\"7\"><h3>" . $PALANG['pOverview_mailbox_title'] . "</h3></td>"; - print " </tr>"; - print " <tr class=\"header\">\n"; - if ($CONF['show_status'] == 'YES') { print "<td></td>\n"; } - print " <td>" . $PALANG['pAdminList_virtual_mailbox_username'] . "</td>\n"; - print " <td>" . $PALANG['pAdminList_virtual_mailbox_name'] . "</td>\n"; - if ($CONF['quota'] == 'YES') print " <td>" . $PALANG['pAdminList_virtual_mailbox_quota'] . "</td>\n"; - print " <td>" . $PALANG['pAdminList_virtual_mailbox_modified'] . "</td>\n"; - print " <td>" . $PALANG['pAdminList_virtual_mailbox_active'] . "</td>\n"; - if ($CONF['alias_control'] == 'YES') - { - print " <td colspan=\"3\"> </td>\n"; - } - else - { - print " <td colspan=\"2\"> </td>\n"; - } - print " </tr>\n"; - - for ($i = 0; $i < sizeof ($tMailbox); $i++) - { - if ((is_array ($tMailbox) and sizeof ($tMailbox) > 0)) - { - print " <tr class=\"hilightoff\" onMouseOver=\"className='hilighton';\" onMouseOut=\"className='hilightoff';\">\n"; - - if ($CONF['show_status'] == 'YES') - { - print " <td>" . gen_show_status($tMailbox[$i]['username']) . "</td>\n"; - } - - print " <td>" . $tMailbox[$i]['username'] . "</td>\n"; - print " <td>" . $tMailbox[$i]['name'] . "</td>\n"; - if ($CONF['quota'] == 'YES') - { - print " <td>"; - if ($tMailbox[$i]['quota'] == 0) - { - print $PALANG['pOverview_unlimited']; - } - elseif ($tMailbox[$i]['quota'] < 0) - { - print $PALANG['pOverview_disabled']; - } - else - { - print divide_quota ($tMailbox[$i]['quota']); - } - print "</td>\n"; - } - print " <td>" . $tMailbox[$i]['modified'] . "</td>\n"; - $active = ($tMailbox[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO']; - print " <td><a href=\"edit-active.php?username=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\">" . $active . "</a></td>\n"; - - if ($CONF['vacation_control_admin'] == 'YES') - { - $v_active = ($tMailbox[$i]['v_active'] == 1) ? $PALANG['pOverview_vacation_edit'] : $PALANG['pOverview_vacation_option']; - print " <td><a href=\"edit-vacation.php?username=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\">" .$v_active . "</a></td>\n"; - } - - if ($CONF['alias_control'] == 'YES') - { - print " <td><a href=\"edit-alias.php?address=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\">" . $PALANG['pOverview_alias_edit'] . "</a></td>\n"; - } - print " <td><a href=\"edit-mailbox.php?username=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\">" . $PALANG['edit'] . "</a></td>\n"; - print " <td><a href=\"delete.php?table=mailbox" . "&delete=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_mailboxes'] . ": ". $tMailbox[$i]['username'] . "')\">" . $PALANG['del'] . "</a></td>\n"; - print " </tr>\n"; - } - } - print "</table>\n"; - print "<div id=\"nav_bar\"><a name=\"LowArrow\" /a>\n"; - if ($tDisplay_back_show == 1) - { - print "<a href=\"list-virtual.php?domain=$fDomain&limit=$tDisplay_back#LowArrow\"><img border=\"0\" src=\"../images/arrow-l.png\" title=\"" . $PALANG['pOverview_left_arrow'] . "\" alt=\"" . $PALANG['pOverview_left_arrow'] . "\" /></a>\n"; - } - if ($tDisplay_up_show == 1) - { - print "<a href=\"list-virtual.php?domain=$fDomain&limit=0#LowArrow\"><img border=\"0\" src=\"../images/arrow-u.png\" title=\"" . $PALANG['pOverview_up_arrow'] . "\" alt=\"" . $PALANG['pOverview_up_arrow'] . "\" /></a>\n"; - } - if ($tDisplay_next_show == 1) - { - print "<a href=\"list-virtual.php?domain=$fDomain&limit=$tDisplay_next#LowArrow\"><img border=\"0\" src=\"../images/arrow-r.png\" title=\"" . $PALANG['pOverview_right_arrow'] . "\" alt=\"" . $PALANG['pOverview_right_arrow'] . "\" /></a>\n"; - } - print "</div>\n"; - -} -if($tCanAddMailbox) { - print "<p><a href=\"create-mailbox.php?domain=$fDomain\">" . $PALANG['pMenu_create_mailbox'] . "</a>\n"; -} - -if ($CONF['show_status'] == 'YES' && $CONF['show_status_key'] == 'YES') -{ - print "<br><br>"; - if ($CONF['show_undeliverable'] == 'YES') - { - print " <span style='background-color:" . $CONF['show_undeliverable_color'] . - "'>" . $CONF['show_status_text'] . "</span>=" . $PALANG['pStatus_undeliverable'] . "\n"; - } - if ($CONF['show_popimap'] == 'YES') - { - print " <span style='background-color:" . $CONF['show_popimap_color'] . - "'>" . $CONF['show_status_text'] . "</span>=" . $PALANG['pStatus_popimap'] . "\n"; - } - if ( $CONF['show_custom_count'] > 0 ) - { - for ($i = 0; $i < sizeof ($CONF['show_custom_domains']); $i++) - { - print " <span style='background-color:" . $CONF['show_custom_colors'][$i] . "'>" . - $CONF['show_status_text'] . "</span>=" . $PALANG['pStatus_custom'] . - $CONF['show_custom_domains'][$i] . "\n"; - } - } - -} -/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */ -?> Modified: trunk/templates/overview.tpl =================================================================== --- trunk/templates/overview.tpl 2007-10-02 23:31:47 UTC (rev 120) +++ trunk/templates/overview.tpl 2007-10-03 00:51:47 UTC (rev 121) @@ -1,7 +1,16 @@ <div id="overview"> -<form name="overview" method="get"> -<select name="domain" onChange="this.form.submit();"> +<form name="overview" method="post"> +<select name="fDomain" onChange="this.form.submit();"> <?php + +if (authentication_has_role('global-admin')) { + $file = 'list-virtual.php'; + $incpath = '..'; # warning: overrides $incpath from common.php - TODO: fix common.php $incpath +} else { + $file = 'overview.php'; + $incpath = '.'; # warning: overrides $incpath from common.php - TODO: fix common.php $incpath +} + if ($limit['aliases'] == 0) $limit['aliases'] = $PALANG['pOverview_unlimited']; if ($limit['mailboxes'] == 0) $limit['mailboxes'] = $PALANG['pOverview_unlimited']; if ($limit['maxquota'] == 0) $limit['maxquota'] = $PALANG['pOverview_unlimited']; @@ -22,43 +31,56 @@ } ?> </select> -<input type="hidden" name="limit" value="0"> +<input type="hidden" name="limit" value="0" /> <input class="button" type="submit" name="go" value="<?php print $PALANG['pOverview_button']; ?>" /> </form> <h4><?php print $PALANG['pOverview_welcome'] . $fDomain; ?></h4> <p><?php print $PALANG['pOverview_alias_alias_count'] . ": " . $limit['alias_count'] . " / " . $limit['aliases']; ?></p> <p><?php print $PALANG['pOverview_alias_mailbox_count'] . ": " . $limit['mailbox_count'] . " / " . $limit['mailboxes']; ?></p> -<?php print $PALANG['pSearch']; ?>:<form name="search" method="post" action="search.php"> -<input type="textbox" name="search" size="10"> +<form name="search" method="post" action="search.php"><?php print $PALANG['pSearch']; ?>: +<input type="textbox" name="search" size="10" /> </form> </div> +<div id="nav_bar"> + <table width=730><colgroup span="1"><col width="550"></col></colgroup> + <tr><td align=left > <?php -print "<div id=\"nav_bar\">\n<table width=730><colgroup span=\"1\"> <col width=\"550\"></col></colgroup> <tr><td align=left >"; -if ( $limit['alias_pgindex_count'] ) print "<b>".$PALANG['pOverview_alias_title']."</b>  "; +if ($limit['alias_pgindex_count'] ) print "<b>".$PALANG['pOverview_alias_title']."</b>  "; ($tDisplay_back_show == 1) ? $highlight_at = $tDisplay_back / $CONF['page_size'] + 1 : $highlight_at = 0; +$current_limit=$highlight_at * $CONF['page_size']; for ($i = 0; $i < $limit['alias_pgindex_count']; $i++) { if ( $i == $highlight_at ) { - print "<a href=\"overview.php?domain=$fDomain&limit=" . $i * $CONF['page_size'] . "\"><b>" . $limit['alias_pgindex'][$i] . "</b></a>\n"; + print "<a href=\"$file?domain=$fDomain&limit=" . $i * $CONF['page_size'] . "\"><b>" . $limit['alias_pgindex'][$i] . "</b></a>\n"; } else { - print "<a href=\"overview.php?domain=$fDomain&limit=" . $i * $CONF['page_size'] . "\">" . $limit['alias_pgindex'][$i] . "</a>\n"; + print "<a href=\"$file?domain=$fDomain&limit=" . $i * $CONF['page_size'] . "\">" . $limit['alias_pgindex'][$i] . "</a>\n"; } } print "</td><td valign=middle align=right>"; -if ($tDisplay_back_show == 1) print "<a href=\"overview.php?domain=$fDomain&limit=$tDisplay_back\"><img border=\"0\" src=\"images/arrow-l.png\" title=\"" . $PALANG['pOverview_left_arrow'] . "\" alt=\"" . $PALANG['pOverview_left_arrow'] . "\"></a>\n"; -if ($tDisplay_up_show == 1) print "<a href=\"overview.php?domain=$fDomain&limit=0\"><img border=\"0\" src=\"images/arrow-u.png\" title=\"" . $PALANG['pOverview_up_arrow']."\" alt=\"" . $PALANG['pOverview_up_arrow'] . "\"></a>\n"; -if ($tDisplay_next_show == 1) print "<a href=\"overview.php?domain=$fDomain&limit=$tDisplay_next\"><img border=\"0\" src=\"images/arrow-r.png\" title=\"" . $PALANG['pOverview_right_arrow'] . "\" alt=\"" . $PALANG['pOverview_right_arrow'] . "\"></a>\n"; + +if ($tDisplay_back_show == 1) +{ + print "<a href=\"$file?domain=$fDomain&limit=$tDisplay_back\"><img border=\"0\" src=\"$incpath/images/arrow-l.png\" title=\"" . $PALANG['pOverview_left_arrow'] . "\" alt=\"" . $PALANG['pOverview_left_arrow'] . "\" /></a>\n"; +} +if ($tDisplay_up_show == 1) +{ + print "<a href=\"$file?domain=$fDomain&limit=0\"><img border=\"0\" src=\"$incpath/images/arrow-u.png\" title=\"" . $PALANG['pOverview_up_arrow'] . "\" alt=\"" . $PALANG['pOverview_up_arrow'] . "\" /></a>\n"; +} +if ($tDisplay_next_show == 1) +{ + print "<a href=\"$file?domain=$fDomain&limit=$tDisplay_next\"><img border=\"0\" src=\"$incpath/images/arrow-r.png\" title=\"" . $PALANG['pOverview_right_arrow'] . "\" alt=\"" . $PALANG['pOverview_right_arrow'] . "\" /></a>\n"; +} print "</td></tr></table></div>\n"; if (sizeof ($tAlias) > 0) { print "<table id=\"alias_table\">\n"; print " <tr>\n"; - print " <td colspan=\"7\"><h3>".$PALANG['pOverview_alias_title']."</h3></td>"; + print " <td colspan=\"7\"><h3>" . $PALANG['pOverview_alias_title'] . "</h3></td>"; print " </tr>"; print " <tr class=\"header\">\n"; if ($CONF['show_status'] == 'YES') { print "<td></td>\n"; } @@ -87,6 +109,17 @@ } print " <td>" . $tAlias[$i]['modified'] . "</td>\n"; + +# TODO: merge superadmin / domain admin code + if (authentication_has_role('global-admin')) { +# superadmin code + $active = ($tAlias[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO']; + print " <td><a href=\"edit-active.php?alias=" . urlencode ($tAlias[$i]['address']) . "&domain=$fDomain&return=$file?domain=$fDomain" . urlencode ("&limit=" . $current_limit) . "\">" . $active . "</a></td>\n"; + print " <td><a href=\"edit-alias.php?address=" . urlencode ($tAlias[$i]['address']) . "&domain=$fDomain" . "\">" . $PALANG['edit'] . "</a></td>\n"; + print " <td><a href=\"delete.php?table=alias" . "&delete=" . urlencode ($tAlias[$i]['address']) . "&domain=$fDomain" . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_aliases'] . ": ". $tAlias[$i]['address'] . "')\">" . $PALANG['del'] . "</a></td>\n"; + + } else { +# domain admin code if ($CONF['special_alias_control'] == 'YES') { $active = ($tAlias[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO']; @@ -112,14 +145,19 @@ print " <td> </td>\n"; } } +# end diff + } + print " </tr>\n"; } } - print "</table>\n"; } +if($tCanAddAlias) { print "<p><a href=\"create-alias.php?domain=$fDomain\">" . $PALANG['pMenu_create_alias'] . "</a>\n"; +} + print "<div id=\"nav_bar\"><a name=\"MidArrow\" /a>\n<table width=730><colgroup span=\"1\"> <col width=\"550\"></col></colgroup> <tr><td align=left >"; if ( $limit['mbox_pgindex_count'] ) print "<b>".$PALANG['pOverview_mailbox_title']."</b>  "; ($tDisplay_back_show == 1) ? $highlight_at = $tDisplay_back / $CONF['page_size'] + 1 : $highlight_at = 0; @@ -127,28 +165,29 @@ { if ( $i == $highlight_at ) { - print "<a href=\"overview.php?domain=$fDomain&limit=" . $i * $CONF['page_size'] . "#MidArrow\"><b>" . $limit['mbox_pgindex'][$i] . "</b></a>\n"; + print "<a href=\"$file?domain=$fDomain&limit=" . $i * $CONF['page_size'] . "#MidArrow\"><b>" . $limit['mbox_pgindex'][$i] . "</b></a>\n"; } else { - print "<a href=\"overview.php?domain=$fDomain&limit=" . $i * $CONF['page_size'] . "#MidArrow\">" . $limit['mbox_pgindex'][$i] . "</a>\n"; + print "<a href=\"$file?domain=$fDomain&limit=" . $i * $CONF['page_size'] . "#MidArrow\">" . $limit['mbox_pgindex'][$i] . "</a>\n"; } } print "</td><td valign=middle align=right>"; - if ($tDisplay_back_show == 1) - { - print "<a href=\"overview.php?domain=$fDomain&limit=$tDisplay_back#MidArrow\"><img border=\"0\" src=\"images/arrow-l.png\" title=\"" . $PALANG['pOverview_left_arrow'] . "\" alt=\"" . $PALANG['pOverview_left_arrow'] . "\" /></a>\n"; - } - if ($tDisplay_up_show == 1) - { - print "<a href=\"overview.php?domain=$fDomain&limit=0#MidArrow\"><img border=\"0\" src=\"images/arrow-u.png\" title=\"" . $PALANG['pOverview_up_arrow'] . "\" alt=\"" . $PALANG['pOverview_up_arrow'] . "\" /></a>\n"; - } - if ($tDisplay_next_show == 1) - { - print "<a href=\"overview.php?domain=$fDomain&limit=$tDisplay_next#MidArrow\"><img border=\"0\" src=\"images/arrow-r.png\" title=\"" . $PALANG['pOverview_right_arrow'] . "\" alt=\"" . $PALANG['pOverview_right_arrow'] . "\" /></a>\n"; - } - print "</td></tr></table></div>\n"; +if ($tDisplay_back_show == 1) +{ + print "<a href=\"$file?domain=$fDomain&limit=$tDisplay_back#MidArrow\"><img border=\"0\" src=\"$incpath/images/arrow-l.png\" title=\"" . $PALANG['pOverview_left_arrow'] . "\" alt=\"" . $PALANG['pOverview_left_arrow'] . "\" /></a>\n"; +} +if ($tDisplay_up_show == 1) +{ + print "<a href=\"$file?domain=$fDomain&limit=0#MidArrow\"><img border=\"0\" src=\"$incpath/images/arrow-u.png\" title=\"" . $PALANG['pOverview_up_arrow'] . "\" alt=\"" . $PALANG['pOverview_up_arrow'] . "\" /></a>\n"; +} +if ($tDisplay_next_show == 1) +{ + print "<a href=\"$file?domain=$fDomain&limit=$tDisplay_next#MidArrow\"><img border=\"0\" src=\"$incpath/images/arrow-r.png\" title=\"" . $PALANG['pOverview_right_arrow'] . "\" alt=\"" . $PALANG['pOverview_right_arrow'] . "\" /></a>\n"; +} +print "</td></tr></table></div>\n"; + if (sizeof ($tMailbox) > 0) { $colspan=8; @@ -156,7 +195,7 @@ if ($CONF['alias_control_admin'] == 'YES') $colspan=$colspan+1; print "<table id=\"mailbox_table\">\n"; print " <tr>\n"; - print " <td colspan=\"$colspan\"><h3>".$PALANG['pOverview_mailbox_title']."</h3></td>"; + print " <td colspan=\"$colspan\"><h3>" . $PALANG['pOverview_mailbox_title'] . "</h3></td>"; print " </tr>"; print " <tr class=\"header\">\n"; if ($CONF['show_status'] == 'YES') { print "<td></td>\n"; } @@ -174,6 +213,7 @@ if ((is_array ($tMailbox) and sizeof ($tMailbox) > 0)) { print " <tr class=\"hilightoff\" onMouseOver=\"className='hilighton';\" onMouseOut=\"className='hilightoff';\">\n"; + if ($CONF['show_status'] == 'YES') { print " <td>" . gen_show_status($tMailbox[$i]['username']) . "</td>\n"; @@ -201,6 +241,7 @@ print " <td>" . $tMailbox[$i]['modified'] . "</td>\n"; $active = ($tMailbox[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO']; print " <td><a href=\"edit-active.php?username=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\">" . $active . "</a></td>\n"; + if ($CONF['vacation_control_admin'] == 'YES') { $v_active_int = $tMailbox[$i]['v_active']; @@ -218,12 +259,18 @@ echo "<td> </td>\n"; } } - if ($CONF['alias_control_admin'] == 'YES') + + $edit_aliases=0; + if ( authentication_has_role('global-admin') && $CONF['alias_control_admin'] == 'YES') $edit_aliases = 1; + if ( (! authentication_has_role('global-admin')) && $CONF['alias_control'] == 'YES') $edit_aliases = 1; + + if ($edit_aliases == 1) { print " <td><a href=\"edit-alias.php?address=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\">" . $PALANG['pOverview_alias_edit'] . "</a></td>\n"; } + print " <td><a href=\"edit-mailbox.php?username=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\">" . $PALANG['edit'] . "</a></td>\n"; - print " <td><a href=\"delete.php?delete=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_mailboxes'] . ": ". $tMailbox[$i]['username'] . "')\">" . $PALANG['del'] . "</a></td>\n"; + print " <td><a href=\"delete.php?table=mailbox" . "&delete=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_mailboxes'] . ": ". $tMailbox[$i]['username'] . "')\">" . $PALANG['del'] . "</a></td>\n"; print " </tr>\n"; } } @@ -231,19 +278,22 @@ print "<div id=\"nav_bar\"><a name=\"LowArrow\" /a>\n"; if ($tDisplay_back_show == 1) { - print "<a href=\"overview.php?domain=$fDomain&limit=$tDisplay_back#LowArrow\"><img border=\"0\" src=\"images/arrow-l.png\" title=\"" . $PALANG['pOverview_left_arrow'] . "\" alt=\"" . $PALANG['pOverview_left_arrow'] . "\" /></a>\n"; + print "<a href=\"$file?domain=$fDomain&limit=$tDisplay_back#LowArrow\"><img border=\"0\" src=\"$incpath/images/arrow-l.png\" title=\"" . $PALANG['pOverview_left_arrow'] . "\" alt=\"" . $PALANG['pOverview_left_arrow'] . "\" /></a>\n"; } if ($tDisplay_up_show == 1) { - print "<a href=\"overview.php?domain=$fDomain&limit=0#LowArrow\"><img border=\"0\" src=\"images/arrow-u.png\" title=\"" . $PALANG['pOverview_up_arrow'] . "\" alt=\"" . $PALANG['pOverview_up_arrow'] . "\" /></a>\n"; + print "<a href=\"$file?domain=$fDomain&limit=0#LowArrow\"><img border=\"0\" src=\"$incpath/images/arrow-u.png\" title=\"" . $PALANG['pOverview_up_arrow'] . "\" alt=\"" . $PALANG['pOverview_up_arrow'] . "\" /></a>\n"; } if ($tDisplay_next_show == 1) { - print "<a href=\"overview.php?domain=$fDomain&limit=$tDisplay_next#LowArrow\"><img border=\"0\" src=\"images/arrow-r.png\" title=\"" . $PALANG['pOverview_right_arrow'] . "\" alt=\"" . $PALANG['pOverview_right_arrow'] . "\" /></a>\n"; + print "<a href=\"$file?domain=$fDomain&limit=$tDisplay_next#LowArrow\"><img border=\"0\" src=\"$incpath/images/arrow-r.png\" title=\"" . $PALANG['pOverview_right_arrow'] . "\" alt=\"" . $PALANG['pOverview_right_arrow'] . "\" /></a>\n"; } print "</div>\n"; + } -print "<p><a href=\"create-mailbox.php?domain=$fDomain\">" . $PALANG['pMenu_create_mailbox'] . "</a>\n"; +if($tCanAddMailbox) { + print "<p><a href=\"create-mailbox.php?domain=$fDomain\">" . $PALANG['pMenu_create_mailbox'] . "</a>\n"; +} if ($CONF['show_status'] == 'YES' && $CONF['show_status_key'] == 'YES') { @@ -263,11 +313,11 @@ for ($i = 0; $i < sizeof ($CONF['show_custom_domains']); $i++) { print " <span style='background-color:" . $CONF['show_custom_colors'][$i] . "'>" . - $CONF['show_status_text'] . "</span>=" . $PALANG['pStatus_custom'] . + $CONF['show_status_text'] . "</span>=" . $PALANG['pStatus_custom'] . $CONF['show_custom_domains'][$i] . "\n"; } } } -/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3 ft=php */ +/* vim: set ft=php expandtab softtabstop=3 tabstop=3 shiftwidth=3: */ ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-02 23:31:45
|
Revision: 120 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=120&view=rev Author: christian_boltz Date: 2007-10-02 16:31:47 -0700 (Tue, 02 Oct 2007) Log Message: ----------- - fix colspan in table headlines - fix: display create mailbox link even if no mailbox exists yet Modified Paths: -------------- trunk/templates/overview.tpl Modified: trunk/templates/overview.tpl =================================================================== --- trunk/templates/overview.tpl 2007-10-02 23:17:07 UTC (rev 119) +++ trunk/templates/overview.tpl 2007-10-02 23:31:47 UTC (rev 120) @@ -58,7 +58,7 @@ { print "<table id=\"alias_table\">\n"; print " <tr>\n"; - print " <td colspan=\"6\"><h3>".$PALANG['pOverview_alias_title']."</h3></td>"; + print " <td colspan=\"7\"><h3>".$PALANG['pOverview_alias_title']."</h3></td>"; print " </tr>"; print " <tr class=\"header\">\n"; if ($CONF['show_status'] == 'YES') { print "<td></td>\n"; } @@ -151,9 +151,12 @@ if (sizeof ($tMailbox) > 0) { + $colspan=8; + if ($CONF['vacation_control_admin'] == 'YES') $colspan=$colspan+1; + if ($CONF['alias_control_admin'] == 'YES') $colspan=$colspan+1; print "<table id=\"mailbox_table\">\n"; print " <tr>\n"; - print " <td colspan=\"7\"><h3>".$PALANG['pOverview_mailbox_title']."</h3></td>"; + print " <td colspan=\"$colspan\"><h3>".$PALANG['pOverview_mailbox_title']."</h3></td>"; print " </tr>"; print " <tr class=\"header\">\n"; if ($CONF['show_status'] == 'YES') { print "<td></td>\n"; } @@ -162,9 +165,7 @@ if ($CONF['quota'] == 'YES') print " <td>" . $PALANG['pOverview_mailbox_quota'] . "</td>\n"; print " <td>" . $PALANG['pOverview_mailbox_modified'] . "</td>\n"; print " <td>" . $PALANG['pOverview_mailbox_active'] . "</td>\n"; - $colspan=2; - if ($CONF['vacation_control_admin'] == 'YES') $colspan=$colspan+1; - if ($CONF['alias_control_admin'] == 'YES') $colspan=$colspan+1; + $colspan = $colspan - 6; print " <td colspan=\"$colspan\"> </td>\n"; print " </tr>\n"; @@ -241,9 +242,8 @@ print "<a href=\"overview.php?domain=$fDomain&limit=$tDisplay_next#LowArrow\"><img border=\"0\" src=\"images/arrow-r.png\" title=\"" . $PALANG['pOverview_right_arrow'] . "\" alt=\"" . $PALANG['pOverview_right_arrow'] . "\" /></a>\n"; } print "</div>\n"; - - print "<p><a href=\"create-mailbox.php?domain=$fDomain\">" . $PALANG['pMenu_create_mailbox'] . "</a>\n"; } +print "<p><a href=\"create-mailbox.php?domain=$fDomain\">" . $PALANG['pMenu_create_mailbox'] . "</a>\n"; if ($CONF['show_status'] == 'YES' && $CONF['show_status_key'] == 'YES') { @@ -267,8 +267,7 @@ $CONF['show_custom_domains'][$i] . "\n"; } } - } -/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */ +/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3 ft=php */ ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-10-02 23:17:11
|
Revision: 119 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=119&view=rev Author: christian_boltz Date: 2007-10-02 16:17:07 -0700 (Tue, 02 Oct 2007) Log Message: ----------- - Fix HTML (<span> is opened inside the error message, close it again) Modified Paths: -------------- trunk/edit-mailbox.php Modified: trunk/edit-mailbox.php =================================================================== --- trunk/edit-mailbox.php 2007-10-02 13:41:23 UTC (rev 118) +++ trunk/edit-mailbox.php 2007-10-02 23:17:07 UTC (rev 119) @@ -60,7 +60,7 @@ $tName = $fName; $tQuota = $fQuota; $tActive = $fActive; - $tMessage = $PALANG['pEdit_mailbox_domain_error'] . "$fDomain</font>"; // XXX ergh; why is a closing font tag here? + $tMessage = $PALANG['pEdit_mailbox_domain_error'] . "$fDomain</span>"; } $user_details = db_array($result['result']); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |