diff --git a/user_account.php b/user_account.php index 0d82d4b..64e4d03 100644 --- a/user_account.php +++ b/user_account.php @@ -90,6 +90,12 @@ case 'save': } } + $x = ($a['link_username_to_email'] == 'yes') ? true : false; + if($x != $username_link) { + $l = $username_link ? 'yes' : 'no'; + mysql_query("UPDATE accounts SET link_username_to_email='$l' WHERE id=$accounts_id"); + } + if($a['username'] != $username) { $save = true; /* Make sure it isn't in use */ @@ -146,7 +152,7 @@ case 'save': $d = ''; $email = $a['email']; - $username_link = 'checked="checked"'; + $username_link = ($a['link_username_to_email'] == 'yes') ? 'checked="checked"' : ''; $username = $email; $ud = 'disabled="disabled"'; @@ -168,7 +174,7 @@ case 'save':