Thread: SF.net SVN: postfixadmin:[432] trunk/edit-vacation.php
Brought to you by:
christian_boltz,
gingerdog
From: <chr...@us...> - 2008-08-01 20:46:58
|
Revision: 432 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=432&view=rev Author: christian_boltz Date: 2008-08-01 20:47:07 +0000 (Fri, 01 Aug 2008) Log Message: ----------- edit-vacation.php: - cleanup vacation_notification table when disabling vacation https://sourceforge.net/forum/message.php?msg_id=5131390 Modified Paths: -------------- trunk/edit-vacation.php Modified: trunk/edit-vacation.php =================================================================== --- trunk/edit-vacation.php 2008-07-30 06:48:37 UTC (rev 431) +++ trunk/edit-vacation.php 2008-08-01 20:47:07 UTC (rev 432) @@ -118,6 +118,7 @@ $db_false = db_get_boolean(false); // retain vacation message if possible - i.e disable vacation away-ness. $result = db_query ("UPDATE $table_vacation SET active = $db_false WHERE email='$fUsername'"); + $result = db_query("DELETE FROM $table_vacation_notification WHERE on_vacation='$fUsername'"); $result = db_query ("SELECT * FROM $table_alias WHERE address='$fUsername'"); if ($result['rows'] == 1) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2009-08-20 07:08:56
|
Revision: 707 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=707&view=rev Author: GingerDog Date: 2009-08-20 07:08:44 +0000 (Thu, 20 Aug 2009) Log Message: ----------- edit-vacation.php: fix postgresql issue Modified Paths: -------------- trunk/edit-vacation.php Modified: trunk/edit-vacation.php =================================================================== --- trunk/edit-vacation.php 2009-08-18 20:52:37 UTC (rev 706) +++ trunk/edit-vacation.php 2009-08-20 07:08:44 UTC (rev 707) @@ -164,7 +164,7 @@ $result = db_query("UPDATE $table_vacation SET active = $Active, subject = '$fSubject', body = '$fBody', created = NOW() WHERE email = '$fUsername'"); } else { - $result = db_query ("INSERT INTO $table_vacation (email,subject,body,domain,created,active) VALUES ('$fUsername','$fSubject','$fBody','$fDomain',NOW(),$Active)"); + $result = db_query ("INSERT INTO $table_vacation (email,subject,body,domain,created,active) VALUES ('$fUsername','$fSubject','$fBody','$fDomain',NOW(),'$Active')"); } if ($result['rows'] != 1) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2009-08-20 07:09:50
|
Revision: 708 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=708&view=rev Author: GingerDog Date: 2009-08-20 07:09:41 +0000 (Thu, 20 Aug 2009) Log Message: ----------- edit-vacation: fix second postgresql issue (removing vacation) Modified Paths: -------------- trunk/edit-vacation.php Modified: trunk/edit-vacation.php =================================================================== --- trunk/edit-vacation.php 2009-08-20 07:08:44 UTC (rev 707) +++ trunk/edit-vacation.php 2009-08-20 07:09:41 UTC (rev 708) @@ -117,7 +117,7 @@ { $db_false = db_get_boolean(false); // retain vacation message if possible - i.e disable vacation away-ness. - $result = db_query ("UPDATE $table_vacation SET active = $db_false WHERE email='$fUsername'"); + $result = db_query ("UPDATE $table_vacation SET active = '$db_false' WHERE email='$fUsername'"); $result = db_query("DELETE FROM $table_vacation_notification WHERE on_vacation='$fUsername'"); $result = db_query ("SELECT * FROM $table_alias WHERE address='$fUsername'"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-08-21 12:03:03
|
Revision: 711 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=711&view=rev Author: christian_boltz Date: 2009-08-21 12:02:55 +0000 (Fri, 21 Aug 2009) Log Message: ----------- edit-vacation.php: - fix another unqouted usage of boolean values Modified Paths: -------------- trunk/edit-vacation.php Modified: trunk/edit-vacation.php =================================================================== --- trunk/edit-vacation.php 2009-08-21 10:49:57 UTC (rev 710) +++ trunk/edit-vacation.php 2009-08-21 12:02:55 UTC (rev 711) @@ -161,7 +161,7 @@ // insert a duplicate $result = db_query("SELECT * FROM $table_vacation WHERE email = '$fUsername'"); if($result['rows'] == 1) { - $result = db_query("UPDATE $table_vacation SET active = $Active, subject = '$fSubject', body = '$fBody', created = NOW() WHERE email = '$fUsername'"); + $result = db_query("UPDATE $table_vacation SET active = '$Active', subject = '$fSubject', body = '$fBody', created = NOW() WHERE email = '$fUsername'"); } else { $result = db_query ("INSERT INTO $table_vacation (email,subject,body,domain,created,active) VALUES ('$fUsername','$fSubject','$fBody','$fDomain',NOW(),'$Active')"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2011-07-18 23:39:07
|
Revision: 1088 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=1088&view=rev Author: christian_boltz Date: 2011-07-18 23:38:57 +0000 (Mon, 18 Jul 2011) Log Message: ----------- edit-vacation.php: whitespace changes - converted DOS to UNIX line endings - replaced some tabs with spaces - removed spaces at the end of some lines Modified Paths: -------------- trunk/edit-vacation.php Modified: trunk/edit-vacation.php =================================================================== --- trunk/edit-vacation.php 2011-07-18 23:23:24 UTC (rev 1087) +++ trunk/edit-vacation.php 2011-07-18 23:38:57 UTC (rev 1088) @@ -1,162 +1,162 @@ -<?php -/** - * Postfix Admin - * - * LICENSE - * This source file is subject to the GPL license that is bundled with - * this package in the file LICENSE.TXT. - * - * Further details on the project are available at : - * http://www.postfixadmin.com or http://postfixadmin.sf.net - * - * @version $Id$ - * @license GNU GPL v2 or later. - * - * File: edit-vacation.php - * Responsible for allowing users to update their vacation status. - * - * Template File: edit-vacation.tpl - * - * Template Variables: - * - * tUseremail - * tSubject - * tBody - * - * Form POST \ GET Variables: - * - * fUsername - * fDomain - * fCanceltarget - * fChange - * fBack - * fQuota - * fActive - */ - -require_once('common.php'); - -if($CONF['vacation'] == 'NO') { - header("Location: list-virtual.php"); - exit(0); -} - -$SESSID_USERNAME = authentication_get_username(); -$tmp = preg_split ('/@/', $SESSID_USERNAME); -$USERID_DOMAIN = $tmp[1]; - -// only allow admins to change someone else's 'stuff' -if(authentication_has_role('admin')) { - if (isset($_GET['username'])) $fUsername = escape_string ($_GET['username']); - if (isset($_GET['domain'])) $fDomain = escape_string ($_GET['domain']); -} -else { - $fUsername = $SESSID_USERNAME; - $fDomain = $USERID_DOMAIN; -} - -date_default_timezone_set(@date_default_timezone_get()); # Suppress date.timezone warnings - -$vh = new VacationHandler($fUsername); -$vacation_domain = $CONF['vacation_domain']; -$vacation_goto = preg_replace('/@/', '#', $fUsername); -$vacation_goto = $vacation_goto . '@' . $vacation_domain; - -$fCanceltarget = "list-virtual.php?domain=$fDomain"; - -if ($_SERVER['REQUEST_METHOD'] == "GET") -{ - - $result = db_query("SELECT * FROM $table_vacation WHERE email='$fUsername'"); - if ($result['rows'] == 1) - { - $row = db_array($result['result']); - $tSubject = $row['subject']; - $tBody = $row['body']; - $tActiveFrom = $row['activefrom']; - $tActiveUntil = $row['activeuntil']; - } - - $tUseremail = $fUsername; - $tDomain = $fDomain; - if ($tSubject == '') { $tSubject = html_entity_decode($PALANG['pUsersVacation_subject_text'], ENT_QUOTES, 'UTF-8'); } - if ($tBody == '') { $tBody = html_entity_decode($PALANG['pUsersVacation_body_text'], ENT_QUOTES, 'UTF-8'); } - -} - -if ($_SERVER['REQUEST_METHOD'] == "POST") -{ - - $tSubject = safepost('fSubject'); - $fSubject = escape_string ($tSubject); - $tBody = safepost('fBody'); -// $tActiveFrom = safepost('activefrom').' 00:00:01'; -// $tActiveUntil = safepost('activeuntil').' 23:59:59'; - $tActiveFrom = date ("Y-m-d 00:00:00", strtotime (safepost('activefrom'))); - $tActiveUntil = date ("Y-m-d 23:59:59", strtotime (safepost('activeuntil'))); - $fBody = escape_string ($tBody); - $fChange = escape_string (safepost('fChange')); - $fBack = escape_string (safepost('fBack')); - if(authentication_has_role('admin') && isset($_GET['domain'])) { - $fDomain = escape_string ($_GET['domain']); - } - else { - $fDomain = $USERID_DOMAIN; - } - if(authentication_has_role('admin') && isset ($_GET['username'])) { - $fUsername = escape_string($_GET['username']); - } - else { - $fUsername = authentication_get_username(); - } - - $tUseremail = $fUsername; - if ($tSubject == '') { $tSubject = html_entity_decode($PALANG['pUsersVacation_subject_text'], ENT_QUOTES, 'UTF-8'); } - if ($tBody == '') { $tBody = html_entity_decode($PALANG['pUsersVacation_body_text'], ENT_QUOTES, 'UTF-8'); } - - //if change, remove old one, then perhaps set new one - if (!empty ($fBack)) - { - if(!$vh->remove()) { - $error = 1; - } - } - - - //Set the vacation data for $fUsername - if (!empty ($fChange)) - { - if(!$vh->set_away($fSubject, $fBody, $tActiveFrom, $tActiveUntil)) { - $error = 1; - } - - } -} - -if($error == 0) { - if(!empty ($fBack)) { - flash_info($PALANG['pVacation_result_removed']); - } - if(!empty($fChange)) { - flash_info($PALANG['pVacation_result_added']); - } -} -else { - flash_error($PALANG['pVacation_result_error']); -} -if (empty ($tActiveFrom)) - $tActiveFrom = date ("Y-m-d"); -if (empty ($tActiveUntil)) - $tActiveUntil = date ("Y-m-d"); - -$smarty->assign ('tUseremail', $tUseremail); -$smarty->assign ('tSubject', $tSubject); -$smarty->assign ('tBody', $tBody ,false); -$smarty->assign ('tActiveFrom', date ("d.m.Y", strtotime ($tActiveFrom))); -$smarty->assign ('tActiveUntil', date ("d.m.Y", strtotime ($tActiveUntil))); -$smarty->assign ('fCanceltarget', $fCanceltarget); -$smarty->assign ('smarty_template', 'edit-vacation'); -$smarty->display ('index.tpl'); - -/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */ -?> +<?php +/** + * Postfix Admin + * + * LICENSE + * This source file is subject to the GPL license that is bundled with + * this package in the file LICENSE.TXT. + * + * Further details on the project are available at : + * http://www.postfixadmin.com or http://postfixadmin.sf.net + * + * @version $Id$ + * @license GNU GPL v2 or later. + * + * File: edit-vacation.php + * Responsible for allowing users to update their vacation status. + * + * Template File: edit-vacation.tpl + * + * Template Variables: + * + * tUseremail + * tSubject + * tBody + * + * Form POST \ GET Variables: + * + * fUsername + * fDomain + * fCanceltarget + * fChange + * fBack + * fQuota + * fActive + */ + +require_once('common.php'); + +if($CONF['vacation'] == 'NO') { + header("Location: list-virtual.php"); + exit(0); +} + +$SESSID_USERNAME = authentication_get_username(); +$tmp = preg_split ('/@/', $SESSID_USERNAME); +$USERID_DOMAIN = $tmp[1]; + +// only allow admins to change someone else's 'stuff' +if(authentication_has_role('admin')) { + if (isset($_GET['username'])) $fUsername = escape_string ($_GET['username']); + if (isset($_GET['domain'])) $fDomain = escape_string ($_GET['domain']); +} +else { + $fUsername = $SESSID_USERNAME; + $fDomain = $USERID_DOMAIN; +} + +date_default_timezone_set(@date_default_timezone_get()); # Suppress date.timezone warnings + +$vh = new VacationHandler($fUsername); +$vacation_domain = $CONF['vacation_domain']; +$vacation_goto = preg_replace('/@/', '#', $fUsername); +$vacation_goto = $vacation_goto . '@' . $vacation_domain; + +$fCanceltarget = "list-virtual.php?domain=$fDomain"; + +if ($_SERVER['REQUEST_METHOD'] == "GET") +{ + + $result = db_query("SELECT * FROM $table_vacation WHERE email='$fUsername'"); + if ($result['rows'] == 1) + { + $row = db_array($result['result']); + $tSubject = $row['subject']; + $tBody = $row['body']; + $tActiveFrom = $row['activefrom']; + $tActiveUntil = $row['activeuntil']; + } + + $tUseremail = $fUsername; + $tDomain = $fDomain; + if ($tSubject == '') { $tSubject = html_entity_decode($PALANG['pUsersVacation_subject_text'], ENT_QUOTES, 'UTF-8'); } + if ($tBody == '') { $tBody = html_entity_decode($PALANG['pUsersVacation_body_text'], ENT_QUOTES, 'UTF-8'); } + +} + +if ($_SERVER['REQUEST_METHOD'] == "POST") +{ + + $tSubject = safepost('fSubject'); + $fSubject = escape_string ($tSubject); + $tBody = safepost('fBody'); +// $tActiveFrom = safepost('activefrom').' 00:00:01'; +// $tActiveUntil = safepost('activeuntil').' 23:59:59'; + $tActiveFrom = date ("Y-m-d 00:00:00", strtotime (safepost('activefrom'))); + $tActiveUntil = date ("Y-m-d 23:59:59", strtotime (safepost('activeuntil'))); + $fBody = escape_string ($tBody); + $fChange = escape_string (safepost('fChange')); + $fBack = escape_string (safepost('fBack')); + if(authentication_has_role('admin') && isset($_GET['domain'])) { + $fDomain = escape_string ($_GET['domain']); + } + else { + $fDomain = $USERID_DOMAIN; + } + if(authentication_has_role('admin') && isset ($_GET['username'])) { + $fUsername = escape_string($_GET['username']); + } + else { + $fUsername = authentication_get_username(); + } + + $tUseremail = $fUsername; + if ($tSubject == '') { $tSubject = html_entity_decode($PALANG['pUsersVacation_subject_text'], ENT_QUOTES, 'UTF-8'); } + if ($tBody == '') { $tBody = html_entity_decode($PALANG['pUsersVacation_body_text'], ENT_QUOTES, 'UTF-8'); } + + //if change, remove old one, then perhaps set new one + if (!empty ($fBack)) + { + if(!$vh->remove()) { + $error = 1; + } + } + + + //Set the vacation data for $fUsername + if (!empty ($fChange)) + { + if(!$vh->set_away($fSubject, $fBody, $tActiveFrom, $tActiveUntil)) { + $error = 1; + } + + } +} + +if($error == 0) { + if(!empty ($fBack)) { + flash_info($PALANG['pVacation_result_removed']); + } + if(!empty($fChange)) { + flash_info($PALANG['pVacation_result_added']); + } +} +else { + flash_error($PALANG['pVacation_result_error']); +} +if (empty ($tActiveFrom)) + $tActiveFrom = date ("Y-m-d"); +if (empty ($tActiveUntil)) + $tActiveUntil = date ("Y-m-d"); + +$smarty->assign ('tUseremail', $tUseremail); +$smarty->assign ('tSubject', $tSubject); +$smarty->assign ('tBody', $tBody ,false); +$smarty->assign ('tActiveFrom', date ("d.m.Y", strtotime ($tActiveFrom))); +$smarty->assign ('tActiveUntil', date ("d.m.Y", strtotime ($tActiveUntil))); +$smarty->assign ('fCanceltarget', $fCanceltarget); +$smarty->assign ('smarty_template', 'edit-vacation'); +$smarty->display ('index.tpl'); + +/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */ +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2011-07-27 21:57:54
|
Revision: 1136 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=1136&view=rev Author: christian_boltz Date: 2011-07-27 21:57:48 +0000 (Wed, 27 Jul 2011) Log Message: ----------- edit-vacation.php: - remove unused variables $vacation_domain and $vacation_goto Modified Paths: -------------- trunk/edit-vacation.php Modified: trunk/edit-vacation.php =================================================================== --- trunk/edit-vacation.php 2011-07-26 19:46:08 UTC (rev 1135) +++ trunk/edit-vacation.php 2011-07-27 21:57:48 UTC (rev 1136) @@ -58,9 +58,6 @@ date_default_timezone_set(@date_default_timezone_get()); # Suppress date.timezone warnings $vh = new VacationHandler($fUsername); -$vacation_domain = $CONF['vacation_domain']; -$vacation_goto = preg_replace('/@/', '#', $fUsername); -$vacation_goto = $vacation_goto . '@' . $vacation_domain; $fCanceltarget = "list-virtual.php?domain=$fDomain"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |