示例#1
0
 } else {
     $user_name = $_POST['User_Name'];
 }
 if (empty($_POST['User_Password'])) {
     $errors[] = "You forgot to enter Your password";
 } else {
     $user_password = $_POST['User_Password'];
 }
 if (empty($errors)) {
     $user = new User($user_name, $user_password);
     $user_controller = new User_Controller($user);
     $Logged_In = $user_controller->login();
     if ($Logged_In) {
         //get the new user
         //and from the new user find the type of the user
         $Logged_In_User = $user_controller->getUser();
         $user_type = $Logged_In_User->getUserType();
         if ($user_type == User_Type::OPERATOR) {
             redirect_user(User_Type::OPERATOR);
         } else {
             if ($user_type == User_Type::ENCODER) {
                 redirect_user(User_Type::ENCODER);
             } else {
                 if ($user_type == User_Type::NORMAL_ENCODER) {
                     redirect_user(User_Type::NORMAL_ENCODER);
                 } else {
                     if ($user_type == User_Type::ADMIN) {
                         redirect_user(User_Type::ADMIN);
                     }
                 }
             }