Location: PHPKode > projects > Netautor Professional > netautor/napro4/index.php
<?php
/* +----------------------------------------------------------------------+
   | Netautor Professional Application Server                             |
   +----------------------------------------------------------------------+
   | Copyright (C) 1998-2005 digiconcept GmbH. <www.digiconcept.net>      |
   +----------------------------------------------------------------------+
   | This file is subject to license, that is bundled with this package   |
   | in the file LICENSE.TXT, and is available at through the             |
   | world-wide-web at http://www.netautor.com/license/                   |
   |                                                                      |
   | If you did not receive a copy of the license and are unable to       |
   | obtain it through the world-wide-web, please send a note to          |
   | hide@address.com so we can mail you a copy.                      |
   +----------------------------------------------------------------------+
   | Authors: Stefan Rottensteiner <hide@address.com>    |
   |          Marek  Kadziela      <hide@address.com>	      |
   |          Gregor Wollner                                              |
   |          Christian Unger                                             |
   |          Helli  Kleinhans  									      |
   +----------------------------------------------------------------------+*/

	/**
	 * @version $Revision: 1.19 $
	 * @author	Helli Kleinhans
	 * @author	Stefan Rottensteiner
	 */

	if(!file_exists('../config/base.php'))	// Check auf Installationsstatus
	{
		if (file_exists('../config/base.conf'))
		{
			if (@copy('../config/base.conf','../config/base.php'))
			{
				@unlink('../config/base.conf');
			}
			else
			{
				Header('Location: admin/install/setup.php');  /* Redirect browser to PHP web site */
				exit();
			}
		}
		else
		{
				Header('Location: admin/install/setup.html');  /* Redirect browser to PHP web site */
				exit();
		}
	}

	require_once('include/init.inc');

	if (!isset($button)		) $button='';
	if (!isset($user_name)	) $user_name='';
	if (!isset($user_pass)	) $user_pass='';

	// Check auf Basisinstallations-Package
	if(!empty($sql_world->sql_errnr) )
	{
		Header('Location: admin/install/setup.php');  /* Redirect browser to netautor setup */
		exit();
	}

	// Check, ob Logout-Menüpunktn gewählt wurde
	if($button == 'logout')
	{
		//session_destroy();
		session_unset();
	}

	// Check, ob Login-Knopf gedrückt wurde
	if (!empty($login_x) || !empty($login))
	{
		// Check, ob ein Name eingegeben wurde
		if(empty($user_name))
		{
			$message=$GLOBALS['LOCALE']->dgettext('system','login_empty');
		}
		else if(empty($message))
		{
			$USER->users_set(0,$user_name,$user_pass);

			$status = $USER->users_init();
			if($status==false)
			{
				if(empty($GLOBALS['return_path']))
				{
					$message=$GLOBALS['LOCALE']->dgettext('system','login_unknown');
				}
				else
				{
					echo('
					<html>
						<head>
							<meta http-equiv="refresh" content="0; URL='.$GLOBALS['return_path'].'" />
						</head>
					</html>
					');
					exit();
				}
			}
			else
			{
				$table	='sessions';
				$fields	='ses_user_id,ses_cookie,ses_valid,ses_creation,ses_access,ses_count,ses_server,ses_sport,ses_host';
				$REMOTE_ADDR 		= "'".(empty($_SERVER['HTTP_CLIENT_IP'])? ( empty($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['REMOTE_ADDR'] : $_SERVER['HTTP_X_FORWARDED_FOR']) : $_SERVER['HTTP_CLIENT_IP'])."'";
				$values	=$USER->ID.",'".time()."',1,'".(date('Y-m-d H:i:s'))."','".(date('Y-m-d H:i:s'))."',1,'1',{$_SERVER['REMOTE_PORT']},{$REMOTE_ADDR}";
				$erg	=$sql_world->insert($table,$fields,$values,'ses_id');
			}
		}

		if(empty($message))
		{
			//Set_Features();
			if( isset($USER->FEATURE['value']['Initialdoc']) && !empty($USER->FEATURE['value']['Initialdoc']) )
			{
				$dest = $USER->FEATURE['value']['Initialdoc'];
			}
			else
			{
				$dest='home/index.php';
			}

			if( !empty($dest) )
			{
				Header('Location: '.$dest );  /* Redirect browser to PHP web site */
				exit();
			}
		}
	}
	include ('index.msk');
?>
Return current item: Netautor Professional