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


PHP UserManager::getFromBLID方法代码示例

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


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

示例1: toHTML

 public function toHTML()
 {
     $returnHtml = $this->text;
     if (isset($this->params->vars)) {
         foreach ($this->params->vars as $i => $var) {
             $html = "<s>invalid</s>";
             switch ($var->type) {
                 case "user":
                     $user = UserManager::getFromBLID($var->blid);
                     $html = "<a href=\"/user/view.php?blid=" . $var->blid . "\">" . $user->getUserName() . "</a>";
                     break;
                 case "addon":
                     $addon = AddonManager::getFromID($var->id);
                     if ($addon) {
                         $html = "<a href=\"/addons/addon.php?id=" . $var->id . "\">" . $addon->getName() . "</a>";
                     } else {
                         $html = "<a href=\"/addons/addon.php?id=" . $var->id . "\">{error}</a>";
                     }
                     break;
             }
             $returnHtml = str_replace('$' . ($i + 1), $html, $returnHtml);
         }
     }
     return $returnHtml;
 }
开发者ID:hoff121324,项目名称:GlassWebsite,代码行数:25,代码来源:NotificationObject.php

示例2: hasGlassAccount

 function hasGlassAccount()
 {
     $user = UserManager::getFromBLID($this->blid);
     if ($user !== false) {
         return true;
     } else {
         return false;
     }
 }
开发者ID:BlocklandGlass,项目名称:GlassWebsite,代码行数:9,代码来源:ClientConnection.php

示例3: getCurrent

 public static function getCurrent()
 {
     if (!isset($_SESSION)) {
         return false;
     }
     if (isset($_SESSION['blid'])) {
         return UserManager::getFromBLID($_SESSION['blid']);
     } else {
         return false;
     }
 }
开发者ID:hoff121324,项目名称:GlassWebsite,代码行数:11,代码来源:UserManager.php

示例4: addEntry

 public static function addEntry($blid, $username, $ip = null)
 {
     if (isset($ip)) {
         if (!UserLog::isRemoteVerified($blid, $username, $ip)) {
             return "auth.blockland.us verification failed";
         }
     }
     $db = new DatabaseManager();
     UserLog::verifyTable($db);
     $resource = $db->query("SELECT * FROM `user_log` WHERE `blid`='" . $db->sanitize($blid) . "' AND `username`='" . $db->sanitize($username) . "'");
     if ($resource->num_rows == 0) {
         $db->query("INSERT INTO `user_log` (`blid`, `firstseen`, `lastseen`, `username`) VALUES ('" . $db->sanitize($blid) . "', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, '" . $db->sanitize($username) . "');");
     } else {
         $db->query("UPDATE `user_log` SET `lastseen` = CURRENT_TIMESTAMP WHERE `blid`='" . $db->sanitize($blid) . "' AND `username`='" . $db->sanitize($username) . "'");
     }
     //update username
     if ($user = UserManager::getFromBLID($blid)) {
         if ($username != $user->getUsername()) {
             $user->setUsername($username);
         }
     }
 }
开发者ID:hoff121324,项目名称:GlassWebsite,代码行数:22,代码来源:UserLog.php

示例5: login

 public static function login($identifier, $password, $redirect = "/index.php")
 {
     if (is_numeric($identifier)) {
         $blid = intval($identifier);
         if (is_int($blid)) {
             $loginDetails = UserManager::getLoginDetailsFromBLID($blid);
             if (!$loginDetails) {
                 return ["message" => "This BL_ID has not been verified yet, please use your E-mail instead"];
             }
         } else {
             return ["message" => "Invalid BL_ID"];
         }
     } elseif (filter_var($identifier, FILTER_VALIDATE_EMAIL)) {
         $email = $identifier;
         $loginDetails = UserManager::getLoginDetailsFromEmail($email);
     } else {
         return ["message" => "Invalid E-mail/BL_ID"];
     }
     if (!$loginDetails) {
         //username not found
         return ["message" => "Incorrect login credentials"];
     }
     $hash = $loginDetails['hash'];
     $salt = $loginDetails['salt'];
     if ($hash === hash("sha256", $password . $salt)) {
         $_SESSION['loggedin'] = 1;
         $_SESSION['blid'] = $loginDetails['blid'];
         $_SESSION['email'] = $loginDetails['email'];
         $_SESSION['username'] = $loginDetails['username'];
         $userObject = UserManager::getFromBLID($_SESSION['blid']);
         if ($userObject == false || $userObject->isMigrated()) {
             return ["redirect" => $redirect];
         } else {
             return ["redirect" => "/user/migrate.php"];
         }
     }
     return ["message" => "Incorrect login credentials"];
 }
开发者ID:BlocklandGlass,项目名称:GlassWebsite,代码行数:38,代码来源:UserManager.php

示例6: UserHandler

            //$uo->initFromId($authors[0]->id);
            $uo = UserManager::getFromBLID($authors[0]->blid);
            $uo2 = new UserHandler();
            $uo2->initFromId($authors[1]->id);
            $uo2 = UserManager::getFromBLID($authors[1]->blid);
            echo "<a href=\"#\">" . $uo->getName() . "</a>";
            echo " and ";
            echo "<a href=\"#\">" . $uo2->getName() . "</a>";
        } else {
            $count = sizeof($authors);
            //echo("DATA: ");
            //print_r($authors);
            foreach ($authors as $num => $author) {
                //$uo = new UserHandler();
                //$uo->initFromId($auth->id);
                $uo = UserManager::getFromBLID($author->blid);
                if ($count - $num == 1) {
                    echo "and <a href=\"#\">" . $uo->getName() . "</a>";
                } else {
                    echo "<a href=\"#\">" . $uo->getName() . "</a>, ";
                }
            }
        }
    }
    ?>
		</td>
		<td>
			<image src="http://blocklandglass.com/icon/icons16/star.png" />
			<image src="http://blocklandglass.com/icon/icons16/star.png" />
			<image src="http://blocklandglass.com/icon/icons16/star.png" />
			<image src="http://blocklandglass.com/icon/icons16/star.png" />
开发者ID:hoff121324,项目名称:GlassWebsite,代码行数:31,代码来源:board.php

示例7: addBLIDToGroupID

 public static function addBLIDToGroupID($blid, $gid)
 {
     //make sure addon exists
     $user = UserManager::getFromBLID($blid);
     if ($user === false) {
         return false;
     }
     $group = GroupManager::getFromID($gid);
     if ($group === false) {
         return false;
     }
     //call real function
     return GroupManager::addUserToGroup($user, $group);
 }
开发者ID:BlocklandGlass,项目名称:GlassWebsite,代码行数:14,代码来源:GroupManager.php

示例8: dirname

<?php

require_once dirname(__DIR__) . '/class/UserManager.php';
$user = UserManager::getFromBLID(9789);
UserManager::sendPasswordResetEmail($user);
//UserManager::email($user, "Password Reset", $body);
开发者ID:BlocklandGlass,项目名称:GlassWebsite,代码行数:6,代码来源:email.php

示例9: realpath

<?php

//this page is designed to be requested by ajax or the in-game client
require_once realpath(dirname(__DIR__) . "/private/class/DatabaseManager.php");
require_once realpath(dirname(__DIR__) . "/private/lib/Parsedown.php");
if (!isset($_POST['query'])) {
    echo "Invalid search";
} else {
    $db = new DatabaseManager();
    $baseQuery = "SELECT * FROM `addon_addons` WHERE `name` LIKE '%" . $db->sanitize($_POST['query']) . "%'";
    //later on we can make it so administrators can search for deleted add-ons
    $extendedQuery = " AND `deleted` = 0";
    if (isset($_POST['blid'])) {
        try {
            require_once realpath(dirname(__DIR__) . "/private/class/UserManager.php");
            $user = UserManager::getFromBLID($_POST['blid']);
            $extendedQuery = $extendedQuery . " AND `author` = '" . $db->sanitize($_POST['blid']) . "'";
        } catch (Exception $e) {
            echo "<p>User " . htmlspecialchars($_POST['blid']) . " not found.</p>";
        }
    }
    //One of the few time's we'll use a direct SQL query on a page
    $result = $db->query($baseQuery . $extendedQuery);
    echo "<h2>Search Results for ";
    echo "\"<u>" . htmlspecialchars($_POST['query']) . "</u>\"";
    if (isset($user) && $user) {
        echo " by <a href=\"/user/view.php?id=" . $user->getID() . "\">" . htmlspecialchars($user->getUsername()) . "</a>";
    }
    echo "</h2><hr />";
    if ($result->num_rows) {
        while ($row = $result->fetch_object()) {
开发者ID:hoff121324,项目名称:GlassWebsite,代码行数:31,代码来源:searchOld.php

示例10: realpath

<?php

$addons = (include realpath(dirname(__FILE__) . "/searchAddons.php"));
require_once realpath(dirname(__DIR__) . "/class/UserManager.php");
$users = [];
foreach ($addons as $addon) {
    if (!isset($users[$addon->blid])) {
        $users[$addon->blid] = UserManager::getFromBLID($addon->blid);
    }
}
$response = ["addons" => $addons, "users" => $users];
return $response;
开发者ID:hoff121324,项目名称:GlassWebsite,代码行数:12,代码来源:searchAddonsWithUsers.php

示例11: stdClass

    $board[3] = "Bricks";
    $board[4] = "Cosmetics";
    $board[5] = "Gamemodes";
    $board[6] = "Tools";
    $board[7] = "Weapons";
    $board[8] = "Colorsets";
    $board[9] = "Vehicles";
    $board[10] = "Bargain Bin";
    $board[11] = "Sounds";
    $o = new stdClass();
    $o->id = $ao->getId();
    $o->name = $ao->getName();
    $o->board = $board[$ao->getBoard()];
    $un = utf8_encode(UserLog::getCurrentUsername($ao->getManagerBLID()));
    if ($un === false) {
        $un = UserManager::getFromBLID($ao->getManagerBLID())->getUsername();
    }
    $o->author = $un;
    $ar[] = $o;
}
$dlg->uploads = $ar;
$ar = array();
foreach ($recentUpdates as $r) {
    $ao = $r->getAddon();
    if (!$ao->getApproved()) {
        continue;
    }
    if ($ao->getBoard() == 10) {
        // bargain bin
        continue;
    }
开发者ID:BlocklandGlass,项目名称:GlassWebsite,代码行数:31,代码来源:home.php

示例12: createGroupWithLeaderBLID

 public static function createGroupWithLeaderBLID($name, $description, $color, $icon, $blid)
 {
     $user = UserManager::getFromBLID($blid);
     if ($user === false) {
         return false;
     }
     return GroupManager::createGroupWithLeader($name, $description, $color, $icon, $user);
 }
开发者ID:hoff121324,项目名称:GlassWebsite,代码行数:8,代码来源:GroupManager.php

示例13: realpath

require_once realpath(dirname(__DIR__) . "/private/class/NotificationManager.php");
require_once realpath(dirname(__DIR__) . "/private/class/NotificationObject.php");
if (isset($_REQUEST['token']) && isset($_REQUEST['id'])) {
    if (isset($_REQUEST['password']) && isset($_REQUEST['confirm'])) {
        if ($_REQUEST['password'] == $_REQUEST['confirm']) {
            UserManager::updatePassword($_REQUEST['id'], $_REQUEST['password']);
            header('Location: /login.php');
            return;
        } else {
            $response = ["message" => "Passwords dont match!", "form" => true];
        }
    } else {
        $blid = $_REQUEST['id'];
        $token = $_REQUEST['token'];
        apc_delete('userObject_' . $_REQUEST['id']);
        $userObj = UserManager::getFromBLID($blid);
        if ($userObj->getResetKey() !== $token) {
            $response = ["message" => "<b>Invalid reset token.</b> Did you request a password reset twice on accident?", "form" => false];
        } else {
            if (time() - $userObj->getResetTime() > 1800) {
                $response = ["message" => "<b>Your password reset has expired!</b> Try resending the email. " . (time() - $userObj->getResetTime()), "form" => false];
            } else {
                $response = ["message" => null, "form" => true];
            }
        }
    }
} else {
    $response = ["message" => "Reset token/id missing", "form" => false];
}
?>
<div class="maincontainer">
开发者ID:BlocklandGlass,项目名称:GlassWebsite,代码行数:31,代码来源:resetPassword.php

示例14: testGetFromBLID2

 public function testGetFromBLID2()
 {
     $this->testRegisterSuccess();
     $response = UserManager::getFromBLID(1234);
     $this->assertFalse($response);
     $response = UserManager::getAllAccountsFromBLID(1234);
     $this->assertNotEquals(false, $response);
     $this->assertEquals(1, count($response));
     $acc = $response[0];
     $this->assertEquals(1234, $acc->getBLID());
 }
开发者ID:hoff121324,项目名称:GlassWebsite,代码行数:11,代码来源:userTest.php

示例15: realpath

if (!isset($_GET['id'])) {
    $response = ["redirect" => "/builds/index.php"];
    return $response;
}
require_once realpath(dirname(__DIR__) . "/class/BuildManager.php");
require_once realpath(dirname(__DIR__) . "/class/UserManager.php");
require_once realpath(dirname(__DIR__) . "/class/ScreenshotManager.php");
//	require_once(realpath(dirname(__DIR__) . "/class/TagManager.php"));
//	require_once(realpath(dirname(__DIR__) . "/class/DependencyManager.php"));
$build = BuildManager::getFromID($_GET['id'] + 0);
if ($build === false) {
    $response = ["redirect" => "/builds/index.php"];
    return $response;
}
$user = UserManager::getFromBLID($build->blid);
//	$tagIDs = $build->getTags();
//	$dependencyIDs = $build->getDependencies();
//	$tags = [];
//	$dependencies = [];
//
//	foreach($tagIDS as $tid) {
//		$tags[] = TagManager::getFromID($tid);
//	}
//
//	foreach($dependencyIDs as $did) {
//		$dependencies[] = DependencyManager::getFromID($did);
//	}
$screenshotIDs = ScreenshotManager::getScreenshotsFromBuild($build->id);
$primaryScreenshotID = ScreenshotManager::getBuildPrimaryScreenshot($build->id);
$screenshots = [];
开发者ID:hoff121324,项目名称:GlassWebsite,代码行数:30,代码来源:getBuildPage.php


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