[Bug 1041] [REV 4008] Merged form trunk to branch

Coding guidelines improvement

git-svn-id: http://piwigo.org/svn/branches/2.0@4009 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
Eric
2009-10-09 15:58:56 +00:00
parent 57225129b2
commit ce511ebf6b
+48 -48
View File
@@ -187,59 +187,59 @@ $page['direction_items'] = array(
// This feature is discussed on Piwigo's english forum // This feature is discussed on Piwigo's english forum
if ($conf['double_password_type_in_admin'] == true) if ($conf['double_password_type_in_admin'] == true)
{ {
if (isset($_POST['submit_add'])) if (isset($_POST['submit_add']))
{ {
if(empty($_POST['password'])) if(empty($_POST['password']))
{ {
array_push($page['errors'], l10n('Password is missing')); array_push($page['errors'], l10n('Password is missing'));
} }
else if(empty($_POST['password_conf'])) else if(empty($_POST['password_conf']))
{ {
array_push($page['errors'], l10n('Password confirmation is missing')); array_push($page['errors'], l10n('Password confirmation is missing'));
} }
else if(empty($_POST['email'])) else if(empty($_POST['email']))
{ {
array_push($page['errors'], l10n('Email address is missing')); array_push($page['errors'], l10n('Email address is missing'));
} }
else if ($_POST['password'] != $_POST['password_conf']) else if ($_POST['password'] != $_POST['password_conf'])
{ {
array_push($page['errors'], l10n('Password confirmation error')); array_push($page['errors'], l10n('Password confirmation error'));
} }
else else
{ {
$page['errors'] = register_user( $page['errors'] = register_user(
$_POST['login'], $_POST['password'], $_POST['email'], false); $_POST['login'], $_POST['password'], $_POST['email'], false);
if (count($page['errors']) == 0) if (count($page['errors']) == 0)
{ {
array_push( array_push(
$page['infos'], $page['infos'],
sprintf( sprintf(
l10n('user "%s" added'), l10n('user "%s" added'),
$_POST['login'] $_POST['login']
) )
); );
} }
} }
} }
} }
else if ($conf['double_password_type_in_admin'] == false) else if ($conf['double_password_type_in_admin'] == false)
{ {
if (isset($_POST['submit_add'])) if (isset($_POST['submit_add']))
{ {
$page['errors'] = register_user( $page['errors'] = register_user(
$_POST['login'], $_POST['password'], $_POST['email'], false); $_POST['login'], $_POST['password'], $_POST['email'], false);
if (count($page['errors']) == 0) if (count($page['errors']) == 0)
{ {
array_push( array_push(
$page['infos'], $page['infos'],
sprintf( sprintf(
l10n('user "%s" added'), l10n('user "%s" added'),
$_POST['login'] $_POST['login']
) )
); );
} }
} }
} }