<?php require_once dirname(dirname(__FILE__)) . '/app.php'; need_login(); if ($_POST) { $update = array('email' => $_POST['email'], 'username' => $_POST['username'], 'realname' => $_POST['realname'], 'zipcode' => $_POST['zipcode'], 'address' => $_POST['address'], 'mobile' => $_POST['mobile'], 'gender' => $_POST['gender'], 'city_id' => $_POST['city_id'], 'qq' => $_POST['qq'], 'city_id' => $_POST['city_id']); $avatar = upload_image('upload_image', $login_user['avatar'], 'user'); $update['avatar'] = $avatar; if ($_POST['password'] == $_POST['password2'] && $_POST['password']) { $update['password'] = $_POST['password']; } if (ZUser::Modify($login_user['id'], $update)) { Session::Set('notice', '修改账户设置成功'); Utility::Redirect(WEB_ROOT . '/account/settings.php '); } else { Session::Set('error', '修改账户设置失败'); } } $readonly['email'] = defined('UC_API') ? '' : 'readonly'; $readonly['username'] = defined('UC_API') ? 'readonly' : ''; include template('account_settings');
$encrypt_pass = ZUser::GenPassword($_POST['password']); $update = array('sns' => $sns); $sns_bind = Table::Fetch('user', $email, 'email'); if (!$sns_bind) { Session::Set('error', '邮箱输入不正确'); Utility::Redirect(WEB_ROOT . '/account/qq_bind.php'); } if ($sns_bind['password'] != $encrypt_pass) { Session::Set('error', '密码输入不正确'); Utility::Redirect(WEB_ROOT . '/account/qq_bind.php'); } if ($sns_bind['sns']) { Session::Set('error', '绑定失败,Email已绑定'); Utility::Redirect(WEB_ROOT . '/account/qq_bind.php'); } if (ZUser::Modify($sns_bind['id'], $update)) { Session::Set('user_id', $sns_bind['id']); Utility::Redirect(get_loginpage(WEB_ROOT . '/index.php')); } } else { $mobile = $_POST['mobile']; $email = $_POST['email']; $have_email = Table::Fetch('user', $email, 'email'); if ($have_email) { Session::Set('error', '该邮箱已被注册'); Utility::Redirect(WEB_ROOT . '/account/qq_bind.php'); } $username = $ms['nick']; $have_user = Table::Fetch('user', $username, 'username'); while (!empty($have_user)) { $username = $ms['nick'] . '_' . rand(100, 999);
<?php require_once dirname(dirname(__FILE__)) . '/app.php'; if (is_post()) { $user = Table::Fetch('user', $_POST['user_id']); if ($user['remcode'] == $_POST['verifycode'] && !empty($_POST['verifycode'])) { if (isset($_SESSION['user_id'])) { unset($_SESSION['user_id']); ZLogin::NoRemember(); $login_user = $login_user_id = $login_manager = $login_leader = null; } if ($_POST['password'] == $_POST['password2']) { ZUser::Modify($user['id'], array('password' => $_POST['password'], 'remcode' => '')); redirect(WEB_ROOT . '/account/reset.php?code=ok'); } Session::Set('error', '两次输入的密码不匹配,请重新设置'); } else { Session::Set('error', '验证码错误'); } } redirect(WEB_ROOT . '/account/repassmobile.php');
<?php require_once dirname(dirname(__FILE__)) . '/app.php'; if ($_POST) { $userid = $_POST['userid']; $update['mobile'] = $_POST['mobile']; $user = Table::Fetch('user', $userid, 'id'); if ($_POST['verifycode'] && $_POST['verifycode'] == $user['mobilecode']) { $update['mobilecode'] = 'yes'; } ZUser::Modify($user['id'], $update); $user = Table::FetchForce('user', $userid); if ($user['mobilecode'] == 'yes') { // Session::Set('notice', '手机验证成功'); ZLogin::Login($user['id']); include template('account_bindmobilesuccess'); } else { Session::Set('error', '手机验证失败'); include template('account_signmobile'); } }