equal
deleted
inserted
replaced
265 $template->footer(); |
265 $template->footer(); |
266 break; |
266 break; |
267 case 'rollback': |
267 case 'rollback': |
268 $id = (isset($_GET['id'])) ? $_GET['id'] : false; |
268 $id = (isset($_GET['id'])) ? $_GET['id'] : false; |
269 if(!$id || !preg_match('#^([0-9]+)$#', $id)) die_friendly('Invalid action ID', '<p>The URL parameter "id" is not an integer. Exiting to prevent nasties like SQL injection, etc.</p>'); |
269 if(!$id || !preg_match('#^([0-9]+)$#', $id)) die_friendly('Invalid action ID', '<p>The URL parameter "id" is not an integer. Exiting to prevent nasties like SQL injection, etc.</p>'); |
270 $rb = PageUtils::rollback( (int) $id ); |
270 |
271 $template->header(); |
271 $id = intval($id); |
272 echo '<p>'.$rb.' <a href="'.makeUrl($paths->page).'">Return to the page</a>.</p>'; |
272 |
|
273 $page = new PageProcessor($paths->page_id, $paths->namespace); |
|
274 $result = $page->rollback_log_entry($id); |
|
275 |
|
276 if ( $result['success'] ) |
|
277 { |
|
278 $result = $lang->get("page_msg_rb_success_{$result['action']}", array('dateline' => $result['dateline'])); |
|
279 } |
|
280 else |
|
281 { |
|
282 $result = $lang->get("page_err_{$result['error']}", array('action' => @$result['action'])); |
|
283 } |
|
284 |
|
285 $template->header(); |
|
286 echo '<p>'.$result.' <a href="'.makeUrl($paths->page).'">' . $lang->get('etc_return_to_page') . '</a></p>'; |
273 $template->footer(); |
287 $template->footer(); |
274 break; |
288 break; |
275 case 'catedit': |
289 case 'catedit': |
276 if(isset($_POST['__enanoSaveButton'])) |
290 if(isset($_POST['__enanoSaveButton'])) |
277 { |
291 { |