diff options
author | mensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2009-01-15 18:05:08 +0000 |
---|---|---|
committer | mensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2009-01-15 18:05:08 +0000 |
commit | 24ab0f6487d7a3883af126cc22f5d9d08acf3a80 (patch) | |
tree | 33e842341ca277da4ba757cacf716c796d36c5c9 /search.php | |
parent | eac302f2255460c6d7e35f1d29c26d488089d6ea (diff) | |
download | semanticscuttle-24ab0f6487d7a3883af126cc22f5d9d08acf3a80.tar.gz semanticscuttle-24ab0f6487d7a3883af126cc22f5d9d08acf3a80.tar.bz2 |
Minor Refactoring: add getIdFromUser()
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@238 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'search.php')
-rw-r--r-- | search.php | 18 |
1 files changed, 7 insertions, 11 deletions
@@ -95,18 +95,14 @@ if (POST_TERMS != '') { } if (isset($s_user)) { - if (is_numeric($s_user)) { - $s_user = intval($s_user); - } else { - $userinfo = $userservice->getObjectUserByUsername($s_user); - if ($userinfo == '' ) { - $tplVars['error'] = sprintf(T_('User with username %s was not found'), $s_user); - $templateservice->loadTemplate('error.404.tpl', $tplVars); - exit(); - } else { - $s_user =& $userinfo->getId(); - } + + $s_user = $userservice->getIdFromUser($s_user); + if($s_user == NULL) { + $tplVars['error'] = sprintf(T_('User with username %s was not found'), $s_user); + $templateservice->loadTemplate('error.404.tpl', $tplVars); + exit(); } + } } $bookmarks =& $bookmarkservice->getBookmarks($start, $perpage, $s_user, NULL, $terms, getSortOrder(), $s_watchlist, $s_start, $s_end); |