summaryrefslogtreecommitdiffstatshomepage
path: root/watch.php
diff options
context:
space:
mode:
authorGravatar mensonge2009-01-15 18:05:08 +0000
committerGravatar mensonge2009-01-15 18:05:08 +0000
commit24ab0f6487d7a3883af126cc22f5d9d08acf3a80 (patch)
tree33e842341ca277da4ba757cacf716c796d36c5c9 /watch.php
parenteac302f2255460c6d7e35f1d29c26d488089d6ea (diff)
downloadscuttle-24ab0f6487d7a3883af126cc22f5d9d08acf3a80.tar.gz
scuttle-24ab0f6487d7a3883af126cc22f5d9d08acf3a80.zip
Minor Refactoring: add getIdFromUser()
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@238 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'watch.php')
-rw-r--r--watch.php17
1 files changed, 6 insertions, 11 deletions
diff --git a/watch.php b/watch.php
index 9fc480b..841317d 100644
--- a/watch.php
+++ b/watch.php
@@ -34,17 +34,12 @@ $currentUser = $userservice->getCurrentObjectUser();
if ($userservice->isLoggedOn() && $user) {
$pagetitle = '';
- if (is_int($user)) {
- $userid = intval($user);
- } else {
- $userinfo = $userservice->getObjectUserByUsername($user);
- if ($userinfo == '') {
- $tplVars['error'] = sprintf(T_('User with username %s was not found'), $user);
- $templateservice->loadTemplate('error.404.tpl', $tplVars);
- exit();
- } else {
- $userid =& $userinfo->getId();
- }
+ $userid = $userservice->getIdFromUser($user);
+
+ if($userid == NULL) {
+ $tplVars['error'] = sprintf(T_('User with username %s was not found'), $user);
+ $templateservice->loadTemplate('error.404.tpl', $tplVars);
+ exit();
}
$watched = $userservice->getWatchStatus($userid, $currentUser->getId());