diff options
-rw-r--r-- | application/Router.php | 6 | ||||
-rw-r--r-- | index.php | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/application/Router.php b/application/Router.php index c9a51912..f6896b1c 100644 --- a/application/Router.php +++ b/application/Router.php | |||
@@ -45,6 +45,8 @@ class Router | |||
45 | 45 | ||
46 | public static $PAGE_SAVE_PLUGINSADMIN = 'save_pluginadmin'; | 46 | public static $PAGE_SAVE_PLUGINSADMIN = 'save_pluginadmin'; |
47 | 47 | ||
48 | public static $GET_TOKEN = 'token'; | ||
49 | |||
48 | /** | 50 | /** |
49 | * Reproducing renderPage() if hell, to avoid regression. | 51 | * Reproducing renderPage() if hell, to avoid regression. |
50 | * | 52 | * |
@@ -142,6 +144,10 @@ class Router | |||
142 | return self::$PAGE_SAVE_PLUGINSADMIN; | 144 | return self::$PAGE_SAVE_PLUGINSADMIN; |
143 | } | 145 | } |
144 | 146 | ||
147 | if (startsWith($query, 'do='. self::$GET_TOKEN)) { | ||
148 | return self::$GET_TOKEN; | ||
149 | } | ||
150 | |||
145 | return self::$PAGE_LINKLIST; | 151 | return self::$PAGE_LINKLIST; |
146 | } | 152 | } |
147 | } | 153 | } |
@@ -1582,6 +1582,13 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history) | |||
1582 | exit; | 1582 | exit; |
1583 | } | 1583 | } |
1584 | 1584 | ||
1585 | // Get a fresh token | ||
1586 | if ($targetPage == Router::$GET_TOKEN) { | ||
1587 | header('Content-Type:text/plain'); | ||
1588 | echo getToken($conf); | ||
1589 | exit; | ||
1590 | } | ||
1591 | |||
1585 | // -------- Otherwise, simply display search form and links: | 1592 | // -------- Otherwise, simply display search form and links: |
1586 | showLinkList($PAGE, $LINKSDB, $conf, $pluginManager); | 1593 | showLinkList($PAGE, $LINKSDB, $conf, $pluginManager); |
1587 | exit; | 1594 | exit; |