[ Index ]
 

Code source de vtiger CRM 5.0.2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/modules/Users/ -> Logout.php (source)

   1  <?php
   2  /*********************************************************************************
   3   * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
   4   * ("License"); You may not use this file except in compliance with the 
   5   * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
   6   * Software distributed under the License is distributed on an  "AS IS"  basis,
   7   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
   8   * the specific language governing rights and limitations under the License.
   9   * The Original Code is:  SugarCRM Open Source
  10   * The Initial Developer of the Original Code is SugarCRM, Inc.
  11   * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
  12   * All Rights Reserved.
  13   * Contributor(s): ______________________________________.
  14   ********************************************************************************/
  15  /*********************************************************************************
  16   * $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/modules/Users/Logout.php,v 1.8 2005/03/21 04:51:21 ray Exp $
  17   * Description:  TODO: To be written.
  18   ********************************************************************************/
  19  
  20  require_once ('include/logging.php');
  21  require_once ('database/DatabaseConnection.php');
  22  require_once ('modules/Users/LoginHistory.php');
  23  require_once ('modules/Users/Users.php');
  24  require_once ('config.php');
  25  require_once ('include/db_backup/backup.php');
  26  require_once ('include/db_backup/ftp.php');
  27  require_once ('include/database/PearDatabase.php');
  28  require_once ('user_privileges/enable_backup.php');
  29  
  30  global $adb, $enable_backup;
  31  
  32  if($enable_backup == 'true')
  33  {
  34      $ftpserver = '';
  35      $ftpuser = '';
  36      $ftppassword = '';
  37      $query = "select * from vtiger_systems where server_type='backup'";
  38      $result = $adb->query($query);
  39      $num_rows = $adb->num_rows($result);
  40      if($num_rows > 0)
  41      {
  42          $ftpserver = $adb->query_result($result,0,'server');
  43          $ftpuser = $adb->query_result($result,0,'server_username');
  44          $ftppassword = $adb->query_result($result,0,'server_password');
  45      }
  46  
  47      //Taking the Backup of DB
  48      $currenttime=date("Ymd_His");
  49      if($ftpserver != '' && $ftpuser != '' && $ftppassword != '')
  50      {    $backupFileName="backup_".$currenttime.".sql";
  51      save_structure($backupFileName, $root_directory);
  52      $source_file=$backupFileName;    
  53      ftpBackupFile($source_file, $ftpserver, $ftpuser, $ftppassword);
  54      if(file_exists($source_file)) unlink($source_file);    
  55  
  56      }
  57  }
  58  // Recording Logout Info
  59      $usip=$_SERVER['REMOTE_ADDR'];
  60          $outtime=date("Y/m/d H:i:s");
  61          $loghistory=new LoginHistory();
  62          $loghistory->user_logout($current_user->user_name,$usip,$outtime);
  63  
  64  
  65  $local_log =& LoggerManager::getLogger('Logout');
  66  
  67  //Calendar Logout
  68  //include('modules/Calendar/logout.php');
  69  
  70  // clear out the autthenticating flag
  71  session_destroy();
  72  
  73  define("IN_LOGIN", true);
  74      
  75  // define('IN_PHPBB', true);
  76  // include($phpbb_root_path . 'extension.inc');
  77  // include($phpbb_root_path . 'common.'.$phpEx);
  78  
  79  //
  80  // Set page ID for session management
  81  //
  82  //$userdata = session_pagestart($user_ip, PAGE_LOGIN);
  83  //init_userprefs($userdata);
  84  //
  85  // End session management
  86  //
  87  
  88  // session id check
  89  /*
  90  if (!empty($HTTP_POST_VARS['sid']) || !empty($HTTP_GET_VARS['sid']))
  91  {
  92          $sid = (!empty($HTTP_POST_VARS['sid'])) ? $HTTP_POST_VARS['sid'] : $HTTP_GET_VARS['sid'];
  93  }
  94  else
  95  {
  96          $sid = '';
  97  }
  98  if( $userdata['session_logged_in'] )
  99      {
 100          if( $userdata['session_logged_in'] )
 101          {
 102              session_end($userdata['session_id'], $userdata['user_id']);
 103          }
 104  
 105      }
 106  */
 107  // go to the login screen.
 108  header("Location: index.php?action=Login&module=Users");
 109  ?>


Généré le : Sun Feb 25 10:22:19 2007 par Balluche grâce à PHPXref 0.7