From 8080d426e7d3921ccbc18254439e83574662944b Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Mon, 28 Jan 2019 20:36:11 +0100 Subject: [PATCH] Added forum account UI and fixed firefox not working issue --- ChangeLog.md | 4 + auth/auth.php | 9 +- shared/css/helptag.scss | 1 + shared/css/modal-connect.scss | 2 + shared/css/modal-settings.scss | 229 +++++++++++ shared/html/templates.html | 161 +++++++- shared/js/main.ts | 2 +- shared/js/profiles/ConnectionProfile.ts | 28 +- .../profiles/identities/TeaForumIdentity.ts | 56 ++- .../profiles/identities/TeamSpeakIdentity.ts | 4 +- shared/js/sound/Sounds.ts | 2 +- shared/js/ui/context_divider.ts | 3 +- shared/js/ui/frames/SelectedItemInfo.ts | 11 + shared/js/ui/modal/ModalSettings.ts | 355 +++++++++++++++--- vendor/bbcode | 2 +- web/js/audio/AudioPlayer.ts | 5 +- 16 files changed, 780 insertions(+), 94 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 28e9f6fc..fc3773c6 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -3,6 +3,10 @@ - Made sounds configurable - Added option to mute sounds when output is muted - Added push to talk delay option + - Have improvements related to identity management + - First load of the app generates identity + - Default VAD is not longer PPT, changed to Voice activity detection via threshold + - Added identity improve gui * **26.01.19** - Improved TeaSpeak identities (now generates automatic and are saveable) diff --git a/auth/auth.php b/auth/auth.php index 1f2ce707..ba880336 100644 --- a/auth/auth.php +++ b/auth/auth.php @@ -243,10 +243,11 @@ } if(!$_INCLIDE_ONLY) { + $app = getXF(); + if(!$app) return; + if (isset($_GET["type"])) { error_log("Got authX request!"); - var_dump($_GET); - var_dump($_POST); if ($_GET["type"] == "login") { die(json_encode(checkLogin($_POST["user"], $_POST["pass"]))); } else if ($_GET["type"] == "logout") { @@ -256,8 +257,12 @@ header("Location: login.php"); else header("Location: https://web.teaspeak.de/"); + + $session = $app->session(); setcookie($session->getCookieName(), '', time() - 3600, '/'); setcookie("session", '', time() - 3600, '/'); + setcookie("user_data", '', time() - 3600, '/'); + setcookie("user_sign", '', time() - 3600, '/'); } else die("unknown type!"); } else if(isset($_POST["action"])) { error_log("Got auth post request!"); diff --git a/shared/css/helptag.scss b/shared/css/helptag.scss index af7f3b80..9bfaaae5 100644 --- a/shared/css/helptag.scss +++ b/shared/css/helptag.scss @@ -1,5 +1,6 @@ .help-tip-container { /* position: relative; */ + display: inline; .help-tip { position: absolute; diff --git a/shared/css/modal-connect.scss b/shared/css/modal-connect.scss index 8f511742..fa0c55b8 100644 --- a/shared/css/modal-connect.scss +++ b/shared/css/modal-connect.scss @@ -24,5 +24,7 @@ display: inline-flex; flex-direction: row; } + + color: red; } } \ No newline at end of file diff --git a/shared/css/modal-settings.scss b/shared/css/modal-settings.scss index 44b96ed8..e4ee7572 100644 --- a/shared/css/modal-settings.scss +++ b/shared/css/modal-settings.scss @@ -430,6 +430,82 @@ } } +.modal .settings-general { + padding: 5px; + + .not-connected { + /* display: none; */ + } + + .connected { + display: flex; + flex-direction: column; + justify-content: stretch; + + .connected-info { + color: green; + } + + .property { + display: flex; + flex-direction: row; + justify-content: stretch; + + .key { + flex-grow: 0; + flex-shrink: 0; + width: 140px; + } + + &.premium { + .premium { + color: green; + } + + .non-premium { + color: red; + } + } + } + + .container-info-action { + display: flex; + flex-direction: row; + justify-content: stretch; + + .divider { + flex-grow: 0; + flex-shrink: 0; + width: 2px; + + background: lightgray; + } + + .container-info, .container-actions { + flex-grow: 1; + flex-shrink: 1; + width: 50%; + + display: flex; + flex-direction: column; + justify-content: stretch; + } + + .container-actions { + display: flex; + flex-direction: column; + justify-content: center; + + button { + width: 150px; + + align-self: center; + } + } + } + } +} + .modal .settings-profiles { margin: 5px; > div:not(:first-of-type) { @@ -565,5 +641,158 @@ } */ } + + &.identity-settings-teamspeak { + .property { + &:not(:first-of-type) { + margin-top: 5px; + } + + display: flex; + flex-direction: row; + justify-content: stretch; + + .key { + width: 200px; + } + + .value { + flex-grow: 1; + flex-shrink: 1; + + input { + width: 100%; + } + } + + &.level { + .value { + display: flex; + flex-direction: row; + justify-content: stretch; + + button { + margin-left: 5px; + } + } + } + } + + .identity-undefined { + text-align: center; + } + + .manage { + display: flex; + flex-direction: row; + justify-content: space-between; + margin-top: 5px; + } + } + } +} + +.container-teamspeak-import { + .error { + color: red; + /* margin-bottom: 5px; */ + } + + .success { + color: green; + } + + .input-file { + display: none; + } + + .load-data { + display: flex; + flex-direction: column; + justify-content: stretch; + + .buttons { + flex-grow: 1; + flex-shrink: 1; + display: flex; + flex-direction: row; + justify-content: end; + + button:not(:first-of-type) { + margin-left: 20px; + } + } + } + + .footer { + margin-top: 5px; + text-align: right; + margin-bottom: 5px; + + .button-import { + width: 100px; + } + } +} + +.container-teamspeak-improve { + display: flex; + flex-direction: column; + + .property { + &:not(:first-of-type) { + margin-top: 5px; + } + + display: flex; + flex-direction: row; + justify-content: stretch; + + .key { + display: flex; + flex-direction: row; + flex-grow: 0; + flex-shrink: 0; + width: 120px; + + .help-tagged { + width: 80px; + } + } + + .value { + flex-grow: 1; + flex-shrink: 2; + + input { + width: 100%; + } + } + } + + .row { + display: flex; + flex-direction: row; + justify-content: space-between; + + .property { + margin-top: 0px; + } + } + + .buttons { + margin-top: 5px; + margin-bottom: 5px; + display: flex; + flex-direction: row; + justify-content: space-between; + + button { + width: 100px; + } + } + + .help-tip-container { + margin-left: 5px; } } \ No newline at end of file diff --git a/shared/html/templates.html b/shared/html/templates.html index 860e6bcd..4d58ea3d 100644 --- a/shared/html/templates.html +++ b/shared/html/templates.html @@ -159,11 +159,14 @@
{{tr "Connection profile:" /}}
- +
+ + +

-
The selected connect profile is invalid
+
{{tr "The selected connect profile is invalid" /}}
Click 
here
 to manage your connect profiles
@@ -608,7 +611,44 @@ {{tr "General"/}} - {{tr "Didnt setuped yet!"/}} + +
+
+
{{tr "TeaSpeak Forum Connection" /}}
+
+
+
{{tr "You're currently not connected with your TeaSpeak Forum account" /}}
+ +
+
+
{{tr "You're connected via TeaSpeak forum" /}}
+
+
+
+
{{tr "Username:" /}}
+
WolverinDEV
+
+
+
{{tr "Premium:" /}}
+
YES
+
+
+
+
+ +
+
+ +
+
+
+
+
{{tr "Audio" /}} @@ -845,10 +885,38 @@
- {{tr "Please enter your exported TS3 Identity string bellow or select your exported Identity"/}}
-
- -
+ + +
+
{{tr "You have'nt generated/imported an identity.
Generate a new one or import one." /}}
+
+
+ +
+ + +
@@ -857,8 +925,9 @@
- You cant use your TeaSpeak forum account. You're not connected!
- Click {{if !client}}here{{else}}{{/if}} to login via the TeaSpeak forum. + + You cant use your TeaSpeak forum account. You're not connected with your forum Account!
+ Setup your connection here.
@@ -889,6 +958,80 @@
+ + + +