function DoCheckUser() { $ret = false; $username = trim(jget('username')); if (!$username) { json_error('请输入帐号'); } #if NEDU if (defined('NEDU_MOYO')) { nlogic('user/passport')->onlogin($username); } #endif if ($this->Config['ldap_enable']) { if ($this->_is_email($username)) { $uid = DB::result_first(" select `uid` from `" . TABLE_PREFIX . "members` where `email` = '{$username}' "); $uid = $uid ? $uid : 0; $face = face_get($uid); json_result($face); } json_error('域帐号不存在'); } else { $uid = jsg_member_uid($username); if ($uid > 0) { $face = face_get($uid); json_result($face); } elseif (true === UCENTER) { include_once ROOT_PATH . 'api/uc_client/client.php'; if ($this->_is_email($username)) { $return = uc_user_checkemail($username); } else { $return = uc_user_checkname($username); } if ($return == '-3' || $return == '-6') { json_result(face_get(0)); } } json_error('帐号不存在'); } }
function Main() { $per_page_num = min(500, max(20, (int) (isset($_GET['pn']) ? $_GET['pn'] : $_GET['per_page_num']))); if ($_GET['pn']) { $pn = '&pn=' . $_GET['pn']; } $where_list = array(); $query_link = 'admin.php?mod=topic' . $pn . '&code=' . $this->Code . '&per_page_num=' . $per_page_num; $type = $this->Get['type']; if ($type == 'first') { $type_arr['first'] = " selected "; $where_list['type'] = "`type` = '{$type}'"; $query_link .= "&type={$type}"; } elseif ($type == 'forward') { $type_arr['forward'] = " selected "; $where_list['type'] = "`type` in ('forward','both')"; $query_link .= "&type={$type}"; } elseif ($type == 'reply') { $type_arr['reply'] = " selected "; $where_list['type'] = "`type` in ('reply','both')"; $query_link .= "&type={$type}"; } $config['channel'] = jconf::get('channel'); if ($config['channel']) { $channels = $channel_one = is_array($config['channel']['first']) ? $config['channel']['first'] : array(); $channel_two = is_array($config['channel']['second']) ? $config['channel']['second'] : array(); $channel_channels = is_array($config['channel']['channels']) ? $config['channel']['channels'] : array(); foreach ($channel_two as $k => $v) { $channels[$v['parent_id']]['child'][$k] = $v; } $channel = $this->Get['channel']; if ($channel == 'all') { $sel_str = ' selected'; } else { $sel_str = ''; } $channel_html = '频道:<select name="channel"><option value="">请选择...</option><option value="all"' . $sel_str . '>所有频道</option>'; foreach ($channels as $val) { if ($channel == $val['ch_id']) { $sel_str = ' selected'; } else { $sel_str = ''; } $channel_html .= '<option value="' . $val['ch_id'] . '"' . $sel_str . '>' . $val['ch_name'] . '</option>'; if ($val['child']) { foreach ($val['child'] as $v) { if ($channel == $v['ch_id']) { $sel_str = ' selected'; } else { $sel_str = ''; } $channel_html .= '<option value="' . $v['ch_id'] . '"' . $sel_str . '>|-' . $v['ch_name'] . '</option>'; } } } $channel_html .= '</select>'; if (strlen($channel) > 0) { if ($channel == 'all') { $where_list['channel'] = "item = 'channel' AND item_id > 0"; $query_link .= "&channel=all"; } else { $channel = (int) $channel; $where_list['channel'] = "item = 'channel' AND item_id IN(" . jimplode($channel_channels[$channel]) . ")"; $query_link .= "&channel=" . $channel; } } unset($channel_one); unset($channel_two); unset($channel_channels); } $postip = $this->Get['postip']; if ($postip) { $where_list['postip'] = " `postip` = '{$postip}' "; $where_list['lastupdatef'] = " `lastupdate` > '" . strtotime(date('Y-m-d', time())) . "' "; $where_list['lastupdatet'] = " `lastupdate` < '" . strtotime(date('Y-m-d', strtotime('+1 day'))) . "' "; $where_list['managetype'] = " managetype = 0"; $query_link .= "&postip={$postip}"; } $tids = array(); $tid = trim($this->Get['tid']); if ($tid) { $_tids = explode(" ", str_replace(array(",", "|"), " ", $tid)); foreach ($_tids as $_tid) { $_tid = jfilter($_tid, 'int'); if ($_tid > 0) { $tids[$_tid] = $_tid; } } $total_record = count($tids); $query_link .= "&tid={$tid}"; } $uid = 0; $username = jget('username', 'txt'); if ($username) { $uid = jsg_member_uid($username); $query_link .= "&username={$username}"; } else { $uid = jget('uid', 'int'); } if ($uid > 0) { $where_list['uid'] = "`uid`='{$uid}'"; $query_link .= "&uid={$uid}"; $p = array('type' => 'all', 'perpage' => $per_page_num, 'page_url' => $query_link); $_rets = jtable('member_topic')->get_tids($uid, $p, 1); $tids = $_rets['ids']; if (!in_array($this->Code, array('verify', 'del'))) { $total_record = $_rets['count']; $page_arr = $_rets['page']; } } if ($tids) { $where_list['tid'] = "`tid` in (" . jimplode($tids) . ")"; } $keyword = trim($this->Get['keyword']); if ($keyword) { $_GET['highlight'] = $keyword; $where_list['keyword'] = build_like_query('content,content2', $keyword); $query_link .= "&keyword=" . urlencode($keyword); } $nickname = trim($this->Get['nickname']); if ($nickname) { $sql = "select `uid`,`nickname` from `" . TABLE_PREFIX . "members` where `nickname`='{$nickname}' limit 0,1"; $query = $this->DatabaseHandler->Query($sql); $members = $query->GetRow(); $where_list['uid'] = "`uid`='{$members['uid']}'"; $query_link .= "&nickname=" . urlencode($members['nickname']); } $timefrom = $this->Get['timefrom']; if ($timefrom) { $str_time_from = strtotime($timefrom); $where_list['timefrom'] = "`lastupdate`>'{$str_time_from}'"; $query_link .= "&timefrom=" . $timefrom; } $timeto = $this->Get['timeto']; if ($timeto) { $str_time_to = strtotime($timeto); $where_list['timeto'] = "`lastupdate`<'{$str_time_to}'"; $query_link .= "&timeto=" . $timeto; } $mtype = $this->Get['mtype']; if ($mtype != '') { if ($mtype == 1) { $where_list['managetype'] = " managetype != 0"; } else { $where_list['managetype'] = " managetype = '{$mtype}'"; } $mtype_arr[$mtype] = " selected "; $query_link .= "&mtype={$mtype}"; } $where = empty($where_list) ? null : ' WHERE ' . implode(' AND ', $where_list) . ' '; if ($this->Code == 'verify' || $this->Code == 'del') { $template = 'topic_verify'; $verify = 1; $del = (int) $this->Get['del']; if ($del) { $where = $where ? $where . " and managetype = 1 " : " where managetype = 1 "; $query_link .= "&del=1"; } else { $where = $where ? $where . " and managetype = 0 " : " where managetype = 0 "; } $sql = " select count(*) as `total_record` from `" . TABLE_PREFIX . "topic_verify` {$where} "; } else { $template = 'topic'; $this->Code = 'topic_manage'; $sql = " select count(*) as `total_record` from `" . TABLE_PREFIX . "topic` {$where} "; } if (!$total_record) { $total_record = DB::result_first($sql); } if (!$page_arr) { $page_arr = page($total_record, $per_page_num, $query_link, array('return' => 'array'), '20 50 100 200 500'); } $topic_list = array(); if ($this->Code == 'verify' || $this->Code == 'del') { $topic_list = $this->TopicLogic->Get(" {$where} order by `dateline` desc {$page_arr['limit']} ", '*', 'Make', TABLE_PREFIX . 'topic_verify', 'id'); $action = "admin.php?mod=topic&code=doverify"; if ($topic_list) { foreach ($topic_list as $key => $val) { if ($val['type'] == 'forward' && $val['roottid'] > 0) { $topic_list[$key]['root_topic'] = $this->TopicLogic->Get($val['roottid']); } if ($val['longtextid'] > 0) { $topic_list[$key]['content'] = jlogic('longtext')->longtext($val['longtextid'], $val['tid']); } } } } else { if ($tids) { $topic_list = $this->TopicLogic->Get($tids); } else { $topic_list = $this->TopicLogic->Get(" {$where} order by `dateline` desc {$page_arr['limit']} "); } $action = "admin.php?mod=topic&code=domanage"; if ($topic_list) { foreach ($topic_list as $key => $val) { if ($val['managetype'] == 0 || $val['managetype'] == 1) { $topic_list[$key]['manage_type'][1] = " checked "; } else { $topic_list[$key]['manage_type'][$val['managetype']] = " checked "; } if ($val['type'] == 'forward' && $val['roottid']) { $topic_list[$key]['root_topic'] = $this->TopicLogic->Get($val['roottid']); } if ($val['longtextid'] > 0) { $topic_list[$key]['content'] = jtable('topic_more')->longtext($val['tid']); } } } } include template('admin/' . $template); }