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 /tag2tagadd.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 '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)); } |