summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSascha Wilde <wilde@intevation.de>2007-01-10 16:50:43 (GMT)
committerSascha Wilde <wilde@intevation.de>2007-01-10 16:50:43 (GMT)
commitecbd351adb6d40ecdcaac130a32e7878c300becd (patch)
tree686ae6f91af81be4ed6d6abb43bcf96cd8da4c64
parente6cdea0f29df5382ad5967ab900224f161e37f1c (diff)
downloadkolab-webadmin-2.1-beta4.tar.gz
Code cleanup: moved the redundant function `checkpw' to include/passwd.php.2.1-beta4
-rw-r--r--php/admin/include/passwd.php21
-rw-r--r--www/admin/administrator/admin.php.in18
-rw-r--r--www/admin/domainmaintainer/domainmaintainer.php.in18
-rw-r--r--www/admin/maintainer/maintainer.php.in18
-rw-r--r--www/admin/user/user.php.in19
5 files changed, 21 insertions, 73 deletions
diff --git a/php/admin/include/passwd.php b/php/admin/include/passwd.php
index 7fa02af..97846f0 100644
--- a/php/admin/include/passwd.php
+++ b/php/admin/include/passwd.php
@@ -1,8 +1,10 @@
<?php
/* -------------------------------------------------------------------
+ Copyright (c) 2004 Klaraelvdalens Datakonsult AB
Copyright (C) 2007 by Intevation GmbH
Author(s):
Sascha Wilde <wilde@intevation.de>
+ Steffen Hansen <steffen@klaralvdalens-datakonsult.se>
This program is free software under the GNU GPL (>=v2)
Read the file COPYING coming with the software for details.
@@ -23,4 +25,23 @@ function gensalt()
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 '';
+}
+
?> \ No newline at end of file
diff --git a/www/admin/administrator/admin.php.in b/www/admin/administrator/admin.php.in
index 1e89b57..65d1bb9 100644
--- a/www/admin/administrator/admin.php.in
+++ b/www/admin/administrator/admin.php.in
@@ -53,24 +53,6 @@ function checkuniquemail( $form, $key, $value ) {
}
}
-// Check that password 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 '';
-}
function fill_form_for_modify( &$form, &$ldap_object ) {
if (is_array($ldap_object['sn'])) $lastname = $ldap_object['sn'][0];
else $lastname = $ldap_object['sn'];
diff --git a/www/admin/domainmaintainer/domainmaintainer.php.in b/www/admin/domainmaintainer/domainmaintainer.php.in
index f03cc30..253b6a2 100644
--- a/www/admin/domainmaintainer/domainmaintainer.php.in
+++ b/www/admin/domainmaintainer/domainmaintainer.php.in
@@ -53,24 +53,6 @@ function checkuniquemail( $form, $key, $value ) {
}
}
-// Check that password 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 '';
-}
function fill_form_for_modify( &$form, &$ldap_object ) {
global $auth;
global $ldap;
diff --git a/www/admin/maintainer/maintainer.php.in b/www/admin/maintainer/maintainer.php.in
index 28cc461..3b82132 100644
--- a/www/admin/maintainer/maintainer.php.in
+++ b/www/admin/maintainer/maintainer.php.in
@@ -53,24 +53,6 @@ function checkuniquemail( $form, $key, $value ) {
}
}
-// Check that password 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 '';
-}
function fill_form_for_modify( &$form, &$ldap_object ) {
global $auth;
if (is_array($ldap_object['sn'])) $lastname = $ldap_object['sn'][0];
diff --git a/www/admin/user/user.php.in b/www/admin/user/user.php.in
index ed7eda6..0e739ef 100644
--- a/www/admin/user/user.php.in
+++ b/www/admin/user/user.php.in
@@ -144,25 +144,6 @@ function checkpolicy( $form, $key, $value ) {
return '';
}
-// Check that password 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 '';
-}
-
// Due to a cyrus imapd bug we can't currently
// support quotas over 4095 MB, see issue1262
function checkquota( $form, $key, $value )