Example #1
0
function verify_test_admin()
{
    global $app_cde;
    global $app_url_path;
    global $user;
    verify_logged_in();
    if ($user->getRole($app_cde) == NULL) {
        log_error("Permission exception in verify_admin.  User id:" . $user->usr_id);
        display_user_message("Permission denied.  You are not an administrator.", '/' . $app_url_path . '/index.php');
        exit;
    }
}
Example #2
0
$is_changing = $is_enrolled;
if ($action == "register") {
    if (!($current_date < $start_date || $current_date > $end_date) || isset($_SESSION['prev_usr_id'])) {
        $presentations = get_presentation_list($currentSession, $sort_by, $sort_order);
        include "view.php";
    } else {
        display_user_message("It's not time to enroll yet", "/" . $app_url_path . "/itinerary");
    }
} else {
    if ($action == "commit") {
        $pres_id = filter_input(INPUT_GET, 'pres_id');
        $presentation = Presentation::getPresentation($pres_id);
        // Error -- not time to sign up.
        if (!isset($_SESSION['prev_usr_id'])) {
            if ($current_date < $start_date || $current_date > $end_date) {
                display_user_message("It is not currently time to enroll.  Please check the enrollment dates.", "/" . $app_url_path . "/itinerary");
                exit;
            } else {
                if (!$presentation->has_space()) {
                    display_user_message("The presentation you selected is already full.  Please select another.", "/" . $app_url_path . "/itinerary");
                    exit;
                }
            }
        }
        // All good -- add the presentation!
        //    echo "add";
        $presentation->addPresForUser($user->usr_id);
        header("Location: ../itinerary/");
    }
}
exit;
Example #3
0
function verify_student()
{
    global $app_cde;
    global $app_url_path;
    global $user;
    verify_logged_in();
    if ($user->usr_type_cde != 'STD') {
        log_error("Permission exception in verify_student.  User id:" . $user->usr_id);
        display_user_message("Permission denied.  You are not a student.", '/' . $app_url_path . '/index.php');
        exit;
    }
}
Example #4
0
 public function addPresForUser($usr_id)
 {
     // begin transaction
     global $db;
     $db->beginTransaction();
     try {
         // Check if the user currently has a presentation for this session.
         // If so, remove it.
         // The loop is a bit of overkill, but in case of an erroneous situation of the user having multiple
         // presentations for the same session, this will remove those extra cases.
         //
         // Include a check to make sure that presenters don't overwrite their presentations through this method.
         $presentations = get_presentations_by_user_by_session($usr_id, $this->ses_id);
         foreach ($presentations as $presentation) {
             if ($presentation['presenting'] == 1) {
                 $db->rollback();
                 display_user_message("You cannot add a presentation for this session since you are presenting at the same time.", '../itinerary');
                 exit;
             }
             SeniorPresentation::deletePresentationsByUser($usr_id, $presentation['pres_id']);
         }
         // Inserts the new session for the user.
         $this->insert_presentation_for_user($usr_id);
         // commit transaction
         $db->commit();
     } catch (PDOException $e) {
         // roll back transaction
         $db->rollback();
         // log any errors to file
         log_pdo_exception($e, $usr_id, "Adding Presentation:" . $this, "addPresForUser");
         display_error("Error saving data.");
         exit;
     }
 }
Example #5
0
        // Need to code
        $choice = filter_input(INPUT_POST, 'choice');
        $pres_id = filter_input(INPUT_POST, 'pres_id');
        $pres_title = filter_input(INPUT_POST, 'pres_title');
        $pres_desc = filter_input(INPUT_POST, 'pres_desc');
        $organization = filter_input(INPUT_POST, 'organization');
        $location = filter_input(INPUT_POST, 'location');
        $field_id = filter_input(INPUT_POST, 'field_id');
        $rm_id = explode(":", filter_input(INPUT_POST, 'ses-room-number'))[1];
        $ses_id = explode(":", filter_input(INPUT_POST, 'ses-room-number'))[0];
        $team_members = filter_input(INPUT_POST, 'team-members') . ',';
        if ($choice == 'Modify') {
            // Append the current user to the team list.
            if (strlen($team_members) > 0) {
                $team_members = $team_members . ',' . $user->usr_id;
            } else {
                $team_members = $user->usr_id;
            }
            $pres = SeniorPresentation::getPresentationForSenior($user->usr_id);
            if ($pres->pres_id != $pres_id) {
                display_user_message("You do not have permission to modify this presentation.");
            }
            mod_pres($pres->pres_id, $pres_title, $pres_desc, $organization, $location, $field_id, $team_members);
        }
        $pres = SeniorPresentation::getPresentationForSenior($user->usr_id);
        include "presentation_view.php";
        break;
    default:
        $pres = SeniorPresentation::getPresentationForSenior($user->usr_id);
        include "presentation_view.php";
}