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
15 * @copyright Copyright (C) 2002-2012 The Nucleus Group
16 * @version $Id: index.php 1748 2012-04-13 13:27:57Z sakamocchi $
18 * @copyright Copyright (C) 2002-2009 The Nucleus Group
19 * @version $Id: index.php 1888 2012-06-17 08:38:54Z sakamocchi $
20 >>>>>>> skinnable-master
23 // we are using admin stuff:
25 $CONF['UsingAdminArea'] = 1;
27 // include the admin code
28 require_once('../config.php');
30 if ( $CONF['alertOnSecurityRisk'] == 1 )
32 // check if files exist and generate an error if so
34 '../install' => _ERRORS_INSTALLDIR,
35 'upgrades' => _ERRORS_UPGRADESDIR,
36 'convert' => _ERRORS_CONVERTDIR
39 foreach ( $aFiles as $fileName => $fileDesc )
41 if ( @file_exists($fileName) )
43 array_push($aFound, $fileDesc);
46 if ( @is_writable('../config.php') )
48 array_push($aFound, _ERRORS_CONFIGPHP);
50 if ( sizeof($aFound) > 0 )
53 _ERRORS_STARTUPERROR1. implode($aFound, '</li><li>')._ERRORS_STARTUPERROR2,
60 $bIsActivation = in_array($action, array('activate', 'activatesetpwd'));
62 if ( $action == 'logout' )
67 if ( !$member->isLoggedIn() && !$bIsActivation )
72 // show error if member cannot login to admin
73 if ( $member->isLoggedIn() && !$member->canLogin() && !$bIsActivation )
75 $error = _ERROR_LOGINDISALLOWED;
81 // see Admin::login() (sets old action in POST vars)
82 setOldAction($action);
83 $action = 'showlogin';
86 if ( !Admin::initialize() )
88 /* TODO: this is a bad way... */
89 sendContentType('text/html', 'admin-' . $action);
91 $skin =& $manager->getSkin(0, 'AdminActions', 'AdminSkin');
94 $skin->parse('fileparse', $DIR_SKINS . 'admin/showlogin.skn');
96 else if ($action == 'adminskinieimport' )
98 Admin::action($action);
102 $skin->parse('importAdmin', $DIR_SKINS . 'admin/defaultimporter.skn');
104 /* TODO: something to handling errors */
108 Admin::action($action);