当前位置: 首页>>代码示例>>PHP>>正文


PHP UserManager::GetLocalUser方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:xerox8521,项目名称:FS-Gamepanel,代码行数:28,代码来源:Page.class.php

示例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();
开发者ID:xerox8521,项目名称:FS-Gamepanel,代码行数:31,代码来源:userdashboard.php

示例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");
}
开发者ID:xerox8521,项目名称:FS-Gamepanel,代码行数:31,代码来源:GetGameserverLog.php

示例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();
开发者ID:xerox8521,项目名称:FS-Gamepanel,代码行数:31,代码来源:servercontrol.php


注:本文中的UserManager::GetLocalUser方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。