function system_login_form

7.x system.module system_login_form()
6.x system.module system_login_form()
4.x system.module system_login_form()
5.x system.module system_login_form()

This draws the form which facilitates logins.

File

modules/system/system.module, line 3317

Code

function system_login_form() {
  $form = array();

  fp_set_title("");

  $bool_clear_cookies = FALSE;

  // If we are coming from having just logged out, display a message.
  if (isset($_REQUEST ["logout"]) && $_REQUEST ["logout"] == "true") {
    $x = variable_get("logout_message", "You have been logged out of FlightPath.");
    fp_add_message(filter_markup($x));
  }

  // Are we here because the user was not found in the whitelist?
  if (isset($_REQUEST ['wlist']) && $_REQUEST ['wlist'] == 'notfound') {
    fp_add_message(t("Sorry, but only certain users are allowed access at this time.  If you believe you need access, please contact your system administrator."), 'error', TRUE);
  }

  // Are we here because the user was not found at all?
  if (isset($_REQUEST ['user']) && $_REQUEST ['user'] == 'notfound') {
    fp_add_message(t("Sorry, but the user you specified could not be found in FlightPath's database.  If you believe you need access, please contact your system administrator."), 'error', TRUE);
  }

  // Are we here because only the admin user is allowed in?
  if (isset($_REQUEST ['user']) && $_REQUEST ['user'] == 'adminonly') {
    fp_add_message(t("Sorry, but logins are disabled at this time while maintenance is being performed.  Please try again later."), 'error', TRUE);
  }


  // Are we here because only the user's rank is not allowed?
  if (isset($_REQUEST ['user']) && $_REQUEST ['user'] == 'rank') {
    fp_add_message(t("Sorry, your rank/classification is not allowed.  At this time this system is only available to students
                                  in the following ranks/classifications: @ranks_str", array("@ranks_str" => $allowed_ranks_str)), 'error', TRUE);
  }


  // Are we here because the user was not found in the whitelist?
  if (isset($_REQUEST ['user']) && $_REQUEST ['user'] == 'disabled') {
    fp_add_message(t("Sorry, but the user you specified has been marked as disabled.  If you believe you need access, please contact your system administrator."), 'error', TRUE);
  }

  // Are we here because the user is trying to do a zoom installation from the marketplace?
  if (module_enabled('zoomapi') && isset($_REQUEST ['zoom_install']) && $_REQUEST ['zoom_install'] == 'marketplace') {
    fp_add_message(t("To install FlightPath Academics to your Zoom account (which allows for automatic meeting requests through appointments), please
                      sign in below."));
    fp_add_message(t("You may be asked to sign into your Zoom account and authorize FlightPath.<br>You will be returned to FlightPath afterwards."));
    $form ['zoom_install'] = array(
      'type' => 'hidden',
      'value' => 'marketplace',
    );
  }


  $form ["user"] = array(
    "label" => t("User:"),
    "type" => "textfield",
    "size" => 30,
    "required" => TRUE,
    "description" => t("Enter your user name or email address."),
  );

  $form ["password"] = array(
    "label" => t("Password:"),
    "type" => "password",
    "size" => 30,
    "required" => TRUE,
  );

  $form ["submit"] = array(
    "type" => "submit",
    "value" => t("Log in"),
    "suffix" => "<div id='login-form-forgot-password'>" . l(t("Need help logging in?"), 'login-help') . "</div>",

  );

  $form ["#attributes"] = array("onSubmit" => "showUpdate(true);");


  return $form;
}