function DoLogin() { if ($this->Config['seccode_enable'] == 1 && $this->Config['seccode_login']) { if (!ckseccode(@$_POST['seccode'])) { $this->Messager("验证码输入错误", -1); } } elseif ($this->Config['seccode_enable'] > 1 && $this->Config['seccode_login'] && $this->yxm_title && $this->Config['seccode_pub_key'] && $this->Config['seccode_pri_key']) { $YinXiangMa_response = jlogic('seccode')->CheckYXM(@$_POST['YinXiangMa_challenge'], @$_POST['YXM_level'][0], @$_POST['YXM_input_result']); if ($YinXiangMa_response != "true") { $this->Messager("验证码输入错误", -1); } } if ($this->Username == "" || $this->Password == "") { $this->Messager("无法登录,用户名或密码不能为空", -1); } $username = $this->Username; $password = $this->Password; $referer = jget('referer'); if (!$referer) { $referer = jsg_getcookie('referer'); } $rets = jsg_member_login($username, $password); $uid = (int) $rets['uid']; if ($uid < 1) { $this->Messager($rets['error'], null); } $member = jsg_member_info(MEMBER_ID); $this->Config['reg_email_verify'] == 1 && $member['email_checked'] == 0 && ($referer = 'index.php?mod=member&code=setverify&ids=' . $uid); $this->Config['email_must_be_true'] == 2 && $member['email_checked'] == 0 && ($referer = 'index.php?mod=member&code=setverify&ids=' . $uid); if ($this->Config['extcredits_enable'] && $uid > 0) { update_credits_by_action('login', $uid); } Load::logic('other'); $otherLogic = new OtherLogic(); $sql = "SELECT m.id as medal_id,m.medal_img,m.medal_name,m.medal_depict,m.conditions,u.dateline,y.apply_id\r\n\t\t\t\tFROM " . TABLE_PREFIX . "medal m\r\n\t\t\t\tLEFT JOIN " . TABLE_PREFIX . "user_medal u ON (u.medalid = m.id AND u.uid = '{$uid}')\r\n\t\t\t\tLEFT JOIN " . TABLE_PREFIX . "medal_apply y ON (y.medal_id = m.id AND y.uid = '{$uid}')\r\n\t\t\t\tWHERE m.is_open = 1\r\n\t\t\t\tORDER BY u.dateline DESC,m.id"; $query = $this->DatabaseHandler->Query($sql); while (false != ($rs = $query->GetRow())) { $rs['conditions'] = unserialize($rs['conditions']); if (in_array($rs['conditions']['type'], array('topic', 'reply', 'tag', 'invite', 'fans', 'sign')) && !$rs['dateline']) { $result .= $otherLogic->autoCheckMedal($rs['medal_id'], $uid); } } $redirecto = $referer ? $referer : referer(); $redirecto = str_replace('#', '', $redirecto); if ($this->Post['loginType'] == 'share') { $redirecto = $this->Post['return_url']; $this->Messager(null, $redirecto, 0); } if ($this->Post['loginType'] == 'show_login') { $this->Messager(NULL, $redirecto, 0); } if ($rets['uc_syn_html']) { $this->Messager("登录成功{$rets['uc_syn_html']}", $redirecto, 3); } else { $this->Messager(null, $redirecto); } }
function CheckMedal() { $medalid = (int) $this->Get['medal_id']; Load::logic('other'); $otherLogic = new OtherLogic(); $result = $otherLogic->autoCheckMedal($medalid); if ($result == '1') { $this->Messager("成功点亮", 'index.php?mod=other&code=medal'); } else { if ($return == '3') { $this->Messager("你已获得此勋章了哦", -1); } else { $this->Messager("未达成获取勋章的条件", -1); } } }
function Login2() { $username = trim(jget('username')); $password = jget('password'); if ($username == "" || $password == "") { json_error("无法登录,用户名或密码不能为空"); } if ($GLOBALS['_J']['plugins']['func']['login']) { hookscript('login', 'funcs', array('param' => $this->Post, 'step' => 'check'), 'login'); } $referer = jget('referer'); if (!$referer) { $referer = jsg_getcookie('referer'); } $rets = jsg_member_login($username, $password); $uid = (int) $rets['uid']; if ($uid < 1) { json_error($rets['error']); } $member = jsg_member_info($uid); $this->Config['email_must_be_true'] == 2 && $member['email_checked'] == 0 && ($referer = 'index.php?mod=member&code=setverify&ids=' . $uid); if ($this->Config['extcredits_enable'] && $uid > 0) { update_credits_by_action('login', $uid); } Load::logic('other'); $otherLogic = new OtherLogic(); $sql = "SELECT m.id as medal_id,m.medal_img,m.medal_name,m.medal_depict,m.conditions,u.dateline,y.apply_id\r\n\t\t\t\tFROM " . TABLE_PREFIX . "medal m\r\n\t\t\t\tLEFT JOIN " . TABLE_PREFIX . "user_medal u ON (u.medalid = m.id AND u.uid = '{$uid}')\r\n\t\t\t\tLEFT JOIN " . TABLE_PREFIX . "medal_apply y ON (y.medal_id = m.id AND y.uid = '{$uid}')\r\n\t\t\t\tWHERE m.is_open = 1\r\n\t\t\t\tORDER BY u.dateline DESC,m.id"; $query = $this->DatabaseHandler->Query($sql); while (false != ($rs = $query->GetRow())) { $rs['conditions'] = unserialize($rs['conditions']); if (in_array($rs['conditions']['type'], array('topic', 'reply', 'tag', 'invite', 'fans')) && !$rs['dateline']) { $result .= $otherLogic->autoCheckMedal($rs['medal_id'], $uid); } } header("location:mobile/index.php"); }