[Users] ha1 ha2

Urtho junk at urtho.net
Mon Mar 27 22:39:11 CEST 2006


>> Frogger wrote:
>> > If I am interested in doing my own insert into the
>> > openser db how should I calculate the following
>> > fields:
>> >
>> > ha1 ha2
>> >

I use the following trigger in a setup with domain support and MySQL 5.0 :

CREATE TRIGGER `tr_insert_subscriber` BEFORE INSERT ON `subscriber` FOR EACH ROW
BEGIN
    SET NEW.ha1 = MD5(CONCAT(NEW.username,':',NEW.domain,':',NEW.password));
    SET NEW.ha1b = MD5(CONCAT(NEW.username,'@',NEW.domain,':',NEW.domain,':',NEW.password));
END


-- 
Regards,
 Pawel Pierscionek





More information about the sr-users mailing list