Quick Search:

View

Revision:

Diff

Diff from 1857 to:

Annotations

Annotate by Age | Author | Mixed | None
/fisheye/browse/osCommerce/branches/hpdl/oscommerce/admin/includes/applications/administrators_log/administrators_log.php

Annotated File View

hpdl
1291
1 <?php
2 /*
3   $Id: administrators_log.php 1857 2009-03-01 02:41:14Z hpdl $
4
5   osCommerce, Open Source E-Commerce Solutions
6   http://www.oscommerce.com
7
hpdl
1857
8   Copyright (c) 2009 osCommerce
hpdl
1291
9
hpdl
1497
10   This program is free software; you can redistribute it and/or modify
11   it under the terms of the GNU General Public License v2 (1991)
12   as published by the Free Software Foundation.
hpdl
1291
13 */
14
hpdl
1857
15   class osC_Application_Administrators_log extends osC_Template_Admin {
hpdl
1291
16
hpdl
1857
17 /* Protected variables */
hpdl
1291
18
hpdl
1857
19     protected $_module = 'administrators_log',
20               $_page_title,
21               $_page_contents = 'main.php';
hpdl
1291
22
23 /* Class constructor */
24
hpdl
1857
25     function __construct() {
hpdl
1467
26       global $osC_Language, $osC_MessageStack;
hpdl
1291
27
hpdl
1467
28       $this->_page_title = $osC_Language->get('heading_title');
29
hpdl
1291
30       if ( !isset($_GET['action']) ) {
31         $_GET['action'] = '';
32       }
33
34       if ( !isset($_GET['page']) || ( isset($_GET['page']) && !is_numeric($_GET['page']) ) ) {
35         $_GET['page'] = 1;
36       }
37
38       if ( !isset($_GET['fm']) ) {
39         $_GET['fm'] = '';
40       }
41
42       if ( !isset($_GET['fu']) || !is_numeric($_GET['fu']) ) {
43         $_GET['fu'] = '';
44       }
45
46       if ( !empty($_GET['action']) ) {
47         switch ( $_GET['action'] ) {
48           case 'info':
49             $this->_page_contents = 'info.php';
50
51             break;
52
53           case 'delete':
54             $this->_page_contents = 'delete.php';
55
56             if ( isset($_POST['subaction']) && ($_POST['subaction'] == 'confirm') ) {
hpdl
1857
57               if ( osC_AdministratorsLog_Admin::delete($_GET['lID']) ) {
hpdl
1845
58                 $osC_MessageStack->add($this->_module, $osC_Language->get('ms_success_action_performed'), 'success');
hpdl
1291
59               } else {
hpdl
1845
60                 $osC_MessageStack->add($this->_module, $osC_Language->get('ms_error_action_not_performed'), 'error');
hpdl
1291
61               }
62
hpdl
1400
63               osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module . '&page=' . $_GET['page'] . '&fm=' . $_GET['fm'] . '&fu=' . $_GET['fu']));
hpdl
1291
64             }
65
66             break;
67
68           case 'batchDelete':
69             if ( isset($_POST['batch']) && is_array($_POST['batch']) && !empty($_POST['batch']) ) {
70               $this->_page_contents = 'batch_delete.php';
71
72               if ( isset($_POST['subaction']) && ($_POST['subaction'] == 'confirm') ) {
73                 $error = false;
74
75                 foreach ($_POST['batch'] as $id) {
hpdl
1857
76                   if ( !osC_AdministratorsLog_Admin::delete($id) ) {
hpdl
1291
77                     $error = true;
78                     break;
79                   }
80                 }
81
82                 if ( $error === false ) {
hpdl
1845
83                   $osC_MessageStack->add($this->_module, $osC_Language->get('ms_success_action_performed'), 'success');
hpdl
1291
84                 } else {
hpdl
1845
85                   $osC_MessageStack->add($this->_module, $osC_Language->get('ms_error_action_not_performed'), 'error');
hpdl
1291
86                 }
87
hpdl
1400
88                 osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, $this->_module . '&page=' . $_GET['page'] . '&fm=' . $_GET['fm'] . '&fu=' . $_GET['fu']));
hpdl
1291
89               }
90             }
91
92             break;
93         }
94       }
95     }
96   }
97 ?>