本文整理汇总了PHP中UserManager类的典型用法代码示例。如果您正苦于以下问题:PHP UserManager类的具体用法?PHP UserManager怎么用?PHP UserManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了UserManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: execute
public function execute($dataContainer)
{
//No direct access
defined('_WEXEC') or die("Access denied");
$smarty = $dataContainer->getSmarty();
require_once PATH_ACCESS . '/GlobalSettingsManager.php';
require_once PATH_ACCESS . '/CardManager.php';
require_once PATH_ACCESS . '/UserManager.php';
$cm = new CardManager();
$um = new UserManager();
$gsManager = new GlobalSettingsManager();
try {
$help_str = $gsManager->getHelpText();
} catch (Exception $e) {
die('Ein Fehler ist aufgetreten:' . $e->getMessage());
}
if ($dataContainer->getAcl()->moduleGet('root/web/Babesk')) {
// set {cardid} in helptext administration to replace it with the cardnumber
$help_str = str_replace("{cardid}", $cm->getCardnumberByUserID($_SESSION['uid']), $help_str);
}
//set {login} in helptext administration to replace it with the login name
$help_str = str_replace("{login}", $um->getUsername($_SESSION['uid']), $help_str);
$smarty->assign('help_str', $help_str);
$smarty->display($this->smartyPath . "help.tpl");
}
开发者ID:Auwibana,项目名称:babesk,代码行数:25,代码来源:Help.php
示例2: service
public function service()
{
$userManager = new UserManager($this->config, $this->args);
$email = strtolower($this->secure($_REQUEST["email"]));
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
$jsonArr = array('status' => "err", "errText" => $this->getPhrase(471));
echo json_encode($jsonArr);
return false;
}
$customer = $userManager->getCustomerByEmail($email);
if ($customer != null) {
$emailSenderManager = new EmailSenderManager('gmail');
$customerEmail = $customer->getEmail();
$userName = $customer->getName();
$password = $customer->getPassword();
$subject = "Your PcStore Password!";
$templateId = "customer_forgot_password";
$params = array("name" => $userName, "password" => $password);
$emailSenderManager->sendEmail('support', $customerEmail, $subject, $templateId, $params);
$jsonArr = array('status' => "ok", "message" => "Your password sent to your " . $email . " email.\nPlease check your email.");
echo json_encode($jsonArr);
return true;
} else {
$jsonArr = array('status' => "err", "errText" => $this->getPhrase(381));
echo json_encode($jsonArr);
return false;
}
}
开发者ID:pars5555,项目名称:pcstore,代码行数:28,代码来源:CustomerForgotPasswordAction.class.php
示例3: process
public function process($parameters)
{
//do control panela maju pristup len prihlaseny uzivatelia
$this->checkUser();
//hlavicka stranky
$this->head['title'] = 'Ovládací panel';
$userManager = new UserManager();
$validation = new Validation();
//zadane URL pre odhlasenie
if (!empty($parameters[0]) && $parameters[0] == 'odhlasit') {
$userManager->logOut();
$this->redirect('prihlasenie');
}
//data pre sablonu
$user = $userManager->returnUser();
$this->data['admin'] = $user['admin'];
$this->data['userRank'] = $validation->returnUserRank($user['admin']);
$this->data['user'] = $user['name'];
$this->data['avatar'] = $user['avatar'];
$this->data['registrationDate'] = $user['registration_date'];
$this->data['lastVisit'] = $user['last_visit'];
$this->data['comments'] = $user['comments'];
$this->data['articles'] = $user['articles'];
$this->data['sex'] = $user['sex'];
$this->data['email'] = $user['email'];
//nastavenie sablony
$this->view = 'controlPanel';
}
开发者ID:tomas3093,项目名称:MVC,代码行数:28,代码来源:PanelController.php
示例4: route
public function route($params)
{
$userManager = new UserManager();
$user = $userManager->returnUser();
if (!$user) {
$this->redirect("login");
}
switch ($user['role']) {
case 2:
$this->view = 'admin_dashboard';
break;
case 1:
$reviewManager = new ReviewManager();
$this->data['no_reviewed'] = $reviewManager->return_no_reviewed($user['id_user']);
$this->data['reviewed'] = $reviewManager->return_reviewed($user['id_user']);
$this->view = 'reviewer_dashboard';
break;
case 0:
default:
$this->view = 'author_dashboard';
break;
}
$header_menu = 'login_bar';
$this->data['title_html'] = 'Hlavní panel';
$this->head['title_html'] = $this->data['title_html'];
$this->header_menu = $header_menu;
}
开发者ID:Eflyax,项目名称:KIVWEB,代码行数:27,代码来源:DashboardController.php
示例5: process
public function process($parameters)
{
$parsedURL = $this->parseURL($parameters[0]);
//predanie URL do funkcie
if (empty($parsedURL[0])) {
//ak chyba prvy parameter
$this->redirect('clanky/uvod');
}
//presmeruj na uvodny clanok
$controllerClass = $this->camelCase(array_shift($parsedURL)) . 'Controller';
//#spracovanie URL na parametre, volanie pozadovaneho kontroleru
if (file_exists('controllers/' . $controllerClass . '.php')) {
//ak existuje kontroler z URL
$this->controller = new $controllerClass();
} else {
$this->redirect('chyba');
}
//ak neexistuje, presmeruj na chybove hlasenie
$this->controller->process($parsedURL);
//spracovanie ostatnych parametrov vo vnorenom kontroleri
$userManager = new UserManager();
//predanie premennych do hlavnej sablony
$this->data['user'] = $userManager->returnUserName();
$this->data['title'] = $this->controller->head['title'];
$this->data['key_words'] = $this->controller->head['key_words'];
$this->data['description'] = $this->controller->head['description'];
$this->data['messages'] = $this->returnMessages();
$this->data['topArticles'] = $this->topArticles();
$this->view = 'layout';
//nastavenie hlavnej sablony
}
开发者ID:tomas3093,项目名称:MVC,代码行数:31,代码来源:RouterController.php
示例6: executePopup
public function executePopup()
{
$userManager = new UserManager();
$acct_schema = $userManager->getAcctSchema();
//if the user name contains spaces, replace %20 by a space
$_GET['user'] = str_replace("%20", " ", $_GET['user']);
//if the group field exists in ACCT table, sort the db result by group
if (array_key_exists(GROUP, $acct_schema)) {
$result = $userManager->getDetailedStat($_GET['user'], GROUP);
} else {
$result = $userManager->getDetailedStat($_GET['user'], null);
}
$user_status = array();
$has_status = 0;
foreach ($result as $line) {
if (array_key_exists(STATUS, $acct_schema)) {
$has_status = 1;
if (!array_key_exists(TYPE, $acct_schema) || $line[TYPE] != 'dir') {
if (isset($user_status[$line[STATUS]])) {
$user_status[$line[STATUS]] += $line[COUNT];
} else {
$user_status[$line[STATUS]] = $line[COUNT];
}
}
}
}
$this->page->addVar('acct_schema', $acct_schema);
$this->page->addVar('result', $result);
if ($has_status) {
$this->page->addVar('user_status', $user_status);
}
}
开发者ID:rootfs,项目名称:robinhood,代码行数:32,代码来源:UserController.class.php
示例7: preforward
/**
* preprocess before forwarding.
*
* @access public
*/
public function preforward()
{
$um = new UserManager();
$list = $um->userlist($this->backend);
$this->af->setApp("userlist", $list);
$this->af->setApp("listsize", count($list));
}
开发者ID:sdkawata,项目名称:tutorial,代码行数:12,代码来源:Userlist.php
示例8: Premium
/**
* Fonction faisant devenir premium le membre connecté.
*/
function Premium()
{
$udm = new User_DroitManager(connexionDb());
$udm->modifDroit($_SESSION['User']->getId(), 3);
$um = new UserManager(connexionDb());
$user = $um->getUserById($_SESSION['User']->getId());
$_SESSION['User'] = $user;
}
开发者ID:OvynFlavian,项目名称:IntegrationTP_Groupe_1,代码行数:11,代码来源:devenirPremium.lib.php
示例9: getAuthor
public function getAuthor()
{
if (!$this->author) {
$manager = new UserManager($this->database);
$this->author = $manager->findById($this->id_author);
}
return $this->author;
}
开发者ID:CreepingPanda,项目名称:FennecPlusUltra,代码行数:8,代码来源:CommentManager.class.php
示例10: getUser
public function getUser()
{
if (!$this->user) {
$manager = new UserManager($this->database);
$this->user = $manager->findById($this->id_user);
}
return $this->user;
}
开发者ID:CreepingPanda,项目名称:FennecPlusUltra,代码行数:8,代码来源:Cart.class.php
示例11: onPost
function onPost($postData, FormSubmit $sender)
{
$userManager = new UserManager();
if ($sender != $this->submitButton) {
throw new Exception("The post sender is invalid!");
}
$userManager->login($this->usernameBox->text, $this->passwordBox->text);
}
开发者ID:ArkayCZ,项目名称:NexusFramework,代码行数:8,代码来源:LoginController.php
示例12: getUser
public function getUser()
{
if (!$this->user) {
$userManager = new UserManager($this->db);
$this->user = $userManager->readById($this->user_id);
}
return $this->user;
}
开发者ID:dispxxx,项目名称:leshop,代码行数:8,代码来源:Order.class.php
示例13: login_form
/**
* Return the complete code for the login page
* @return <string>
*/
public static function login_form()
{
$user_manager = new UserManager();
$user_manager->_render->hideLoginLanguageSelection();
$user_manager->setLoginStyle(false);
$html = Form::openForm('login_confirm', Get::rel_path('lms') . '/index.php?modname=login&op=confirm') . $user_manager->getExtLoginMask(Get::rel_path('lms') . '/index.php?modname=login&op=login', '') . Form::closeForm();
return $html;
}
开发者ID:abhinay100,项目名称:forma_app,代码行数:12,代码来源:lib.loginlayout.php
示例14: getAuthor
public function getAuthor()
{
if (!$this->user) {
$userManager = new UserManager($this->db);
$this->user = $userManager->findById($this->id_author);
}
return $this->user;
}
开发者ID:Hollux,项目名称:Fennec,代码行数:8,代码来源:SousRubrique.class.php
示例15: checkUser
public function checkUser($admin = false)
{
$userManager = new UserManager();
$user = $userManager->returnUser();
if (!$user || $admin && $user['admin'] != '1') {
$this->createMessage('Nemáte dostatočné oprávnenie.', 'info');
$this->redirect('prihlasenie');
}
}
开发者ID:tomas3093,项目名称:cms-blog,代码行数:9,代码来源:Controller.php
示例16: addGuestUserToSession
function addGuestUserToSession()
{
$userManager = new UserManager();
$user = $userManager->getUserByEmail("guest");
if ($user == FALSE) {
die("utilities.addGuestUserToSession: Cannot access guest account");
}
$_SESSION['FFuser'] = serialize($user);
return $user;
}
开发者ID:cownby,项目名称:weblab2015-project,代码行数:10,代码来源:utilities.php
示例17: rechercheMembre
/**
*Fonction permettant d'aller rechercher en BDD tous les membres contenant le string contenu dans le formulaire de
* recherche de nom.
* @return array : la liste des membres trouvés.
*/
function rechercheMembre()
{
if (isPostFormulaire()) {
$name = $_POST['userName'];
} else {
$name = "";
}
$um = new UserManager(connexionDb());
$tab = $um->searchAllUserByName($name);
return $tab;
}
开发者ID:OvynFlavian,项目名称:IntegrationTP_Groupe_1,代码行数:16,代码来源:listeMembres.lib.php
示例18: checkToken
/**
* @param Rest_Token $token
* @return PFUser or null if the user is not found
* @throws Rest_Exception_InvalidTokenException
*/
public function checkToken(Rest_Token $token)
{
if ($this->token_factory->doesTokenExist($token->getUserId(), $token->getTokenValue())) {
return $this->user_manager->getUserById($token->getUserId());
}
throw new Rest_Exception_InvalidTokenException();
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:12,代码来源:TokenManager.class.php
示例19: continueSession
/**
*
* @see session_continue
*
* @param String $sessionKey
*
* @return User
*/
private function continueSession($sessionKey)
{
$user = $this->userManager->getCurrentUser($sessionKey);
if ($user->isLoggedIn()) {
return $user;
}
throw new SoapFault('3001', 'Invalid session');
}
开发者ID:nterray,项目名称:tuleap,代码行数:16,代码来源:User_SOAPServer.class.php
示例20: create
/**
*
* @param int $group_id
* @param string $password
* @return GenericUser
*/
public function create($group_id, $password)
{
$generic_user = $this->generateGenericUser($group_id, new PFUser());
$generic_user->setPassword($password);
$this->user_manager->createAccount($generic_user);
$this->dao->save($group_id, $generic_user->getId());
return $generic_user;
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:14,代码来源:GenericUserFactory.class.php
注:本文中的UserManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论