Account Settings'; if ($err != '') $pg .= "$err

"; $pg .= ''; $pg .= ''; $pg .= ''; $pg .= ''; $pg .= '
'; $pg .= makeForm('settings'); $pg .= ''; $pg .= ''; $pg .= ''; $pg .= ''; $pg .= ''; $pg .= '
'; $pg .= 'To change your email, enter a new email address and your password'; $pg .= '
'; $pg .= 'EMail:'; $pg .= ''; $pg .= ""; $pg .= '
'; $pg .= 'Password:'; $pg .= ''; $pg .= ''; $pg .= '
'; $pg .= 'Change: '; $pg .= '
'; $pg .= '
'; if (!isset($data['info']['u_multiaddr'])) { $pg .= makeForm('settings'); $pg .= ''; $pg .= ''; $pg .= ''; $pg .= ''; $pg .= ''; $pg .= '
'; $pg .= 'To change your payout address, enter a new address and your password'; $pg .= '
'; $pg .= 'BTC Address:'; $pg .= ''; $pg .= ""; $pg .= '
'; $pg .= 'Password:'; $pg .= ''; $pg .= ''; $pg .= '
'; $pg .= 'Change: '; $pg .= '
'; $pg .= '
'; } $pg .= makeForm('settings'); $pg .= ''; $pg .= ''; $pg .= ''; $pg .= ''; $pg .= ''; $pg .= ''; $pg .= '
'; $pg .= 'To change your password, enter your old password and new password twice'; $pg .= '
'; $pg .= 'Old Password:'; $pg .= ''; $pg .= ""; $pg .= '
'; $pg .= 'New Password:'; $pg .= ''; $pg .= ''; $pg .= '
'; $pg .= 'New Password again:'; $pg .= ''; $pg .= ''; $pg .= '
'; $pg .= 'Change: '; $pg .= '
'; $pg .= '
'; return $pg; } # function dosettings($data, $user) { $err = ''; $chg = getparam('Change', false); $check = false; switch ($chg) { case 'EMail': $email = getparam('email', false); $pass = getparam('pass', false); $ans = userSettings($user, $email, null, $pass); $check = true; break; case 'Address': if (!isset($data['info']['u_multiaddr'])) { $addr = getparam('baddr', false); $addrarr = array(array('addr' => $addr)); $pass = getparam('pass', false); $ans = userSettings($user, null, $addrarr, $pass); $check = true; } break; case 'Password': $oldpass = getparam('oldpass', false); $pass1 = getparam('pass1', false); $pass2 = getparam('pass2', false); if (!safepass($pass1)) { $err = "Password is unsafe - requires 6 or more characters, including
" . "at least one of each uppercase, lowercase and digits, but not Tab"; } elseif ($pass1 != $pass2) $err = "Passwords don't match"; else { $ans = setPass($user, $oldpass, $pass1); $err = 'Password changed'; $check = true; } break; } if ($check === true) if ($ans['STATUS'] != 'ok') { $err = $ans['STATUS']; if ($ans['ERROR'] != '') $err .= ': '.$ans['ERROR']; } $ans = userSettings($user); if ($ans['STATUS'] != 'ok') dbdown(); // Should be no other reason? if (isset($ans['email'])) $email = $ans['email']; else $email = ''; // Use the first one - updating will expire all others if (isset($ans['rows']) and $ans['rows'] > 0) $addr = $ans['addr:0']; else $addr = ''; $pg = settings($data, $user, $email, $addr, $err); return $pg; } # function show_settings($info, $page, $menu, $name, $user) { gopage($info, NULL, 'dosettings', $page, $menu, $name, $user); } # ?>