- Posts: 2
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Problem with password encryption after transferring installation
- kmc13
- Topic Author
- Offline
- New Member
Less
More
9 years 9 months ago #110676
by kmc13
Problem with password encryption after transferring installation was created by kmc13
Hi there,
I have just managed to get my LS installation transferred to a new server, logged in and everything appears to be working as normal. Well almost everything..
There is some issues with the password encryption, the passwords are not working in there regular format. I see they are saved in the Database in hashed bytea form (eg. "582f443f5477a4d6f50f33c14edb1abcbf2048eccc130f430caj4s8hp6e54cdd"). If I copy paste this into the password box I can log in but it fails if I enter the regular/ non encrypted password.
Not sure how to fix this.. any ideas?
I'm running LS version 2.00+ on Apache 2.2 with PHP 5.4.
Cheers,
Keith.
I have just managed to get my LS installation transferred to a new server, logged in and everything appears to be working as normal. Well almost everything..
There is some issues with the password encryption, the passwords are not working in there regular format. I see they are saved in the Database in hashed bytea form (eg. "582f443f5477a4d6f50f33c14edb1abcbf2048eccc130f430caj4s8hp6e54cdd"). If I copy paste this into the password box I can log in but it fails if I enter the regular/ non encrypted password.
Not sure how to fix this.. any ideas?
I'm running LS version 2.00+ on Apache 2.2 with PHP 5.4.
Cheers,
Keith.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
9 years 9 months ago #110731
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Problem with password encryption after transferring installation
Hard to detect without testing in my postgre install (and no time actually).
But PG 8.x seems have some issue .
Try editing application/core/UserIdentity.php
to
And we use sha256 to validate password:
elseif ($sStoredPassword !== hash('sha256', $this->password))
But PG 8.x seems have some issue .
Try editing application/core/UserIdentity.php
Code:
if (gettype($user->password)=='resource') { $sStoredPassword=stream_get_contents($user->password,-1,0); // Postgres delivers bytea fields as streams :-o } else { $sStoredPassword=$user->password; }
Code:
if (false && gettype($user->password)=='resource') { $sStoredPassword=stream_get_contents($user->password,-1,0); // Postgres delivers bytea fields as streams :-o } else { $sStoredPassword=$user->password; }
And we use sha256 to validate password:
elseif ($sStoredPassword !== hash('sha256', $this->password))
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The following user(s) said Thank You: kmc13
The topic has been locked.
- kmc13
- Topic Author
- Offline
- New Member
Less
More
- Posts: 2
- Thank you received: 1
9 years 9 months ago #110736
by kmc13
Replied by kmc13 on topic Problem with password encryption after transferring installation
Thanks for your reply, I have just figured out.. It was the Postgres database that I hadn't set up correctly.. I had to define the Variable 'bytea_output' = escape and I also replicated the Privileges that were on the old DB.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
9 years 9 months ago #110758
by DenisChenu
Maybe you can put some information for other PostGre user on our manual : manual.limesurvey.org/Installation_FAQ can be a good place.
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Problem with password encryption after transferring installation
Hi,kmc13 wrote: Thanks for your reply, I have just figured out.. It was the Postgres database that I hadn't set up correctly.. I had to define the Variable 'bytea_output' = escape and I also replicated the Privileges that were on the old DB.
Maybe you can put some information for other PostGre user on our manual : manual.limesurvey.org/Installation_FAQ can be a good place.
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.