function displayPage() { $db =& $this->db; $user =& $this->user; $homepage = $this->user->homePage; if ($homepage == 'mediamanager') { include 'lib/pages/mediamanager.class.php'; $userHomepage = new mediamanagerDAO($db, $user); } else { if ($homepage == 'statusdashboard') { include 'lib/pages/statusdashboard.class.php'; $userHomepage = new statusdashboardDAO($db, $user); } else { include "lib/pages/dashboard.class.php"; $userHomepage = new dashboardDAO($db, $user); } } $userHomepage->displayPage(); }
function displayPage() { $db =& $this->db; $user =& $this->user; // Shall we show the new user dashboard? $newUserWizard = 1; try { $dbh = PDOConnect::init(); $sth = $dbh->prepare('SELECT newUserWizard FROM `user` WHERE userid = :userid'); $sth->execute(array('userid' => $user->userid)); $newUserWizard = $sth->fetchColumn(0); } catch (Exception $e) { Debug::LogEntry('error', $e->getMessage(), get_class(), __FUNCTION__); } if ($newUserWizard == 0 || Kit::GetParam('sp', _GET, _WORD) == 'welcome') { // Update to say we have seen it try { $dbh = PDOConnect::init(); $sth = $dbh->prepare('UPDATE `user` SET newUserWizard = 1 WHERE userid = :userid'); $sth->execute(array('userid' => $user->userid)); } catch (Exception $e) { Debug::LogEntry('error', $e->getMessage()); } Theme::Render('new_user_welcome'); } else { $homepage = $this->user->homePage; if ($homepage == 'mediamanager') { include 'lib/pages/mediamanager.class.php'; $userHomepage = new mediamanagerDAO($db, $user); } else { if ($homepage == 'statusdashboard') { include 'lib/pages/statusdashboard.class.php'; $userHomepage = new statusdashboardDAO($db, $user); } else { include "lib/pages/dashboard.class.php"; $userHomepage = new dashboardDAO($db, $user); } } $userHomepage->displayPage(); } }