SugarCRM user password - sugarcrm

I've created a user in SugarCRM; once I've created a user the password is mailed to the user.
I see the table user, but the user_hash is blank.
Where does it store the password before it sends an email?

Check the column 'system_generated_password'. 'user_hash' will be null until the new user logs in with the the system generated password and then creates a new password for themselves.

I think you might be mistaken. I just created a new user with a user name new_user. I then did the following query:
SELECT * FROM users WHERE user_name = "new_user"
The user_hash has a value of 1e3fab09c625a96334d18d2da27dae46.
I double-checked, and the password emailed to me was l7YaR7, which md5 hashes to the above.
I did this in Sugar 6.1.1. What version are you using?
Also, did the email get sent out? It's possible that the password hash isn't sent to the DB until after the email has been successfully sent.

You can create user using md5 function if you using phpmyadmin.
You can alter the passworld and use md5() function;

Related

Cakephp 2.4 Re-hash stored values in database

I am new to cakephp and I need some help.
I have a database with hashed password of users, and I want to update HASH $key (just for security) so I want to rehash users password with new seed, So they donĀ“t have to set password again.
Any suggestions ?
Thanks in advance

Why is hash function fast?

Let's say I created a database that stores just name and password.
Then if I use a hash function(let's say md5) to one-way encrypt the password which the user enters when signing up.
Name = "James"
Password = "password1234" -> "bdc87b9c894da5168059e00ebffb9077"
The encrypted message will be stored in the database with his name "James"
Now when he enters his password to login, his password's md5 hash will be compared with the encrpyted message in the database.
So, if there is 1 million data on my database, the server will need to search through all the data to find "bdc87b9c894da5168059e00ebffb9077".
How come is it possible to locate the password's position instantly?

Laravel 5.1 Reset Password Function; user's email is in a different table

I have a question regarding Laravel's Reset Password function. I have thoroughly searched for a possible solution and could not find one. Moreover, I tried to scrutinize the code and manually implement it, but failed miserably because of the nesting. (I'm new to Laravel).
According to Laravel's documentation, the user's email must be in the table user in order to work and the error code confirms it.
*Column not found: 1054 Unknown column 'email' in 'where clause' (SQL: select * from user where email = usermail#provider.com limit 1*
However, we do have the scenario that an user might have multiple email addresses, hence stored in a different table called user_email.
Does anybody have experience with this scenario and could take the time to enlighten me on this?
You have two Options:
Write your own password recovery system.
Let the user choose a primary e-mail and make a column on the users table which represents the primary e-mail adresse.

Hash method in Laravel

I have a question concerning the Hash::make method in Laravel 4.2 .. I've notice that it returns always a different string for the same value . So I am wondering if this affects If I want to look for a user using his email and hashed password in the table . If it's not ? Why I have then this issue of not getting a user with correct credentials from the table using the where statements (where email and where password) ? but when I look for it using just the email it works .. I am 100% convinced it's just about the Password . What do you think ?
You get different hashes on purpose, the function adds a random salt to each hashed password. This is important to get secure hashes.
// Hash a new password for storing in the database.
// The function automatically generates a cryptographically safe salt.
$hashToStoreInDb = Hash::make($password);
The verification cannot be done in the SQL statement directly, instead you can search for the user by username/email, get the stored password-hash, and afterwards verify the entered password with the password-hash from the database.
// Check if the hash of the entered login password, matches the stored hash.
// The salt and the cost factor will be extracted from $existingHashFromDb.
$isPasswordCorrect = Hash::check($password, $existingHashFromDb);

Difference between setIdentity and setCredential in Zend Framework

What is the difference between setIdentity and setCredential in Zend Framework?
$authAdapter->setIdentityColumn('username')
->setCredentialColumn('password');
$authAdapter->setIdentity($data['username'])
->setCredential($data['password']);
Please help me I need some detailed explanation.
identityColumn: This is the name of the database table column used to represent the identity. The identity column must contain unique values, such as a username or e-mail address.
credentialColumn: This is the name of the database table column used to represent the credential. Under a simple identity and password authentication scheme, the credential value corresponds to the password. See also the credentialTreatment option.
Basically, setIdentity tells the system to set a username and setCredential tells the system to set the provided password for authentication.
Hope it helps.
Ref: Zend Table