XMPP invitation landing page, without javascript
Diffstat (limited to 'index.php')
-rw-r--r--index.php12
1 files changed, 11 insertions, 1 deletions
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;
}
?>