diff options
author | Eric <eric@piwigo.org> | 2009-09-28 19:22:59 +0000 |
---|---|---|
committer | Eric <eric@piwigo.org> | 2009-09-28 19:22:59 +0000 |
commit | d67b2765190159eb2ff59a0b891d4704ca8b23e6 (patch) | |
tree | 025c33bcec34654fb3149a00e0276eda617b46aa /admin/user_list.php | |
parent | eba92234e863eb551c0001c83bc0e92819099656 (diff) |
[Bug 1041] Switchable double/single password input with text or password type in admin using new $conf
git-svn-id: http://piwigo.org/svn/trunk@3935 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | admin/user_list.php | 68 |
1 files changed, 49 insertions, 19 deletions
diff --git a/admin/user_list.php b/admin/user_list.php index c7e36ae0b..daac95a8e 100644 --- a/admin/user_list.php +++ b/admin/user_list.php @@ -183,30 +183,34 @@ $page['direction_items'] = array( // | add a user | // +-----------------------------------------------------------------------+ -if (isset($_POST['submit_add'])) +// Check for config_default var - If True : Using double password type else single password type +// This feature is discussed on Piwigo's english forum +if ($conf['double_password_type_in_admin'] == true) { - if(empty($_POST['password'])) - { - array_push($page['errors'], l10n('Password is missing')); - } - else if(empty($_POST['password_conf'])) - { - array_push($page['errors'], l10n('Password confirmation is missing')); - } - else if(empty($_POST['email'])) - { - array_push($page['errors'], l10n('Email address is missing')); - } - else if ($_POST['password'] != $_POST['password_conf']) - { - array_push($page['errors'], l10n('Password confirmation error')); - } - else + if (isset($_POST['submit_add'])) { + if(empty($_POST['password'])) + { + array_push($page['errors'], l10n('Password is missing')); + } + else if(empty($_POST['password_conf'])) + { + array_push($page['errors'], l10n('Password confirmation is missing')); + } + else if(empty($_POST['email'])) + { + array_push($page['errors'], l10n('Email address is missing')); + } + else if ($_POST['password'] != $_POST['password_conf']) + { + array_push($page['errors'], l10n('Password confirmation error')); + } + else + { $page['errors'] = register_user( $_POST['login'], $_POST['password'], $_POST['email'], false); - if (count($page['errors']) == 0) + if (count($page['errors']) == 0) { array_push( $page['infos'], @@ -216,8 +220,28 @@ if (isset($_POST['submit_add'])) ) ); } + } } } +else if ($conf['double_password_type_in_admin'] == false) +{ + if (isset($_POST['submit_add'])) + { + $page['errors'] = register_user( + $_POST['login'], $_POST['password'], $_POST['email'], false); + + if (count($page['errors']) == 0) + { + array_push( + $page['infos'], + sprintf( + l10n('user "%s" added'), + $_POST['login'] + ) + ); + } + } +} // +-----------------------------------------------------------------------+ // | user list | @@ -505,6 +529,12 @@ if ($conf['allow_adviser']) $template->assign('adviser', true); } +// Display or Hide double password type +if ($conf['double_password_type_in_admin']) +{ + $template->assign('Double_Password', true); +} + // Filter status options $status_options[-1] = '------------'; foreach (get_enums(USER_INFOS_TABLE, 'status') as $status) |