Permalink
Browse files

Add support for all the current pages (Repflez)

  • Loading branch information...
NightYoshi370 committed Jul 5, 2017
1 parent 73dc0cd commit 4a4cd4ce072ef22267ebacb015bf33b5b9d9c96d
Showing with 27 additions and 0 deletions.
  1. +2 −0 lib/urls.yaml
  2. +25 −0 pages/catchall.php
@@ -28,6 +28,8 @@ addsec: ['GET|POST', '/admin/secgroups/add', 'addsecgroups']
removesec: ['GET|POST', '/admin/secgroups/remove', 'removesecgroups']
editsettings: ['GET|POST', '/admin/editsettings', 'editsettings']
catchall: ['GET|POST', '/[a:page]/[a:id]?-[s:name]?', 'catchall']
# ehh
irc: ['GET', '/misc/irc', 'irc']
credits: ['GET', '/misc/credits', 'credits']
@@ -0,0 +1,25 @@
<?php
if (!defined('BLARG')) die();
// Catchall page, for legacy blargboard pages
// Set the page and id, as REQUEST
$_REQUEST['page'] = $pageParams['page'];
if (isset($pageParams['id']))
$_REQUEST['id'] = $pageParams['id'];
// Set the page, in both POST and GET when required
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$_POST['page'] = $pageParams['page'];
if (isset($pageParams['id']))
$_POST['id'] = $pageParams['id'];
} else {
$_GET['page'] = $pageParams['page'];
if (isset($pageParams['id']))
$_GET['id'] = $pageParams['id'];
}
require_once(__DIR__ . '/' . $pageParams['page'] . '.php');

0 comments on commit 4a4cd4c

Please sign in to comment.