3 * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
4 * Copyright (C) 2002-2012 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-2012 The Nucleus Group
15 * @version $Id: index.php 1638 2012-01-29 08:07:27Z sakamocchi $
18 // we are using admin stuff:
20 $CONF['UsingAdminArea'] = 1;
22 // include the admin code
23 require_once('../config.php');
25 if ($CONF['alertOnSecurityRisk'] == 1)
27 // check if files exist and generate an error if so
29 // '../install.sql' => _ERRORS_INSTALLSQL,
30 // '../install.php' => _ERRORS_INSTALLPHP,
31 '../install' => _ERRORS_INSTALLDIR,
32 'upgrades' => _ERRORS_UPGRADESDIR,
33 'convert' => _ERRORS_CONVERTDIR
36 foreach($aFiles as $fileName => $fileDesc)
38 if ( @file_exists($fileName) )
40 array_push($aFound, $fileDesc);
43 if ( @is_writable('../config.php') ) {
44 array_push($aFound, _ERRORS_CONFIGPHP);
46 if (sizeof($aFound) > 0)
48 sendContentType('text/html', 'startUpError');
50 _ERRORS_STARTUPERROR1 . implode($aFound, '</li><li>') . _ERRORS_STARTUPERROR2,
57 $bIsActivation = in_array($action, array('activate', 'activatesetpwd'));
59 if ( $action == 'logout' )
64 if ( !$member->isLoggedIn() && !$bIsActivation )
69 // show error if member cannot login to admin
70 if ( $member->isLoggedIn() && !$member->canLogin() && !$bIsActivation )
72 $error = _ERROR_LOGINDISALLOWED;
78 // see Admin::login() (sets old action in POST vars)
79 setOldAction($action);
80 $action = 'showlogin';
83 sendContentType('text/html', 'admin-' . $action);
86 $admin->action($action);