From dd106c063b84060dd158cd5d3b79f4ac3a15eecc Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Mon, 6 Jun 2022 19:52:36 +0000 Subject: URIs: Add register URIs --- index.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'index.php') diff --git a/index.php b/index.php index b7a0024..6b37a18 100644 --- a/index.php +++ b/index.php @@ -22,13 +22,23 @@ $action = $lang->chat; if ( str_contains($uri, '?join') ) { $action = $lang->muc; + } elseif ( str_contains($uri, '?register;') ) { + $action = $lang->register; + if ( str_contains($uri, "@") ) { + $action = $lang->register_name; + } } - $name = ucfirst(explode("@", substr($uri, 5))[0]); + $parsed = parse_url($uri); + $name = explode("@", $parsed['path'])[0]; + $server = explode("@", $parsed['path'])[1] ?? $name; function t($template) { GLOBAL $name; GLOBAL $os; + GLOBAL $server; $template = str_replace('{{name}}', $name, $template); + $template = str_replace('{{Name}}', ucfirst($name), $template); $template = str_replace('{{os}}', $os, $template); + $template = str_replace('{{server}}', $server, $template); return $template; } ?> -- cgit 1.4.1