aboutsummaryrefslogtreecommitdiffstats
path: root/profile.php
diff options
context:
space:
mode:
authorz0rglub <z0rglub@piwigo.org>2004-01-22 22:46:46 +0000
committerz0rglub <z0rglub@piwigo.org>2004-01-22 22:46:46 +0000
commit316a3dca3eaeac79de850bce0bdae16415fd00f2 (patch)
treee22d902d20a38e9339a66cedd7e686cc557f516a /profile.php
parent40a11658a9f54d04f94d3febc204d09a86622e3e (diff)
- Php warnings correction
- code refactoring git-svn-id: http://piwigo.org/svn/branches/release-1_3@312 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'profile.php')
-rw-r--r--profile.php25
1 files changed, 9 insertions, 16 deletions
diff --git a/profile.php b/profile.php
index e9fb7dc93..5a8e196a7 100644
--- a/profile.php
+++ b/profile.php
@@ -67,19 +67,12 @@ if ( isset( $_POST['submit'] ) )
}
}
$mail_error = validate_mail_address( $_POST['mail_address'] );
- if ( $mail_error != '' )
- {
- array_push( $errors, $mail_error );
- }
- if ( $_POST['use_new_pwd'] == 1 )
- {
- // password must be the same as its confirmation
- if ( $_POST['password'] != $_POST['passwordConf'] )
- {
- array_push( $errors, $lang['reg_err_pass'] );
- }
- }
-
+ if ( $mail_error != '' ) array_push( $errors, $mail_error );
+ // password must be the same as its confirmation
+ if ( isset( $_POST['use_new_pwd'] )
+ and $_POST['password'] != $_POST['passwordConf'] )
+ array_push( $errors, $lang['reg_err_pass'] );
+
if ( count( $errors ) == 0 )
{
$query = 'UPDATE '.PREFIX_TABLE.'users';
@@ -95,7 +88,7 @@ if ( isset( $_POST['submit'] ) )
$query.= ';';
mysql_query( $query );
- if ( $_POST['use_new_pwd'] == 1 )
+ if ( isset( $_POST['use_new_pwd'] ) )
{
$query = 'UPDATE '.PREFIX_TABLE.'users';
$query.= " SET password = '".md5( $_POST['password'] )."'";
@@ -103,7 +96,7 @@ if ( isset( $_POST['submit'] ) )
$query.= ';';
mysql_query( $query );
}
- if ( $_POST['create_cookie'] == 1 )
+ if ( isset( $_POST['create_cookie'] ) )
{
setcookie( 'id',$page['session_id'],$_POST['cookie_expiration'],
cookie_path() );
@@ -116,7 +109,7 @@ if ( isset( $_POST['submit'] ) )
}
// redirection
$url = 'category.php';
- if ( $_POST['create_cookie'] != 1 ) $url = add_session_id( $url, true );
+ if ( isset( $_POST['create_cookie'] ) ) $url = add_session_id( $url,true );
header( 'Request-URI: '.$url );
header( 'Content-Location: '.$url );
header( 'Location: '.$url );