当前位置: 首页>>代码示例>>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;未经允许,请勿转载。