From 0478c4f78c0121d208b3b23205ffcc8fdea7da07 Mon Sep 17 00:00:00 2001 From: Michael Erdely Date: Wed, 9 Oct 2024 12:41:31 -0400 Subject: [PATCH] Revert "use newuser_default_family to set a mandatory default family for new users" This reverts commit 8903531a465e3627cc902c99e27d33f34d6fa335. --- src/includes/config.php | 6 ------ src/signup.php | 11 ++++------- src/templates/signup.tpl | 2 +- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/includes/config.php b/src/includes/config.php index 6fa2494..4db0795 100644 --- a/src/includes/config.php +++ b/src/includes/config.php @@ -39,12 +39,6 @@ function getGlobalOptions() { */ "newuser_requires_approval" => 1, - /* Do not allow new user to choose family - 0 = allow new user to choose family - 1 or more = default family - */ - "newuser_default_family" => 1, - /* Whether or not whom an item is reserved/bought by is hidden. */ "anonymous_purchasing" => 0, diff --git a/src/signup.php b/src/signup.php index 778e7fb..c7e0174 100644 --- a/src/signup.php +++ b/src/signup.php @@ -19,10 +19,10 @@ $smarty = new MySmarty(); $opt = $smarty->opt(); if (isset($_POST["action"]) && $_POST["action"] == "signup") { - $username = isset($_REQUEST["username"]) ? $_POST["username"] : ""; - $fullname = isset($_REQUEST["fullname"]) ? $_POST["fullname"] : ""; - $email = isset($_REQUEST["email"]) ? $_POST["email"] : ""; - $familyid = isset($_REQUEST["familyid"]) ? $_POST["familyid"] : $opt['newuser_default_family']; + $username = $_POST["username"]; + $fullname = $_POST["fullname"]; + $email = $_POST["email"]; + $familyid = $_POST["familyid"]; // make sure that username isn't taken. $stmt = $smarty->dbh()->prepare("SELECT userid FROM {$opt["table_prefix"]}users WHERE username = ?"); @@ -101,9 +101,6 @@ if (count($families) == 1) { // default the family to the single family we have. $familyid = $families[0]["familyid"]; } -if (isset($opt['newuser_default_family']) && $opt['newuser_default_family'] != 0) { - $familyid = $opt['newuser_default_family']; -} $smarty->assign('families', $families); $smarty->assign('username', $username); $smarty->assign('fullname', $fullname); diff --git a/src/templates/signup.tpl b/src/templates/signup.tpl index 0a2351d..e1b8abf 100644 --- a/src/templates/signup.tpl +++ b/src/templates/signup.tpl @@ -128,7 +128,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - {if $familycount > 1 && $opt.newuser_default_family == 0} + {if $familycount > 1}