The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Change Username login
#1
Hi.

my name is ruben. and have 1{3bc1fe685386cc4c3ab89a3f76566d8931e181ad17f08aed9ad73b30bf28114d} of knowdledge on programing. i was trying to use a numeric for username and register the form.

but when i try log in. i cant. i notice that if the username is a numeric it try to get it by ID and not for the Username.

-- i can log in whit. username: 1 password: password

<pre>
Code:
public function find($user = null){
        if ($user) {
            if(is_numeric($user)){
                $field = 'id';
            }
else
if(!filter_var($user, FILTER_VALIDATE_EMAIL) === false){
                $field = 'email';
            }else{
                $field = 'username';
            }
</pre>


but i cant log in whit the real numeric, username, can i know a way of login whit another field of the DB or whit a numeric username ?.
  Reply
#2
i am still trying to get it but i cant log in whit a numeric username. so i decided make another form whit a field for username and another one for a numeric id..
  Reply
#3
Yep. I just answered a question about the same thing in another post. I thought it was you but it might have been someone else. I spent some time looking at it and I have no idea why it doesn't work. Note that every user is already given a number and if you want to you can go in the database and make that number start at a higher number like 1000 or 10000 if you want to.
  Reply
#4
sorry. maybe my english is bad.

i can use the green ones...
Code:
<img src="http://prntscr.com/d09r1n" alt="visual" />
but when the username is numeric
Code:
<img src="http://prntscr.com/d09rzc" alt="" />
it calls a classes function. so i dont know how to use a numeric username. if this function dont let me doit. i try replacing the ID by Username. but the problem there is another one.

PD: for some reason i cant use img on forum ...
  Reply
#5
Right. I cannot figure out why the login does not happen if the username is purely numeric.

The default behavior is if it sees a number, it looks for the id instead of the username and as you said...if you tell it to look for a username instead, the login fails.

However, it does work fine if you use it as intended. (Default login for admin would be id 1 and password...that works fine). I have tried converting the numeric input to a string, but that didn't help.

I guess what I was saying is if you want everyone to have a numeric username, you could start the id at hire than the default 1,2.

Otherwise, for the time being, I will put in a validation that does not allow people to use purely numeric usernames until I can figure out the problem.
  Reply
#6
Right. I cannot figure out why the login does not happen if the username is purely numeric.

The default behavior is if it sees a number, it looks for the id instead of the username and as you said...if you tell it to look for a username instead, the login fails.

However, it does work fine if you use it as intended. (Default login for admin would be id 1 and password...that works fine). I have tried converting the numeric input to a string, but that didn't help.

I guess what I was saying is if you want everyone to have a numeric username, you could start the id at hire than the default 1,2.

Otherwise, for the time being, I will put in a validation that does not allow people to use purely numeric usernames until I can figure out the problem.
  Reply
#7
ohh.. really. is a pretty nice idea. id = list of usernames

my problem is that i have 1800 records of numbers = login ID. but put it them on iD place works fine.
  Reply
#8
mudmin.. do you know a way of create a list of passwords for users... i have a excel for made md5 passwords but userspice uses sha256 and bcrypt. i cant figure out a way of make the passwords..
  Reply
#9
Are you wanting encrypted passwords or encrypted passwords?

Also...just seeing...are you wanting to take the md5 hashes and make THOSE bcypted passwords or are you wanting to take the actual text passwords and encrypt them with bcrypt?
  Reply
#10
ok. let me explain it.

i have a list of 100 users and want to create a Personalized passwords for every one of them.
  Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)