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


PHP UserManager::existsById方法代码示例

本文整理汇总了PHP中UserManager::existsById方法的典型用法代码示例。如果您正苦于以下问题:PHP UserManager::existsById方法的具体用法?PHP UserManager::existsById怎么用?PHP UserManager::existsById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UserManager的用法示例。


在下文中一共展示了UserManager::existsById方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct($id)
 {
     if (UserManager::existsById($id)) {
         $con = Database::getCon();
         $res = $con->query("SELECT * FROM users WHERE id = {$id}");
         $this->Data = $res->fetch_array();
         $this->Data["settings"] = unserialize($this->Data["settings"]);
         $this->Data["gameServerCount"] = Database::getRowCount("gameserver", array("userID" => $this->getData("id")));
     } else {
         trigger_error("User existiert nicht");
     }
 }
开发者ID:xerox8521,项目名称:FS-Gamepanel,代码行数:12,代码来源:User.class.php

示例2: initialize

 public static function initialize()
 {
     if (isset($_SESSION['id']) && $_SESSION['id'] != -1) {
         if (UserManager::existsById($_SESSION['id'])) {
             UserManager::$_localUser = new User($_SESSION['id']);
         } else {
             $_SESSION['id'] = -1;
         }
     } else {
         if (isset($_COOKIE['username']) && isset($_COOKIE['password']) && !(isset($_SESSION['id']) && $_SESSION['id'] != -1)) {
             UserManager::tryLogin($_COOKIE['username'], $_COOKIE['password'], true);
         }
     }
 }
开发者ID:xerox8521,项目名称:FS-Gamepanel,代码行数:14,代码来源:UserManager.class.php

示例3: isset

 * 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 this program.  If not, see <http://www.gnu.org/licenses/>.
 */
include "../core.php";
// Admin Check
$user = UserManager::getLocalUser();
if (!$user->isAdmin()) {
    PageManager::displayErrorPage("access");
    return;
}
$userid = isset($_GET['userid']) ? $_GET['userid'] : null;
if ($userid != null) {
    if (UserManager::existsById($userid)) {
        $user = new User($userid);
        $page = new Page($smarty, "modals/CustomerRemove.tpl");
        if ($user->getData("gameServerCount") == 0) {
            $page->assign("u", $user);
        } else {
            $page->assign("t_Report", Reporting::Error("This customer cannot be deleted because still has gameservers. They have to be deleted manually."));
        }
        $page->display();
    } else {
        $p = new Page($smarty, "modals/DefaultError.tpl");
        $p->display();
    }
} else {
    $p = new Page($smarty, "modals/DefaultError.tpl");
    $p->display();
开发者ID:xerox8521,项目名称:FS-Gamepanel,代码行数:31,代码来源:CustomerRemove.php

示例4: Template

         $error[] = "The given Template doesnt exist.";
     } else {
         $template = new Template($_POST['templateid']);
         if ($template->isBaseTemplate()) {
             $error[] = "The given Template is not a gameserver template.";
         } else {
             $gameName = $template->getData("gameName");
         }
     }
 }
 // Customer ID
 $err = @Utils::checkInput($_POST['customerid'], "Customer ID", 1, 64, INPUT_TYPE_NUMERIC);
 if (strlen($err) != 0) {
     $error[] = $err;
 } else {
     if (!UserManager::existsById($_POST['customerid'])) {
         $error[] = "The given User doesnt exist.";
     } else {
         $user = new User($_POST['customerid']);
         $userName = $user->getData("username") . " (" . $user->getData("prename") . " " . $user->getData("lastname") . ")";
     }
 }
 // Slots
 $err = @Utils::checkInput($_POST['slots'], "Slots", 1, 64, INPUT_TYPE_NUMERIC);
 if (strlen($err) != 0) {
     $error[] = $err;
 }
 if (count($error) == 0) {
     $page->assign("t_Report", Reporting::success("A Gameserver for the User {$userName} will be installed shortly.<br />Server: {$serverName} {$serverIP}:{$serverPort}<br />Game: {$gameName}"));
     GameserverManager::createServer($server, $user, $template, $serverPort, $_POST["slots"]);
     // Log
开发者ID:xerox8521,项目名称:FS-Gamepanel,代码行数:31,代码来源:admingameserver.php

示例5:

 * 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";
// Admin Check
$user = UserManager::getLocalUser();
if (!$user->isAdmin()) {
    PageManager::displayErrorPage("access");
    return;
}
if (isset($_GET["userid"])) {
    if (UserManager::existsById($_GET['userid'])) {
        $gs = GameserverManager::getAllByUserID($_GET['userid']);
        if ($gs !== false) {
            $smarty->assign("Gameservers", $gs);
        }
    } else {
        $smarty->assign("t_Report", Reporting::error("The given user doesnt exist."));
    }
} else {
    $gs = GameserverManager::getAll();
    if ($gs !== false) {
        $smarty->assign("Gameservers", $gs);
    }
}
$smarty->display("ajax/getAdminGameserverList.tpl");
开发者ID:xerox8521,项目名称:FS-Gamepanel,代码行数:31,代码来源:GetAdminGameserverList.php

示例6: array

     }
     if (count($error) == 0) {
         $username = $_POST["username"];
         UserManager::addUser($_POST['username'], $_POST['prename'], $_POST['lastname'], $_POST['email']);
         $page->assign("t_Report", Reporting::success("The user \"{$username}\" was added successfully."));
     } else {
         $page->assign("t_Report", Reporting::error(Utils::buildErrorString($error)));
     }
 } else {
     if ("RemoveCustomer" == $do) {
         $error = array();
         $err = @Utils::checkInput($_POST['userid'], "User ID", 0, 0, INPUT_TYPE_NUMERIC);
         if (strlen($err) != 0) {
             $error[] = $err;
         } else {
             if (!UserManager::existsById($_POST['userid'])) {
                 $error[] = "The given User ID doesn't exist.";
             } else {
                 $user = new User($_POST['userid']);
                 if ($user->getData("coins") > 0) {
                     $error[] = "The user still has coins. You cannot delete him.";
                 }
                 // TODO: Gameserver Count ask
             }
         }
         if (count($error) == 0) {
             $username = $user->getData("username");
             $name = $user->getData("prename") . " " . $user->getData("lastname");
             $page->assign("t_Report", Reporting::success("The user \"{$username}\" (\"{$name}\") has been removed successfully."));
             Database::rowDeleteByField("users", "id", $_POST['userid']);
         } else {
开发者ID:xerox8521,项目名称:FS-Gamepanel,代码行数:31,代码来源:customers.php


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