當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Teacher::createTeacherFromId方法代碼示例

本文整理匯總了PHP中Teacher::createTeacherFromId方法的典型用法代碼示例。如果您正苦於以下問題:PHP Teacher::createTeacherFromId方法的具體用法?PHP Teacher::createTeacherFromId怎麽用?PHP Teacher::createTeacherFromId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Teacher的用法示例。


在下文中一共展示了Teacher::createTeacherFromId方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: updateCurrentUser

function updateCurrentUser()
{
    $user = $_SESSION['user'];
    $sessionUserId = $user->getUserId();
    if ($user->getRole() === 'STUDENT') {
        $_SESSION['user'] = Student::createStudentFromId($sessionUserId);
    } else {
        $_SESSION['user'] = Teacher::createTeacherFromId($sessionUserId);
    }
}
開發者ID:benwhite10,項目名稱:Smarkbook,代碼行數:10,代碼來源:forgotPassword.php

示例2: infoLog

         $desc = "The account for '{$username}' has been locked due to too many login attempts.";
         infoLog($desc);
         returnToPageError($message, $username);
     } else {
         unlockUser($userid);
         clearFailedLogins($userid);
         $user = User::createUserLoginDetails($userid);
     }
 }
 $random_salt = $user->getSalt();
 $pwd = hash('sha512', $pwd . $random_salt);
 if ($pwd === $user->getPassword()) {
     if ($user->getRole() === 'STUDENT') {
         $_SESSION['user'] = Student::createStudentFromId($userid);
     } else {
         $_SESSION['user'] = Teacher::createTeacherFromId($userid);
     }
     clearFailedLogins($userid);
     $_SESSION['timeout'] = time();
     $message = "User {$userid} has been successfully logged in.";
     if (isset($_SESSION['url']) && isset($_SESSION['urlid']) && $userid == $_SESSION['urlid']) {
         $url = $_SESSION['url'];
         unset($_SESSION['url']);
         unset($_SESSION['urlid']);
     } else {
         $url = '../portalhome.php';
     }
     returnToPageSuccess($message, $url);
 } else {
     //Check when the last failed login was
     $lastFailedLogin = strtotime($user->getLastFailedLogin());
開發者ID:benwhite10,項目名稱:Smarkbook,代碼行數:31,代碼來源:process_login.php

示例3: filter_input

$userid = filter_input(INPUT_GET, 'userid', FILTER_SANITIZE_STRING);
$query = "SELECT `Role` FROM TUSERS WHERE `User ID` = {$userid}";
try {
    $role = db_select_single_exception($query, 'Role');
} catch (Exception $ex) {
    header("Location: ../portalhome.php");
    exit;
}
if ($role == 'STUDENT') {
    $user = Student::createStudentFromId($userid);
    $prefName = $user->getPrefferedName();
    $dob = $user->getDateOfBirth();
    $hideStaff = 'style="display:none;"';
    $hideStudents = '';
} else {
    $user = Teacher::createTeacherFromId($userid);
    $title = $user->getTitle();
    $initials = $user->getInitials();
    $classroom = $user->getClassroom();
    $number = $user->getPhoneNumber();
    $hideStaff = '';
    $hideStudents = 'style="display:none;"';
}
$firstName = $user->getFirstName();
$surname = $user->getSurname();
$email = $user->getEmail();
if (isset($_SESSION['message'])) {
    $message = $_SESSION['message'];
    unset($_SESSION['message']);
}
?>
開發者ID:benwhite10,項目名稱:Smarkbook,代碼行數:31,代碼來源:editUser.php


注:本文中的Teacher::createTeacherFromId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。