mirror of
https://codeberg.org/keyoxide/keyoxide-web.git
synced 2024-12-22 14:59:29 -07:00
Allow verify, encrypt and proofs with prefilled UID
This commit is contained in:
parent
c3af757bd0
commit
ff0e72da83
1 changed files with 22 additions and 7 deletions
29
index.php
29
index.php
|
@ -11,6 +11,9 @@ $router->map('GET', '/', function() {}, 'index');
|
|||
$router->map('GET', '/verify', function() {}, 'verify');
|
||||
$router->map('GET', '/encrypt', function() {}, 'encrypt');
|
||||
$router->map('GET', '/proofs', function() {}, 'proofs');
|
||||
$router->map('GET', '/verify/[:uid]', function() {}, 'verifyUid');
|
||||
$router->map('GET', '/encrypt/[:uid]', function() {}, 'encryptUid');
|
||||
$router->map('GET', '/proofs/[:uid]', function() {}, 'proofsUid');
|
||||
$router->map('GET', '/faq', function() {}, 'faq');
|
||||
$router->map('GET', '/[:uid]', function() {}, 'profile');
|
||||
|
||||
|
@ -25,19 +28,27 @@ if(is_array($match) && is_callable($match['target'])) {
|
|||
break;
|
||||
|
||||
case 'verify':
|
||||
readfile('pages/verify.html');
|
||||
case 'verifyUid':
|
||||
$content = file_get_contents('pages/verify.html');
|
||||
$content = str_replace('%UID%', (array_key_exists('uid', $match['params']) ? $match['params']['uid'] : ""), $content);
|
||||
header('Content-Type: text/html; charset=utf-8');
|
||||
echo($content);
|
||||
break;
|
||||
|
||||
case 'encrypt':
|
||||
readfile('pages/encrypt.html');
|
||||
case 'encryptUid':
|
||||
$content = file_get_contents('pages/encrypt.html');
|
||||
$content = str_replace('%UID%', (array_key_exists('uid', $match['params']) ? $match['params']['uid'] : ""), $content);
|
||||
header('Content-Type: text/html; charset=utf-8');
|
||||
echo($content);
|
||||
break;
|
||||
|
||||
case 'proofs':
|
||||
readfile('pages/proofs.html');
|
||||
break;
|
||||
|
||||
case 'faq':
|
||||
readfile('pages/faq.html');
|
||||
case 'proofsUid':
|
||||
$content = file_get_contents('pages/proofs.html');
|
||||
$content = str_replace('%UID%', (array_key_exists('uid', $match['params']) ? $match['params']['uid'] : ""), $content);
|
||||
header('Content-Type: text/html; charset=utf-8');
|
||||
echo($content);
|
||||
break;
|
||||
|
||||
case 'profile':
|
||||
|
@ -46,6 +57,10 @@ if(is_array($match) && is_callable($match['target'])) {
|
|||
header('Content-Type: text/html; charset=utf-8');
|
||||
echo($content);
|
||||
break;
|
||||
|
||||
case 'faq':
|
||||
readfile('pages/faq.html');
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// No route was matched
|
||||
|
|
Loading…
Reference in a new issue