equal
deleted
inserted
replaced
213 'mode' => 'error', |
213 'mode' => 'error', |
214 'error' => 'Couldn\'t retrieve plugin ID.', |
214 'error' => 'Couldn\'t retrieve plugin ID.', |
215 ); |
215 ); |
216 break; |
216 break; |
217 } |
217 } |
|
218 |
|
219 // log action |
|
220 $time = time(); |
|
221 $ip_db = $db->escape($_SERVER['REMOTE_ADDR']); |
|
222 $username_db = $db->escape($session->username); |
|
223 $file_db = $db->escape($request['plugin']); |
|
224 // request['mode'] is TRUSTED - the case statement will only process if it is one of {enable,disable}. |
|
225 $q = $db->sql_query('INSERT INTO '.table_prefix."logs(log_type, action, time_id, edit_summary, author, page_text) VALUES\n" |
|
226 . " ('security', 'plugin_{$request['mode']}', $time, '$ip_db', '$username_db', '$file_db');"); |
|
227 if ( !$q ) |
|
228 $db->_die(); |
|
229 |
218 // perform update |
230 // perform update |
219 $q = $db->sql_query('UPDATE ' . table_prefix . "plugins SET plugin_flags = $flags_col WHERE plugin_id = {$dataset['plugin id']};"); |
231 $q = $db->sql_query('UPDATE ' . table_prefix . "plugins SET plugin_flags = $flags_col WHERE plugin_id = {$dataset['plugin id']};"); |
220 if ( !$q ) |
232 if ( !$q ) |
221 $db->die_json(); |
233 $db->die_json(); |
222 |
234 |