Password encryption (MD5 or SHA1)

23 views
Skip to first unread message

R Oort

unread,
Oct 13, 2021, 8:38:19 AM10/13/21
to Xataface
I would like to enable password encryption, bu i can't get it working

I've made an Users Table and placed an fields.ini file in the path /<site>/tables/Users/
[password] 
encryption=md5

I've also tried placing an fields.ini.php
;<?php exit;
[password]
encryption=md5

But, when changing a password they are stil stored in plain text

Steve Hannah

unread,
Oct 13, 2021, 8:44:52 AM10/13/21
to xata...@googlegroups.com
The most likely thing is that it isn't picking up the fields.ini file due to case differences.  You can test this by just changing the label on a field to see if it is picked up.

If your table name is "users", then the directory should be tables/users .  If "Users", then it should be tables/Users.  Etc...

Both fields.ini and fields.ini.php will work, but fields.ini.php is recommended

--
You received this message because you are subscribed to the Google Groups "Xataface" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xataface+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xataface/79398831-6bcb-4986-b2a5-9d18ac844b6an%40googlegroups.com.


--
Steve Hannah
Web Lite Solutions Corp.

R Oort

unread,
Oct 13, 2021, 10:10:01 AM10/13/21
to Xataface
i've checked the case and i'm positive it's correct

mysql> show tables;
+-------------------------+
| Tables_in_testdb        |
+-------------------------+
| Users                   |
| dataface__failed_logins |
| dataface__modules       |
| dataface__mtimes        |
| dataface__preferences   |
| dataface__record_mtimes |
| dataface__version       |
+-------------------------+
9 rows in set (0.00 sec)

conf.ini
[_auth]
users_table=Users
[_tables]
Users = "Users"

 /<site>/tables/Users/fields.ini

Op woensdag 13 oktober 2021 om 14:44:52 UTC+2 schreef Steve Hannah:

Steve Hannah

unread,
Oct 13, 2021, 10:11:32 AM10/13/21
to xata...@googlegroups.com
Did you test a label change to ensure it's picking it up?

R Oort

unread,
Oct 13, 2021, 10:27:01 AM10/13/21
to Xataface
i can try.....
only don't know what you suggest to to 
change whitch label in what file or table to what ?

Op woensdag 13 oktober 2021 om 16:11:32 UTC+2 schreef Steve Hannah:

Steve Hannah

unread,
Oct 13, 2021, 10:30:25 AM10/13/21
to xata...@googlegroups.com


change whitch label in what file or table to what ?


In your fields.ini file try changing a label.

E.g.

[password]
    widget:label="My Password"

Then load the edit or new record form in the users table and see if the label says "My Password".  If it doesn't, then either it isn't picking up the fields.ini at all, or it isn't picking up the "password" field config.  (Note also that your password field is case sensitive - if the column name is Password, then in fields.ini you need [Password].  If it is password, then it needs to be [password]
 

R Oort

unread,
Oct 13, 2021, 10:40:46 AM10/13/21
to Xataface
Great ! Your remark fixed it 
Note also that your password field is case sensitive - if the column name is Password, then in fields.ini you need [Password].  If it is password, then it needs to be [password]

The column in the table Users was "Password" as suggested on the Wiki 
changed my fields.ini to
[Password] 
encryption=md5

now encryption works 

Thanks for your assistance !
Op woensdag 13 oktober 2021 om 16:30:25 UTC+2 schreef Steve Hannah:
Reply all
Reply to author
Forward
0 new messages