本文整理汇总了PHP中UserManager::get方法的典型用法代码示例。如果您正苦于以下问题:PHP UserManager::get方法的具体用法?PHP UserManager::get怎么用?PHP UserManager::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserManager
的用法示例。
在下文中一共展示了UserManager::get方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: convertRecord
/**
* Convert the results of a DB query to an array of TutoringReport's
* @param Array $record Holds the results of a DB query
* @return Array | null Holds all the instances of TutoringReport
*/
function convertRecord(array $record)
{
if (sizeof($record) == 0) {
return null;
}
$reportArray = array();
foreach ($record as $r) {
$userID = $r['userID'];
$date = $r['date'];
$studentName = $r['studentName'];
$report = $r['report'];
$userManager = new UserManager();
// Creates a Tutor object out of the ID
$tutor = $userManager->get($userID);
$report = new TutoringReport($tutor, $studentName, $report, $date);
$reportArray[] = $report;
}
return $reportArray;
}
示例2: cmdDeluser
public function cmdDeluser()
{
$login = ArgsHolder::get()->shiftCommand();
$group = ArgsHolder::get()->shiftCommand();
if ($login === false || $group === false) {
return io::out('Incorrect param count', IO::MESSAGE_FAIL) | 1;
}
if (!in_array($group, array_values(ACL::getGroups()))) {
return io::out("No such group {$group}", IO::MESSAGE_FAIL) | 3;
}
if (!($id = UserManager::get()->getIdByLogin($login))) {
return io::out("No such user {$login}", IO::MESSAGE_FAIL) | 3;
}
if (IO::YES == io::dialog('Remove user ~WHITE~ ' . $login . '~~~ from group ~WHITE~' . $group . '~~~', IO::NO | IO::YES, IO::YES)) {
io::out('deleting...', false);
ACL::deleteUserFromGroup($id, $group);
io::done();
}
}
示例3: switch
// -------------------------------------------------------------------------------
// acces securisé : verif user connecté ou pas
// utilisation d'une variable de session "accessuser" avec comme valeurs oui/non
// definir l'acces à non si la variable de session n'existe pas
$iduser = $_SESSION["id"];
// !!!!!!! On fixe l'idmembre tant que l'on n'a pas fait l'identification
// ------------------------------------------------------------------------------------
// controleur
if (isset($_GET["action"])) {
$action = $_GET["action"];
//recupère l'action passé dans l'url
switch ($action) {
// liste de tous les objets dispos
case "liste":
$objets = $objetsManager->getListDispo();
$userco = $userManager->get($iduser);
$categories = $categorieManager->getList();
//boucle pour avoir pour chaque objet le prix actuel
foreach ($objets as $objet) {
$enchere = $enchereManager->getLast($objet->getIdObj());
$objet->setPrix($enchere->getSomme());
}
echo $twig->render('index_site.html.twig', array('objs' => $objets, 'cats' => $categories, 'accessuser' => $_SESSION["co"], 'userco' => $userco));
break;
//affiche le résultat de la recherche
//affiche le résultat de la recherche
case "search":
// liste de tous les objets dispos par rapport à la recherche effectuée
$objets = $objetsManager->search($_POST);
$nomObjCherch = $_POST;
if ($_POST['cat'] != 0) {
示例4: header
$userManager->delete($_GET['id']);
header('Location: ?controler=user&action=list');
} else {
header('Location: ?controler=user&action=list');
}
break;
case 'edit':
if (isset($_POST['login']) && isset($_POST['pass']) && isset($_POST['id'])) {
$_POST['pass'] = sha1($_POST['pass']);
$userManager = new UserManager($bdd);
$user = new User($_POST);
$userManager->update($user);
header('Location: ?controler=user&action=list');
} elseif (isset($_GET['id'])) {
$userManager = new UserManager($bdd);
$user = $userManager->get($_GET['id']);
ob_start();
require_once 'view/user/edituser.php';
$content = ob_get_contents();
ob_end_clean();
require_once 'view/layout/layout.php';
}
break;
case 'list':
$userManager = new UserManager($bdd);
$users = $userManager->getList();
ob_start();
require_once 'view/user/listuser.php';
$content = ob_get_contents();
ob_end_clean();
require_once 'view/layout/layout.php';
示例5: foreach
$directory = $timesheetManager->getSaveDirectory();
if (is_null($timesheetListBackwards)) {
echo "There are currently no timesheets to display.";
} else {
$timesheetList = array_reverse($timesheetListBackwards);
echo '<table id="viewTimesheetTable">';
echo '<tr>';
echo '<th>Date</th>';
echo $isSupervisor ? "<th>Tutor</th>" : "";
echo '<th>Timesheet</th>';
echo '</tr>';
foreach ($timesheetList as $timesheetData) {
$date = $timesheetData[0];
$userID = $timesheetData[1];
$filename = $timesheetData[2];
$tutor = $userManager->get($userID);
$tutorName = $tutor->getName();
// get the tutor name using the ID
$pathToTimesheet = $timesheetManager->getWebDirectory() . $filename . ".pdf";
echo "<tr>";
echo '<td class="date">' . $date . '</td>';
echo $isSupervisor ? '<td class="name">' . $tutorName . '</td>' : '';
echo '<td class="timesheetLink"><a href="' . $pathToTimesheet . '" target="_blank">View Timesheet</a></td>';
echo "</tr>";
}
echo '</table>';
}
?>
示例6: CategorieManager
$categorieManager = new CategorieManager($bdd);
$enchereManager = new EnchereManager($bdd);
// -------------------------------------------------------------------------------
// acces securisé : verif user connecté ou pas
// utilisation d'une variable de session "accessuser" avec comme valeurs oui/non
// definir l'acces à non si la variable de session n'existe pas
$iduser = $_SESSION["id"];
// !!!!!!! On fixe l'idmembre tant que l'on n'a pas fait l'identification
// controleur
if (isset($_GET["action"])) {
$action = $_GET["action"];
//recupère l'action passé dans l'url
switch ($action) {
// affichage du profil d'un utilisateur
case "profil":
$userco = $userManager->get($iduser);
echo $twig->render('index_user.html.twig', array('accessuser' => $_SESSION["co"], 'userco' => $userco));
break;
/////////////// OBJETS ACQUIS //////////////////
// recupérer les enchères gagnées
/////////////// OBJETS ACQUIS //////////////////
// recupérer les enchères gagnées
case "objetsachete":
$userco = $userManager->get($iduser);
$objets = $objetsManager->getListTerm();
$wins = [];
foreach ($objets as $objet) {
$enchere = $enchereManager->getWin($objet->getIdObj(), $iduser);
if ($enchere) {
$enchere = $enchereManager->getLast($objet->getIdObj());
$objet->setPrix($enchere->getSomme());
示例7: TokenManager
$tokenManager = new TokenManager($bdd);
$tokenManager->createTable();
/*redirection*/
header('Location: ?controler=install&action=firstuser');
break;
case 'firstuser':
$userManager = new UserManager($bdd);
if ($userManager->count() > 0) {
header('Location: ?controler=index');
} else {
if (isset($_POST['login']) && isset($_POST['pass'])) {
$_POST['pass'] = sha1($_POST['pass']);
$userManager = new UserManager($bdd);
$user = new User($_POST);
$userManager->add($user);
$user = $userManager->get($_POST['login'], 'login');
$userRights = new UserRights(array('userid' => $user->id(), 'adminlvl' => '4'));
$userRightsManager = new UserRightsManager($bdd);
$userRightsManager->add($userRights);
header('Location: ?controler=user&action=list');
} else {
ob_start();
require_once 'view/user/addfirstuser.php';
$content = ob_get_contents();
ob_end_clean();
require_once 'view/layout/layout.php';
}
}
break;
default:
break;