X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=scripts%2Fchange_password.ml;h=531e2e6b1451d9957bdff08582574b7685996a23;hb=f281fd7b2ac035be5a15cc1519d395b4e383eb84;hp=d189f8336b72bd3281d803f145f7c1a964c7fc46;hpb=79f907772aef608a83338589f64c10a901889b5c;p=cocanwiki.git diff --git a/scripts/change_password.ml b/scripts/change_password.ml index d189f83..531e2e6 100644 --- a/scripts/change_password.ml +++ b/scripts/change_password.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * Copyright (C) 2004 Merjis Ltd. - * $Id: change_password.ml,v 1.1 2004/09/25 13:17:00 rich Exp $ + * $Id: change_password.ml,v 1.2 2004/10/14 15:57:15 rich Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,8 +37,9 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid _ user = | User (userid, _, _) -> userid in let sth = dbh#prepare_cached "select 1 from users - where id = ? and password = ?" in - sth#execute [`Int userid; `String old_password]; + where hostid = ? and id = ? + and password = ?" in + sth#execute [`Int hostid; `Int userid; `String old_password]; let old_password_ok = try 1 = sth#fetch1int () @@ -73,8 +74,8 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid _ user = let sth = dbh#prepare_cached "update users set password = ?, force_password_change = false - where id = ?" in - sth#execute [`String password; `Int userid]; + where hostid = ? and id = ?" in + sth#execute [`String password; `Int hostid; `Int userid]; dbh#commit ();