// Copyright (C) 2006 The Trustees of Princeton University // // $Id$ $ // // Get session and API handles require_once 'plc_session.php'; global $plc, $api; // Print header require_once 'plc_drupal.php'; drupal_set_title('Login'); include 'plc_header.php'; if (!empty($_REQUEST['email']) && !empty($_REQUEST['password'])) { $plc = new PLCSession($_REQUEST['email'], $_REQUEST['password']); if ($plc->person) { // Login admins to Drupal as the superuser if (in_array('admin', $plc->person['roles']) && function_exists('user_load')) { global $user; $user = user_load(array('uid' => 1)); } if (empty($_REQUEST['url'])) { // XXX Redirect to default home page header("Location: /"); exit(); } else { // Make sure that redirections are always local $url = urldecode($_REQUEST['url']); if ($url[0] != "/") { $url = "/$url"; } header("Location: $url"); exit(); } } else { // XXX Use our own stylesheet instead of drupal.css print '
Sorry. Unrecognized username or password.
'; } } $self = $_SERVER['PHP_SELF']; if (!empty($_SERVER['QUERY_STRING'])) { $self .= "?" . $_SERVER['QUERY_STRING']; } $url = htmlspecialchars($_REQUEST['url']); // XXX Use our own stylesheet instead of drupal.css print <<

Forgot your password?

Create an account

File a site registration

EOF; include 'plc_footer.php'; ?>