Index: trunk/admin/index.php
===================================================================
diff -u -r4199 -r7391
--- trunk/admin/index.php	(.../index.php)	(revision 4199)
+++ trunk/admin/index.php	(.../index.php)	(revision 7391)
@@ -1,88 +1,42 @@
-<?php 
-##############################################################
-##In-portal													##
-##############################################################
-##					      In-portal							##
-##					Intechnic Corporation					##
-##			   All Rights Reserved, 1998-2002				##
-##															##	
-##	No portion of this code may be copied, reproduced or	##	
-##	   otherwise redistributed without proper written		##
-##	  consent of Intechnic Corporation.  Violation will		##
-##	   result in revocation of the license and support		##
-##	 privileges along maximum prosecution allowed by law.	##
-##############################################################
+<?php
 
-	// new startup: begin
-	define('REL_PATH', 'admin');
-	define('THIS_FILE', 'admin/index');
-	
-	$relation_level = count( explode('/', REL_PATH) );
-	define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) );
-	require_once FULL_PATH.'/kernel/startup.php';
-	// new startup: end
+$start = getmicrotime();
 
-	$objConfig->Set('AdminDirectory', $admin, 0, true);
-	$objConfig->Save();
+define('ADMIN', 1);
+define('FULL_PATH', realpath(dirname(__FILE__).'/..') );
+if (!file_exists(FULL_PATH.'/core/kernel/application.php')) {
+	die('Please re-checkout _inportal_kernel4 cvs module into the root directory ('.FULL_PATH.') and remove kernel/kernel4 folder. Make sure to checkout correct branch (RC or HEAD).');
+}
+include_once(FULL_PATH.'/core/kernel/startup.php');
 
-	if (!admin_login() || GetVar('logout') || GetVar('expired') ) {
-		if (!headers_sent()) {
-			set_cookie(SESSION_COOKIE_NAME, '', adodb_mktime() - 3600);
-		}
-		$objSession->Logout();
-		require_once FULL_PATH.'/admin/login.php';
-	}
+/*
+	kApplication $application
+*/
+$application =& kApplication::Instance();
+$application->Init();
+$application->Run();
+$application->Done();
 
-	$envar = 'env='.BuildEnv();
+$end = getmicrotime();
 
-	require_once FULL_PATH.'/admin/include/elements.php'; 
-	require_once FULL_PATH.'/kernel/admin/include/navmenu.php'; 
+function getmicrotime()
+{
+    list($usec, $sec) = explode(" ", microtime());
+    return ((float)$usec + (float)$sec);
+}
 
-	$charset = GetRegionalOption('Charset');
-?>
+//update_memory_check_script();
 
-<html>
-
-	<head>
-		<meta http-equiv="content-type" content="text/html;charset=<?php echo $charset; ?>">
-		<meta name="generator" content="kwrite">
-		<link rel="stylesheet" type="text/css" href="include/style.css">
-		<title>In-portal Administration</title>
-	</head>
-<script type="text/javascript">
-	window.name = 'main_frame';
-	lala = navigator.appVersion.substring(0,1);
-
-	if (navigator.appName == "Netscape") {
-		if (lala != "5") {
-			document.write("<frameset rows='96,*' framespacing='0' scrolling='no' frameborder='0'>");
-		} else {
-			document.write("<frameset rows='95,*' framespacing='0' scrolling='no' frameborder='0'>");
-		}
-	} else {
-		document.write("<frameset rows='94,*' framespacing='0' scrolling='no' frameborder='0'>");
+function update_memory_check_script() {
+	$files = get_included_files();
+	$script = '$files = Array('."\n";
+	foreach ($files as $file_name) {
+		$script .= "\t\t'".str_replace(FULL_PATH, '', $file_name)."',\n";
 	}
-	
-	function getFrame($name)
-	{
-		var $frameset = window.frames;
-		for ($i = 0; $i < window.length; $i++) {
-			if ($frameset[$i].name == $name) {
-	    		return $frameset[$i];
-	    	}
-		}
-		return window;
-	}
-</script>
-	<frame src="<?php echo $adminURL; ?>/head.php?<?php echo $envar; ?>" name="head" scrolling="no" noresize>		
-	<frameset cols="200,*" border="0">
-			<frame src="<?php echo $adminURL; ?>/tree/tree.php?<?php echo $envar; ?>" name="menu" target="_main" noresize scrolling="auto" marginwidth="0" marginheight="0">
-			<frame src="<?php echo $adminURL; ?>/subitems.php?<?php echo $envar."&section=in-portal:root"; ?>" name="main" marginwidth="0" marginheight="0" frameborder="NO" noresize scrolling="auto">
-		</frameset>
-	</frameset>
-	<noframes>
-		<body bgcolor="#ffffff">
-			<p></p>
-		</body>
-	</noframes>
-</html>
\ No newline at end of file
+	$script .= ");\n";
+	echo "<pre>";
+	echo $script;
+	echo "</pre>";
+}
+
+?>
\ No newline at end of file