index : flyspray | |
Archlinux32 customized Flyspray installation | gitolite user |
summaryrefslogtreecommitdiff |
author | Andreas Baumann <mail@andreasbaumann.cc> | 2020-02-01 09:05:48 +0100 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2020-02-01 09:05:48 +0100 |
commit | 6854cb3f4d8219cf1829e32122eb2502a916eae9 (patch) | |
tree | 350feb504587d932e02837a1442b059759927646 /js/callbacks/savesearches.php |
-rw-r--r-- | js/callbacks/savesearches.php | 27 |
diff --git a/js/callbacks/savesearches.php b/js/callbacks/savesearches.php new file mode 100644 index 0000000..e656a0a --- /dev/null +++ b/js/callbacks/savesearches.php @@ -0,0 +1,27 @@ +<?php +/** + * This script is the AJAX callback that saves a user's search + */ + +define('IN_FS', true); + +require_once('../../header.php'); + +if (Cookie::has('flyspray_userid') && Cookie::has('flyspray_passhash')) { + $user = new User(Cookie::val('flyspray_userid')); + $user->check_account_ok(); + + if( !Post::has('csrftoken') ){ + http_response_code(428); # 'Precondition Required' + die('missingtoken'); + }elseif( Post::val('csrftoken')==$_SESSION['csrftoken']){ + # empty + }else{ + http_response_code(412); # 'Precondition Failed' + die('wrongtoken'); + } + + $user->save_search(); +} + +?> |