get-token and post-page
This commit is contained in:
parent
6b2304af93
commit
80a816de8c
1 changed files with 15 additions and 0 deletions
|
@ -63,6 +63,10 @@ class AdminPage extends Extension
|
||||||
if ($event->cmd == "help") {
|
if ($event->cmd == "help") {
|
||||||
print "\tget-page <query string>\n";
|
print "\tget-page <query string>\n";
|
||||||
print "\t\teg 'get-page post/list'\n\n";
|
print "\t\teg 'get-page post/list'\n\n";
|
||||||
|
print "\tpost-page <query string> <urlencoded params>\n";
|
||||||
|
print "\t\teg 'post-page ip_ban/delete id=1'\n\n";
|
||||||
|
print "\tget-token\n";
|
||||||
|
print "\t\tget a CSRF auth token\n\n";
|
||||||
print "\tregen-thumb <id / hash>\n";
|
print "\tregen-thumb <id / hash>\n";
|
||||||
print "\t\tregenerate a thumbnail\n\n";
|
print "\t\tregenerate a thumbnail\n\n";
|
||||||
}
|
}
|
||||||
|
@ -71,6 +75,17 @@ class AdminPage extends Extension
|
||||||
send_event(new PageRequestEvent($event->args[0]));
|
send_event(new PageRequestEvent($event->args[0]));
|
||||||
$page->display();
|
$page->display();
|
||||||
}
|
}
|
||||||
|
if ($event->cmd == "post-page") {
|
||||||
|
global $page;
|
||||||
|
$_SERVER['REQUEST_METHOD'] = "POST";
|
||||||
|
parse_str($event->args[1], $_POST);
|
||||||
|
send_event(new PageRequestEvent($event->args[0]));
|
||||||
|
$page->display();
|
||||||
|
}
|
||||||
|
if ($event->cmd == "get-token") {
|
||||||
|
global $user;
|
||||||
|
print($user->get_auth_token());
|
||||||
|
}
|
||||||
if ($event->cmd == "regen-thumb") {
|
if ($event->cmd == "regen-thumb") {
|
||||||
$uid = $event->args[0];
|
$uid = $event->args[0];
|
||||||
$image = Image::by_id_or_hash($uid);
|
$image = Image::by_id_or_hash($uid);
|
||||||
|
|
Reference in a new issue