diff options
author | mensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2008-01-11 09:34:32 +0000 |
---|---|---|
committer | mensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2008-01-11 09:34:32 +0000 |
commit | 0bfd4e4d3f4fa3db0b2de50277b0cfbddcf6efdf (patch) | |
tree | 02a9e7a282f8e5c46596d728e76ec72170e38a9a /tag2tagdelete.php | |
parent | cfbf95ebe5417875e739eacf344304f478d855c0 (diff) | |
download | semanticscuttle-0bfd4e4d3f4fa3db0b2de50277b0cfbddcf6efdf.tar.gz semanticscuttle-0bfd4e4d3f4fa3db0b2de50277b0cfbddcf6efdf.tar.bz2 |
Interface design: structured tags on frontpage and tag pages + permission control added to add and delete tag links
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@10 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'tag2tagdelete.php')
-rw-r--r-- | tag2tagdelete.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tag2tagdelete.php b/tag2tagdelete.php index e75e60a..f794456 100644 --- a/tag2tagdelete.php +++ b/tag2tagdelete.php @@ -24,12 +24,20 @@ $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, $tag1, $tag2) = explode('/', $_SERVER['PATH_INFO']); if ($_POST['confirm']) { if ($tag2tagservice->removeLinkedTags($_POST['tag1'], $_POST['tag2'], '>', $userservice->getCurrentUserId())) { $tplVars['msg'] = T_('Tag link deleted'); - $logged_on_user = $userservice->getCurrentUser(); header('Location: '. createURL('bookmarks', $logged_on_user[$userservice->getFieldName('username')])); } else { $tplVars['error'] = T_('Failed to delete the link'); @@ -37,7 +45,6 @@ if ($_POST['confirm']) { exit(); } } elseif ($_POST['cancel']) { - $logged_on_user = $userservice->getCurrentUser(); header('Location: '. createURL('bookmarks', $logged_on_user[$userservice->getFieldName('username')] .'/'. $tags)); } |