index.php
changeset 481 07bf15b066bc
parent 468 194a19711346
child 513 c15fbf197a54
--- a/index.php	Thu Mar 06 20:53:26 2008 -0500
+++ b/index.php	Thu Mar 06 22:45:41 2008 -0500
@@ -267,9 +267,23 @@
     case 'rollback':
       $id = (isset($_GET['id'])) ? $_GET['id'] : false;
       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>');
-      $rb = PageUtils::rollback( (int) $id );
+      
+      $id = intval($id);
+      
+      $page = new PageProcessor($paths->page_id, $paths->namespace);
+      $result = $page->rollback_log_entry($id);
+      
+      if ( $result['success'] )
+      {
+        $result = $lang->get("page_msg_rb_success_{$result['action']}", array('dateline' => $result['dateline']));
+      }
+      else
+      {
+        $result = $lang->get("page_err_{$result['error']}", array('action' => @$result['action']));
+      }
+      
       $template->header();
-      echo '<p>'.$rb.' <a href="'.makeUrl($paths->page).'">Return to the page</a>.</p>';
+      echo '<p>'.$result.' <a href="'.makeUrl($paths->page).'">' . $lang->get('etc_return_to_page') . '</a></p>';
       $template->footer();
       break;
     case 'catedit':