From e5b1a19b681d467890654ca9557c3fadc8812f6a Mon Sep 17 00:00:00 2001 From: SJ Date: Tue, 6 Aug 2013 06:36:56 +0200 Subject: [PATCH 1/6] theme fixes --- util/db-upgrade-0.1.23-vs-0.1.24.sql | 2 + webui/config.php | 1 + webui/model/audit/audit.php | 2 +- webui/model/policy/retention.php | 2 +- webui/view/javascript/piler-in.js | 29 +++++++++++- .../default/templates/common/layout-audit.tpl | 2 +- .../default/templates/common/layout-email.tpl | 2 +- .../templates/common/layout-search.tpl | 2 +- .../theme/default/templates/common/layout.tpl | 2 +- .../theme/default/templates/login/login.tpl | 2 +- .../theme/default/templates/search/popup.tpl | 17 ++----- .../theme/mobile/stylesheet/style-mobile.css | 8 +++- .../mobile/templates/common/layout-audit.tpl | 2 + .../mobile/templates/common/layout-email.tpl | 2 + .../mobile/templates/common/layout-search.tpl | 2 + .../theme/mobile/templates/common/layout.tpl | 2 + .../theme/mobile/templates/login/login.tpl | 46 +++++++++---------- .../theme/mobile/templates/search/popup.tpl | 10 ++-- 18 files changed, 85 insertions(+), 50 deletions(-) diff --git a/util/db-upgrade-0.1.23-vs-0.1.24.sql b/util/db-upgrade-0.1.23-vs-0.1.24.sql index dcd0d058..62bd33d6 100644 --- a/util/db-upgrade-0.1.23-vs-0.1.24.sql +++ b/util/db-upgrade-0.1.23-vs-0.1.24.sql @@ -13,6 +13,8 @@ create unique index `entry` on retention_rule (`domain`,`from`,`to`,`subject`,`_ drop view if exists `v_messages`; create view `v_messages` AS select `metadata`.`id` AS `id`,`metadata`.`piler_id` AS `piler_id`,`metadata`.`from` AS `from`,`metadata`.`fromdomain` AS `fromdomain`,`rcpt`.`to` AS `to`,`rcpt`.`todomain` AS `todomain`,`metadata`.`subject` AS `subject`, `metadata`.`size` AS `size`, `metadata`.`direction` AS `direction`, `metadata`.`sent` AS `sent`, `metadata`.`retained` AS `retained`, `metadata`.`arrived` AS `arrived`, `metadata`.`digest` AS `digest`, `metadata`.`bodydigest` AS `bodydigest` from (`metadata` join `rcpt`) where (`metadata`.`id` = `rcpt`.`id`); +update user_settings set theme='mobile' where theme='orig'; + create table if not exists `ldap` ( `id` int not null auto_increment primary key, `description` varchar(255) not null, diff --git a/webui/config.php b/webui/config.php index 7fbf14be..854bf550 100644 --- a/webui/config.php +++ b/webui/config.php @@ -17,6 +17,7 @@ $config['PILERGETD_PASSWORD'] = ''; $config['BRANDING_TEXT'] = ''; $config['BRANDING_URL'] = ''; $config['BRANDING_LOGO'] = ''; +$config['BRANDING_FAVICON'] = ''; $config['SUPPORT_LINK'] = ''; $config['BOOTSTRAP_THEME'] = '-cosmo'; diff --git a/webui/model/audit/audit.php b/webui/model/audit/audit.php index 9a913f1a..32ce7073 100644 --- a/webui/model/audit/audit.php +++ b/webui/model/audit/audit.php @@ -39,7 +39,7 @@ class ModelAuditAudit extends Model { $where .= " AND ( " . $this->append_search_criteria("meta_id", $data['ref'], $arr) . " )"; } - if(Registry::get('admin_user') == 0) { + if(Registry::get('admin_user') == 0 && RESTRICTED_AUDITOR == 1) { while(list($k, $v) = each($_SESSION['auditdomains'])) { if($q) { $q .= ","; } $q .= "?"; diff --git a/webui/model/policy/retention.php b/webui/model/policy/retention.php index 330e062c..903eaa73 100644 --- a/webui/model/policy/retention.php +++ b/webui/model/policy/retention.php @@ -47,7 +47,7 @@ class ModelPolicyRetention extends Model { $default_retention = DEFAULT_RETENTION * 86400; $delta = NOW + 86400 * $data['days'] - $default_retention; - $start_ts = NOW - $default_retention; + $start_ts = NOW - 2*$default_retention; $query = $this->db->query("UPDATE " . VIEW_MESSAGES . " SET retained=? WHERE arrived > ? AND (todomain=? OR fromdomain=?)", array($delta, $start_ts, $data['domain'], $data['domain'])); diff --git a/webui/view/javascript/piler-in.js b/webui/view/javascript/piler-in.js index 15057b8e..f26d7a6a 100644 --- a/webui/view/javascript/piler-in.js +++ b/webui/view/javascript/piler-in.js @@ -633,7 +633,11 @@ var Piler = $('input#xbody').val(''); $('input#xtag').val(''); $('input#xnote').val(''); - $('input#xhas_attachment')[0].checked = 0; + $('input#xhas_attachment_doc')[0].checked = 0; + $('input#xhas_attachment_xls')[0].checked = 0; + $('input#xhas_attachment_pdf')[0].checked = 0; + $('input#xhas_attachment_image')[0].checked = 0; + $('input#xhas_attachment_any')[0].checked = 0; $('input#date1').val(''); $('input#date2').val(''); @@ -641,6 +645,29 @@ var Piler = }, + /* + * when clicked on the "any" attachment type, clear the other types + */ + + clear_attachment_others: function() + { + $('input#xhas_attachment_doc')[0].checked = 0; + $('input#xhas_attachment_xls')[0].checked = 0; + $('input#xhas_attachment_pdf')[0].checked = 0; + $('input#xhas_attachment_image')[0].checked = 0; + }, + + + /* + * when clicked on any of the named attachment types, clear the "any" type + */ + + clear_attachment_any: function() + { + $('input#xhas_attachment_any')[0].checked = 0; + }, + + /* * show a temporary message to the user */ diff --git a/webui/view/theme/default/templates/common/layout-audit.tpl b/webui/view/theme/default/templates/common/layout-audit.tpl index 469a5b77..e92cd9f9 100644 --- a/webui/view/theme/default/templates/common/layout-audit.tpl +++ b/webui/view/theme/default/templates/common/layout-audit.tpl @@ -30,7 +30,7 @@ - + diff --git a/webui/view/theme/default/templates/common/layout-email.tpl b/webui/view/theme/default/templates/common/layout-email.tpl index d11f4a67..9ca2694b 100644 --- a/webui/view/theme/default/templates/common/layout-email.tpl +++ b/webui/view/theme/default/templates/common/layout-email.tpl @@ -24,7 +24,7 @@ - + diff --git a/webui/view/theme/default/templates/common/layout.tpl b/webui/view/theme/default/templates/common/layout.tpl index f0e6c7ae..1138fec5 100644 --- a/webui/view/theme/default/templates/common/layout.tpl +++ b/webui/view/theme/default/templates/common/layout.tpl @@ -29,7 +29,7 @@ - + - + diff --git a/webui/view/theme/default/templates/search/popup.tpl b/webui/view/theme/default/templates/search/popup.tpl index f26df8af..1bb14ea9 100644 --- a/webui/view/theme/default/templates/search/popup.tpl +++ b/webui/view/theme/default/templates/search/popup.tpl @@ -55,18 +55,11 @@
- checked="checked" /> -
-
- -
- -
- Word checked="checked" /> - Excel checked="checked" /> - PDF checked="checked" /> - image checked="checked" /> - any checked="checked" /> + Word checked="checked" onclick="Piler.clear_attachment_any();" /> + Excel checked="checked" onclick="Piler.clear_attachment_any();" /> + PDF checked="checked" onclick="Piler.clear_attachment_any();" /> + image checked="checked" onclick="Piler.clear_attachment_any();" /> + any checked="checked" onclick="Piler.clear_attachment_others();" />
diff --git a/webui/view/theme/mobile/stylesheet/style-mobile.css b/webui/view/theme/mobile/stylesheet/style-mobile.css index 2ecbdaa2..2438341b 100644 --- a/webui/view/theme/mobile/stylesheet/style-mobile.css +++ b/webui/view/theme/mobile/stylesheet/style-mobile.css @@ -7,6 +7,13 @@ .mybody { background-color: #6D6D6D; color: #3d3d3d; } + .loginpage {background-color: #fcfcfc; padding-top: 40px; padding-bottom: 40px;} + #logo-lg {width: 300px; margin: 0 auto 20px;} + #compatibility { max-width: 300px; margin:0 auto; color:#444; text-align: justify; } + .form-signin{ max-width:300px; padding:19px 29px 29px; margin:0 auto 20px; background-color:#fff; border:1px solid #e5e5e5; -webkit-border-radius:5px; -moz-border-radius:5px; border-radius:5px; -webkit-box-shadow:0 1px 2px rgba(0, 0, 0, 0.05); -moz-box-shadow:0 1px 2px rgba(0, 0, 0, 0.05); box-shadow:0 1px 2px rgba(0, 0, 0, 0.05); } + .form-signin .form-signin-heading,.form-signin .checkbox{ margin-bottom: 10px; } + .form-signin input[type="text"], .form-signin input[type="password"]{ font-size:16px; height:auto; margin-bottom:15px; padding:7px 9px; } + #piler1 { width: 100%; height: 100%; background: #ffffff; border: 0px solid black; position: absolute; margin-left: auto; margin-right: auto; padding-top: 0px; } #messagebox1 { position: absolute; top: 0px; left: 50%; border: 3px solid red; display: none; background: orange; color: #000000; font-weight: bold; padding: 15px; z-index: 1; } @@ -160,7 +167,6 @@ .message_highlight { background: lightblue; } - } diff --git a/webui/view/theme/mobile/templates/common/layout-audit.tpl b/webui/view/theme/mobile/templates/common/layout-audit.tpl index 2f91280f..8c3640c1 100644 --- a/webui/view/theme/mobile/templates/common/layout-audit.tpl +++ b/webui/view/theme/mobile/templates/common/layout-audit.tpl @@ -24,6 +24,8 @@ + + diff --git a/webui/view/theme/mobile/templates/common/layout-email.tpl b/webui/view/theme/mobile/templates/common/layout-email.tpl index fcf95f92..d12bf9cd 100644 --- a/webui/view/theme/mobile/templates/common/layout-email.tpl +++ b/webui/view/theme/mobile/templates/common/layout-email.tpl @@ -27,6 +27,8 @@ + + diff --git a/webui/view/theme/mobile/templates/common/layout-search.tpl b/webui/view/theme/mobile/templates/common/layout-search.tpl index 128d3946..55c64e7d 100644 --- a/webui/view/theme/mobile/templates/common/layout-search.tpl +++ b/webui/view/theme/mobile/templates/common/layout-search.tpl @@ -24,6 +24,8 @@ + + diff --git a/webui/view/theme/mobile/templates/common/layout.tpl b/webui/view/theme/mobile/templates/common/layout.tpl index 3a6fb8d7..fae1b072 100644 --- a/webui/view/theme/mobile/templates/common/layout.tpl +++ b/webui/view/theme/mobile/templates/common/layout.tpl @@ -25,6 +25,8 @@ + + - + @@ -24,42 +24,40 @@ + - - -
- - + + - - -
- + + diff --git a/webui/view/theme/mobile/templates/search/popup.tpl b/webui/view/theme/mobile/templates/search/popup.tpl index cdc32f2f..49e2311b 100644 --- a/webui/view/theme/mobile/templates/search/popup.tpl +++ b/webui/view/theme/mobile/templates/search/popup.tpl @@ -48,11 +48,11 @@
:
- Word checked="checked" /> - Excel checked="checked" /> - PDF checked="checked" /> - image checked="checked" /> - any checked="checked" /> + Word checked="checked" onclick="Piler.clear_attachment_any();" /> + Excel checked="checked" onclick="Piler.clear_attachment_any();" /> + PDF checked="checked" onclick="Piler.clear_attachment_any();" /> + image checked="checked" onclick="Piler.clear_attachment_any();" /> + any checked="checked" onclick="Piler.clear_attachment_others();" />
From ce865677247b247091f722f376ac9e5dcc25912c Mon Sep 17 00:00:00 2001 From: SJ Date: Tue, 6 Aug 2013 06:58:06 +0200 Subject: [PATCH 2/6] html header fixes --- webui/controller/group/email.php | 2 +- webui/view/theme/default/templates/common/layout-audit.tpl | 2 +- webui/view/theme/default/templates/common/layout-email.tpl | 2 +- .../view/theme/default/templates/common/layout-search.tpl | 2 +- webui/view/theme/default/templates/common/layout.tpl | 2 +- webui/view/theme/default/templates/login/login.tpl | 2 +- webui/view/theme/mobile/templates/common/layout-email.tpl | 2 +- webui/view/theme/mobile/templates/common/layout.tpl | 2 +- webui/view/theme/mobile/templates/login/login.tpl | 7 ++++--- 9 files changed, 12 insertions(+), 11 deletions(-) diff --git a/webui/controller/group/email.php b/webui/controller/group/email.php index 6551395a..636617c3 100644 --- a/webui/controller/group/email.php +++ b/webui/controller/group/email.php @@ -17,7 +17,7 @@ class ControllerGroupEmail extends Controller { $this->load->model('group/group'); - //$this->document->title = $language->get('text_group_management'); + $this->document->title = ''; $this->data['page'] = 0; $this->data['page_len'] = get_page_length(); diff --git a/webui/view/theme/default/templates/common/layout-audit.tpl b/webui/view/theme/default/templates/common/layout-audit.tpl index e92cd9f9..86056c24 100644 --- a/webui/view/theme/default/templates/common/layout-audit.tpl +++ b/webui/view/theme/default/templates/common/layout-audit.tpl @@ -2,7 +2,7 @@ - <?php print $title; ?> | <?php print SITE_NAME; ?> <?php if(PROVIDED_BY) { print PROVIDED_BY; } ?> + <?php print $title; ?> diff --git a/webui/view/theme/default/templates/common/layout-email.tpl b/webui/view/theme/default/templates/common/layout-email.tpl index 9ca2694b..5538b071 100644 --- a/webui/view/theme/default/templates/common/layout-email.tpl +++ b/webui/view/theme/default/templates/common/layout-email.tpl @@ -2,7 +2,7 @@ - <?php print $title; ?> | <?php print SITE_NAME; ?> <?php if(PROVIDED_BY) { print PROVIDED_BY; } ?> + <?php print $title; ?> diff --git a/webui/view/theme/default/templates/common/layout-search.tpl b/webui/view/theme/default/templates/common/layout-search.tpl index ea66c593..d94e44fc 100644 --- a/webui/view/theme/default/templates/common/layout-search.tpl +++ b/webui/view/theme/default/templates/common/layout-search.tpl @@ -2,7 +2,7 @@ - <?php print $title; ?> | <?php print SITE_NAME; ?> <?php if(PROVIDED_BY) { print PROVIDED_BY; } ?> + <?php print $title; ?> diff --git a/webui/view/theme/default/templates/common/layout.tpl b/webui/view/theme/default/templates/common/layout.tpl index 1138fec5..1fe9a861 100644 --- a/webui/view/theme/default/templates/common/layout.tpl +++ b/webui/view/theme/default/templates/common/layout.tpl @@ -2,7 +2,7 @@ - <?php print $title; ?> | <?php print SITE_NAME; ?> <?php if(PROVIDED_BY) { print PROVIDED_BY; } ?> + <?php print $title; ?> diff --git a/webui/view/theme/default/templates/login/login.tpl b/webui/view/theme/default/templates/login/login.tpl index d7d0b7f1..a68da3cb 100644 --- a/webui/view/theme/default/templates/login/login.tpl +++ b/webui/view/theme/default/templates/login/login.tpl @@ -2,7 +2,7 @@ - <?php print SITE_NAME; ?> | <?php print PROVIDED_BY; ?> + <?php print $title; ?> diff --git a/webui/view/theme/mobile/templates/common/layout-email.tpl b/webui/view/theme/mobile/templates/common/layout-email.tpl index d12bf9cd..9f8f86f9 100644 --- a/webui/view/theme/mobile/templates/common/layout-email.tpl +++ b/webui/view/theme/mobile/templates/common/layout-email.tpl @@ -2,7 +2,7 @@ - piler<?php if(isset($title) && $title) { ?> | <?php print $title; } ?> + <?php print $title; ?> diff --git a/webui/view/theme/mobile/templates/common/layout.tpl b/webui/view/theme/mobile/templates/common/layout.tpl index fae1b072..55771b56 100644 --- a/webui/view/theme/mobile/templates/common/layout.tpl +++ b/webui/view/theme/mobile/templates/common/layout.tpl @@ -2,7 +2,7 @@ - piler | <?php print $title; ?> + <?php print $title; ?> diff --git a/webui/view/theme/mobile/templates/login/login.tpl b/webui/view/theme/mobile/templates/login/login.tpl index 874195c8..7162a55f 100644 --- a/webui/view/theme/mobile/templates/login/login.tpl +++ b/webui/view/theme/mobile/templates/login/login.tpl @@ -2,11 +2,12 @@ - piler | <?php print $title; ?> + <?php print $title; ?> - - + + + From fa76a1a0e7d89cd1348895b6ef7860b3ca4f2c64 Mon Sep 17 00:00:00 2001 From: SJ Date: Tue, 6 Aug 2013 11:04:20 +0200 Subject: [PATCH 3/6] login title fix --- webui/controller/login/login.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webui/controller/login/login.php b/webui/controller/login/login.php index 547a1a4c..40375207 100644 --- a/webui/controller/login/login.php +++ b/webui/controller/login/login.php @@ -32,7 +32,7 @@ class ControllerLoginLogin extends Controller { $this->load->model('saas/customer'); } - $this->document->title = $this->data['text_login']; + $this->data['title'] = $this->data['text_login']; if($this->request->server['REQUEST_METHOD'] == 'POST' && $this->validate() == true) { From e8f3b51ca52802f0d5a1cbaff446d61451d84e79 Mon Sep 17 00:00:00 2001 From: SJ Date: Tue, 6 Aug 2013 11:32:02 +0200 Subject: [PATCH 4/6] added mobile device detection --- webui/config.php | 4 ++++ webui/system/controller.php | 3 ++- webui/system/helper/detectmobilebrowser.php | 7 +++++++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 webui/system/helper/detectmobilebrowser.php diff --git a/webui/config.php b/webui/config.php index 854bf550..099bac98 100644 --- a/webui/config.php +++ b/webui/config.php @@ -237,6 +237,10 @@ require_once 'config-site.php'; if(isset($_SESSION['theme']) && preg_match("/^([a-zA-Z0-9\-\_]+)$/", $_SESSION['theme'])) { $config['THEME'] = $_SESSION['theme']; } +include("/system/helper/detectmobilebrowser.php"); + +if(MOBILE_DEVICE == 1) { $config['THEME'] = 'mobile'; } + // make sure auditors are restricted in a saas environment if($config['ENABLE_SAAS'] == 1) { $config['RESTRICTED_AUDITOR'] = 1; } if(isset($_SESSION['username']) && $_SESSION['username'] == 'auditor@local') { $config['RESTRICTED_AUDITOR'] = 0; } diff --git a/webui/system/controller.php b/webui/system/controller.php index 6bb88a15..6a5b017e 100644 --- a/webui/system/controller.php +++ b/webui/system/controller.php @@ -93,7 +93,8 @@ class Controller { $file = DIR_THEME . THEME . '/templates/' . $this->template; } - + if(MOBILE_DEVICE == 1) { $file = DIR_THEME . 'mobile' . '/templates/' . $this->template; } + if(file_exists($file)){ extract($this->data); diff --git a/webui/system/helper/detectmobilebrowser.php b/webui/system/helper/detectmobilebrowser.php new file mode 100644 index 00000000..a5e8ae8a --- /dev/null +++ b/webui/system/helper/detectmobilebrowser.php @@ -0,0 +1,7 @@ + From c6099145f45c3d984e75b9350f59fd3714581ffd Mon Sep 17 00:00:00 2001 From: SJ Date: Tue, 6 Aug 2013 11:35:25 +0200 Subject: [PATCH 5/6] mobile detection fix --- webui/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webui/config.php b/webui/config.php index 099bac98..59fafee6 100644 --- a/webui/config.php +++ b/webui/config.php @@ -237,7 +237,7 @@ require_once 'config-site.php'; if(isset($_SESSION['theme']) && preg_match("/^([a-zA-Z0-9\-\_]+)$/", $_SESSION['theme'])) { $config['THEME'] = $_SESSION['theme']; } -include("/system/helper/detectmobilebrowser.php"); +include("system/helper/detectmobilebrowser.php"); if(MOBILE_DEVICE == 1) { $config['THEME'] = 'mobile'; } From 4b9d07dd234c2be807e688e7b46e3dbaa2c1de66 Mon Sep 17 00:00:00 2001 From: SJ Date: Wed, 7 Aug 2013 14:02:56 +0200 Subject: [PATCH 6/6] postinstall typo fix --- util/postinstall.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/postinstall.sh b/util/postinstall.sh index 441174e3..06042d95 100755 --- a/util/postinstall.sh +++ b/util/postinstall.sh @@ -105,7 +105,7 @@ make_cron_entries() { echo "30 2 * * * $LIBEXECDIR/piler/indexer.main.sh" >> $CRON_TMP echo "*/15 * * * * $INDEXER --quiet tag1 --rotate" >> $CRON_TMP echo "*/15 * * * * $INDEXER --quiet note1 --rotate" >> $CRON_TMP - echo "30 6 * * * /usr/bin/php $LIBEXECDIR/piler/generate_stats.php $$DOCROOT" >> $CRON_TMP + echo "30 6 * * * /usr/bin/php $LIBEXECDIR/piler/generate_stats.php $DOCROOT" >> $CRON_TMP echo "### PILEREND" >> $CRON_TMP }