Hi I would just like my subs to sign up with their email as their login name so they just need to provide: email address and password thus not having to type in first & last name and username can this be done? and how? may thanks
Alex, This may be of alot of interest to othe aMember users, I was thinking about doing this type of login myself. I just hadn't had the time to ask you about it yet! Is there any chance of posting your solution here for me and others to look at? Thanks, David
I will try. 1. Edit file amember/templates/signup.html and remove the following lines: PHP: {if not $config.generate_login}<script>function checkUniqLogin(){ var login=document.forms['signup'].elements['login'].value; var email=document.forms['signup'].elements['email'].value; {/literal}{if not $config.generate_pass} var word=document.forms['signup'].elements['pass0'].value; {else} var word=""; {/if}{literal} window.open('uniq_login.php?login='+login+'&email='+email+'&word='+word, '', 'dependent=1,directories=0,height=400,width=300,location=0');}</script><tr> <th><b>Choose a Login Name (User ID)</b><br><br> <small>It must be {$config.login_min_length} or more characters in length and may<br> only contain small letters, numbers, and<br>the underscore '_'</small></th> <td nowrap><input type=text name=login value="{$smarty.request.login|escape}" size=15 maxlength=15> <a href="javascript:checkUniqLogin()"><small>check for uniqueness</small></a> </td></tr>{/if} 2. Edit file amember/signup.php, replace PHP: $vars = & get_input_vars(); to PHP: $vars = & get_input_vars();$vars['login'] = $vars['email']; and PHP: if (preg_match('/[^0-9a-zA-Z_ ]+/', $vars['login'])){ to PHP: if (preg_match('/[^0-9a-zA-Z@_ ]+/', $vars['login'])){ 3. Enable aMember Cp -> Setup -> Require Unique Email It should work.
Alex, Before I try this, will this affect any future upgrades when the next release comes out. Is this due to be soon by the way or a long way off? Best wishes, David
David, if upgrade will touch signup.php or signup.html you will have to repeat changes described above.
Add as an option in Admin Do you think that this could be added as an option in a future version. You could select in the setup or in the admin to have people us their email address as their login? All the best, -Jon
Unfortunately, this will create problems with integration plugins, so we don't plan to make this "official" option.
Email as Login name Alex, FYI - I am also wanting to use the email as the username. For me as a pre-purchaser, this is important. I appreciate the fact that it can be worked around, but reapplying the workaround after upgrades is very annoying and error prone. Thanks, Scott
I tried this but when signing up I get this error: "Username contains invalid characters - please use digits, letters or spaces" Perhaps the @ symbol or the "." is tripping it up? How can those be added as an allowed character? EDIT: Nevermind, I added a period to this line: Code: if (preg_match('/[^0-9a-zA-Z@_ ]+/', $vars['login'])){ so it became Code: [if (preg_match('/[^0-9a-zA-Z@_. ]+/', $vars['login'])){ ] Everything works now.
I get an error: Parse error: parse error, unexpected '[' in /var/www/web154/html/amember/signup.php on line 55
Problem Does it works with amember 3.0.7..? I get error: WARNING: preg_match() [function.preg-match]: Compilation failed: range out of order in character class at offset 15 in line 59 of file signup.php email adress xxxxx@xxx-xxx.com Sign-up.php: if (preg_match('/[^0-9a-zA-Z@_.- ]+/', $vars['login'])){
Alex, Can this be implemented with a single "include" to minimize the editing required when signup.php or signup.html are touched by an upgrade? Kirk