diff options
Diffstat (limited to 'tag2tagadd.php')
-rw-r--r-- | tag2tagadd.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tag2tagadd.php b/tag2tagadd.php index 916c388..83af1d6 100644 --- a/tag2tagadd.php +++ b/tag2tagadd.php @@ -24,13 +24,22 @@ $tag2tagservice = & ServiceFactory :: getServiceInstance('Tag2TagService'); $templateservice = & ServiceFactory :: getServiceInstance('TemplateService'); $userservice = & ServiceFactory :: getServiceInstance('UserService'); +$logged_on_user = $userservice->getCurrentUser(); + +//permissions +if($logged_on_user == null) { + $tplVars['error'] = T_('Permission denied.'); + $templateservice->loadTemplate('error.500.tpl', $tplVars); + exit(); +} + + list ($url, $tag) = explode('/', $_SERVER['PATH_INFO']); if ($_POST['confirm']) { $newTag = $_POST['newTag']; if ($tag2tagservice->addLinkedTags($tag, $newTag, '>', $userservice->getCurrentUserId())) { $tplVars['msg'] = T_('Tag link created'); - $logged_on_user = $userservice->getCurrentUser(); header('Location: '. createURL('bookmarks', $logged_on_user[$userservice->getFieldName('username')])); } else { $tplVars['error'] = T_('Failed to create the link'); @@ -38,7 +47,6 @@ if ($_POST['confirm']) { exit(); } } elseif ($_POST['cancel']) { - $logged_on_user = $userservice->getCurrentUser(); header('Location: '. createURL('bookmarks', $logged_on_user[$userservice->getFieldName('username')] .'/'. $tags)); } |