function getJsonSeatChange($type, $seatId, $username = null, $usercss = null, $seatCss = null) { if (Session::isLoggedIn() && $username == Session::getUser()->getUsername()) { $username = '******'; } return array('type' => $type, 'seat' => $seatId, 'username' => $username, 'usernameCss' => $usercss, 'seatCss' => $seatCss); }
public function renderSidebar() { global $db, $tpl; if (Session::isLoggedIn()) { $f = new FormShoutbox(); if ($f->validate()) { $f->process(); } } startbox(); $sql = 'SELECT ps.id, u.username, u.id userId, ps.content FROM plugin_shoutbox ps, users u WHERE ps.user = u.id ORDER BY ps.id DESC LIMIT 3'; $result = $db->query($sql); foreach ($result->fetchAll() as $shout) { echo '<p><a href = "profile.php?id=' . $shout['userId'] . '">' . $shout['username'] . '</a>: ' . $shout['content'] . '</p>'; } if (Session::isLoggedIn()) { echo '<hr />'; $tpl->assignForm($f); $tpl->assign('excludeBox', true); $tpl->display('form.tpl'); $tpl->clear_assign('form'); } stopbox('Shout Box'); }
<?php /******************************************************************************* Copyright (C) 2004-2006 xconspirisist (xconspirisist@gmail.com) This file is part of pFrog. pFrog is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. pFrog is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with pFrog; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *******************************************************************************/ require_once 'includes/common.php'; if (\libAllure\Session::isLoggedIn()) { \libAllure\Session::logout(); } $core->redirect('index.php', 'You are now logged out.'); require_once 'includes/widgets/footer.php';
<?php require_once 'includes/common.php'; require_once 'includes/classes/FormUpdateProfile.php'; requireLogin(); require_once 'includes/widgets/header.php'; require_once 'includes/widgets/sidebar.php'; use libAllure\Session; use libAllure\HtmlLinksCollection; use libAllure\DatabaseFactory; if (!Session::isLoggedIn()) { loginPrompt(); } $notifications = array(); if (Session::hasPriv('GALLERY_APPROVE_IMAGE')) { $sql = 'SELECT i.filename, g.id AS gallery, g.title AS galleryTitle FROM images i LEFT JOIN galleries g ON i.gallery = g.id WHERE i.user_uploaded != 0 AND i.published = 0 '; $stmt = DatabaseFactory::getInstance()->prepare($sql); $stmt->execute(); $unpublishedUserUploadedImages = $stmt->fetchAll(); foreach ($unpublishedUserUploadedImages as $image) { $notifications[] = 'Image <a href = "viewGalleryImage.php?filename=' . $image['filename'] . '&gallery=' . $image['gallery'] . '">' . $image['filename'] . '</a> in gallery ' . $image['galleryTitle'] . ', uploaded by a user, is unpublished. Please publish or delete.'; } } checkNotificationNotGuarenteedSeats($notifications); $tpl->assign('notifications', $notifications); $tpl->assign('emailFlagged', Session::getUser()->getData('emailFlagged')); $tpl->assign('username', Session::getUser()->getUsername()); $standardLinks = new HtmlLinksCollection(); $standardLinks->addIf(Session::hasPriv('CHANGE_AVATAR'), 'updateAvatar.php', 'Avatar', 'avatar'); $standardLinks->addIf(Session::hasPriv('VIEW_ATTENDANCE'), 'viewAttendance.php', 'Attendance'); $standardLinks->addIfPriv('UPLOAD_GALLERY_IMAGE', 'formUploadImage.php', 'Upload gallery image');
function formatDt(DateTime $date, $format = null) { if (empty($format)) { if (Session::isLoggedIn()) { $dateFormat = Session::getUser()->getData('dateFormat'); } else { $dateFormat = 'Y-m-d H:i'; } } else { $dateFormat = $format; } if ($dateFormat == "opus") { return formatDtOpus($date); } $dateTime = empty($dateTime) ? 'Y-m-d H:i' : $dateFormat; return $date->format($dateFormat); }
$tpl->error('Could not find user.'); } if (Session::hasPriv('GROUP_EDIT')) { $formAddUserToGroup = new FormAddUserToGroup($user->getId()); if ($formAddUserToGroup->validate()) { $formAddUserToGroup->process(); } } require_once 'includes/widgets/header.php'; require_once 'includes/widgets/sidebar.php'; $userArray = array('username' => $user->getData('username'), 'realName' => $user->getData('real_name'), 'registered' => $user->getData('registered')); $avatarUrl = 'resources/images/avatars/' . $user->getId() . '.png'; if (file_exists($avatarUrl)) { $userArray['avatar'] = $avatarUrl; } if (Session::isLoggedIn() && Session::getUser()->hasPriv('VIEW_PROFILE_PRIVATE')) { $userArray['canSeePrivate'] = true; $userArray['lastLogin'] = $user->getData('lastLogin'); $userArray['email'] = $user->getData('email'); $bannedReason = $user->getData('bannedReason'); $userArray['isBanned'] = !empty($bannedReason); $userArray['bannedReason'] = $bannedReason; } else { $userArray['canSeePrivate'] = false; } $tpl->assign('user', $userArray); $tpl->display('profile.tpl'); if (Session::hasPriv('PRIVS_VIEW')) { $listPermissions = array(); foreach ($user->getPrivs() as $privilege) { if ($privilege['source'] == 'Group') {
<?php require_once 'includes/common.php'; use libAllure\Session; $id = intval($_REQUEST['id']); if (!(Session::isLoggedIn() && Session::getUser()->hasPriv('EVENT_DELETE'))) { throw new PermissionsException(); } $sql = 'DELETE FROM events WHERE id = :id LIMIT 1'; $stmt = $db->prepare($sql); $stmt->bindValue(':id', $id); $stmt->execute(); logActivity('Event deleted'); redirect('listEvents.php', 'Event deleted. Oh dear.');
function getThemeDirectory() { $installedThemes = 'resources/themes/'; if (Session::isLoggedIn()) { $theme = Session::getUser()->getData('theme'); if (is_dir($installedThemes . $theme)) { return $installedThemes . $theme; } } return $installedThemes . getSiteSetting('theme', 'airdale'); }
$tpl->assign('username', Session::getUser()->getUsername()); $tpl->assign('userId', Session::getUser()->getId()); } else { $tpl->assign('avatar', 'resources/images/defaultAvatar.png'); $tpl->assign('username', 'Guest'); } // We don't output all the naviagion and whatnot if there has been some sort of error. if (isset($_GET['error']) || basename($_SERVER['PHP_SELF']) == 'error.php') { return; } $sql = 'SELECT i.title, i.url FROM additional_menu_items i '; $stmt = $db->query($sql); $ll = new HtmlLinksCollection(); foreach ($stmt->fetchAll() as $link) { $ll->add($link['url'], $link['title']); } if (!empty($_SESSION['userHidden'])) { $tpl->assign('userHidden', $_SESSION['userHidden']->getUsername()); } $tpl->assign('promo', 'resources/themes/westlan.ng/images/logo.png'); $tpl->assign('IS_LOGGED_IN', Session::isLoggedIn()); $tpl->assign('additionalLinks', $ll); $tpl->assign('globalAnnouncement', getSiteSetting('globalAnnouncement')); $tpl->assign('newsFeatureEnabled', getSiteSetting('newsFeature')); $tpl->assign('galleryFeatureEnabled', getSiteSetting('galleryFeature')); $tpl->assign('notification', SessionBasedNotifications::getInstance()->pop()); $tpl->assign('isMobileBrowser', isMobileBrowser()); $tpl->assign('theme', getThemeDirectory()); $tpl->assign('siteTitle', getSiteSetting('siteTitle')); $tpl->assign('siteDescription', getSiteSetting('siteDescription')); $tpl->display('header.tpl');