コード例 #1
0
 function __construct()
 {
     global $osC_Language, $osC_MessageStack;
     $this->_page_title = $osC_Language->get('heading_title');
     if (!isset($_GET['action'])) {
         $_GET['action'] = '';
     }
     if (!isset($_GET['page']) || isset($_GET['page']) && !is_numeric($_GET['page'])) {
         $_GET['page'] = 1;
     }
     if (!empty($_GET['action'])) {
         switch ($_GET['action']) {
             case 'info':
                 $this->_page_contents = 'info.php';
                 break;
             case 'delete':
                 $this->_page_contents = 'delete.php';
                 if (isset($_POST['subaction']) && $_POST['subaction'] == 'confirm') {
                     if (osC_WhosOnline_Admin::delete($_GET['info'])) {
                         $osC_MessageStack->add($this->_module, $osC_Language->get('ms_success_action_performed'), 'success');
                     } else {
                         $osC_MessageStack->add($this->_module, $osC_Language->get('ms_error_action_not_performed'), 'error');
                     }
                     osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module . '&page=' . $_GET['page']));
                 }
                 break;
             case 'batchDelete':
                 if (isset($_POST['batch']) && is_array($_POST['batch']) && !empty($_POST['batch'])) {
                     $this->_page_contents = 'batch_delete.php';
                     if (isset($_POST['subaction']) && $_POST['subaction'] == 'confirm') {
                         $error = false;
                         foreach ($_POST['batch'] as $id) {
                             if (!osC_WhosOnline_Admin::delete($id)) {
                                 $error = true;
                                 break;
                             }
                         }
                         if ($error === false) {
                             $osC_MessageStack->add($this->_module, $osC_Language->get('ms_success_action_performed'), 'success');
                         } else {
                             $osC_MessageStack->add($this->_module, $osC_Language->get('ms_error_action_not_performed'), 'error');
                         }
                         osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module . '&page=' . $_GET['page']));
                     }
                 }
                 break;
         }
     }
 }
コード例 #2
0
ファイル: info.php プロジェクト: heshuai64/gamestore
  http://www.oscommerce.com

  Copyright (c) 2007 osCommerce

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License v2 (1991)
  as published by the Free Software Foundation.
*/
$osC_Currencies = new osC_Currencies();
$osC_Tax = new osC_Tax_Admin();
$osC_Weight = new osC_Weight();
$osC_GeoIP = osC_GeoIP_Admin::load();
if ($osC_GeoIP->isInstalled()) {
    $osC_GeoIP->activate();
}
$osC_ObjectInfo = new osC_ObjectInfo(osC_WhosOnline_Admin::getData($_GET['info']));
if (STORE_SESSIONS == 'database') {
    $Qsession = $osC_Database->query('select value from :table_sessions where id = :id');
    $Qsession->bindTable(':table_sessions', TABLE_SESSIONS);
    $Qsession->bindValue(':id', $osC_ObjectInfo->get('session_id'));
    $Qsession->execute();
    $session_data = trim($Qsession->value('value'));
} else {
    if (file_exists($osC_Session->getSavePath() . '/sess_' . $osC_ObjectInfo->get('session_id')) && filesize($osC_Session->getSavePath() . '/sess_' . $osC_ObjectInfo->get('session_id')) > 0) {
        $session_data = trim(file_get_contents($osC_Session->getSavePath() . '/sess_' . $osC_ObjectInfo->get('session_id')));
    }
}
$navigation = unserialize(osc_get_serialized_variable($session_data, 'osC_NavigationHistory_data', 'array'));
$last_page = end($navigation);
$last_page_url = $last_page['page'];
if (isset($last_page['get']['osCsid'])) {
コード例 #3
0
 function deleteOnlineCustomers()
 {
     global $toC_Json, $osC_Language;
     $error = false;
     $batch = explode(',', $_REQUEST['batch']);
     foreach ($batch as $id) {
         if (!osC_WhosOnline_Admin::delete($id)) {
             $error = true;
             break;
         }
     }
     if ($error === false) {
         $response = array('success' => true, 'feedback' => $osC_Language->get('ms_success_action_performed'));
     } else {
         $response = array('success' => false, 'feedback' => $osC_Language->get('ms_error_action_not_performed'));
     }
     echo $toC_Json->encode($response);
 }