コード例 #1
0
<?php

include_once 'service/UsersCoursesController.php';
session_start();
if (isset($_POST['user_id'])) {
    $student_arr = $_POST['user_id'];
} else {
    $student_arr = array();
}
$course_id = $_POST['course_id_hidden'];
echo $course_id . "<br>";
$user_type = $_POST['user_type_hidden'];
echo $user_type . "<br>";
$UsersCoursesController = new UsersCoursesController();
$UsersCoursesController->set_id($course_id);
$UsersCoursesController->set_user_type($user_type);
//echo $course_id;
$UsersCoursesController->remove_user($student_arr);
$_SESSION['course'] = $course_id;
$_SESSION['user_type'] = $user_type;
header("Location:manage_courses.php");
?>

コード例 #2
0
<?php

include_once 'service/UsersCoursesController.php';
session_start();
$course_id = $_POST['course_id'];
$user_type = $_POST['user_type'];
$textval = $_POST['textarea'];
$UsersCoursesController = new UsersCoursesController();
$UsersCoursesController->set_id($course_id);
$UsersCoursesController->set_user_type($user_type);
$arr = preg_split('/\\r\\n|[\\r\\n]/', $textval);
$UsersCoursesController->enroll_user($arr);
$_SESSION['course'] = $course_id;
$_SESSION['user_type'] = $user_type;
header("Location:manage_courses.php");
コード例 #3
0
if (un_hash_val($_SESSION['current_user_type']) != constantss::$user_type_admin) {
    header("Location:main_page.php");
    exit;
}
if (isset($_SESSION['course'])) {
    $hashed_course_id = $_SESSION['course'];
} else {
    $hashed_course_id = -1;
}
if (isset($_SESSION['user_type'])) {
    $hashed_user_type = $_SESSION['user_type'];
} else {
    $hashed_user_type = -1;
}
$CoursesController = new CoursesController();
$UsersCoursesController = new UsersCoursesController();
$UsersCoursesController->set_id($hashed_course_id);
$UsersCoursesController->set_user_type($hashed_user_type);
?>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">


        <!-- Bootstrap -->
        <link href="css/bootstrap.min.css" rel="stylesheet">
        <link href="css/custom.css?<?php 
echo time();
?>
コード例 #4
0
<?php

include_once 'function.php';
include_once 'service/UsersCoursesController.php';
session_start();
if (validate_session_time_out() == 0) {
    header("Location:login.php");
    exit;
}
if (isset($_POST['user_new_password'])) {
    $user_new_password = $_POST['user_new_password'];
    $UsersCoursesController = new UsersCoursesController();
    $UsersCoursesController->check_old_password($_SESSION['user_id'], $user_new_password);
    if ($_SESSION['change_old_password'] == 1) {
        $UsersCoursesController->change_user_password($_SESSION['user_id'], $user_new_password);
    }
}
?>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">


        <!-- Bootstrap -->
        <link href="css/bootstrap.min.css" rel="stylesheet">
        <link href="css/custom.css" rel="stylesheet">
    </head>
    <body >
        <?php 
コード例 #5
0
if (validate_session_time_out() == 1) {
    if ($_SESSION['change_password'] == 0) {
        header("Location:change_password.php");
    } else {
        if (un_hash_val($_SESSION['current_user_type']) == constantss::$user_type_admin) {
            header("Location:manage_courses.php");
            exit;
        }
        header("Location:main_page.php");
    }
    exit;
}
if (isset($_POST['user_id']) && isset($_POST['user_password'])) {
    $user_id = $_POST['user_id'];
    $user_password = $_POST['user_password'];
    $UsersCoursesController = new UsersCoursesController();
    if ($UsersCoursesController->select_user($user_id, $user_password) == 1) {
        $_SESSION['testing'] = time();
        echo "ssss";
        if ($_SESSION['change_password'] == 0) {
            header("Location:change_password.php");
        } else {
            header("Location:main_page.php");
        }
        $_SESSION['wrong_password'] = 0;
        exit;
    } else {
        $_SESSION['wrong_password'] = 1;
    }
} else {
    $_SESSION['wrong_password'] = 0;