public function edit($args) { $project = $args[0]; $p = PermissionHandler::getInstance(); // do we have an error thing? if (!$p->allowedto(PermissionHandler::PERM_EDIT_EPISODE, $project)) { Utils::error('You don\'t have permission to edit this episode.'); return; } }
public function settings($args) { $this->vars["pagename"] = "Administration :: Settings"; $p = PermissionHandler::getInstance(); if (!$p->allowedto(PermissionHandler::PERM_EDIT_SETTINGS)) { Utils::error("You don't have permission to edit settings."); return; } if (isset($_POST) && !empty($_POST)) { foreach ($_POST as $k => $v) { Doctrine_Query::create()->update("Setting")->set("value", "?", $v)->where("name = ?", str_replace("_", ".", $k))->execute(); } Utils::success("Settings saved."); } $this->vars["settings"] = Doctrine_Query::create()->from("Setting")->fetchArray(); }
public function edit($args) { $project = $args[0]; $p = PermissionHandler::getInstance(); // do we have an error thing? if (!$p->allowedto(PermissionHandler::PERM_EDIT_PROJECT, $project)) { Utils::error("You don't have permission to edit this project."); return; } }
public function edit($args) { if (count($args) == 0) { $this->view = null; Utils::redirect('staff'); return; } $staff = $args[0]; $p = PermissionHandler::getInstance(); $session = SesMan::getInstance(); // PERM_EDIT_STAFF is different slightly, since they are always allowed to edit their own profile. if (!$p->allowedto(PermissionHandler::PERM_EDIT_STAFF) && $staff != $session['staffid']) { Utils::error('You don\'t have permission to edit other staff members.'); return; } }
* Copyright (c) 2009 Frac Development Team * * See COPYING for license conditions. */ // commands to run before Fwork::__construct is executed. Full access to the Fwork object is provided in its state at the beginning of Fwork::serve. $session = SesMan::getInstance(); // we don't want to redirect them if they're already at login... // ... is there some better way of checking for this? O_o // hold on, hold on. are we actually logged in or is it wrong? if (isset($session['staffid'])) { $user = Doctrine::getTable('Staff')->find($session['staffid']); if ($user == null) { unset($session['staffid']); } } if (!isset($session['staffid']) && ($path[0] != "staff" || $path[1] != "login")) { // if they're not logged in, send them to login, PERIOD. // But set their last page first. $session['lastpage'] = 'staff/login'; Utils::redirect("staff/login"); return; } if (isset($session['flash'])) { $this->savant->flashmsg = $session['flash']; // If we had a flash message, NOW WE DON'T unset($session['flash']); } $this->savant->staffid = $session['staffid']; // they're logged in, so start the permissionhandler $permissions = PermissionHandler::getInstance(); $permissions->id = $session['staffid'];
define("WIKI_DIFF", "wiki.php"); define("WIKI_CATEGORY_LISTING", "wiki.php"); define("WIKI_CONTRIBUTORS", "wiki.php"); } if (class_exists('MybbStuff_MyAlerts_AlertFormatterManager')) { require_once MYBB_ROOT . "inc/plugins/wiki/WikiCustomAlertFormatter.php"; $formatterManager = MybbStuff_MyAlerts_AlertFormatterManager::getInstance(); if (!$formatterManager) { $formatterManager = MybbStuff_MyAlerts_AlertFormatterManager::createInstance($mybb, $lang); } $formatterManager->registerFormatter(new WikiCustomAlertFormatter($mybb, $lang, 'mybb_wiki_alert_code')); } eval("\$menu_wiki .= \"" . $templates->get("wiki_menu_item") . "\";"); } function wiki_admin_user_groups_add_commit_end() { global $gid, $permission; $permission->register_group($gid); } function wiki_admin_user_groups_delete_commit_end() { global $usergroup, $permission; $permission->delete_group($usergroup['gid']); } /** * Create our handlers. */ if (wiki_is_installed()) { require_once 'wiki/handlers/PermissionHandler.php'; $permission = PermissionHandler::singleton(); }