Browse Source

Add ToS agree checkbox

Skylar Ittner 3 months ago
parent
commit
5f7d45e812
2 changed files with 7 additions and 1 deletions
  1. 2
    0
      settings.template.php
  2. 5
    1
      signup/index.php

+ 2
- 0
settings.template.php View File

@@ -33,6 +33,8 @@ $SETTINGS = [
33 33
     "mobile_enabled" => true,
34 34
     // Allow users to signup for new accounts
35 35
     "signups_enabled" => false,
36
+    // Terms of Service URL for user signup
37
+    "tos_url" => "",
36 38
     // For supported values, see http://php.net/manual/en/timezones.php
37 39
     "timezone" => "America/Denver",
38 40
     // List of external apps connected to this system.

+ 5
- 1
signup/index.php View File

@@ -22,6 +22,10 @@ function showHTML($errormsg = null, $genform = true, $noformcontent = "", $title
22 22
     $form->addInput("email", "", "email", false, null, null, "Email", "fas fa-envelope", 6, 5, 255, "", $Strings->get("That email address doesn't look right.", false));
23 23
     $form->addInput("name", "", "text", true, null, null, "Name", "fas fa-user", 6, 2, 200, "", $Strings->get("Enter your name.", false));
24 24
 
25
+    if (!empty($SETTINGS['tos_url'])) {
26
+        $form->addInput("agree_tos", "1", "checkbox", true, null, null, "I agree to the <a href=\"$SETTINGS[tos_url]\" target=\"_BLANK\">terms of service</a>");
27
+    }
28
+
25 29
     $form->addHiddenInput("submit", "1");
26 30
 
27 31
     $form->addButton($Strings->get("Create Account", false), "fas fa-user-plus", null, "submit", "savebtn");
@@ -134,7 +138,7 @@ if (strlen($_POST['password']) < $SETTINGS['min_password_length']) {
134 138
     showHTML($Strings->build("Your password must be at least {n} characters long.", ["n" => $SETTINGS[min_password_length]], false));
135 139
 }
136 140
 require_once __DIR__ . "/../lib/worst_passwords.php";
137
-$passrank = checkWorst500List($new);
141
+$passrank = checkWorst500List($_POST['password']);
138 142
 if ($passrank !== FALSE) {
139 143
     showHTML($Strings->get("That password is one of the most popular and insecure ever, make a better one.", false));
140 144
 }

Loading…
Cancel
Save