Файл: monst/core/pag/setting/account.php
Строк: 72
<?
if ( !empty($_POST['save']) ) {
$new_pass = null_html($_POST['new_pass']);
$tel = null_html($_POST['tel']);
$email = null_html($_POST['email']);
$err = '';
if ( strlen($tel) > 20 ) {
$err .= $lang['setting.php']['account']['error']['long_tel'].'<br/>';
}
if ( !is_numeric($tel) ) {
$err .= $lang['setting.php']['account']['error']['bad_tel'].'<br/>';
}
if ( strlen($email) > 50 ) {
$err .= $lang['setting.php']['account']['error']['long_email'].'<br/>';
}
if ( @!ereg('@', $email) ) {
$err .= $lang['setting.php']['account']['error']['bad_email'].'<br/>';
}
if ( $err != '' ) {
?>
<div class='error_box'>
<?=$err?>
</div>
<?
} else {
$_users -> update(
[
'id' => $user['id']
],
[
'$set' => [
'tel' => $tel,
'email' => $email
]
]
);
if ( !empty($new_pass) ) {
$_users -> update(
[
'id' => $user['id']
],
[
'$set' => [
'pass' => md5($new_pass),
]
]
);
Cook_set('pass', md5($new_pass));
}
g('/setting/account?save_ok');
}
}
if ( isset($_GET['save_ok']) ) {
?>
<div class='ok_box'>
<?=$lang['setting.php']['account']['save_ok']?><br/>
</div>
<?
}
?>
<div class='padding'>
<form method='post' action='/setting/account'>
<input type='hidden' name='save' value='1'/>
<?=$lang['setting.php']['account']['new_pass']?><br/>
<span style='color: indianred;'><?=$lang['setting.php']['account']['new_pass_desc']?></span><br/>
<input name='new_pass' value=""/><br/>
<?=$lang['setting.php']['account']['tel']?><br/>
+<input name='tel' value='<?=$user['tel']?>'/><br/>
<?=$lang['setting.php']['account']['email']?><br/>
<input name='email' value='<?=$user['email']?>'/><br/>
<div style='text-align: center;'>
<input type='submit' value='<?=$lang['setting.php']['account']['submit']['save']?>'/>
</div>
</form>
</div>
<br/>
<div>
<a href='/setting'><?=$lang['setting.php']['back']?></a>
</div>
<?