Exemple #1
0
        $loggers['audit']->info("Reminder sent to Access Service students for NOE {$noe_id}");
        $professor->reminderToProfessors(array('source' => 'faculty', 'exam_request_id' => $noe_id));
        $loggers['audit']->info("Reminder sent to professors for NOE {$noe_id}");
    } else {
        echo $noe_id;
    }
} elseif ($_GET['page'] === "update") {
    $blackout = unserialize(PROFESSOR_NOE_SUBMISSION_BLACKOUT);
    if (!empty($blackout['start']) && !empty($blackout['end'])) {
        if (strtotime($_POST['exam_date']) >= strtotime($blackout['start']) && strtotime($_POST['exam_date']) <= strtotime($blackout['end'])) {
            $loggers['audit']->notice("Attempted to edit NOE in range of blackout dates");
            echo "invalid-dates";
            exit;
        }
    }
    $has_permission = $model->checkCourseAllowed($SESSION->user_id, $_POST['cid']);
    if ($has_permission) {
        $noes->updateNOE($_POST['rid'], $_POST, $SESSION->user_id);
        $loggers['audit']->info("Details updated for NOE {$_POST['rid']}");
    } else {
        $loggers['audit']->warning("Unauthorized attempt to update details for NOE {$_POST['rid']}");
    }
} elseif ($_GET['page'] === "delete") {
    $has_permission = $model->checkCourseAllowed($SESSION->user_id, $_POST['cid']);
    if ($has_permission) {
        $noes->deleteNOE($_POST['rid']);
        $loggers['audit']->info("Deleted NOE {$_POST['rid']}");
    } else {
        $loggers['audit']->warning("Unauthorized attempt to delete NOE {$_POST['rid']}");
    }
} else {