WebCalendar PHP Cross Reference Groupware Applications

Source: /nulogin.php - 79 lines - 2294 bytes - Summary - Text - Print

   1  <?php
   2  /* $Id: nulogin.php,v 1.15.2.5 2011/04/27 00:27:35 rjones6061 Exp $
   3   *
   4   * This page handles logins for nonuser calendars.
   5   */
   6  require_once 'includes/classes/WebCalendar.class';
   7  
   8  $WebCalendar = new WebCalendar ( __FILE__ );
   9  
  10  include  'includes/translate.php';
  11  include  'includes/config.php';
  12  include  'includes/dbi4php.php';
  13  include  'includes/formvars.php';
  14  include  'includes/functions.php';
  15  
  16  $WebCalendar->initializeFirstPhase ();
  17  
  18  include 'includes/' . $user_inc;
  19  include_once  'includes/access.php';
  20  include  'includes/gradient.php';
  21  
  22  $WebCalendar->initializeSecondPhase ();
  23  
  24  load_global_settings ();
  25  
  26  $WebCalendar->setLanguage ();
  27  
  28  if ( $single_user == 'Y') /* No login for single-user mode.*/ 
  29    die_miserable_death ( print_not_auth (22) );
  30  
  31  if ( $use_http_auth )/* No web login for HTTP-based authentication.*/
  32    die_miserable_death ( print_not_auth (23) );
  33      
  34  $login = getValue ( 'login' );
  35  if ( empty ( $login ) )
  36    die_miserable_death ( translate ( 'A login must be specified' ) . '.' );
  37  
  38  $date = getValue ( 'date' );
  39  $return_path = getValue ( 'return_path' );
  40  // Was a return path set?
  41  $url = ( ! empty ( $return_path )
  42    ? clean_whitespace ( $return_path
  43       . ( ! empty ( $date ) ? '?date=' . $date : '' ) )
  44    : 'index.php' );
  45  
  46  if ( $login == '__public__' )
  47    do_redirect ( $url );
  48  
  49  if ( ! nonuser_load_variables ( $login, 'temp_' ) )
  50    die_miserable_death ( translate ( 'No such nonuser calendar' )
  51       . ": $login" );
  52  
  53  if ( empty ( $temp_is_public ) || $temp_is_public != 'Y' )
  54    die_miserable_death ( print_not_auth (24) );
  55  // calculate path for cookie
  56  if ( empty ( $PHP_SELF ) )
  57    $PHP_SELF = $_SERVER['PHP_SELF'];
  58  
  59  $cookie_path = str_replace ( 'nulogin.php', '', $PHP_SELF );
  60  // echo "Cookie path: $cookie_path\n";
  61  if ( get_magic_quotes_gpc () )
  62    $login = stripslashes ( $login );
  63  
  64  $login = trim ( $login );
  65  if ( $login != addslashes ( $login ) )
  66    die_miserable_death ( translate ( 'Illegal characters in login' )
  67       . ' <tt>' . htmlentities ( $login ) . '</tt>.' );
  68  
  69  // Allow proper login using NUC name
  70  $encoded_login = encode_string ( $login . '|nonuser' );
  71  
  72  // set login to expire in 365 days
  73  SetCookie ( 'webcalendar_session', $encoded_login,
  74    ( ! empty ( $remember ) && $remember == 'yes' ?
  75    86400 * 365 + time () : 0 ), $cookie_path );
  76  
  77  do_redirect ( $url );
  78  
  79  ?>

title

Description

title

Description

title

Description

title

title

Body