diff --git a/modules/ncenterlite/ncenterlite.controller.php b/modules/ncenterlite/ncenterlite.controller.php index 705e1a10b..abfd56ff7 100644 --- a/modules/ncenterlite/ncenterlite.controller.php +++ b/modules/ncenterlite/ncenterlite.controller.php @@ -985,9 +985,19 @@ class ncenterliteController extends ncenterlite function procNcenterliteRedirect() { $logged_info = Context::get('logged_info'); - $url = Context::get('url'); + if(!$logged_info || !$logged_info->member_srl) + { + throw new Rhymix\Framework\Exceptions\MustLogin; + } + $notify = Context::get('notify'); - if(!$logged_info || !$url || !$notify) + if(!strlen($notify)) + { + throw new Rhymix\Framework\Exceptions\InvalidRequest; + } + + $notify_info = getModel('ncenterlite')->getNotification($notify, $logged_info->member_srl); + if (!$notify_info) { throw new Rhymix\Framework\Exceptions\InvalidRequest; } @@ -998,8 +1008,7 @@ class ncenterliteController extends ncenterlite return $output; } - $url = str_replace('&', '&', $url); - header('Location: ' . $url, TRUE, 302); + header('Location: ' . $notify_info->target_url, true, 302); Context::close(); exit; } diff --git a/modules/ncenterlite/ncenterlite.model.php b/modules/ncenterlite/ncenterlite.model.php index 8dded7870..131de829b 100644 --- a/modules/ncenterlite/ncenterlite.model.php +++ b/modules/ncenterlite/ncenterlite.model.php @@ -188,7 +188,7 @@ class ncenterliteModel extends ncenterlite { $v->text = $this->getNotificationText($v); $v->ago = $this->getAgo($v->regdate); - $v->url = getUrl('','act','procNcenterliteRedirect', 'notify', $v->notify, 'url', $v->target_url); + $v->url = getUrl('','act','procNcenterliteRedirect', 'notify', $v->notify); if($v->target_member_srl) { $profileImage = $oMemberModel->getProfileImage($v->target_member_srl); @@ -405,6 +405,29 @@ class ncenterliteModel extends ncenterlite $this->add('colorset_list', $colorsets); } + /** + * Get information about a single notification. + * + * @param string $notify + * @param int $member_srl + * @return object|false + */ + public function getNotification($notify, $member_srl) + { + $args = new stdClass; + $args->notify = $notify; + $args->member_srl = $member_srl; + $output = executeQuery('ncenterlite.getNotify', $args); + if ($output->toBool() && $output->data) + { + return $output->data; + } + else + { + return false; + } + } + /** * Return the notification text. * diff --git a/modules/ncenterlite/queries/getNotify.xml b/modules/ncenterlite/queries/getNotify.xml new file mode 100644 index 000000000..c0be88e16 --- /dev/null +++ b/modules/ncenterlite/queries/getNotify.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + +