wilde: server/kolab-webadmin/kolab-webadmin/php/admin/include passwd.php, 1.1, 1.2
cvs at kolab.org
cvs at kolab.org
Wed Jan 10 17:50:45 CET 2007
Author: wilde
Update of /kolabrepository/server/kolab-webadmin/kolab-webadmin/php/admin/include
In directory doto:/tmp/cvs-serv7039/kolab-webadmin/kolab-webadmin/php/admin/include
Modified Files:
passwd.php
Log Message:
Code cleanup: moved the redundant function `checkpw' to include/passwd.php.
Index: passwd.php
===================================================================
RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/php/admin/include/passwd.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- passwd.php 10 Jan 2007 15:59:58 -0000 1.1
+++ passwd.php 10 Jan 2007 16:50:43 -0000 1.2
@@ -1,8 +1,10 @@
<?php
/* -------------------------------------------------------------------
+ Copyright (c) 2004 Klaraelvdalens Datakonsult AB
Copyright (C) 2007 by Intevation GmbH
Author(s):
Sascha Wilde <wilde at intevation.de>
+ Steffen Hansen <steffen at klaralvdalens-datakonsult.se>
This program is free software under the GNU GPL (>=v2)
Read the file COPYING coming with the software for details.
@@ -21,6 +23,25 @@
while (strlen($salt) < 4)
$salt = $salt . chr(mt_rand(0,255));
return $salt;
+}
+
+// Check that passwords from form input match
+function checkpw( $form, $key, $value ) {
+ global $action;
+ if( $action == 'firstsave' ) {
+ if( $key == 'password_0' ) {
+ if( $value == '' ) return _('Password is empty');
+ } else if( $key == 'password_1' ) {
+ if( $value != $_POST['password_0'] ) {
+ return _('Passwords dont match');
+ }
+ }
+ } else {
+ if( $value != $_POST['password_0'] ) {
+ return _('Passwords dont match');
+ }
+ }
+ return '';
}
?>
More information about the commits
mailing list