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


PHP UserDB::getFullUserById方法代码示例

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


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

示例1: get

 public static function get()
 {
     if (!isset($_GET['user'])) {
         //No user id given so redirect to the manageuser
         //page to search a user
         header('Location: renewusersearch', true, 303);
     } else {
         $page = new Page();
         $page->data['title'] = 'Gebruiker hernieuwen';
         try {
             $_SESSION['Stippers']['RenewUser']['user'] = UserDB::getFullUserById($_GET['user']);
             RenewUserController::buildRenewUserPage($page, false);
         } catch (UserDBException $ex) {
             if ($ex->getCode() == UserDBException::NOUSERFORID) {
                 $page->data['ErrorMessageNoDescriptionWithLinkView']['errorTitle'] = 'Er is geen gebruiker met deze id';
             } else {
                 $page->data['ErrorMessageNoDescriptionWithLinkView']['errorTitle'] = 'Kan gegevens niet ophalen uit de database';
             }
             $page->data['ErrorMessageNoDescriptionWithLinkView']['tryAgainUrl'] = $_SERVER['REQUEST_URI'];
             $page->addView('error/ErrorMessageNoDescriptionWithLinkView');
         } catch (Exception $ex) {
             $page->data['ErrorMessageNoDescriptionWithLinkView']['errorTitle'] = 'Kon gegevens van gebruiker niet ophalen';
             $page->data['ErrorMessageNoDescriptionWithLinkView']['tryAgainUrl'] = $_SERVER['REQUEST_URI'];
             $page->addView('error/ErrorMessageNoDescriptionWithLinkView');
         }
         $page->showWithMenu();
     }
 }
开发者ID:JHDeStip,项目名称:Stippers,代码行数:28,代码来源:RenewUserController.php

示例2: get

 public static function get()
 {
     $page = new Page();
     $page->data['title'] = 'Geld beheren';
     //Redirect if user is not set
     if (!isset($_GET['user'])) {
         header('Location: manageuser', true, 303);
     } else {
         try {
             $_SESSION['Stippers']['ManageUserMoney']['user'] = UserDB::getFullUserById($_GET['user']);
             ManageUserMoneyController::buildEnterTransactionView($page, false);
         } catch (UserDBException $ex) {
             if ($ex->getCode() == UserDBException::NOUSERFORCARDNUMER) {
                 $page->data['ErrorMessageNoDescriptionWithLinkView']['errorTitle'] = 'Er is geen gebruiker met deze id';
             } else {
                 $page->data['ErrorMessageNoDescriptionWithLinkView']['errorTitle'] = 'Kan gegevens niet ophalen uit de database';
             }
             $page->data['ErrorMessageNoDescriptionWithLinkView']['tryAgainUrl'] = $_SERVER['REQUEST_URI'];
             $page->addView('error/ErrorMessageNoDescriptionWithLinkView');
         } catch (Exception $ex) {
             $page->data['ErrorMessageNoDescriptionWithLinkView']['errorTitle'] = 'Kan gegevens niet ophalen uit de database';
             $page->data['ErrorMessageNoDescriptionWithLinkView']['tryAgainUrl'] = $_SERVER['REQUEST_URI'];
             $page->addView('error/ErrorMessageNoDescriptionWithLinkView');
         }
         $page->showWithMenu();
     }
 }
开发者ID:JHDeStip,项目名称:Stippers,代码行数:27,代码来源:ManageUserMoneyController.php

示例3: get

 public static function get()
 {
     $page = new Page();
     $page->data['title'] = 'Wachtwoord wijzigen';
     try {
         //Get all data of logged in user from database
         $_SESSION['Stippers']['ChangePassword']['user'] = UserDB::getFullUserById($_SESSION['Stippers']['user']->userId);
         //Build view
         ChangePasswordController::buildChangePasswordView($page);
     } catch (Exception $ex) {
         $page->data['ErrorMessageNoDescriptionWithLinkView']['errorTitle'] = 'Kan gegevens niet ophalen uit de database';
         $page->data['ErrorMessageNoDescriptionWithLinkView']['tryAgainUrl'] = $_SERVER['REQUEST_URI'];
         $page->addView('error/ErrorMessageNoDescriptionWithLinkView');
     }
     $page->showWithMenu();
 }
开发者ID:JHDeStip,项目名称:Stippers,代码行数:16,代码来源:ChangePasswordController.php

示例4: get

 public static function get()
 {
     $page = new Page();
     $page->data['title'] = 'Profiel';
     try {
         //Get all data of logged in user from database
         $_SESSION['Stippers']['Profile']['user'] = UserDB::getFullUserById($_SESSION['Stippers']['user']->userId);
         //Build views
         ProfileController::buildProfileTopView($page, false, false);
         $page->addView('profile/ProfileDisabledFormBottomView');
         ProfileController::buildMembershipDetailsView($page);
     } catch (Exception $ex) {
         $page->data['ErrorMessageNoDescriptionWithLinkView']['errorTitle'] = 'Kan gegevens niet ophalen uit de database';
         $page->data['ErrorMessageNoDescriptionWithLinkView']['tryAgainUrl'] = $_SERVER['REQUEST_URI'];
         $page->addView('error/ErrorMessageNoDescriptionWithLinkView');
     }
     $page->showWithMenu();
 }
开发者ID:JHDeStip,项目名称:Stippers,代码行数:18,代码来源:ProfileController.php

示例5: get

 public static function get()
 {
     if (!isset($_GET['user'])) {
         //No user id given so redirect to the manageuser
         //page to search a user
         header('Location: manageuser', true, 303);
     } else {
         $page = new Page();
         $page->data['title'] = 'Gebruiker bewerken';
         try {
             //Get user who's ID is given in GET from database
             $_SESSION['Stippers']['EditUser']['user'] = UserDB::getFullUserById($_GET['user']);
             //Build views
             EditUserController::buildEditUserTopView($page, false, false);
             if ($_SESSION['Stippers']['user']->isAdmin) {
                 EditUserController::buildEditUserAdminView($page, false, false);
             }
             if ($_SESSION['Stippers']['user']->isAdmin || $_SESSION['Stippers']['user']->isMoneyManager) {
                 EditUserController::buildEditUserMoneyManagerView($page);
             }
             $page->addView('editUser/EditUserDisabledFormBottomView');
             EditUserController::buildMembershipDetailsView($page);
         } catch (UserDBException $ex) {
             if ($ex->getCode() == UserDBException::NOUSERFORID) {
                 $page->data['ErrorMessageNoDescriptionWithLinkView']['errorTitle'] = 'Er is geen gebruiker met deze id';
             } else {
                 $page->data['ErrorMessageNoDescriptionWithLinkView']['errorTitle'] = 'Kan gegevens niet ophalen uit de database';
             }
             $page->data['ErrorMessageNoDescriptionWithLinkView']['tryAgainUrl'] = $_SERVER['REQUEST_URI'];
             $page->addView('error/ErrorMessageNoDescriptionWithLinkView');
         } catch (Exception $ex) {
             $page->data['ErrorMessageNoDescriptionWithLinkView']['errorTitle'] = 'Kan gegevens niet ophalen uit de database';
             $page->data['ErrorMessageNoDescriptionWithLinkView']['tryAgainUrl'] = $_SERVER['REQUEST_URI'];
             $page->addView('error/ErrorMessageNoDescriptionWithLinkView');
         }
         $page->showWithMenu();
     }
 }
开发者ID:JHDeStip,项目名称:Stippers,代码行数:38,代码来源:EditUserController.php

示例6: post

 public static function post()
 {
     $page = new Page();
     $page->data['title'] = 'Gebruiker toevoegen';
     //Validate input
     $formTopViewErrMsgs = UserDataFormTopViewValidator::validate($_POST);
     $formPasswordViewErrMsgs = UserDataFormPasswordViewValidator::validate($_POST);
     $formMiddleViewErrMsgs = UserDataFormMiddleViewValidator::validate($_POST);
     //No error means we create a user and password salt
     if (empty($formTopViewErrMsgs) && empty($formPasswordViewErrMsgs) && empty($formMiddleViewErrMsgs)) {
         $passwordSalt = Random::getGuid();
         $user = new User();
         $user->email = $_POST['email'];
         $user->firstName = ucwords($_POST['first_name']);
         $user->lastName = ucwords($_POST['last_name']);
         $user->passwordHash = hash_pbkdf2("sha256", $_POST['password'], $passwordSalt, SecurityConfig::N_PASSWORD_HASH_ITERATIONS);
         $user->street = ucwords($_POST['street']);
         $user->houseNumber = $_POST['house_number'];
         $user->city = ucwords($_POST['city']);
         $user->postalCode = $_POST['postal_code'];
         $user->country = ucwords($_POST['country']);
         $user->phone = $_POST['phone'];
         $user->dateOfBirth = $_POST['date_of_birth'];
         //Add the user
         try {
             $userId = UserDB::addUser($user, $passwordSalt, $_POST['card_number']);
             $page->addView('addRenewUser/addUser/SuccessfullyAddedView');
             //Send welcome mail
             try {
                 $failedEmails = Email::sendEmails('WelcomeNewMember.html', 'JH DE Stip - Welkom', EmailConfig::FROM_ADDRESS, [$user], null);
                 //If failedEmails is not empty the mail was not sent
                 if (!empty($failedEmails)) {
                     $page->data['ErrorMessageNoDescriptionNoLinkView']['errorTitle'] = 'Kan welkomstmail niet verzenden.';
                     $page->addView('error/ErrorMessageNoDescriptionNoLinkView');
                 }
             } catch (Exception $ex) {
                 $page->data['ErrorMessageNoDescriptionNoLinkView']['errorTitle'] = 'Kan welkomstmail niet verzenden.';
                 $page->addView('error/ErrorMessageNoDescriptionNoLinkView');
             }
             //Add money to user's card
             try {
                 $addedUser = UserDB::getFullUserById($userId);
                 $executingBrowserName = BrowserDB::getBrowserById($_SESSION['Stippers']['browser']->browserId)->name;
                 $trans = new MoneyTransaction(null, $addedUser->userId, 0, AddOrRenewUserConfig::NEW_OR_RENEWED_USER_BONUS, 0, 0, true, null, $executingBrowserName, null);
                 MoneyTransactionDB::addTransaction($addedUser, $trans);
             } catch (Exception $ex) {
                 if (isset($page->data['ErrorMessageNoDescriptionNoLinkView']['errorTitle'])) {
                     $page->data['ErrorMessageNoDescriptionNoLinkView']['errorTitle'] .= ' Kan het saldo van het account niet verhogen, probeer dit handmatig te doen.';
                 } else {
                     $page->data['ErrorMessageNoDescriptionNoLinkView']['errorTitle'] = 'Kan het saldo van het account niet verhogen, probeer dit handmatig te doen.';
                 }
                 $page->addView('error/ErrorMessageNoDescriptionNoLinkView');
             }
         } catch (UserDBException $ex) {
             AddUserController::buildAddUserPage($page, true);
             if ($ex->getCode() == UserDBException::EMAILALREADYEXISTS) {
                 $page->data['UserDataFormTopView']['errMsgs']['global'] = '<h2 class="error_message" id="user_data_form_error_message">Dit e-mailadres is al in gebruik.</h2>';
             } elseif ($ex->getCode() == UserDBException::CARDALREADYUSED) {
                 $page->data['UserDataFormTopView']['errMsgs']['global'] = '<h2 class="error_message" id="user_data_form_error_message">Dit kaartnummer is al in gebruik.</h2>';
             } else {
                 $page->data['UserDataFormTopView']['errMsgs']['global'] = '<h2 class="error_message" id="user_data_form_error_message">Kan gebruiker niet toevoegen, probeer het opnieuw.</h2>';
             }
         } catch (Exception $ex) {
             AddUserController::buildAddUserPage($page, true);
             $page->data['UserDataFormTopView']['errMsgs']['global'] = '<h2 class="error_message" id="user_data_form_error_message">Kan gebruiker niet toevoegen, probeer het opnieuw.</h2>';
         }
     } else {
         AddUserController::buildAddUserPage($page, true);
         $page->data['UserDataFormTopView']['errMsgs'] = array_merge($page->data['UserDataFormTopView']['errMsgs'], $formTopViewErrMsgs);
         $page->data['UserDataFormPasswordView']['errMsgs'] = array_merge($page->data['UserDataFormPasswordView']['errMsgs'], $formPasswordViewErrMsgs);
         $page->data['UserDataFormMiddleView']['errMsgs'] = array_merge($page->data['UserDataFormMiddleView']['errMsgs'], $formMiddleViewErrMsgs);
     }
     $page->showWithMenu();
 }
开发者ID:JHDeStip,项目名称:Stippers,代码行数:74,代码来源:AddUserController.php


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