';
// Actions!
@@ -1312,11 +1313,36 @@
global $lang;
global $cache;
- if(!$session->get_permissions('vote_reset'))
+ if ( !$session->get_permissions('vote_reset') )
{
return $lang->get('etc_access_denied');
}
- $q = 'UPDATE ' . table_prefix.'pages SET delvotes=0,delvote_ips=\'' . $db->escape(serialize(array('ip'=>array(),'u'=>array()))) . '\' WHERE urlname=\'' . $page_id . '\' AND namespace=\'' . $namespace . '\'';
+
+ $page_id = $db->escape($page_id);
+ $namespace = $db->escape($namespace);
+
+ // pull existing info
+ $q = $db->sql_query('SELECT delvotes, delvote_ips FROM ' . table_prefix . "pages WHERE urlname = '$page_id' AND namespace = '$namespace'");
+ if ( !$q )
+ $db->_die();
+ if ( $db->numrows() < 1 )
+ return $lang->get('page_err_page_not_exist');
+
+ list($delvotes, $delvote_ips) = $db->fetchrow_num();
+ $db->free_result();
+ $delvote_ips = $db->escape($delvote_ips);
+ $username = $db->escape($session->username);
+
+ // log action
+ $time = time();
+ $q = $db->sql_query('INSERT INTO ' . table_prefix . "logs (time_id, log_type, action, edit_summary, page_text, author, page_id, namespace) VALUES\n"
+ . " ( $time, 'page', 'votereset', '$delvotes', '$delvote_ips', '$username', '$page_id', '$namespace' )");
+ if ( !$q )
+ $db->_die();
+
+ // reset votes
+ $empty_vote_record = $db->escape(serialize(array('ip'=>array(),'u'=>array())));
+ $q = 'UPDATE ' . table_prefix.'pages SET delvotes=0,delvote_ips=\'' . $empty_vote_record . '\' WHERE urlname=\'' . $page_id . '\' AND namespace=\'' . $namespace . '\'';
$e = $db->sql_query($q);
if ( !$e )
{
@@ -1541,6 +1567,8 @@
public static function setwikimode($page_id, $namespace, $level)
{
global $db, $session, $paths, $template, $plugins; // Common objects
+ global $cache;
+
if(!$session->get_permissions('set_wiki_mode')) return('Insufficient access rights');
if ( !isset($level) || ( isset($level) && !preg_match('#^([0-2]){1}$#', (string)$level) ) )
{
@@ -1551,6 +1579,8 @@
{
return('Error during update query: '.$db->get_error()."\n\nSQL Backtrace:\n".$db->sql_backtrace());
}
+
+ $cache->purge('page_meta');
return('GOOD');
}
diff -r 95d0d8596c87 -r 3ec535acd11e language/english/core.json
--- a/language/english/core.json Wed Apr 15 16:20:33 2009 -0400
+++ b/language/english/core.json Wed Apr 15 17:14:20 2009 -0400
@@ -128,6 +128,7 @@
err_rb_action_not_supported: 'Rolling back actions of type "%action%" isn\'t supported.',
err_rb_file_rename_failed: 'Could not rename the file to its new name (1.1.x format)',
err_protection_already_there: 'The protection level you selected is already in effect for this page.',
+ err_page_not_exist: 'The page you tried to perform this action on does not exist.',
msg_this_is_a_redirector: 'This page is a redirector.
This means that this page will not show its own content by default. Instead it will display the contents of the page it redirects to.
@@ -139,12 +140,14 @@
msg_rb_success_rename: 'The page has been restored the name it had on %dateline%.',
// next 3 are mostly identical
msg_rb_success_prot: 'The page\'s protection has been undone and replaced with the previous level it had as of %dateline%.',
- msg_rb_success_unprot: 'The page\'s protection has been undone and replaced with the previous level it had as of %dateline%.',
+ msg_rb_success_unprot: 'The page\'s unprotection has been undone and replaced with the previous level it had as of %dateline%.',
msg_rb_success_semiprot: 'The page\'s semi-protection has been undone and replaced with the previous level it had as of %dateline%.',
msg_rb_success_delete: 'The deletion of this page, which occurred on %dateline%, has been undone. This page has been restored, but comments and categorization data may have been lost.',
msg_rb_success_reupload: 'The file has been restored to the version uploaded on %dateline%.',
+ msg_rb_success_votereset: 'The votes for deletion of this page as of %dateline% have been restored and merged with any existing votes.',
+
msg_passrequired_title: 'Password required',
msg_passrequired: 'Access to this page requires a password. Please enter the password for this page below:',
msg_pass_wrong: 'The password you entered for this page was incorrect. Please enter the password for this page below:',
@@ -428,6 +431,7 @@
extra_oldtitle: 'Old title:',
extra_protection_reversion: '(Reversion of previous protection)',
extra_upload_reversion: '(Restoration of previous upload)',
+ extra_numvotes: 'Number of votes:',
tip_rdns: 'Click cell background for reverse DNS info',
action_view: 'View',
action_contrib: 'User contribs',
@@ -440,6 +444,7 @@
log_create: 'Created page',
log_delete: 'Deleted page',
log_uploadnew: 'Uploaded new file version',
+ log_votereset: 'Reset deletion votes',
lbl_comparingrevisions: 'Comparing revisions:',
summary_none_given: 'No edit summary provided.',
err_wrong_password: 'Please enter the password for this page before viewing its history.'
diff -r 95d0d8596c87 -r 3ec535acd11e language/english/tools.json
--- a/language/english/tools.json Wed Apr 15 16:20:33 2009 -0400
+++ b/language/english/tools.json Wed Apr 15 17:14:20 2009 -0400
@@ -158,6 +158,7 @@
action_protect_semi: 'Semiprotected page (%reason%)',
action_protect_full: 'Protected page (%reason%)',
action_reupload: 'Uploaded new revision: %reason%',
+ action_votereset: 'Reset deletion votes (had %num_votes% vote%plural%)',
action_protect: 'Protect and unprotect',
action_edit: 'Edit',
@@ -179,6 +180,8 @@
formaction_rename: 'Rename',
formaction_create: 'Create page',
formaction_delete: 'Delete page',
+ formaction_reupload: 'File reupload',
+ formaction_votereset: 'Reset of deletion votes',
heading_addfilter: 'Add a filter',
heading_logdisplay: 'Log filter results',
diff -r 95d0d8596c87 -r 3ec535acd11e plugins/SpecialLog.php
--- a/plugins/SpecialLog.php Wed Apr 15 16:20:33 2009 -0400
+++ b/plugins/SpecialLog.php Wed Apr 15 17:14:20 2009 -0400
@@ -239,6 +239,8 @@
+
+
@@ -318,7 +320,8 @@
$crumb = $lang->get('log_breadcrumb_page', array('page' => '' . htmlspecialchars(get_page_title($value)) . ''));
break;
case 'action':
- $crumb = $lang->get('log_breadcrumb_action', array('action' => htmlspecialchars($lang->get("log_action_{$value}"))));
+ $action = ( $lang->get("log_formaction_{$value}") === "log_formaction_{$value}" ) ? $lang->get("log_action_{$value}") : $lang->get("log_formaction_{$value}");
+ $crumb = $lang->get('log_breadcrumb_action', array('action' => htmlspecialchars($action)));
break;
case 'within':
$value = intval($value);