Switched various files to new Login service.

This commit is contained in:
2014-01-19 03:11:59 +01:00
parent 9954387e90
commit 41a027417d
28 changed files with 153 additions and 158 deletions

View File

@ -11,8 +11,8 @@
$tpl->name = 'mytop5';
$tpl->menuitem = MNU_MYPROFILE_RECOMMENDATIONS;
$login->verify();
if ($login->userid == 0)
$GLOBALS['container']->get('ocde.login')->verify();
if ($GLOBALS['container']->get('ocde.login')->getUserId() == 0)
$tpl->redirect('login.php?target=mytop5.php');
$action = isset($_REQUEST['action']) ? mb_strtolower($_REQUEST['action']) : '';
@ -20,7 +20,7 @@
if ($action == 'delete')
{
$cache_id = isset($_REQUEST['cacheid']) ? $_REQUEST['cacheid']+0 : 0;
sql("DELETE FROM `cache_rating` WHERE `cache_id`='&1' AND `user_id`='&2'", $cache_id, $login->userid);
sql("DELETE FROM `cache_rating` WHERE `cache_id`='&1' AND `user_id`='&2'", $cache_id, $GLOBALS['container']->get('ocde.login')->getUserId());
if (sql_affected_rows() == 0)
{
// will happen if
@ -44,7 +44,7 @@
INNER JOIN `caches` ON `cache_rating`.`cache_id`=`caches`.`cache_id`
LEFT JOIN `caches_attributes` `ca` ON `ca`.`cache_id`=`caches`.`cache_id` AND `ca`.`attrib_id`=6
WHERE `cache_rating`.`user_id`='&1'
ORDER BY `rating_date` DESC", $login->userid);
ORDER BY `rating_date` DESC", $GLOBALS['container']->get('ocde.login')->getUserId());
$tpl->assign_rs('ratings', $rs);
sql_free_result($rs);