Форум программистов, компьютерный форум, киберфорум
PHP: базы данных
Войти
Регистрация
Восстановить пароль
Блоги Сообщество Поиск Заказать работу  
 
Рейтинг 4.60/5: Рейтинг темы: голосов - 5, средняя оценка - 4.60
0 / 0 / 2
Регистрация: 29.01.2013
Сообщений: 48

Взлом модуля

15.02.2014, 09:35. Показов 971. Ответов 1
Метки нет (Все метки)

Студворк — интернет-сервис помощи студентам
Если модуль, так как он ДЕМО в нем отсутствует функция сохранения, может кто поможет это исправить, вот код файла из админки
PHP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
<?php
class ControllerMtaMta extends Controller {
    private $error = array();
    private $scheme = array();
    private $error_keys = array('permission','name','duplicate_name','invalid_percent',
'invalid_commission','unknown','database','warning','no_default','no_default_unconverted','all');
    public function index() {
        $this->load->model('mta/mta_affiliate');
        $this->load->model('mta/mta_product_affiliate');
        $_fields = array('heading_title','text_no_results','column_name','column_code','column_action','column_commission','error_invalid_request','entry_tier','text_percent','text_amount','text_show_usage','text_hide','text_delete_scheme_warning','text_success','text_copy_scheme','entry_new_name','text_move_users','text_move','text_select_scheme','button_insert','button_delete','text_default','error_fixed_aff_commission','text_convert_success',
        'text_settings', 'button_save_settings', 'column_settings_tracking', 'column_settings_no_shipping', 'column_settings_autoadd_statuses', 'column_settings_llaff_priority', 'text_settings_llaff_higher', 'text_settings_llaff_lower', 'text_settings_tracking_permanent', 'text_settings_tracking_cookies', 'text_settings_no_shipping_default', 'text_settings_no_shipping_any', 'text_settings_no_shipping_subtotal'
        );
        $this->data['unconverted_affiliates'] = $this->model_mta_mta_affiliate->countPreMtaAffiliates();
        if($this->data['unconverted_affiliates']) $_fields = array_merge($_fields, array('text_unconverted_affiliates','text_convert_affiliates'));
      
        $this->_preprocess($_fields, array('insert'));
      
        $this->data['has_default'] = $this->model_mta_mta_affiliate->getDefaultSchemeId() ? true : false;
        if(!$this->data['has_default'])    $this->error = array_merge($this->error, array('no_default', 'no_default_unconverted'));
      
        $this->data['schemes'] = $this->model_mta_mta_affiliate->getSchemes(array('sort' => 'default', 'order' => 'desc'));
              
        $this->data['user_types'] = array(
            'affiliate' => 'a',
            'product' => 'p',          
            'product_discount' => 'p_d',
            'product_special' => 'p_s',
            'product_coupon' => 'p_c',
            'product_affiliate' => 'pa',
            'product_affiliate_discount' => 'pa_d',
            'product_affiliate_special' => 'pa_s',
            'product_affiliate_coupon' => 'pa_c'  
        );
        $this->data['user_types_lng'] = array();
        $_trans = array();
        foreach($this->data['user_types'] as $_k => $_v) {
            $_kAr = explode('_', $_k);
            $_kAr2 = array();
            foreach($_kAr as $_k2) {
                if(!isset($_trans[$_k2])) $_trans[$_k2] = $this->language->get('word_' . $_k2);
                $_kAr2[] = ucfirst($_trans[$_k2]);
            }
            $this->data['user_types_lng'][$_k] = implode(' / ', $_kAr2);
        }
      
        $this->data['s_opts'] = array();
        $this->data['all_fixed'] = array();
      
        foreach($this->data['schemes'] as $i => $s) {
            $s['id'] = $s['mta_scheme_id'];
            $s['name'] = $s['scheme_name'];
            $s['user_count'] = $this->_count_scheme_users($s['id']);
            $s['user_total'] = array_sum(array_values($s['user_count']));
            foreach($this->data['user_types'] as $_k => $_v) {
                if(!isset($s['user_count'][$_k])) $s['user_count'][$_k] = 0;
            }
            $_c = unserialize($s['all_commissions']);
            foreach($_c as $ii => $v) {
                foreach($v as $i2 => $v2) {
                    $_c[$ii][$i2] = mta_float4($v2);
                }
                $_c[$ii] = implode(', ', $_c[$ii]);
            }
            $s['commissions'] = implode('<br />', $_c);
            unset($s['mta_scheme_id']);
            unset($s['scheme_name']);
            unset($s['all_commissions']);
            unset($s['all_autoadd']);
          
            $s['edit_link'] = array(
                'text' => $this->language->get('text_edit'),
                'href' => $this->url->link('mta/mta/update', 'token=' . $this->session->data['token'] . '&id=' . $s['id'], 'SSL')
            );          
            $this->data['s_opts'][] = array('id' => $s['id'], 'name' => $s['name']);
            if($s['commission_type'] == 'fixed') $this->data['all_fixed'][] = (int) $s['id'];
            $this->data['schemes'][$i] = $s;          
        }
      
        $this->data['all_fixed'] = json_encode($this->data['all_fixed']);
        $this->data['num_schemes'] = sizeof($this->data['schemes']);      
        $this->load->model('localisation/order_status');
        $this->data['order_statuses'] = $this->model_localisation_order_status->getOrderStatuses();
        $this->data['autoadd_statuses'] = $this->config->get('mta_ypx_autoadd_statuses');
        if(!is_array($this->data['autoadd_statuses'])) $this->data['autoadd_statuses'] = array($this->config->get('config_complete_status_id'));
      
        $this->_process_errors();      
        $this->template = 'mta/mta.tpl';
        $this->children = array(
            'common/header',  
            'common/footer'  
        );
      
        $this->response->setOutput($this->render());      
    }
    public function insert() {
        $this->load->model('mta/mta_scheme');
        if($this->request->server['REQUEST_METHOD'] == 'POST' && isset($this->request->post['name'])) {
            $this->_save();
            return;
        }
      
        $this->_preprocess(array('heading_title_insert','entry_name','entry_is_default','entry_before_shipping','entry_tiers','entry_tier','column_commission','column_autoadd','column_autoapprove','text_default_value','entry_add_tier','entry_remove_tier','button_save','button_cancel','text_yes','text_no','entry_autoadd','entry_autoapprove','text_percent','text_amount','entry_eternal','text_eternal_description','entry_commission_type','entry_level','error_duplicate_name','error_invalid_percent','entry_description','error_invalid_commission','error_name'), array('insert','save','cancel'));              
        $this->_process_errors();
        $this->template = 'mta/mta_insert.tpl';
        $this->children = array(
            'common/header',  
            'common/footer'  
        );
      
        $this->response->setOutput($this->render());      
    }
    public function update() {
        if(!isset($this->request->request['id']) || !mta_check_int($this->request->request['id']) || $this->request->request['id'] < 1) {
            $this->redirect($this->url->link('mta/mta/insert', 'token=' . $this->session->data['token'] . $url, 'SSL'));
            return;
        }      
        $this->load->model('mta/mta_scheme');      
      
        if($this->request->server['REQUEST_METHOD'] == 'POST' && isset($this->request->post['name'])) {
            $this->_save();
            return;
        }
      
        $id = intval($this->request->request['id']);
        $this->model_mta_mta_scheme->getSchemeById($id);
        $this->scheme =& $this->model_mta_mta_scheme->scheme;
        if(!$this->scheme || isset($this->scheme['error'])) {
            $this->redirect($this->url->link('mta/mta/insert', 'token=' . $this->session->data['token'] . $url, 'SSL'));
            return;
        }      
      
        $this->_preprocess(array('heading_title_update','entry_name','entry_is_default','entry_before_shipping','entry_tiers','entry_tier','column_commission','column_autoadd','column_autoapprove','text_default_value','entry_add_tier','entry_remove_tier','button_save','button_cancel','text_yes','text_no','entry_autoadd','entry_autoapprove','text_percent','text_amount','entry_eternal','text_eternal_description','entry_commission_type','entry_level','error_duplicate_name','error_invalid_percent','entry_description','error_invalid_commission','error_name','text_no_fixed_for_affs'), array('update','save','cancel'));      
      
        foreach($this->scheme as $k => $v) {
            $this->data['s_' . $k] = $v;
        }  
        $this->data['update'] = $this->url->link('mta/mta/update', 'token=' . $this->session->data['token'] . '&id=' . $id, 'SSL');
      
        $this->data['s_autoadd_json'] = json_encode($this->data['s__autoadd']);  
        $this->data['s_autoapprove_json'] = json_encode($this->data['s__autoapprove']);  
        $this->data['s_commissions_json'] = json_encode($this->data['s__commissions']);
        $this->data['has_affiliates'] = $this->model_mta_mta_scheme->hasAffiliates();
        $this->_process_errors();
        $this->template = 'mta/mta_update.tpl';
        $this->children = array(
            'common/header',  
            'common/footer'  
        );
      
        $this->response->setOutput($this->render());
    }
    public function delete() {      
        $this->response->setOutput('0');
    }
  
    public function check_scheme_name() {
        if(!isset($this->request->request['name']) || $this->request->request['name'] == 'INVALID') {
            $this->response->setOutput('0');
            return;
        }
        $this->load->model('mta/mta_scheme');
        $id = isset($this->request->request['id']) ? $this->request->request['id'] : false;      
        $this->response->setOutput(intval($this->model_mta_mta_scheme->checkName($this->request->request['name'], $id)));
    }
    public function copy() {      
        $this->response->setOutput('0');
    }
  
    public function convert_affiliates() {
        $this->load->model('mta/mta_affiliate');
        if(!$this->model_mta_mta_affiliate->countPreMtaAffiliates()) {
            $this->response->setOutput('1');
            return;
        }
        $r = $this->model_mta_mta_affiliate->convertPreMtaAffiliates();
        $this->response->setOutput($r ? strval($r) : '0');
    }  
  
    public function save_settings() {
        if(!$this->user->hasPermission('modify', 'mta/mta')) {
            $this->response->setOutput('0');
            return;
        }  
        if(!isset($this->request->post['mta_ypx_autoadd_statuses'])) {
            $this->request->post['mta_ypx_autoadd_statuses'] = array();
        } else {
            $this->request->post['mta_ypx_autoadd_statuses'] = array_values($this->request->post['mta_ypx_autoadd_statuses']);
        }
        $_settings = array();
        foreach($this->request->post as $k => $v) {
            if(strpos($k, 'mta_ypx_') === 0) $_settings[$k] = $v;
        }
        $this->load->model('setting/setting');
        $this->model_setting_setting->editSetting('mta_ypx', $_settings);
        $this->response->setOutput('1');  
    }
  
      
/////////////////////////////////////////////////////////////////
    private function _count_scheme_users($scheme_id) {
        if(!mta_check_int($scheme_id) || $scheme_id < 1) return false;
        $c = array(
            'affiliate' => $this->model_mta_mta_affiliate->countUsers($scheme_id)
        );      
        $c = array_merge($c, $this->model_mta_mta_product_affiliate->countUsers($scheme_id, 'product_affiliate'));
        $c = array_merge($c, $this->model_mta_mta_product_affiliate->countUsers($scheme_id));      
      
        return $c;      
    }
  
    private function _save() {
          $this->response->setOutput('Please use full version');
          return false;
    }
    private function _preprocess($fields, $buttons) {
        $this->load->language('mta/mta');
        $this->document->setTitle($this->language->get('heading_title'));
      
        foreach($fields as $_v) {
            $this->data[$_v] = $this->language->get($_v);          
        }
      
        if (isset($this->session->data['success'])) {
            $this->data['success'] = $this->session->data['success'];
      
            unset($this->session->data['success']);
        } else {
            $this->data['success'] = '';
        }
      
        $url = '';
      
      $this->data['breadcrumbs'] = array(
          array(
        'text'      => $this->language->get('text_home'),
            'href'      => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'),
      'separator' => false
          ),
          array(
      'text'      => $this->language->get('heading_title'),
            'href'      => $this->url->link('mta/mta', 'token=' . $this->session->data['token'] . $url, 'SSL'),
      'separator' => ' :: '
          )
      );
      
        foreach($buttons as $_b) {
            $_bv = $_b == 'cancel' ? '' : '/' . $_b;  
            $this->data[$_b] = $this->url->link('mta/mta' . $_bv, 'token=' . $this->session->data['token'] . $url, 'SSL');
        }
    }
  
    private function _post_to_scheme(&$p) {
        foreach(array('name', 'max_levels') as $_v) {
            if(!isset($p[$_v])) return false;
        }
        if(utf8_strlen($p['name']) < 1 || utf8_strlen($p['name']) > 100 || !mta_check_int($p['max_levels'])) return false;
      
        if(!isset($p['description'])) $p['description'] = '';
        if(!isset($p['is_default']) || !mta_check_bool($p['is_default'])) $p['is_default'] = 0;
        if(!isset($p['commission_type']) || !in_array($p['commission_type'], array('fixed', 'percentage'))) $p['commission_type'] = 'percentage';
        if(!isset($p['before_shipping']) || !mta_check_bool($p['before_shipping'])) $p['before_shipping'] = 1;
        if(!isset($p['eternal']) || !mta_check_int($p['eternal'])) $p['eternal'] = 0;
        $scheme = array();
        $_levels = array('autoadd' => array(), 'commission' => array());
        $autoapprove = array();      
        foreach($p as $k => $v) {
            if(preg_match("/^((?:tiers)|(?:level))(\d+)_(.+)$/", $k, $_lAr)) {
                if($_lAr[1] == 'tiers') {
                    if(!preg_match("/^\d+(\.\d+)?$/s", $v)) return false;
                    $tier = $_lAr[2];
                    $_lAr = explode('_', $_lAr[3]);
                    $_type = $_lAr[1];
                    preg_match("/\d+$/", $_lAr[0], $_lAr);
                    $level = $_lAr[0];
                    if(!isset($_levels[$_type][$tier])) $_levels[$_type][$tier] = array();
                    $_levels[$_type][$tier][$level] = $v;                  
                } else {
                    $autoapprove[$_lAr[2]] = $v;                  
                }
            } else {
                $scheme[$k] = $v;
            }
        }
        //if($scheme['commission_type'] == 'fixed') $scheme['is_default'] = 0;      
      
        if($scheme['eternal'] > $scheme['max_levels']) $scheme['eternal'] = 0;      
        $scheme['_autoapprove'] = mta_array_a2n($autoapprove);
        if(sizeof($scheme['_autoapprove']) != $scheme['max_levels']) return false;
        foreach($scheme['_autoapprove'] as $_i => $_v) {
            if(!mta_check_bool($_v)) $scheme['_autoapprove'][$_i] = 1;
        }
      
        foreach($_levels as $k => $v) {          
            $v = mta_array_a2n($v);
            if(sizeof($v) != $scheme['max_levels']) return false;
            foreach($v as $i => $v2) {              
                $v[$i] = mta_array_a2n($v2);
                if(sizeof($v[$i]) != ($i + 1)) return false;
                foreach($v[$i] as $_i => $_v) {
                    if($k == 'autoadd') {
                        if(!mta_check_bool($_v)) $v[$i][$_i] = 1;
                    } else if($k == 'commission') {
                        if(!mta_check_float($_v)) return false;
                    } else {
                        return false;
                    }
                }
            }
            $_levels[$k] = $v;
        }
      
        $scheme['_commissions'] = $_levels['commission'];
        $scheme['_autoadd'] = $_levels['autoadd'];      
        $this->scheme =& $this->model_mta_mta_scheme->setScheme($scheme);
        return (isset($this->scheme['error']) ? false : true);      
    }
  
    private function _process_errors() {      
        $_num_errors = sizeof($this->error);
        $_errors = array();
        if($_num_errors) {
            foreach($this->error as $i => $_er) {
                if(is_array($_er)) {
                    $_msg = mta_tpl($this->language->get('error_' . $_er[0]));
                    $_er = $_er[0];
                } else {
                    $_msg = $this->language->get('error_' . $_er);
                }
                if(!isset($this->data['error_' . $_er])) $this->data['error_' . $_er] = $_msg;
                $this->error[$_er] = $this->data['error_' . $_er];
                $_errors[] = $this->data['error_' . $_er];
                unset($this->error[$_er]);
            }      
            if($_num_errors > 1) {
                $this->data['error_all'] = $this->language->get('error_all') . "\n" . implode("\n", $_errors);
            } else {
                $this->data['error_all'] = $_errors[0];
            }
        }      
        foreach($this->error_keys as $_er) {
            if(!isset($this->data['error_' . $_er])) $this->data['error_' . $_er] = '';
        }
    }
}
0
Programming
Эксперт
39485 / 9562 / 3019
Регистрация: 12.04.2006
Сообщений: 41,671
Блог
15.02.2014, 09:35
Ответы с готовыми решениями:

Взлом накрутки голосов
Здравствуйте. Есть сайт где голосуют за рисунки. При нажатии кнопки &quot;POCHVALIT&quot;(проголосовать) выбивает страницу с кнопкой фейсбука. Если...

Взлом , внедрения вредоносного кода
Достался мне такой файл , после взлома сайта. Объясните логику? были залиты 3 файла adminer-4.2.5.php, &lt;?php $c=$_REQUEST; ...

Устранить ошибку отсутствия модуля exeptions при импорте модуля docx
Доброго времени суток! только начал знакомство с питоном, установил pip, pycharm и тд. Вот решил сделать хоть немного нужную программку....

1
15.02.2014, 09:40
 Комментарий модератора 
Взлом не обсуждается. Тема закрыта.
0
Надоела реклама? Зарегистрируйтесь и она исчезнет полностью.
inter-admin
Эксперт
29715 / 6470 / 2152
Регистрация: 06.03.2009
Сообщений: 28,500
Блог
15.02.2014, 09:40
Помогаю со студенческими работами здесь

Как из одного модуля добраться к языковым переменным другого модуля? (Joomla 2.5)
Хочу сделать регистрацию в модальном окне. Для этого делаю модуль вставки html и вставляю форму регистрации под футер. Но мне нужно как-то...

ПММ AEG. Нужна ремонтная документашка и прошивка силового модуля и модуля индикации
F55402VI0P 911676002 j24_cac01_02z003.dax 117384831 computime code: ELED046 ELECTROLUX CODE: 328604682 SW VERSION:EMJ24_FR ...

запуск модуля из модуля (Sub test() CommandBars(1).Enabled = False load module2.test1 End Sub)
Sub test() CommandBars(1).Enabled = False load module2.test1 End Subвот что-то типа такого и не воркает.

В начало каждого модуля должен быть помещен комментарий, описывающий функции данного модуля
Очень нужна ваша помощь. Пожалуйста, кто знает, помогите с этой задачей. Задача на тему: Использование процедур и функций Примечание: В...

Какой физический смысл модуля кручения и модуля сдвига
Какой физический смысл модуля кручения и модуля сдвига?


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
2
Закрытая тема Создать тему
Новые блоги и статьи
Thinkpad X220 Tablet — это лучший бюджетный ноутбук для учёбы, точка.
Programma_Boinc 23.12.2025
Thinkpad X220 Tablet — это лучший бюджетный ноутбук для учёбы, точка. Рецензия / Мнение/ Перевод https:/ / **********/ gallery/ thinkpad-x220-tablet-porn-gzoEAjs . . .
PhpStorm 2025.3: WSL Terminal всегда стартует в ~
and_y87 14.12.2025
PhpStorm 2025. 3: WSL Terminal всегда стартует в ~ (home), игнорируя директорию проекта Симптом: После обновления до PhpStorm 2025. 3 встроенный терминал WSL открывается в домашней директории. . .
Как объединить две одинаковые БД Access с разными данными
VikBal 11.12.2025
Помогите пожалуйста !! Как объединить 2 одинаковые БД Access с разными данными.
Новый ноутбук
volvo 07.12.2025
Всем привет. По скидке в "черную пятницу" взял себе новый ноутбук Lenovo ThinkBook 16 G7 на Амазоне: Ryzen 5 7533HS 64 Gb DDR5 1Tb NVMe 16" Full HD Display Win11 Pro
Музыка, написанная Искусственным Интеллектом
volvo 04.12.2025
Всем привет. Некоторое время назад меня заинтересовало, что уже умеет ИИ в плане написания музыки для песен, и, собственно, исполнения этих самых песен. Стихов у нас много, уже вышли 4 книги, еще 3. . .
От async/await к виртуальным потокам в Python
IndentationError 23.11.2025
Армин Ронахер поставил под сомнение async/ await. Создатель Flask заявляет: цветные функции - провал, виртуальные потоки - решение. Не threading-динозавры, а новое поколение лёгких потоков. Откат?. . .
Поиск "дружественных имён" СОМ портов
Argus19 22.11.2025
Поиск "дружественных имён" СОМ портов На странице: https:/ / norseev. ru/ 2018/ 01/ 04/ comportlist_windows/ нашёл схожую тему. Там приведён код на С++, который показывает только имена СОМ портов, типа,. . .
Сколько Государство потратило денег на меня, обеспечивая инсулином.
Programma_Boinc 20.11.2025
Сколько Государство потратило денег на меня, обеспечивая инсулином. Вот решила сделать интересный приблизительный подсчет, сколько государство потратило на меня денег на покупку инсулинов. . . .
Ломающие изменения в C#.NStar Alpha
Etyuhibosecyu 20.11.2025
Уже можно не только тестировать, но и пользоваться C#. NStar - писать оконные приложения, содержащие надписи, кнопки, текстовые поля и даже изображения, например, моя игра "Три в ряд" написана на этом. . .
Мысли в слух
kumehtar 18.11.2025
Кстати, совсем недавно имел разговор на тему медитаций с людьми. И обнаружил, что они вообще не понимают что такое медитация и зачем она нужна. Самые базовые вещи. Для них это - когда просто люди. . .
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2025, CyberForum.ru