/** * Summary of displayInternalHeader */ public static function displayInternalHeader() { // userid // username // sitenotice global $smarty, $session; $userid = isset($_SESSION['userID']) ? $_SESSION['userID'] : 0; $user = isset($_SESSION['user']) ? $_SESSION['user'] : ""; $sitenotice = InterfaceMessage::get(InterfaceMessage::SITENOTICE); $smarty->assign("userid", $userid); $smarty->assign("username", $user); $smarty->assign("sitenotice", $sitenotice); $smarty->assign("alerts", SessionAlert::retrieve()); $smarty->display("header-internal.tpl"); if ($userid != 0) { User::getCurrent()->touchLastLogin(); $session->forceLogout($_SESSION['userID']); } }
private function getIdentityCache() { global $oauthConsumerToken, $oauthSecretToken, $oauthBaseUrl, $oauthBaseUrlInternal; try { $util = new OAuthUtility($oauthConsumerToken, $oauthSecretToken, $oauthBaseUrl, $oauthBaseUrlInternal); $this->identityCache = $util->getIdentity($this->oauthaccesstoken, $this->oauthaccesssecret); $this->oauthidentitycache = serialize($this->identityCache); $this->dbObject->prepare("UPDATE user SET oauthidentitycache = :identity WHERE id = :id;")->execute(array(":id" => $this->id, ":identity" => $this->oauthidentitycache)); } catch (UnexpectedValueException $ex) { $this->identityCache = null; $this->oauthidentitycache = null; $this->dbObject->prepare("UPDATE user SET oauthidentitycache = null WHERE id = :id;")->execute(array(":id" => $this->id)); SessionAlert::warning("OAuth error getting identity from MediaWiki: " . $ex->getMessage()); } }
$emailTemplate->setActive(isset($_POST['active'])); $emailTemplate->setPreloadOnly(isset($_POST['preloadonly'])); } // Check if the entered name already exists (since these names are going to be used as the labels for buttons on the zoom page). $nameCheck = EmailTemplate::getByName($_POST['name'], gGetDb()); if ($nameCheck != false && $nameCheck->getId() != $_GET['edit']) { BootstrapSkin::displayAlertBox("That Email template name is already being used. Please choose another."); BootstrapSkin::displayInternalFooter(); die; } $database->transactionally(function () use($database, $emailTemplate) { $emailTemplate->save(); Logger::editedEmail($database, $emailTemplate); global $baseurl; Notification::emailEdited($emailTemplate); SessionAlert::success("Email template has been saved successfully."); header("Location: {$baseurl}/acc.php?action=emailmgmt"); }); die; } $emailTemplate = EmailTemplate::getById($_GET['edit'], gGetDb()); $smarty->assign('id', $emailTemplate->getId()); $smarty->assign('emailTemplate', $emailTemplate); $smarty->assign('createdid', $createdid); $smarty->assign('requeststates', $availableRequestStates); $smarty->assign('emailmgmtpage', 'Edit'); // Use a variable so we don't need two Smarty templates for creating and editing. $smarty->display("email-management/edit.tpl"); BootstrapSkin::displayInternalFooter(); die; }