function advise_init

7.x advise.module advise_init()
6.x advise.module advise_init()
4.x advise.module advise_init()
5.x advise.module advise_init()

Implementation of hook_init

File

modules/advise/advise.module, line 2467

Code

function advise_init() {
  global $current_student_id, $user, $screen, $student, $degree_plan;
  $current_student_id = @$_REQUEST ["current_student_id"];

  // Since this user doesn't have permission to view this student's sessions,
  // he can only view his own.  This is to stop hackers from experimenting with the URL
  // to see other users' data.
  if (!advise_can_access_view($current_student_id)) {

    // Reset our global vars....
    $current_student_id = "";
    if (isset($user->cwid) && $user->is_student) {
      $current_student_id = $user->cwid;
    }
    $_REQUEST ["current_student_id"] = $current_student_id;
    $_POST ["current_student_id"] = $current_student_id;
    $_GET ["current_student_id"] = $current_student_id;
    $_SESSION ["current_student_id"] = $current_student_id;
    $_REQUEST ["advising_student_id"] = $current_student_id;
    $_POST ["advising_student_id"] = $current_student_id;
    $_GET ["advising_student_id"] = $current_student_id;
    $_SESSION ["advising_student_id"] = $current_student_id;

    $GLOBALS ["fp_advising"]["advising_student_id"] = $current_student_id;


    $_REQUEST ["advising_load_active"] = "yes";
  }


  if (!isset($_SESSION ["fp_draft_mode"])) {
    $_SESSION ["fp_draft_mode"] = "";
  }

  // Is draft mode enabled?
  if ($_SESSION ["fp_draft_mode"] == "yes") {
    fp_add_message("<b>" . t("Draft mode") . "</b> " . t("is currently enabled, however, substitutions and advisings will
                      still be saved normally."), "status", TRUE);
  }




}