Implement editing hash password field with custom algo/salt?
Posted: Wed Oct 05, 2011 12:00 am
Hello.
I have a table in my database with a list of users. They are users of my own application, this table doesn't have any relation to Xataface authorization. It's structure is like
Password is defined like
So, password field value depends on salt value. How do I implement UI for admin with Xataface to allow administrator to change password for a given user?
I tried to look at field__serialize example on forum, but it seems, it doesn't allow you to access values of fields, other than the one being serialized in the handler.
I'm new to Xataface, but already inspired by it's capabilities Can you help me?
I have a table in my database with a list of users. They are users of my own application, this table doesn't have any relation to Xataface authorization. It's structure is like
- Code: Select all
CREATE TABLE IF NOT EXISTS `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`email` char(50) CHARACTER SET latin1 NOT NULL,
`password_hash` binary(20) NOT NULL,
`password_salt` char(5) NOT NULL
)
Password is defined like
- Code: Select all
$password = RandomPasswordGenerator::generate(PasswordGenerator::ALLOWED_CHARS_LATIN_ALPHA_NUMERIC, 12);
$insertDb['password_salt'] = RandomPasswordGenerator::generate(PasswordGenerator::ALLOWED_CHARS_LATIN_ALPHA_NUMERIC, 5);
$insertDb['password_hash'] = sha1(sha1($password, true) . $insertDb['password_salt'], true);
So, password field value depends on salt value. How do I implement UI for admin with Xataface to allow administrator to change password for a given user?
I tried to look at field__serialize example on forum, but it seems, it doesn't allow you to access values of fields, other than the one being serialized in the handler.
I'm new to Xataface, but already inspired by it's capabilities Can you help me?