source: trunk/admin/index.php @ 788

Revision 788, 3.3 KB checked in by r2, 13 months ago (diff)

jquery 1.5.2

  • Property svn:executable set to *
Line 
1<?php Error_Reporting(E_ALL & ~E_NOTICE & ~E_WARNING);
2/******************************************************************************/
3//                                                                            //
4//                             InstantCMS v1.8                                //
5//                        http://www.instantcms.ru/                           //
6//                                                                            //
7//                   written by InstantCMS Team, 2007-2010                    //
8//                produced by InstantSoft, (www.instantsoft.ru)               //
9//                                                                            //
10//                        LICENSED BY GNU/GPL v2                              //
11//                                                                            //
12/******************************************************************************/
13
14        session_start();
15       
16        define("VALID_CMS", 1);
17        define("VALID_CMS_ADMIN", 1);
18
19    define('PATH', $_SERVER['DOCUMENT_ROOT']);
20    define('HOST', 'http://' . $_SERVER['HTTP_HOST']);
21
22        require("../core/cms.php");
23        require("includes/cp.php");
24                                       
25        require("../includes/config.inc.php"); 
26        require("../includes/database.inc.php");
27        require("../includes/tools.inc.php");   
28
29    $inCore = cmsCore::getInstance();
30
31    $inCore->loadClass('page');         //ñòðàíèöà
32    $inCore->loadClass('config');       //êîíôèãóðàöèÿ
33    $inCore->loadClass('db');           //áàçà äàííûõ
34    $inCore->loadClass('plugin');       //ïëàãèíû
35    $inCore->loadClass('user');       //ïëàãèíû
36        $inCore->loadClass('actions');    //ëåíòà ñîáûòèé
37
38    $inPage     = cmsPage::getInstance();
39    $inConf     = cmsConfig::getInstance();
40    $inDB       = cmsDatabase::getInstance();
41    $inUser     = cmsUser::getInstance();
42
43    date_default_timezone_set($inConf->timezone);
44
45    if ( !$inUser->update() ) { $inCore->redirect('/404'); }
46
47    define('TEMPLATE_DIR', PATH.'/templates/'.$inConf->template.'/');
48    define('DEFAULT_TEMPLATE_DIR', PATH.'/templates/_default_/');
49
50        //-------CHECK AUTHENTICATION--------------------------------------//
51        if (!$inUser->id ) {
52                $inCore->redirect('/admin/login.php');
53        } else {       
54                if (!$inCore->userIsAdmin($inUser->id)){
55                        if ($inCore->userIsEditor($inUser->id)){
56                                $inCore->redirect('editor/index.php');
57                        } else { $inCore->redirect('login.php'); }
58                }
59        }
60        //--------LOAD ACCESS OPTIONS LIST---------------------------------//
61       
62        $adminAccess = $inCore->checkAdminAccess();     
63
64        //------------------------------------------------------------------//
65
66        $inCore->onlineStats();
67
68        if (isset($_REQUEST['view'])){
69        $applet = $inCore->request('view', 'str');
70        if (!preg_match('/([a-z0-9]+)/i', $applet)) { $inCore->halt(); }
71                $GLOBALS['applet'] = $applet;
72        } else {
73                $GLOBALS['applet'] = 'main';
74        }
75       
76        $GLOBALS['cp_page_title'] = '';
77        $GLOBALS['cp_page_head'] = array();
78        $GLOBALS['cp_page_body'] = '';
79       
80        $GLOBALS['cp_pathway'] = array();
81        $GLOBALS['cp_pathway'][0]['title'] = 'Ãëàâíàÿ';
82        $GLOBALS['cp_pathway'][0]['link'] = 'index.php';
83       
84        $GLOBALS['mainmenu'] = array();
85
86    $inCore->loadLanguage('lang');
87
88        cpGenerateMenu();
89
90        cpProceedBody();
91
92        include("template.php");
93
94?>
Note: See TracBrowser for help on using the repository browser.