[ Index ]
 

Code source de IMP H3 (4.1.5)

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/ -> recompose.php (source)

   1  <?php
   2  /**
   3   * $Horde: imp/recompose.php,v 2.13.10.8 2007/01/02 13:54:54 jan Exp $
   4   *
   5   * Copyright 2003-2007 Charles J. Hagenbuch <chuck@horde.org>
   6   *
   7   * See the enclosed file COPYING for license information (GPL). If you
   8   * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
   9   */
  10  
  11  function _getFormData($val)
  12  {
  13      static $fd;
  14      if (!isset($fd)) {
  15          global $formData;
  16          $fd = @unserialize($formData);
  17      }
  18  
  19      if (!empty($fd['post'][$val])) {
  20          return $fd['post'][$val];
  21      } elseif (!empty($fd['get'][$val])) {
  22          return $fd['get'][$val];
  23      } else {
  24          return '';
  25      }
  26  }
  27  
  28  @define('IMP_BASE', dirname(__FILE__));
  29  $authentication = 'none';
  30  require_once  IMP_BASE . '/lib/base.php';
  31  require_once  IMP_BASE . '/lib/Session.php';
  32  require IMP_BASE . '/config/servers.php';
  33  
  34  // If we somehow get to this page with a valid session, go immediately
  35  // to compose.php. No need to do other validity checks if the session
  36  // already exists.
  37  if (Auth::getAuth() && IMP::checkAuthentication(OP_HALFOPEN, true)) {
  38      $_SESSION['formData'] = serialize(array('get' => $_GET, 'post' => $_POST));
  39      header('Location: ' . Util::addParameter(Horde::applicationUrl('compose.php', true), 'actionID', 'recompose', false));
  40      exit;
  41  }
  42  
  43  // Check for a login attempt.
  44  if (Util::getPost('imapuser')) {
  45      $imapuser = Util::getPost('imapuser');
  46      $pass = Util::getPost('pass');
  47  
  48      /* Create a new session if we're given the proper parameters. */
  49      if (!is_null($imapuser) && !is_null($pass)) {
  50          if (Auth::getProvider() == 'imp') {
  51              /* Destroy any existing session on login and make sure to
  52               * use a new session ID, to avoid session fixation
  53               * issues. */
  54              Horde::getCleanSession();
  55          }
  56  
  57          /* Read the required server parameters from the servers.php
  58           * file. */
  59          require_once IMP_BASE . '/config/servers.php';
  60          $server_key = Util::getFormData('server_key');
  61          if (!empty($servers[$server_key])) {
  62              $sessArray = $servers[$server_key];
  63          }
  64  
  65          foreach (array('server', 'port', 'protocol', 'folders') as $val) {
  66              $data = Util::getFormData($val);
  67              if (!empty($data)) {
  68                  $sessArray[$val] = $data;
  69              }
  70          }
  71  
  72          if (IMP_Session::createSession($imapuser, $pass, $sessArray['server'], $sessArray)) {
  73              $entry = sprintf('Relogin success for %s [%s] to {%s:%s}', $imp['uniquser'], $_SERVER['REMOTE_ADDR'], $imp['server'], $imp['port']);
  74              Horde::logMessage($entry, __FILE__, __LINE__, PEAR_LOG_NOTICE);
  75  
  76              if (($horde_language = Util::getFormData('new_lang'))) {
  77                  $_SESSION['horde_language'] = $horde_language;
  78              }
  79  
  80              // Store the user's message data in their session, so that
  81              // we can redirect to compose.php. This insures that
  82              // everything gets loaded with a proper session present,
  83              // which can affect things like the user's preferences.
  84              $_SESSION['formData'] = Util::getPost('formData');
  85              header('Location: ' . Util::addParameter(Horde::applicationUrl('compose.php', true), 'actionID', 'recompose', false));
  86              exit;
  87          }
  88      }
  89  }
  90  
  91  $actionID = null;
  92  $imp_auth = (Auth::getProvider() == 'imp');
  93  $formAction = 'recompose.php';
  94  $formData = Util::getPost('formData', serialize(array('get' => $_GET, 'post' => $_POST)));
  95  
  96  $reason = _("Please log in again to resume composing your message. If you are NOT using cookies AND you are composing messages in popup windows, you will have to log in again in your main window as well. This is to keep attackers from hijacking your session ID. We apologize for any inconvenience.");
  97  $title = _("Resume your session");
  98  
  99  require IMP_TEMPLATES . '/common-header.inc';
 100  if (Auth::getProvider() == 'imp' || Auth::getAuth()) {
 101      $autologin = false;
 102      require_once 'Horde/Menu.php';
 103      require IMP_TEMPLATES . '/login/login.inc';
 104  }
 105  require IMP_TEMPLATES . '/compose/recompose.inc';
 106  if (@is_readable(IMP_BASE . '/config/motd.php')) {
 107      require IMP_BASE . '/config/motd.php';
 108  }
 109  require $registry->get('templates', 'horde') . '/common-footer.inc';


Généré le : Thu Nov 29 12:30:07 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics