3 * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
4 * Copyright (C) 2002-2009 The Nucleus Group
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 * (see nucleus/documentation/index.html#license for more info)
13 * @license http://nucleuscms.org/license.txt GNU General Public License
14 * @copyright Copyright (C) 2002-2009 The Nucleus Group
15 * @version $Id: index.php 1491 2011-01-03 23:00:35Z ftruscot $
17 // we are using admin stuff:
19 $CONF['UsingAdminArea'] = 1;
21 // include the admin code
22 require_once('../config.php');
24 if ($CONF['alertOnSecurityRisk'] == 1)
26 // check if files exist and generate an error if so
28 '../install.sql' => _ERRORS_INSTALLSQL,
29 '../install.php' => _ERRORS_INSTALLPHP,
30 'upgrades' => _ERRORS_UPGRADESDIR,
31 'convert' => _ERRORS_CONVERTDIR
34 foreach($aFiles as $fileName => $fileDesc)
36 if (@file_exists($fileName))
37 array_push($aFound, $fileDesc);
39 if (@is_writable('../config.php')) {
40 array_push($aFound, _ERRORS_CONFIGPHP);
42 if (sizeof($aFound) > 0)
45 _ERRORS_STARTUPERROR1. implode($aFound, '</li><li>')._ERRORS_STARTUPERROR2,
52 $bIsActivation = in_array($action, array('activate', 'activatesetpwd'));
54 if ($action == 'logout')
57 if (!$member->isLoggedIn() && !$bIsActivation)
60 // show error if member cannot login to admin
61 if ($member->isLoggedIn() && !$member->canLogin() && !$bIsActivation) {
62 $error = _ERROR_LOGINDISALLOWED;
68 setOldAction($action); // see ADMIN::login() (sets old action in POST vars)
69 $action = 'showlogin';
72 sendContentType('text/html', 'admin-' . $action);
75 $admin->action($action);