Ejemplo n.º 1
0
 function CCore($url = '', $wiki = true)
 {
     global $DOCUMENT_ROOT, $content_type, $CORE, $ipc, $XPFS;
     debug_watchdog_clear();
     if ($url == '') {
         $url = config_get('document-root');
     }
     $this->wiki = $wiki;
     $this->URL = $url;
     $this->PAGE = new CVCPage();
     $this->PAGE->Init('title=GATE;');
     $CORE = $this;
     // Starting session
     session_start();
     // Set the internal encoding
     mb_internal_encoding(config_get('internal-charset'));
     date_default_timezone_set(config_get('timezone'));
     // Connect to database
     db_connect(config_get('check-database'));
     // Initialize XPFS
     $XPFS = new XPFS();
     $XPFS->createVolume();
     // Initialize content stuff
     content_initialize();
     // Initialize wiki stuff
     wiki_initialize();
     // Initialie manage stuff
     manage_initialize();
     security_initialize();
     ipc_initialize();
     service_initialize();
     editor_initialize();
     $this->DeleteUnwanted();
     if ($ipc != '') {
         ipc_exec($ipc);
         die;
     } else {
         // Make default actions
         $this->ActionHandler();
         // Creating page
         $this->PAGE->AddScript('language=JavaScript;type=text/javascript', "\n" . tpl('common/globals', array(), false));
         $this->PAGE->AddScriptFile('core.js');
         $this->PAGE->AddMeta('http-equiv=content-language;content=' . config_get('content-language'));
         $this->PAGE->AddMeta('http-equiv=Content-Type;content=text/html\\; charset\\=' . config_get('character-set'));
         $this->PAGE->AddMeta('name=url;content=' . config_get('meta-url'));
         $this->PAGE->AddMeta('name=keywords;content=' . config_get('meta-keywords'));
         $this->PAGE->AddMeta('name=description;content=' . config_get('meta-description'));
         $this->PAGE->AddMeta('name=robots;content=all');
         $this->PAGE->SetIcon(config_get('document-root') . '/pics/favicon.ico');
         $this->PAGE->AddStyle('content');
         $this->PAGE->AddStyle('pages');
         add_body_handler('onmousemove', 'core_StoreMousePos', array('event'));
         if (browser_engine() == 'OPERA') {
             $this->PAGE->AddStyle('content_opera_rep');
         }
         foreach (config_get('default-scripts') as $k) {
             $this->AddScriptFile($k);
         }
     }
 }
Ejemplo n.º 2
0
 * This program can be distributed under the terms of the GNU GPL.
 * See the file COPYING.
 */
if ($PHP_SELF != '') {
    print 'HACKERS?';
    die;
}
global $MARKET, $ipc, $action;
InitMarket();
/* Some optimization stuff */
$serv_ipc_procs = '#basket_add#';
if ($ipc != '') {
    $n = count($serv_ipc_procs);
    if (strpos($serv_ipc_procs, $ipc) > 0) {
        /* Execute IPC command */
        ipc_exec($ipc);
        die;
    }
}
if ($action == 'drop') {
    global $id;
    if (isNumber($id)) {
        $MARKET->BASKET->DropById($id);
    }
} else {
    if ($action == 'send') {
        $MARKET->BASKET->Send();
    }
}
if ($action != 'send') {
    $tpl = manage_template_by_name('Магазин / Корзина');