Save the username link

This commit is contained in:
dave 2010-07-14 19:02:05 +00:00
parent 80537e75f2
commit c81bc0c7da

View File

@ -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) { if($a['username'] != $username) {
$save = true; $save = true;
/* Make sure it isn't in use */ /* Make sure it isn't in use */
@ -146,7 +152,7 @@ case 'save':
$d = ''; $d = '';
$email = $a['email']; $email = $a['email'];
$username_link = 'checked="checked"'; $username_link = ($a['link_username_to_email'] == 'yes') ? 'checked="checked"' : '';
$username = $email; $username = $email;
$ud = 'disabled="disabled"'; $ud = 'disabled="disabled"';
@ -168,7 +174,7 @@ case 'save':
</tr><tr> </tr><tr>
<td><?=i18n('Username')?>:</td> <td><?=i18n('Username')?>:</td>
<td> <input <?=$ud?> <?=$d?> id="username" name=username type="text" size="20" value="<?=$username?>"><br /> <td> <input <?=$ud?> <?=$d?> id="username" name=username type="text" size="20" value="<?=$username?>"><br />
<input id="username_link" <?=$username_yes?> <?=$d?> type="checkbox" name="username_link" value="yes" /> <input id="username_link" <?=$username_link?> <?=$d?> type="checkbox" name="username_link" value="yes" />
<?=i18n('Use the email address as the login username')?><br /> <?=i18n('Use the email address as the login username')?><br />
</td> </td>
@ -196,10 +202,6 @@ case 'save':
<br /> <br />
<script type="text/javascript"> <script type="text/javascript">
$.validator.setDefaults({
});
var username_valid = true; var username_valid = true;
var username_checking = true; var username_checking = true;
var check_username_time = false; var check_username_time = false;