function member_log($content, $opera = '', $type = '') { if ($_COOKIE['uid']) { $value = "`uid`='" . (int) $_COOKIE['uid'] . "',"; $value .= "`usertype`='" . (int) $_COOKIE['usertype'] . "',"; $value .= "`content`='" . $content . "',"; $value .= "`opera`='" . $opera . "',"; $value .= "`type`='" . $type . "',"; $value .= "`ip`='" . fun_ip_get() . "',"; $value .= "`ctime`='" . time() . "'"; $this->obj->DB_insert_once("member_log", $value); } }
function synlogin($user) { global $timestamp, $uc_key; list($winduid, $windid, $windpwd) = explode("\t", $this->base->strcode($user, false)); header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"'); require_once "../../config/db.config.php"; require_once "../../app/include/mysql.class.php"; require_once "../../app/include/public.function.php"; require_once "../../data/plus/config.php"; $ip = fun_ip_get(); $time = time(); if ($config[sy_pw_type] == "pw_center") { $db = new mysql($db_config['dbhost'], $db_config['dbuser'], $db_config['dbpass'], $db_config['dbname'], ALL_PS, $db_config['charset']); $user_query = $db->query("SELECT * FROM {$db_config['def']}member WHERE `username`='{$windid}'"); while ($userrs = $db->fetch_array($user_query)) { $userinfo = $userrs; } //判断是否是重名用户 if ($userinfo["uid"] > 0) { if ($userinfo["pw_repeat"] != "1") { //判断账户名密码是否一致 if ($userinfo["password"] == md5($windpwd . $userinfo[salt])) { $db->query("UPDATE {$db_config['def']}member SET `pwuid`='{$winduid}' WHERE `uid`='{$userinfo['uid']}'"); $this->unset_cookie(); $this->add_cookie($userinfo[uid], $userinfo[username], $userinfo[salt], $userinfo[email], $userinfo[password]); } else { //不一致标注为重名用户 $db->query("UPDATE {$db_config['def']}member SET `pw_repeat`='1' WHERE `uid`='{$userinfo['uid']}'"); } } } else { //用户不存在 新建一个用户 $salt = substr(uniqid(rand()), -6); $pass = md5($windpwd . $salt); $db->query("INSERT INTO {$db_config['def']}member SET `username`='{$windid}',`password`='{$pass}',`salt`='{$salt}',`usertype`='1',`reg_ip`='{$ip}',`reg_date`='{$time}',`pwuid`='{$winduid}'"); $uid = $db->insert_id(); $db->query("INSERT INTO {$db_config['def']}resume SET `uid`='" . $uid . "'"); $db->query("INSERT INTO {$db_config['def']}member_statis SET `uid`='" . $uid . "'"); $this->unset_cookie(); $this->add_cookie($winduid, $windid, $salt, "", $pass); } } }
function get_ip() { include LIB_PATH . "public.function.php"; global $config; $ip = fun_ip_get(); if (in_array($ip, @explode("|", $config["sy_bannedip"])) && $config["sy_bannedip"] != '') { echo $config["sy_bannedip_alert"]; die; } }
function newuser($Member, $username, $password, $email, $usertype, $pwuid, $qqid = '') { $salt = substr(uniqid(rand()), -6); $pass = md5($password . $salt); $mdata['username'] = $username; $mdata['password'] = $pass; $mdata['email'] = $email; $mdata['usertype'] = $usertype; $mdata['status'] = $this->config['user_status']; $mdata['salt'] = $salt; $mdata['reg_date'] = time(); $mdata['reg_ip'] = fun_ip_get(); $mdata['pwuid'] = $pwuid; $Member->AddMember($mdata); $this->unset_cookie(); $new_info = $Member->GetMemberOne(array("username" => $username)); $userid = $new_info['uid']; if ($this->config['sy_pw_type'] == "pw_center") { $Member->UpdateMember(array("pwuid" => $pwuid), array("uid" => $userid)); } $this->add_cookie($userid, $username, $salt, $email, $pass, $usertype); if ($usertype == "1") { $table = "member_statis"; $table2 = "resume"; $data['uid'] = $userid; $data2['uid'] = $userid; $data2['email'] = $email; } elseif ($usertype == "2") { $table = "company_statis"; $table2 = "company"; $data = $Member->FetchRatingInfo(array("uid" => $userid)); $data2['uid'] = $userid; $data2['linkmail'] = $email; } if ($qqid) { $Member->UpdateMember(array("qqid" => $qqid), array("uid" => $userid)); } $Member->InsertReg($table, $data); $Member->InsertReg($table2, $data2); return $new_info; }
function show_action() { if (isset($_GET['id'])) { $id = (int) $_GET['id']; $M = $this->MODEL('once'); $M->UpdateOncejob(array("`hits`=`hits`+1"), array('id' => $id)); $o_info = $M->GetOncejobOne(array('id' => $id)); } $ip = fun_ip_get(); $this->yunset("ip", $ip); $this->yunset('o_info', $o_info); $data['once_job'] = $o_info['title']; $data['once_name'] = $o_info['companyname']; $description = $o_info['require']; $data['once_desc'] = $this->GET_content_desc($description); $this->data = $data; $this->seo('once_show'); $this->yun_tpl(array('show')); }
function add_user($p, $l) { $salt = substr(uniqid(rand()), -6); $pass = md5(md5($l['locoy_pwd']) . $salt); $ip = fun_ip_get(); $time = time(); $username = $this->get_username($l); if ($l['locoy_user_status'] == 1) { $satus = 1; } $userid = $this->obj->DB_insert_once("member", "`username`='" . $username . "',`password`='{$pass}',`moblie`='" . $p['info_telphone'] . "',`email`='" . $p['info_email'] . "',`usertype`='1',`status`='{$satus}',`salt`='{$salt}',`reg_date`='{$time}',`reg_ip`='{$ip}',`source`='6'"); $value = "`uid`='{$userid}'"; $this->obj->DB_insert_once("resume", $value); $this->obj->DB_insert_once("member_statis", $value); $this->obj->DB_insert_once("friend_info", "`uid`='" . $userid . "',`nickname`='" . $username . "',`usertype`='1'"); return $userid; }
function qqbind_action() { session_start(); if (($_GET['usertype'] == '1' || $_GET['usertype'] == '2') && $_SESSION['qq']['openid']) { $usertype = $_GET['usertype']; $ip = fun_ip_get(); $time = time(); $salt = substr(uniqid(rand()), -6); $pass = md5(md5($salt) . $salt); $username = $this->checkuser($_SESSION['qq']['nickname'], $_SESSION['qq']['nickname']); $userid = $this->obj->DB_insert_once("member", "`username`='{$username}',`password`='{$pass}',`usertype`='{$usertype}',`status`='1',`salt`='{$salt}',`reg_date`='{$time}',`reg_ip`='{$ip}',`qqid`='" . $_SESSION['qq']['openid'] . "'"); if (!$userid) { $user = $this->obj->DB_select_once("member", "`username`='" . $username . "'", "`uid`,`email`"); $userid = $user['uid']; $email = $user['email']; } $this->unset_cookie(); if ($usertype == "1") { $table = "member_statis"; $table2 = "resume"; $value = "`uid`='{$userid}'"; $value2 = "`uid`='{$userid}',`name`='{$username}'"; } elseif ($usertype == "2") { $table = "company_statis"; $table2 = "company"; $value = "`uid`='{$userid}'," . $this->rating_info(); $value2 = "`uid`='{$userid}',`linktel`='{$moblie}'"; } $this->obj->DB_insert_once($table, $value); $this->obj->DB_insert_once($table2, $value2); $this->obj->DB_insert_once("friend_info", "`uid`='" . $userid . "',`nickname`='{$username}',`usertype`='{$usertype}'"); $this->add_cookie($userid, $username, $salt, $email, $pass, $usertype); unset($_SESSION['qq']); $this->ACT_msg("/member", "登录成功!", 9); } $this->seo("qqlogin"); $this->yun_tpl(array('index')); }
function add_action() { $rating_list = $this->obj->DB_select_all("company_rating", "`category`=1"); if ($_POST['submit']) { extract($_POST); if ($username == "" || strlen($username) < 2 || strlen($username) > 15) { $data['msg'] = "会员名不能为空或不符合要求!"; $data['type'] = '8'; } elseif ($password == "" || strlen($username) < 2 || strlen($username) > 15) { $data['msg'] = "密码不能为空或不符合要求!"; $data['type'] = '8'; } elseif ($email == "") { $data['msg'] = "email不能为空!"; $data['type'] = '8'; } else { if ($this->config['sy_uc_type'] == "uc_center") { $this->uc_open(); $user = uc_get_user($username); } else { $user = $this->obj->DB_select_once("member", "`username`='{$username}' OR `email`='{$email}'"); } if (is_array($user)) { $data['msg'] = "用户名或邮箱已存在!"; $data['type'] = '8'; } else { $ip = fun_ip_get(); $time = time(); if ($this->config['sy_uc_type'] == "uc_center") { $uid = uc_user_register($_POST['username'], $_POST['password'], $_POST['email']); if ($uid < 0) { $this->obj->get_admin_msg("index.php?m=com_member&c=add", "该邮箱已存在!"); } else { list($uid, $username, $email, $password, $salt) = uc_get_user($username); $value = "`username`='{$username}',`password`='{$password}',`email`='{$email}',`usertype`='2',`address`='{$address}',`status`='{$status}',`salt`='{$salt}',`moblie`='{$moblie}',`reg_date`='{$time}',`reg_ip`='{$ip}'"; } } else { $salt = substr(uniqid(rand()), -6); $pass = md5(md5($password) . $salt); $value = "`username`='{$username}',`password`='{$pass}',`email`='{$email}',`usertype`='2',`address`='{$address}',`status`='{$status}',`salt`='{$salt}',`moblie`='{$moblie}',`reg_date`='{$time}',`reg_ip`='{$ip}'"; } $nid = $this->obj->DB_insert_once("member", $value); $new_info = $this->obj->DB_select_once("member", "`username`='{$username}'"); $uid = $new_info['uid']; if ($uid > 0) { $this->obj->DB_insert_once("company", "`uid`='{$uid}',`name`='{$name}',`linktel`='{$moblie}',`linkmail`='{$email}',`address`='{$address}'"); $rat_arr = @explode("+", $rating_name); $value = "`uid`='{$uid}',"; $value .= $this->rating_info($rat_arr[0]); $this->obj->DB_insert_once("company_statis", $value); $this->obj->DB_insert_once("friend_info", "`uid`='{$uid}',`nickname`='{$name}',`usertype`='2'"); $data['msg'] = "会员(ID:" . $uid . ")添加成功"; $data['type'] = '9'; } } } if ($_POST['type']) { echo "<script type='text/javascript'>window.location.href='index.php?m=admin_company_job&c=show&uid=" . $nid . "'</script>"; die; } else { $this->ACT_layer_msg($data['msg'], $data['type'], "index.php?m=admin_company", 2, 1); } } $this->yunset("get_info", $_GET); $this->yunset("rating_list", $rating_list); $this->yuntpl(array('admin/admin_member_comadd')); }
function regsave_action() { $_POST = $this->post_trim($_POST); $usertype = intval($_POST['usertype']); $_POST['username'] = yun_iconv("utf-8", "gbk", $_POST['username']); $_POST['unit_name'] = yun_iconv("utf-8", "gbk", $_POST['unit_name']); $_POST['address'] = yun_iconv("utf-8", "gbk", $_POST['address']); $_POST['linkman'] = yun_iconv("utf-8", "gbk", $_POST['linkman']); $_POST['name'] = yun_iconv("utf-8", "gbk", $_POST['name']); if ($_COOKIE['uid'] != "" && $_COOKIE['username'] != "") { $this->errjson('您已经登录了!'); } if (strpos($this->config['code_web'], '注册会员') !== false) { session_start(); if (md5($_POST['authcode']) != $_SESSION['authcode']) { $this->errjson('验证码错误!'); } } if (!$this->CheckRegUser($_POST['username']) && !$this->CheckRegEmail($_POST['username'])) { $this->errjson('用户名包含特殊字符!'); } $Member = $this->MODEL("userinfo"); if ($_POST['codeid'] == '1') { if ($this->config['reg_username'] == '1' && $usertype == '1') { if (!$this->CheckRegUser($_POST['name']) || $_POST['name'] == "") { $this->errjson('真实姓名格式不规范'); } } if ($this->config['reg_usertel'] == '1' && $usertype == '1' || $this->config['reg_comtel'] == '1' && $usertype == '2') { if (!preg_match("/1[34578]{1}\\d{9}\$/", $_POST['moblie'])) { $this->errjson('手机格式错误!'); } else { $moblieNum = $Member->GetMemberNum(array("moblie" => $_POST['moblie'])); if ($moblieNum > 0) { $this->errjson('手机已存在!'); } } } if ($this->config['reg_useremail'] == '1' && $usertype == '1' || $this->config['reg_comemail'] == '1' && $usertype == '2') { if (!$this->CheckRegEmail($_POST['email']) || $_POST['email'] == "") { $this->errjson('Email格式不规范!'); } } if ($usertype == '2') { if ($this->config['reg_comname'] == '1') { if (!$this->CheckRegUser($_POST['unit_name']) || $_POST['unit_name'] == "") { $this->errjson('请正确填写企业名称!'); } } if ($this->config['reg_comaddress'] == '1') { if (!$this->CheckRegUser($_POST['address']) || $_POST['address'] == "") { $this->errjson('请正确填写企业地址!'); } } if ($this->config['reg_comlink'] == '1') { if (!$this->CheckRegUser($_POST['linkman']) || $_POST['linkman'] == "") { $this->errjson('请正确填写企业联系人'); } } } } elseif ($_POST['codeid'] == '2') { if (!preg_match("/1[34578]{1}\\d{9}\$/", $_POST['moblie'])) { $this->errjson('手机格式错误!'); } if ($this->config['sy_msg_regcode'] == "1") { if ($_POST['moblie_code']) { $regCertMobile = $Member->GetCompanyCert(array("type" => '2', "check" => $_POST['moblie'])); } if ($regCertMobile['check2'] != $_POST['moblie_code'] || $regCertMobile['check2'] == '') { $this->errjson('短信验证码错误!'); } } $_POST['username'] = $_POST['moblie']; } elseif ($_POST['codeid'] == '3') { if (!$this->CheckRegEmail($_POST['email']) || $_POST['email'] == "") { $this->errjson('Email格式不规范!'); } $_POST['username'] = $_POST['email']; } if ($_POST['username'] != "") { $nid = $Member->GetMemberNum(array("username" => $_POST['username'])); if ($nid) { $this->errjson('账户名已存在!'); } else { if ($_POST['usertype'] == '1') { $satus = 1; } elseif ($_POST['usertype'] == '2') { $satus = $this->config['com_status']; } if ($this->config['sy_uc_type'] == "uc_center") { $this->uc_open(); $uid = uc_user_register($_POST['username'], $_POST['password'], $_POST['email']); if ($uid <= 0) { $this->errjson('该邮箱已存在!'); } else { list($uid, $username, $password, $email, $salt) = uc_user_login($_POST['username'], $_POST['password']); $pass = md5(md5($_POST['password']) . $salt); $ucsynlogin = uc_user_synlogin($uid); } } elseif ($this->config['sy_pw_type'] == "pw_center") { include APP_PATH . "/api/pw_api/pw_client_class_phpapp.php"; $password = $_POST['password']; $email = $_POST['email']; $pw = new PwClientAPI($username, $password, $email); $pwuid = $pw->register(); $salt = substr(uniqid(rand()), -6); $pass = md5(md5($password) . $salt); } else { $salt = substr(uniqid(rand()), -6); $pass = md5(md5($_POST['password']) . $salt); } $ip = fun_ip_get(); $data['username'] = $_POST['username']; $data['password'] = $pass; $data['usertype'] = $_POST['usertype']; $data['email'] = $_POST['email']; $data['moblie'] = $_POST['moblie']; $data['status'] = $satus; $data['salt'] = $salt; $data['reg_date'] = time(); $data['reg_ip'] = $ip; $data['qqid'] = $_SESSION['qq']['openid']; $data['sinaid'] = $_SESSION['sina']['openid']; $data['wxid'] = $_SESSION['wx']['openid']; $data['regcode'] = (int) $_COOKIE['regcode']; $userid = $Member->AddMember($data); if (!$userid) { $user_id = $Member->GetMemberOne(array("username" => $_POST['username']), array("field" => "uid")); $userid = $user_id['uid']; } if ($userid) { $this->unset_cookie(); if ($this->config['sy_pw_type'] == "pw_center") { $Member->UpdateMember(array("pwuid" => $pwuid), array("uid" => $userid)); } if ($_POST['usertype'] == "1") { $table = "member_statis"; $table2 = "resume"; $data1 = array("uid" => $userid); $data2 = array("uid" => $userid, "email" => $_POST['email'], "telphone" => $_POST['moblie'], "name" => $_POST['name']); } elseif ($_POST['usertype'] == "2") { $table = "company_statis"; $table2 = "company"; $data1 = $Member->FetchRatingInfo(array("uid" => $userid)); $data2['uid'] = $userid; $data2['linkmail'] = $_POST['email']; $data2['name'] = $_POST['unit_name']; $data2['linktel'] = $_POST['moblie']; $data2['address'] = $_POST['address']; $data2['linkman'] = $_POST['linkman']; if ($this->config['com_status'] == 0) { $data2['r_status'] = 2; } } if ($_POST['codeid'] == '2' && $this->config['sy_msg_regcode'] == "1") { $Member->UpdateMember(array("moblie" => ''), array("moblie" => trim($_POST['moblie']))); if ($usertype == '1') { $Member->UpdateResume(array("telphone" => "", "moblie_status" => "0"), array("telphone" => $_POST['moblie'])); $data2['moblie_status'] = "1"; } elseif ($usertype == '2') { $Member->UpdateCompany(array("linktel" => "", "moblie_status" => "0"), array("linktel" => $_POST['moblie'])); $data2['moblie_status'] = "1"; } } $Member->InsertReg($table, $data1); $Member->InsertReg($table2, $data2); $Friend = $this->MODEL("friend"); $Friend->SaveFriendInfo(array("uid" => $userid, "nickname" => $_POST['username'], "usertype" => $_POST['usertype'])); if ($_COOKIE['regcode'] != "") { if ($this->config['integral_invite_reg_type'] == "1") { $auto = true; } else { $auto = false; } $Member->company_invtal((int) $_COOKIE['regcode'], $this->config['integral_invite_reg'], $auto, "邀请注册", true, 2, 'integral', 23); } if ($this->config['integral_reg'] > 0) { $Member->company_invtal($userid, $this->config['integral_reg'], true, "注册赠送", true, 2, 'integral', 23); } if ($_POST['usertype'] == "1") { if ($this->config['user_status'] == "1" && $_POST['email']) { $randstr = rand(10000000, 99999999); $base = base64_encode($userid . "|" . $randstr . "|" . $this->config['coding']); $data_cert['uid'] = $userid; $data_cert['type'] = "cert"; $data_cert['email'] = $_POST['email']; $data_cert['url'] = "<a href='" . $this->config['sy_weburl'] . "/index.php?m=qqconnect&c=mcert&id=" . $base . "'>点击认证</a>"; $data_cert['date'] = date("Y-m-d"); if ($this->config['sy_smtpserver'] != "" && $this->config['sy_smtpemail'] != "" && $this->config['sy_smtpuser'] != "") { $this->send_msg_email($data_cert); $this->errjson('帐号激活邮件已发送到您邮箱,请先激活!', 7); } else { $this->errjson('还没有配置邮箱,请联系管理员!'); } } else { $Member->UpdateMember(array("login_date" => time()), array("uid" => $userid)); $this->add_cookie($userid, $_POST['username'], $salt, $_POST['email'], $pass, $usertype); $_POST['uid'] = $userid; $this->regemail($_POST); $this->errjson('', 1); } } elseif ($usertype == "2") { $_POST['uid'] = $userid; $this->regemail($_POST); if ($this->config['com_status'] != "1") { $this->errjson('注册成功,请等待管理员审核!', 7); } else { $Member->UpdateMember(array("login_date" => time()), array("uid" => $userid)); $this->add_cookie($userid, $_POST['username'], $salt, $_POST['email'], $pass, $usertype); $this->errjson('', 1); } } } else { $this->errjson('注册失败!', 8); } } } else { if ($_POST['username'] == '') { $this->errjson('用户名不能为空!', 8); } } }
function synlogin($get, $post) { if (!API_SYNLOGIN) { return API_RETURN_FORBIDDEN; } header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"'); require_once "../../data/db.config.php"; require_once "../../include/mysql.class.php"; require_once "../../include/public.function.php"; require_once "../../plus/config.php"; $ip = fun_ip_get(); $time = time(); if ($config[sy_uc_type] == "uc_center") { $db = new mysql($db_config['dbhost'], $db_config['dbuser'], $db_config['dbpass'], $db_config['dbname'], ALL_PS, $db_config['charset']); $user_query = $db->query("SELECT * FROM {$db_config['def']}member WHERE `username`='{$get['username']}'"); while ($userrs = $db->fetch_array($user_query)) { $userinfo[] = $userrs; } if ($config[sy_onedomain] != "") { $weburl = str_replace("http://www", "", $config[sy_onedomain]); } elseif ($config[sy_indexdomain] != "") { $weburl = str_replace("http://www", "", $config[sy_indexdomain]); } else { $weburl = str_replace("http://www", "", $config[sy_weburl]); } if (is_array($userinfo)) { $uid = $userinfo[0][uid]; $certokquery = $db->query("SELECT * FROM {$db_config['def']}company_cert where `uid`='{$uid} ' and `type`='1'"); while ($certrow = $db->fetch_array($certokquery)) { $certstatus = $certrow[status]; } if ($userinfo[0][username] == $get[username] && $userinfo[0][name_repeat] != "1") { $this->unset_cookie($weburl); if ($userinfo[0][password] == $get[password]) { if ($certstatus == "1" || $config[user_status] != "1" || $userinfo[0][usertype] == "2") { $this->add_cookie($weburl, $userinfo[0][uid], $userinfo[0][username], $userinfo[0][salt], $userinfo[0][email], $userinfo[0][password], $userinfo[0][usertype]); } } else { $db->query("UPDATE {$db_config['def']}member SET `password`='{$get['password']}',`email`='{$get['email']}',`salt`='{$get['salt']}' WHERE `uid`='{$uid}'"); if ($certstatus == "1" || $config[user_status] != "1") { $this->add_cookie($weburl, $userinfo[0][uid], $userinfo[0][username], $get[salt], $get[email], $get[password], $userinfo[0][usertype]); } } $db->query("UPDATE {$db_config['def']}member SET `login_ip`='{$ip}',`login_date`='{$time}',`login_hits`=`login_hits`+1 where `uid`='{$uid}'"); } } else { $db->query("INSERT INTO {$db_config['def']}member SET `username`='{$get['username']}',`password`='{$get['password']}',`email`='{$get['email']}',`salt`='{$get['salt']}',`usertype`='1',`reg_ip`='{$ip}',`reg_date`='{$time}'"); $uid = $db->insert_id(); $db->query("INSERT INTO {$db_config['def']}resume SET `uid`='" . $uid . "'"); $db->query("INSERT INTO {$db_config['def']}member_statis SET `uid`='" . $uid . "'"); $randstr = rand(10000000, 99999999); $db->query("INSERT INTO {$db_config['def']}company_cert SET `status`='0',`step`='1',`check`='{$get['email']}',`check2`='{$randstr}',`ctime`='" . mktime() . "',`type`='1',`uid`='" . $uid . "'"); $this->unset_cookie($weburl); if ($config[user_status] != "1") { $this->add_cookie($weburl, $uid, $get[username], $get[salt], $get[email], $get[password]); } } } }
function clickHits_action() { if ($_GET['id']) { $M = $this->MODEL("index"); $id = (int) $_GET['id']; $ad = $M->GetAdOne(array("id" => $id), array("field" => "pic_src,id")); if (!empty($ad)) { $ip = fun_ip_get(); if ($this->config['sy_adclick'] > "0") { $num = $M->GetAdclickNum("`ip`='" . $ip . "' and `aid`='" . $id . "' and `addtime`>'" . strtotime('-' . $this->config['sy_adclick'] . ' hour') . "'"); if ($num > "0") { header('Location: ' . $ad['pic_src']); } } $data['aid'] = $id; $data['uid'] = $this->uid; $data['ip'] = $ip; $data['addtime'] = time(); $nid = $M->InsertAdclick($data); if ($nid) { $M->AddAdHits($id); } if (!$ad['pic_src']) { $ad['pic_src'] = $this->config['sy_weburl']; } header('Location: ' . $ad['pic_src']); } } }
function get_ip() { global $config; $ip = fun_ip_get(); if (in_array($ip, @explode("|", $config["sy_bannedip"])) && $config["sy_bannedip"] != '') { echo $config["sy_bannedip_alert"]; die; } }
function add_user($p, $l) { $salt = substr(uniqid(rand()), -6); $pass = md5(md5($l['locoy_pwd']) . $salt); $ip = fun_ip_get(); $time = time(); $username = $this->get_username($l); if ($l['locoy_user_status'] == 1) { $satus = 1; } $userid = $this->obj->DB_insert_once("member", "`username`='" . $username . "',`password`='{$pass}',`moblie`='" . $p['moblie'] . "',`email`='" . $p['email'] . "',`usertype`='2',`status`='{$satus}',`salt`='{$salt}',`reg_date`='{$time}',`reg_ip`='{$ip}',`source`='6'"); $value = "`uid`='{$userid}'," . $this->rating_info($l['locoy_rating']); $value2 = "`uid`='{$userid}',`linkmail`='" . $p['email'] . "',`name`='" . $p['com_name'] . "',`linktel`='" . $p['moblie'] . "',`address`='" . $_POST['address'] . "'"; $this->obj->DB_insert_once("company_statis", $value); $this->obj->DB_insert_once("company", $value2); $this->obj->DB_insert_once("friend_info", "`uid`='" . $userid . "',`nickname`='" . $username . "',`usertype`='2'"); return $userid; }
function save_action() { if ($_POST['submit']) { extract($_POST); if ($username == "" || strlen($username) < 2 || strlen($username) > 15) { $msg = "会员名不能为空或不符合要求!"; $msg_type = 8; } elseif ($password == "" || strlen($username) < 2 || strlen($username) > 15) { $msg = "密码不能为空或不符合要求!"; $msg_type = 8; } else { if ($this->config['sy_uc_type'] == "uc_center") { $this->uc_open(); $user = uc_get_user($username); } else { $user = $this->obj->DB_select_once("member", "`username`='{$username}'"); } if (is_array($user)) { $msg = "该会员已经存在!"; $msg_type = 8; } else { $time = time(); $ip = fun_ip_get(); if ($this->config['sy_uc_type'] == "uc_center") { $uid = uc_user_register($_POST['username'], $_POST['password'], $_POST['email']); if ($uid < 0) { $msg = "uc_center已存在该邮箱!"; $msg_type = 8; } else { list($uid, $username, $email, $password, $salt) = uc_get_user($username); $value = "`username`='{$username}',`password`='{$password}',`email`='{$email}',`usertype`='1',`salt`='{$salt}',`moblie`='{$moblie}',`reg_date`='{$time}',`reg_ip`='{$ip}'"; } } else { $salt = substr(uniqid(rand()), -6); $pass = md5(md5($password) . $salt); $value = "`username`='{$username}',`password`='{$pass}',`email`='{$email}',`usertype`='1',`status`='{$satus}',`salt`='{$salt}',`moblie`='{$moblie}',`reg_date`='{$time}',`reg_ip`='{$ip}'"; } $nid = $this->obj->DB_insert_once("member", $value); if ($nid > 0) { $this->obj->DB_insert_once("resume", "`uid`='{$nid}',`email`='{$email}',`telphone`='{$moblie}'"); $this->obj->DB_insert_once("member_statis", "`uid`='{$nid}'"); $this->obj->DB_insert_once("friend_info", "`uid`='{$nid}',`nickname`='{$name}',`usertype`='1'"); $msg = "个人会员(ID:" . $nid . ")添加成功"; $msg_type = 9; } } } $this->ACT_layer_msg($msg, $msg_type, "index.php?m=user_member&c=add", 2, 1); } }
function addresume_action() { if ($_POST['next']) { if ($_POST['uid']) { $this->obj->update_once('resume', array('name' => trim($_POST['resume_name']), 'sex' => $_POST['sex'], 'birthday' => $_POST['birthday'], 'living' => $_POST['living'], 'edu' => $_POST['edu'], 'exp' => $_POST['exp'], 'telphone' => trim($_POST['moblie']), 'email' => trim($_POST['email']), 'description' => trim($_POST['description'])), array('uid' => $_POST['uid'])); $this->obj->update_once('member', array('email' => trim($_POST['email']), 'moblie' => trim($_POST['moblie'])), array('uid' => $_POST['uid'])); echo "<script type='text/javascript'>window.location.href='index.php?m=admin_resume&c=saveresume&uid=" . $_POST['uid'] . "'</script>"; die; } else { if ($this->config["sy_uc_type"] == "uc_center") { $this->uc_open(); $user = uc_get_user($_POST['username']); } else { $user = $this->obj->DB_select_once("member", "`username`='" . $_POST['username'] . "'", "`uid`"); } $password = trim($_POST['password']); if (is_array($user)) { $this->ACT_layer_msg("该会员已经存在!", 8, "index.php?m=user_member&c=add", 2); die; } else { $time = time(); $ip = fun_ip_get(); if ($this->config["sy_uc_type"] == "uc_center") { $uid = uc_user_register($_POST['username'], $password, $_POST['email']); if ($uid < 0) { $this->obj->get_admin_msg("index.php?m=com_member&c=add", "该邮箱已存在!"); } else { list($uid, $username, $email, $password, $salt) = uc_get_user($_POST['username'], $password); $value = "`username`='" . $_POST['username'] . "',`password`='{$password}',`email`='" . $_POST['email'] . "',`usertype`='1',`salt`='{$salt}',`moblie`='" . $_POST['moblie'] . "',`reg_date`='{$time}',`reg_ip`='{$ip}'"; } } else { $salt = substr(uniqid(rand()), -6); $pass = md5(md5($password) . $salt); $value = "`username`='" . $_POST['username'] . "',`password`='{$pass}',`email`='" . $_POST['email'] . "',`usertype`='1',`status`='1',`salt`='{$salt}',`moblie`='" . $_POST['moblie'] . "',`reg_date`='{$time}',`reg_ip`='{$ip}'"; } $nid = $this->obj->DB_insert_once("member", $value); if ($nid > 0) { $this->obj->DB_insert_once("resume", "`uid`='{$nid}',`email`='" . $_POST['email'] . "',`telphone`='" . $_POST['moblie'] . "',`name`='" . $_POST['resume_name'] . "',`description`='" . $_POST['description'] . "',`sex`='" . $_POST['sex'] . "',`living`='" . $_POST['living'] . "',`exp`='" . $_POST['exp'] . "',`edu`='" . $_POST['edu'] . "',`birthday`='" . $_POST['birthday'] . "'"); $this->obj->DB_insert_once("member_statis", "`uid`='{$nid}'"); $this->obj->DB_insert_once("friend_info", "`uid`='{$nid}',`nickname`='" . $_POST['resume_name'] . "',`usertype`='1'"); echo "<script type='text/javascript'>window.location.href='index.php?m=admin_resume&c=saveresume&uid=" . $nid . "'</script>"; die; } else { $this->ACT_layer_msg("会员添加失败,请重试!", 8, "index.php?m=user_member&c=add", 2); die; } } } } else { $this->yunset($this->MODEL('cache')->GetCache(array('user'))); $row = $this->obj->DB_select_once("resume", "`uid`='" . $_GET['uid'] . "'"); $this->yunset("row", $row); $this->yuntpl(array('admin/admin_addresume')); } }