about summary refs log tree commit diff stats
path: root/wiki/inc/Action/Revert.php
diff options
context:
space:
mode:
authorahriman <ahriman@falte.red>2019-01-02 04:57:35 +0000
committerahriman <ahriman@falte.red>2019-01-02 04:57:35 +0000
commit2bd7f83a6495011ada78ca8a9f2af417caf01760 (patch)
treef9acdb7f09e011c65330ab993d4db3620787dbfb /wiki/inc/Action/Revert.php
parentbcb215c3a7e914d05f166846a33860e48bba64fb (diff)
downloadsite-2bd7f83a6495011ada78ca8a9f2af417caf01760.tar.gz
removed dokuwiki
Diffstat (limited to 'wiki/inc/Action/Revert.php')
-rw-r--r--wiki/inc/Action/Revert.php65
1 files changed, 0 insertions, 65 deletions
diff --git a/wiki/inc/Action/Revert.php b/wiki/inc/Action/Revert.php
deleted file mode 100644
index ca35374..0000000
--- a/wiki/inc/Action/Revert.php
+++ /dev/null
@@ -1,65 +0,0 @@
-<?php
-
-namespace dokuwiki\Action;
-
-use dokuwiki\Action\Exception\ActionAbort;
-use dokuwiki\Action\Exception\ActionException;
-
-/**
- * Class Revert
- *
- * Quick revert to an old revision
- *
- * @package dokuwiki\Action
- */
-class Revert extends AbstractAction {
-
-    /** @inheritdoc */
-    public function minimumPermission() {
-        global $INFO;
-        if($INFO['ismanager']) {
-            return AUTH_EDIT;
-        } else {
-            return AUTH_ADMIN;
-        }
-    }
-
-    /**
-     *
-     * @inheritdoc
-     * @throws ActionAbort
-     * @throws ActionException
-     * @todo check for writability of the current page ($INFO might do it wrong and check the attic version)
-     */
-    public function preProcess() {
-        if(!checkSecurityToken()) throw new ActionException();
-
-        global $ID;
-        global $REV;
-        global $lang;
-
-        // when no revision is given, delete current one
-        // FIXME this feature is not exposed in the GUI currently
-        $text = '';
-        $sum = $lang['deleted'];
-        if($REV) {
-            $text = rawWiki($ID, $REV);
-            if(!$text) throw new ActionException(); //something went wrong
-            $sum = sprintf($lang['restored'], dformat($REV));
-        }
-
-        // spam check
-        if(checkwordblock($text)) {
-            msg($lang['wordblock'], -1);
-            throw new ActionException('edit');
-        }
-
-        saveWikiText($ID, $text, $sum, false);
-        msg($sum, 1);
-        $REV = '';
-
-        // continue with draftdel -> redirect -> show
-        throw new ActionAbort('draftdel');
-    }
-
-}