OK I solved it. It seems to go wrong if I try to have addUser, deleteUser, editUser and getUserNames as SQL methods and getUserDetails as a Python Script, so after ripping my hair off I changed them all to python scripts. And suddenly everything worked fine:-) I have no idea if this was due to an error on my behaf or if it is a limitation in SUF(if it is, you should try to get rid of it!). Just for the record; I did not change my encryption lines, and yes they are in a python scripts(some external). You might think of caching the username and roles in some way, is it really neccesary to query the db every single GET command? Thank you very much for all your help! Really great of everybody on this list to help eachother:o) cheers Bjorge On Mon, 6 Jan 2003, Chris Withers wrote:
Bjørge Solli wrote:
It works fine if I use only sql with the easy table from createTable.sql and I copy all the tests/*.sql into my folder where the SUF-object is. I can also change the getUsers so it gets my correct users. But my roles are stored in different tables, and I have no good way of making a query returning on the format SUF understands(my sql-expert is working on it though;-)
Yep, you either need to get SQL return the correct format, or just use a script, as you suggest:
I encrypt the password in this way: crypted = sha.new(plaintext).hexdigest()
Is this code in a Script (Python)?
I change the passwords I get from my database in this way: prefiks = '{SHA}' passord = binascii.b2a_base64(binascii.unhexlify(crypted))[:-1] passwd = '%s%s' %(prefiks,passord)
But this does not work! I really don't understand why!
Well, break it down into steps, and see waht you're gettign at each stage. I can't see anything obviously bad but then I know next to nothing about SHA.
One question I have asked is if it is possible to mix sql and py(?).
Don't know what you mean.
cheers,
Chris
-- http://www.ii.uib.no/~bjorge/smile/Smiles -- Bjørge Solli - Universitas Bergensis, Norway mailto:Bjorge@Kvarteret.no icq#29210281 MSN:bobelloco@hotmail.com Møllendalsv.19, 5009 Bergen, Norway tel:+47 55202853/91614343