X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=nucleus%2Findex.php;h=cad62572a2bd8c997ddf8b71492ad777995e3216;hb=3d59f746308b6cc445587c494826dbbc3e9cac5c;hp=77f8ddfcb7bf6d0025004be02fbca62ff198e114;hpb=0926bc19967e1b472c9aeb40eb47234a601a68f8;p=nucleus-jp%2Fnucleus-next.git
diff --git a/nucleus/index.php b/nucleus/index.php
index 77f8ddf..cad6257 100644
--- a/nucleus/index.php
+++ b/nucleus/index.php
@@ -1,7 +1,7 @@
_ERRORS_INSTALLDIR,
+ 'upgrades' => _ERRORS_UPGRADESDIR,
+ 'convert' => _ERRORS_CONVERTDIR
+ );
+ $aFound = array();
+ foreach ( $aFiles as $fileName => $fileDesc )
{
- // check if files exist and generate an error if so
- $aFiles = array(
- '../install.sql' => _ERRORS_INSTALLSQL,
- '../install.php' => _ERRORS_INSTALLPHP,
- 'upgrades' => _ERRORS_UPGRADESDIR,
- 'convert' => _ERRORS_CONVERTDIR
- );
- $aFound = array();
- foreach($aFiles as $fileName => $fileDesc)
- {
- if (@file_exists($fileName))
- array_push($aFound, $fileDesc);
- }
- if (@is_writable('../config.php')) {
- array_push($aFound, _ERRORS_CONFIGPHP);
- }
- if (sizeof($aFound) > 0)
+ if ( @file_exists($fileName) )
{
- startUpError(
- _ERRORS_STARTUPERROR1. implode($aFound, '
')._ERRORS_STARTUPERROR2,
- _ERRORS_STARTUPERROR3
- );
+ array_push($aFound, $fileDesc);
}
}
+ if ( @is_writable('../config.php') )
+ {
+ array_push($aFound, _ERRORS_CONFIGPHP);
+ }
+ if ( sizeof($aFound) > 0 )
+ {
+ startUpError(
+ _ERRORS_STARTUPERROR1. implode($aFound, '')._ERRORS_STARTUPERROR2,
+ _ERRORS_STARTUPERROR3
+ );
+ }
+}
- $bNeedsLogin = false;
- $bIsActivation = in_array($action, array('activate', 'activatesetpwd'));
+$bNeedsLogin = FALSE;
+$bIsActivation = in_array($action, array('activate', 'activatesetpwd'));
- if ($action == 'logout')
- $bNeedsLogin = true;
+if ( $action == 'logout' )
+{
+ $bNeedsLogin = TRUE;
+}
- if (!$member->isLoggedIn() && !$bIsActivation)
- $bNeedsLogin = true;
+if ( !$member->isLoggedIn() && !$bIsActivation )
+{
+ $bNeedsLogin = TRUE;
+}
- // show error if member cannot login to admin
- if ($member->isLoggedIn() && !$member->canLogin() && !$bIsActivation) {
- $error = _ERROR_LOGINDISALLOWED;
- $bNeedsLogin = true;
- }
+// show error if member cannot login to admin
+if ( $member->isLoggedIn() && !$member->canLogin() && !$bIsActivation )
+{
+ $error = _ERROR_LOGINDISALLOWED;
+ $bNeedsLogin = TRUE;
+}
- if ($bNeedsLogin)
- {
- setOldAction($action); // see ADMIN::login() (sets old action in POST vars)
- $action = 'showlogin';
- }
+if ( $bNeedsLogin )
+{
+ // see Admin::login() (sets old action in POST vars)
+ setOldAction($action);
+ $action = 'showlogin';
+}
+if ( !Admin::initialize() )
+{
+ /* TODO: this is a bad way... */
sendContentType('text/html', 'admin-' . $action);
+
+ $skin =& $manager->getSkin(0, 'AdminActions', 'AdminSkin');
+ if ( $bNeedsLogin )
+ {
+ $skin->parse('fileparse', $DIR_SKINS . 'admin/showlogin.skn');
+ }
+ else if ($action == 'adminskinieimport' )
+ {
+ Admin::action($action);
+ }
+ else
+ {
+ $skin->parse('importAdmin', $DIR_SKINS . 'admin/defaultimporter.skn');
+ }
+ /* TODO: something to handling errors */
+ exit;
+}
- $admin = new ADMIN();
- $admin->action($action);
-?>
\ No newline at end of file
+Admin::action($action);
+exit;