本文整理汇总了PHP中UserManager::GetLocalUser方法的典型用法代码示例。如果您正苦于以下问题:PHP UserManager::GetLocalUser方法的具体用法?PHP UserManager::GetLocalUser怎么用?PHP UserManager::GetLocalUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserManager
的用法示例。
在下文中一共展示了UserManager::GetLocalUser方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($smarty, $smartyTemplate, $mode = null)
{
if (null == $mode) {
if (!empty($_GET['mode'])) {
if ("json" == $_GET['mode']) {
$mode = MODE_JSON;
}
}
}
if (null == $mode) {
$mode = MODE_WEB;
}
$this->_mode = $mode;
$this->_smarty = $smarty;
$this->_smartyTemplate = $smartyTemplate;
// User specified global information
if (UserManager::GetLocalUser() != null) {
$this->_assigns["t_User"] = UserManager::GetLocalUser();
$this->_assigns["t_GameserverList"] = UserManager::GetLocalUser()->getAllGameserver();
$this->_assigns["t_Gameserver"] = UserManager::GetLocalUser()->getSelectedGameserver();
}
// Javascript File
$jsscript = str_replace("pages/", "", str_replace(".tpl", ".js", $smartyTemplate));
$jsfile = Core::GetConfig("dirIntRoot") . "assets/js/custom/{$jsscript}";
if (file_exists($jsfile)) {
$smarty->assign("t_JS", $jsscript);
}
}
示例2: Page
$smarty->assign("pageActive", "userdashboard");
$page = new Page($smarty, "pages/userDashboard.tpl");
if (isset($_GET['do']) || isset($_POST['do'])) {
$do = isset($_GET['do']) ? $_GET['do'] : $_POST['do'];
if ("select" == $do) {
$error = array();
// Gameserver ID
$err = @Utils::checkInput($_REQUEST['id'], "Gameserver ID", 1, 64, INPUT_TYPE_NUMERIC);
if (strlen($err) != 0) {
$error[] = $err;
} else {
if (!GameserverManager::existsById($_REQUEST['id'])) {
$error[] = "The given Gameserver doesnt exist.";
} else {
$gameserver = new Gameserver($_REQUEST['id']);
if ($gameserver->getOwnerId() != UserManager::GetLocalUser()->getData("id")) {
$error[] = "You dont have permission to perform this command";
} else {
UserManager::GetLocalUser()->setSelectedGameserver($gameserver);
}
}
}
if (count($error) == 0) {
$page->assign("t_Report", Reporting::Success("The server has been selected."));
UserManager::GetLocalUser()->setSelectedGameserver($gameserver);
} else {
$page->assign("t_Report", Reporting::error(Utils::buildErrorString($error)));
}
}
}
$page->display();
示例3: Gameserver
<?php
/*
* WolfPanel (c) 2015 by Fursystems.de (Marcel Kallen)
*
* WolfPanel is licensed under a
* Creative Commons Attribution-NonCommercial 4.0 International License.
*
* You should have received a copy of the license along with this
* work. If not, see <http://creativecommons.org/licenses/by-nc/4.0/>.
*/
include "../core.php";
if (isset($_POST["id"])) {
// Gameserver ID
$err = @Utils::checkInput($_POST['id'], "Gameserver ID", 1, 64, INPUT_TYPE_NUMERIC);
if (strlen($err) != 0) {
$error[] = $err;
} else {
if (!GameserverManager::existsById($_POST['id'])) {
$error[] = "The given Gameserver doesnt exist.";
} else {
$gameserver = new Gameserver($_POST['id']);
if ($gameserver->getOwnerId() != UserManager::GetLocalUser()->getData("id")) {
$error[] = "You dont have permission to perform this command";
} else {
$smarty->assign("log", "<pre>" . $gameserver->getLatestLog() . "</pre>");
}
}
}
$smarty->display("ajax/getGameserverLog.tpl");
}
示例4: Page
<?php
/*
* WolfPanel (c) 2015 by Fursystems.de (Marcel Kallen)
*
* WolfPanel is licensed under a
* Creative Commons Attribution-NonCommercial 4.0 International License.
*
* You should have received a copy of the license along with this
* work. If not, see <http://creativecommons.org/licenses/by-nc/4.0/>.
*/
include "assets/core.php";
$smarty->assign("page", "Start / Stop / Restart");
$smarty->assign("pageActive", "userservercontrol");
$lU = UserManager::GetLocalUser();
if ($lU->getSelectedGameserver() != null) {
$gs = $lU->getSelectedGameserver();
$page = new Page($smarty, "pages/userServerControl.tpl");
if (isset($_GET['do']) || isset($_POST['do'])) {
$do = isset($_GET['do']) ? $_GET['do'] : $_POST['do'];
} else {
$do = "nothing";
}
// Controllable
$page->assign("controllable", $gs->isControlable());
if (!$gs->isControlable()) {
$page->assign("t_Report", Reporting::error("This Gameserver is not availabe for control at the moment."));
} else {
if ("Start" == $do) {
$page->assign("t_Report", Reporting::success("The gameserver will be started soon."));
$gs->scheduleStart();