blob: ea257106ee99300afd96bd167338a7c49a10ffb9 [file] [log] [blame]
droye95652e2007-11-27 18:16:36 +00001<?php
2/*******************************************************************************
3 * Copyright (c) 2007 Eclipse Foundation and others.
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Paul Colton (Aptana)- initial API and implementation
11 * Eclipse Foundation
12*******************************************************************************/
13define('BABEL_BASE_DIR', "../");
14define('USE_PHOENIX', true);
15
16
17# Load up Phoenix classes
18$App;
19if(USE_PHOENIX) {
20 require_once(BABEL_BASE_DIR . '/eclipse.org-common/system/app.class.php');
21 require_once(BABEL_BASE_DIR . "/eclipse.org-common/system/nav.class.php");
22 require_once(BABEL_BASE_DIR . "/eclipse.org-common/system/menu.class.php");
23 $App = new App();
24 $Nav = new Nav();
25 $Menu = new Menu();
26}
27$GLOBALS['g_LOADTIME'] = microtime();
28require("utils.inc.php");
29session_name(COOKIE_SESSION);
30session_start();
31extract($_SESSION);
32
33
34function InitPage($page) {
35 $lastPage = GetSessionVar('s_pageName');
36 $userName = GetSessionVar('s_userName');
37
38 if (empty($GLOBALS['page']))
39 $GLOBALS['page'] = '';
40
41 if (($lastPage != $_SERVER['PHP_SELF']) AND ($lastPage != "login"))
42 SetSessionVar('s_pageLast',$lastPage);
43 SetSessionVar('s_pageName',$GLOBALS['page']);
44
45 sqlOpen(NULL);
46 if (!$userName && isset($_COOKIE[COOKIE_REMEMBER])) {
47 # Try to fetch username from session
48 $session = new sessions_iu(0);
49
50 if(!$session->validate()) {
51 SetSessionVar('s_pageLast',$GLOBALS['page']);
52 exitTo("login.php");
53 }
54 else {
55 $user = new users_iu(0);
56 $user->sqlLoad($session->_userid);
57 # hack! Not every one has a username
58 SetSessionVar("s_userName", str_replace("@", ".", $user->_email));
59 }
60 }
61
62 $GLOBALS['g_PHPSELF'] = $GLOBALS['page'];
63 $GLOBALS['g_PAGE'] = $page;
64 $GLOBALS['g_SITEURL'] = $_SERVER['HTTP_HOST'];
65 $GLOBALS['g_SITENAME'] = substr($GLOBALS['g_SITEURL'],0,strlen($GLOBALS['g_SITEURL'])-4);
66 $GLOBALS['g_TITLE'] = $GLOBALS['g_SITENAME'];
67 $GLOBALS['g_ERRSTRS'] = array("","","","","","","","","","","",);
68 // $GLOBALS['g_MAINMENU'] = buildMainMenu($page,$userName);
69 $GLOBALS['DEBUG'] = "";
70
71 // Build left nav
72 // $GLOBALS['g_LEFTNAV'] = "&nbsp;";
73
74 // Build rite nav/ad
75 // $GLOBALS['g_RITENAV'] = "&nbsp;";
76
77}
78
79
80?>