Page 1 of 1

Email as user name

Posted: 2014-02-03 12:22
by claudiu111
Hi,
Is it possible to set the email as a user name in the admin panel? I want to log in using email not a simple user with email.

Thanks

Re: Email as user name

Posted: 2014-02-08 13:35
by a.gneady
You can use the email address as a username .. but in the default application code generated by AppGini, you'd still have to provide an email address in the sign up form ... so, new users would be entering their email twice. You can adjust the generated code to hide the username field and then copy the email address into the username field in the membership_users table.

Re: Email as user name

Posted: 2014-02-10 07:46
by claudiu111
Thank you.

Re: Email as user name

Posted: 2016-01-26 18:22
by dantes
Hello. I apologize if the questions that I will turn out silly ...

It's seems a good idea. There are two problems:

First problem: the maximum length allowed for the username is 20 characters. I tried to change the value of the field MemberID in the table membership_user: unfortunately it's not enough and the control will always return an error. Where do I go to change the control parameters?

Second problem: the method requires that administrator validate registration. I would prefer that user register himself (maybe by sending an email verification) and the administrator must not provide each time to validate the registration .... maybe this is not possible. :|

How can I solve this problem?

Re: Email as user name

Posted: 2016-01-31 15:33
by shasta59
Hello

What version are you using - just nice to know as it can affect answers. I will assume 5.5.

Step 1: First what you need to do is to change the length of the varchar field in your database to something longer. Using, for example, phpmyadmin you could change the length of memberID to 40 characters. This will allow for longer entries. (you can do this in Appgini but it means regenerating the application again and uploading. )
Voila_Capture626.jpg
varchar size
Voila_Capture626.jpg (22.32 KiB) Viewed 5417 times
Step 2: Next you would look in incFunctions.php and change:
memberID varchar(20) to the new value you set for memberID so it would now look like:

memberID varchar(newvalue)

You really do not need to do step 2 as the code is only run once but I like to do it to keep things neat and tidy.

This method took me less than a minute to do. I used a program to search for all instances and make the changes. Faster than regenerating and uploading again. Next time you make major changes and need to regen you can set the new value in Appgini for memberID to your new value.

2nd part of question:

Step 1: Go into the admin area in your application once you log in as an admin
Step 2: Under Utilities select Admin Settings and change the default sign up mode at the bottom to auto approve.
Voila_Capture625.jpg
admin setting
Voila_Capture625.jpg (33.41 KiB) Viewed 5417 times
Hope this helps.

Alan

Re: Email as user name

Posted: 2016-01-31 16:03
by shasta59
Hello again

Forgot to add. I do not think it is a good idea to use an email address as a user name. Unless the security aspect of your application is not really an issue. I do not allow it and added code to check to insure they are not using an email address.

But that is a decision you have to make. In some cases, if the data is not really sensitive or important it really does not matter. In my app I have added code to encrypt user names (memberID) and also email addresses to add a bit more security.

Bit of a pain as these values are used elsewhere at times to reference other values but it just meant changing a few other minor things elsewhere. Once I had sweated over it once it was easy the next time. There are other ways to do this but this was the easiest for me to do. (Hey just writing this comment I figured out another method - will have to give it a go).

You can take a bit of a performance hit doing this but, in most cases, it does not really matter unless you are getting so many users at one time it really bogs down. On my server would have to have over 500 users at the exact same time to see an issue.

Alan

Re: Email as user name

Posted: 2016-01-31 17:49
by shasta59
Please do not ask how I do this. The reason for not giving it out is due to security. I was purposely vague in the previous post for this reason. If I do a show and tell then my security is much less.

I know many of you would like to consider increased security of data. I change the md5 security to use crypt along with a strong 'salt' and other things.
It does mean a few other changes as well.

I do appreciate the 'need to know' factor but in this case I have to ignore that need to know and say 'Sorry' but I need to keep my security up. I only do this in situations where the data is sensitive. If you need more security the developer of AppGini would have to add it in. This could, however, mean older databases could have issues if you updated with a new version of AppGini. There would be a need for an update routine and other factors as well. I make all the changes before the app is even run for the first time.

Alan