From a56a73e7b2f1c6017ca912747cb9ad3ca1c5029c Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 30 Apr 2008 12:32:09 +0000 Subject: [PATCH] Messages base64 encoded Closes #450 git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10745 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../addons/goto/events/DaemonEvent_notify.tpl | 4 ++++ .../goto/events/class_DaemonEvent_notify.inc | 19 ++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/gosa-plugins/goto/addons/goto/events/DaemonEvent_notify.tpl b/gosa-plugins/goto/addons/goto/events/DaemonEvent_notify.tpl index 1499e46fa..479dafb61 100644 --- a/gosa-plugins/goto/addons/goto/events/DaemonEvent_notify.tpl +++ b/gosa-plugins/goto/addons/goto/events/DaemonEvent_notify.tpl @@ -6,6 +6,10 @@ {t}Message settings{/t} + + + + diff --git a/gosa-plugins/goto/addons/goto/events/class_DaemonEvent_notify.inc b/gosa-plugins/goto/addons/goto/events/class_DaemonEvent_notify.inc index 0f0365bc9..16a2796f9 100644 --- a/gosa-plugins/goto/addons/goto/events/class_DaemonEvent_notify.inc +++ b/gosa-plugins/goto/addons/goto/events/class_DaemonEvent_notify.inc @@ -29,10 +29,17 @@ class DaemonEvent_notify extends DaemonEvent var $message = ""; var $subject = ""; + var $from = ""; public function __construct($config,$data = array()) { DaemonEvent::__construct($config,$data); + + $ui = get_userinfo(); + $this->from = $ui->cn; + + $this->message = base64_decode($this->message); + $this->s_Menu_Name = _("Send message"); $this->s_Event_Name = _("Send message"); @@ -57,8 +64,6 @@ class DaemonEvent_notify extends DaemonEvent $display = $this->get_header(); $tmp = $this->data; $smarty = get_smarty(); - $smarty->assign("subject" ,"subject"); - $smarty->assign("message" ,"message"); $smarty->assign("data" , $this->data); $smarty->assign("is_new" , $this->is_new); $smarty->assign("timestamp" , $this->get_time_select()); @@ -69,6 +74,7 @@ class DaemonEvent_notify extends DaemonEvent $smarty->assign("add_str", msgPool::addButton(_("Target"))); $smarty->assign("del_str", msgPool::delButton(_("Target"))); + $smarty->assign("from", xmlentities($this->from)); $smarty->assign("subject", xmlentities($this->subject)); $smarty->assign("message", xmlentities($this->message)); @@ -87,6 +93,9 @@ class DaemonEvent_notify extends DaemonEvent if(empty($this->message)){ $msgs[] = msgPool::required(_("Message")); } + if(empty($this->from)){ + $msgs[] = msgPool::required(_("From")); + } if(!count($this->groups) && !count($this->users)){ $msgs[] = msgPool::required(_("Target")); } @@ -119,6 +128,9 @@ class DaemonEvent_notify extends DaemonEvent if(isset($_POST['message'])){ $this->message = get_post('message'); } + if(isset($_POST['from'])){ + $this->from = get_post('from'); + } } public function add_users($targets) @@ -187,7 +199,8 @@ class DaemonEvent_notify extends DaemonEvent $ret['users'] = array_values($this->users); $ret['groups'] = array_values($this->groups); $ret['subject'] = $this->subject; - $ret['message'] = $this->message; + $ret['from'] = $this->from; + $ret['message'] = base64_encode($this->message); return($ret); } } -- 2.30.2
{t}Sender{/t}
{t}Subject{/t}