use newuser_default_family to set a mandatory default family for new users
This commit is contained in:
parent
582c53a5fd
commit
8903531a46
3 changed files with 14 additions and 5 deletions
|
@ -39,6 +39,12 @@ 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,
|
||||
|
||||
|
|
|
@ -19,10 +19,10 @@ $smarty = new MySmarty();
|
|||
$opt = $smarty->opt();
|
||||
|
||||
if (isset($_POST["action"]) && $_POST["action"] == "signup") {
|
||||
$username = $_POST["username"];
|
||||
$fullname = $_POST["fullname"];
|
||||
$email = $_POST["email"];
|
||||
$familyid = $_POST["familyid"];
|
||||
$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'];
|
||||
|
||||
// make sure that username isn't taken.
|
||||
$stmt = $smarty->dbh()->prepare("SELECT userid FROM {$opt["table_prefix"]}users WHERE username = ?");
|
||||
|
@ -101,6 +101,9 @@ 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);
|
||||
|
|
|
@ -128,7 +128,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||
<input id="email" name="email" type="text" class="input-xlarge" value="{$email|escape:'htmlall'}" placeholder="you@somewhere.com">
|
||||
</div>
|
||||
</div>
|
||||
{if $familycount > 1}
|
||||
{if $familycount > 1 && $opt.newuser_default_family == 0}
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="familyid">Family</label>
|
||||
<div class="controls">
|
||||
|
|
Loading…
Add table
Reference in a new issue