User Registration

infinityssm
infinityssm
@makande
7 years ago
53 posts
Hi,

I have been trying to create a separate registration page and was told I could follow the same logic as below.

Docs: "HowTo: add the login form to any page"
https://www.jamroom.net/the-jamroom-network/documentation/module-developer-guide/603/howto-add-the-user-login-form-to-any-page


I tried with the attached code and failed.


Is this possible to do?


regform.jpg
regform.jpg  •  99KB


updated by @makande: 12/18/17 10:33:52AM
michael
@michael
7 years ago
7,746 posts
If you use a Site Builder page, there is a widget you can drop in.
infinityssm
infinityssm
@makande
7 years ago
53 posts
Hi,

I tried the site builder. It's a great tool but not working for my needs. I can create multiple pages with a signup widget, however, there is no way to direct the signup to the correct quota.

I even tried using the subscriptions module. I setup a signup quota and directed the registered user to a page that provided three choices to complete the registration. But trying to configure the subscriptions became a headache, meaning there was no way to show the new user only the selection that pertained to their desired choice.

Why is this so hard. It was so simple in Jam4. All we had to do was code in the quota ID in the sign-up template.

Any ideas?

I just want my users to be able to choose between Member, Artist or Label/Manager. The current drop-down way is confusing to some users. they sometimes just register for the default account not realizing there are other options.

Thanks
Michael
michael
@michael
7 years ago
7,746 posts
That code is for LOGIN, not SIGNUP.

What do you mean by direct the "signup to the correct quota"?

Where the user is redirected after signup/login is set on the QUOTA CONFIG page of the USER module:
ACP -> MODULES -> USER -> USER ->QUOTA CONFIG -> Login Redirect Page
ACP -> MODULES -> USER -> USER ->QUOTA CONFIG -> Signup Redirect Page
michael
@michael
7 years ago
7,746 posts
Good point about the signup quota, that needs to be added in.
michael
@michael
7 years ago
7,746 posts
Use this code:
{jrCore_include template="header.tpl"}


{jrCore_form_create_session module="jrUser" option="signup" assign="token"}
<div id="jrUser_signup_msg"></div>
<form id="jrUser_signup" name="jrUser_signup" action="{$jamroom_url}/user/signup_save" method="post" accept-charset="utf-8" enctype="multipart/form-data">
    <input type="hidden" id="jr_html_form_token" name="jr_html_form_token" value="{$token}">
    user name <input type="text" id="user_name" class="form_text" name="user_name" value=""><br>
    email <input type="text" id="user_email" class="form_text" name="user_email" value=""><br>
    password <input type="password" id="user_passwd1" class="form_text" name="user_passwd1" value=""><br>
    repeat password <input type="password" id="user_passwd2" class="form_text" name="user_passwd2" value=""><br>
    <input type="hidden" id="quota_id" name="quota_id" value="1">
    <img id="form_submit_indicator" src="{$jamroom_url}/skins/jrNova/img/submit.gif" width="24" height="24" alt="working...">
    <input type="button" id="jrUser_signup_submit" class="form_button" value="signup" tabindex="3" onclick="jrFormSubmit('#jrUser_signup','{$token}','post');">
</form>


{jrCore_include template="footer.tpl"}

Change the quota_id from "1" to the number of the quota you want to allow signups for.
infinityssm
infinityssm
@makande
7 years ago
53 posts
Hi,

It's not working. It creates an account and profile but does not save the name or email information to the account
infinityssm
infinityssm
@makande
7 years ago
53 posts
Sorry forgot to add the link

https://meridianartistnetwork.com/member_reg2
michael
@michael
7 years ago
7,746 posts
Just seeing the jrLaunch page.

Will check it out here to see what I see. (have added the selection form into the signup widget in jrUser 2.2.2)

--edit--
This is also fixed in jrUser 2.2.2.

If you want to patch your jrUser module before the current one is released, in the view_jrUser_signup_save() function around line 1033 of:
/modules/jrUser/index.php

Locate this code
    // Create our user account
    $_data['user_password']  = $pass;
    $_data['user_language']  = (isset($_post['user_language']{0})) ? $_post['user_language'] : $_conf['jrUser_default_language'];
    $_data['user_active']    = 0;
    $_data['user_validated'] = 0;
    $_data['user_validate']  = $code;
change it to
    // Create our user account
    $_data['user_name']      = $_post['user_name'];
    $_data['user_email']     = $_post['user_email'];
    $_data['user_password']  = $pass;
    $_data['user_language']  = (isset($_post['user_language']{0})) ? $_post['user_language'] : $_conf['jrUser_default_language'];
    $_data['user_active']    = 0;
    $_data['user_validated'] = 0;
    $_data['user_validate']  = $code;

The issue is, because the form is not coming in from a jamroom created form the form validation system is not seeing that its valid.
updated by @michael: 09/18/17 11:18:57PM