includes/pageutils.php
changeset 329 e48b1937dfc3
parent 323 58fa63f7f23b
equal deleted inserted replaced
328:17eebd541742 329:e48b1937dfc3
     1 <?php
     1 <?php
     2 /*
     2 /*
     3  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
     3  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
     4  * Version 1.0.5 (Ferrishyn)
     4  * Version 1.0.6 (Roane)
     5  * Copyright (C) 2006-2007 Dan Fuhry
     5  * Copyright (C) 2006-2007 Dan Fuhry
     6  * pageutils.php - a class that handles raw page manipulations, used mostly by AJAX requests or their old-fashioned form-based counterparts
     6  * pageutils.php - a class that handles raw page manipulations, used mostly by AJAX requests or their old-fashioned form-based counterparts
     7  *
     7  *
     8  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
     8  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
     9  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
     9  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
  1449     if(!$e) $db->_die('The page text entry could not be deleted.');
  1449     if(!$e) $db->_die('The page text entry could not be deleted.');
  1450     $e = $db->sql_query('DELETE FROM ' . table_prefix.'pages WHERE urlname=\'' . $page_id . '\' AND namespace=\'' . $namespace . '\'');
  1450     $e = $db->sql_query('DELETE FROM ' . table_prefix.'pages WHERE urlname=\'' . $page_id . '\' AND namespace=\'' . $namespace . '\'');
  1451     if(!$e) $db->_die('The page entry could not be deleted.');
  1451     if(!$e) $db->_die('The page entry could not be deleted.');
  1452     $e = $db->sql_query('DELETE FROM ' . table_prefix.'files WHERE page_id=\'' . $page_id . '\'');
  1452     $e = $db->sql_query('DELETE FROM ' . table_prefix.'files WHERE page_id=\'' . $page_id . '\'');
  1453     if(!$e) $db->_die('The file entry could not be deleted.');
  1453     if(!$e) $db->_die('The file entry could not be deleted.');
       
  1454     $e = $db->sql_query('DELETE FROM ' . table_prefix.'acl WHERE page_id=\'' . $page_id . '\' AND namespace=\'' . $namespace . '\'');
       
  1455     if(!$e) $db->_die('The ACL entries associated with the page could not be deleted.');
  1454     return('This page has been deleted. Note that there is still a log of edits and actions in the database, and anyone with admin rights can raise this page from the dead unless the log is cleared. If the deleted file is an image, there may still be cached thumbnails of it in the cache/ directory, which is inaccessible to users.');
  1456     return('This page has been deleted. Note that there is still a log of edits and actions in the database, and anyone with admin rights can raise this page from the dead unless the log is cleared. If the deleted file is an image, there may still be cached thumbnails of it in the cache/ directory, which is inaccessible to users.');
  1455   }
  1457   }
  1456   
  1458   
  1457   /**
  1459   /**
  1458    * Increments the deletion votes for a page by 1, and adds the current username/IP to the list of users that have voted for the page to prevent dual-voting
  1460    * Increments the deletion votes for a page by 1, and adds the current username/IP to the list of users that have voted for the page to prevent dual-voting