function set_weibo($phone1, $sinaUid, $sinaNick, $QIYU_ID_USER, $password) { $sql_select = "select * from qiyu_user where user_phone='" . $phone1 . "'"; $rs_select = mysql_query($sql_select); $row_select = mysql_fetch_assoc($rs_select); if ($row_select) { $sqls = "select user_id from qiyu_user where user_password='******'user_salt'])) . "' and user_phone=" . $phone1 . " and user_id=" . $row_select['user_id']; $rss = mysql_query($sqls); $rows = mysql_fetch_assoc($rss); if (!$rows) { return "E"; exit; } //修改这个用户的新浪信息 updateUserSina($row_select['user_id'], $sinaUid, $sinaNick); //修改喜欢 updateUserLike($row_select['user_id'], $QIYU_ID_USER); //修改地址 updateUserADDUser($row_select['user_id'], $QIYU_ID_USER); //删除临时账号 deleteUserByID($QIYU_ID_USER); $QIYU_ID_USER = $row_select['user_id']; $_SESSION['qiyu_uid'] = $QIYU_ID_USER; } else { $pw1 = getRndCode_r(6); //随即生成的密码 $vercode = getRndCode(6); $pw = md5(md5($pw1 . $vercode)); //发送短信 $content = '感谢您使用<?php echo $SHOP_NAME?>网站,您今后登陆<?php echo $SHOP_NAME?>网站的帐号为您的手机号,登陆密码为' . $pw1 . '. 可在网站个人中心页面修改您的密码。稍后您将收到订单进程的短信提醒。'; $sql_update = "update qiyu_user set user_phone='" . $phone1 . "',user_salt='" . $vercode . "',user_password='******',user_account='" . $phone1 . "' where user_id=" . $QIYU_ID_USER; mysql_query($sql_update) or die('插入出错'); sendCode($phone1, $content); } $_SESSION['qiyu_temporary'] = ''; $_SESSION['sinaNick'] = ''; }
<?php session_start(); if (!isset($_SESSION['user_id']) || strcmp($_SESSION['type'], 'admin') != 0 || !isset($_REQUEST['type']) || !isset($_REQUEST['action']) || !isset($_REQUEST['ID'])) { // redirect unauthorized user at once to homepage header('Location: http://localhost/qa/index.php'); die; } require '../database/models.php'; // delete the user if (strcmp($_REQUEST['action'], 'delete') == 0) { deleteUserByID($_REQUEST['ID']); } else { if (!updateUserType($_REQUEST['ID'], $_REQUEST['type'])) { die("Failed to update!"); } } header('Location: http://localhost/qa/admin/index.php'); die;
function api_deleteUserByID($i_id = 0) { return deleteUserByID($i_id); }