Example #1
0
 public function login()
 {
     $username = jget('username', 'txt');
     $password = jget('password');
     $openid = jget('openid');
     if ($username == "" || $password == "") {
         json_error("无法登录,用户名或密码不能为空");
     }
     if ($this->Config['login_by_uid']) {
         is_numeric($username) && json_error("禁止使用UID登录");
     }
     if ($GLOBALS['_J']['plugins']['func']['login']) {
         hookscript('login', 'funcs', array('param' => $this->Post, 'step' => 'check'), 'login');
     }
     $rets = jsg_member_login($username, $password);
     $uid = (int) $rets['uid'];
     if ($uid < 1) {
         json_error(array_iconv($this->Config['charset'], 'utf-8', $rets['error']));
     }
     $r = false;
     if ($openid && $uid) {
         $r = jlogic('wechat')->do_bind($openid, $uid);
     }
     if ($r) {
         json_result("绑定成功!");
     } else {
         json_error("绑定失败!");
     }
 }
Example #2
0
 function static_data_refresh()
 {
     $type = jget('type');
     if (!in_array($type, array('app', 'content', 'login', 'other', 'role', 'user', 'verify'))) {
         exit('type is invalid');
     }
     $ret = array();
     $other_logic = jlogic('other');
     $func = 'get' . ucfirst($type) . 'Statistics';
     if (method_exists($other_logic, $func)) {
         $cache_id = 'misc/' . $type . '_statistics';
         cache_file('rm', $cache_id);
         if ($type == 'other') {
             cache_file('rm', 'misc/data_length');
         }
         $ret = $other_logic->{$func}();
     }
     #生成html代码
     $head_html = "<tr class='altbg1'>";
     $body_html = "<tr class='altbg2'>";
     if ($ret) {
         foreach ($ret['data'] as $k => $v) {
             $head_html .= "<td>{$v['name']}</td>";
             $body_html .= "<td>{$v['num']}</td>";
         }
     }
     $head_html .= "</tr>";
     $body_html .= "</tr>";
     echo $head_html . $body_html;
     exit;
 }
Example #3
0
function get_sub_menu()
{
    if (defined('IN_GET_SUB_MENU_FUNC')) {
        return array();
    }
    define('IN_GET_SUB_MENU_FUNC', true);
    if (!@(include_once ROOT_PATH . "./setting/admin_page_menu.php")) {
        return false;
    }
    $mod = jget('mod', 'txt');
    $code = jget('code', 'txt');
    $admin_link2 = $admin_link = 'admin.php';
    if ($mod) {
        $admin_link .= '?mod=' . $mod;
        if (empty($code) || 'index' == $code) {
            $admin_link2 = $admin_link;
        }
        if ($code) {
            $admin_link .= '&code=' . $code;
        }
    }
    foreach ($menu_list as $menus) {
        foreach ($menus as $k => $v) {
            if (false !== strpos($v['link'], $admin_link) || $v['link'] == $admin_link2) {
                $v['current'] = 1;
                $menus[$k] = $v;
                return $menus;
            }
        }
    }
    return false;
}
Example #4
0
 function ModuleObject($config)
 {
     $this->MasterObject($config);
     $this->ID = jget('id', 'int');
     $this->IDS = jget('ids');
     $this->Execute();
 }
Example #5
0
 function Main()
 {
     if (MEMBER_ID < 1) {
         response_text('登录后才能继续操作');
     }
     global $_J;
     if (!isset($_J['plugins'])) {
         jlogic('plugin')->loadplugincache();
     }
     $pluginid = jget('id');
     if (!empty($pluginid)) {
         list($identifier, $module) = explode(':', $pluginid);
         $module = $module !== NULL ? $module : $identifier;
     }
     if (!is_array($_J['plugins']['hookmod']) || !array_key_exists($pluginid, $_J['plugins']['hookmod'])) {
         response_text("插件不存在或已关闭");
     }
     if (empty($identifier) || !preg_match("/^[a-z]+[a-z0-9_]*[a-z]+\$/i", $identifier) || !preg_match("/^[a-z]+[a-z0-9_]*[a-z]+\$/i", $module)) {
         response_text("未定义的操作");
     }
     if (@(!file_exists($modfile = PLUGIN_DIR . '/' . $identifier . '/' . $module . '.mod.php'))) {
         response_text("插件模块文件(" . $modfile . ")不存在或者插件文件不完整");
     }
     if ($_J['plugins']['hookmod'][$pluginid]['role_id'] && 'admin' != MEMBER_ROLE_TYPE) {
         response_text("您没有权限进行该操作");
     }
     include $modfile;
 }
Example #6
0
 function RewardDetail()
 {
     $rid = jget('rid', 'int');
     $tid = jget('tid', 'int');
     if (!$rid || !$tid) {
         response_text('无效的有奖转发ID');
     }
     $reward = jlogic('reward')->getRewardInfo($rid);
     if (!$reward) {
         response_text('无效的有奖转发ID');
     }
     if ($reward['time_lesser'] > 0) {
         $hours = $reward['time_lesser'] % 86400;
         $day = floor($reward['time_lesser'] / 86400) ? floor($reward['time_lesser'] / 86400) . '天' : '';
         $i = $hours % 3600;
         $hours = floor($hours / 3600) ? floor($hours / 3600) . '时' : '';
         $i = floor($i / 60) ? floor($i / 60) . '分' : '';
         $reward['time_lesser'] = '距离转发结束还有 ' . $day . $hours . $i;
     } else {
         $reward['time_lesser'] = '有奖转发结束';
     }
     if ($reward['rules']['tag']) {
         $content = '#' . implode('##', $reward['rules']['tag']) . '#';
     }
     include template('widget/widget_reward_view');
 }
Example #7
0
 function topic()
 {
     $id = jget('id', 'int');
     $infos = jlogic('image')->get_uploadimg_byid($id);
     $sql_wheres = array("item" => "`item` = 'topic_image'", "item_id" => "`item_id` = '" . $id . "'");
     $this->_topic_list('new', $sql_wheres, $order, array(), array('imageinfo' => $infos[$id]));
 }
 public function fromJson($json)
 {
     if (!empty($json)) {
         parent::fromJson($json);
         $this->PaymentId = jget($json, 'PaymentId');
         $this->PaymentRequestId = jget($json, 'PaymentRequestId');
         $this->Status = jget($json, 'Status');
         $this->PaymentType = jget($json, 'PaymentType');
         $this->FundingSource = jget($json, 'FundingSource');
         $this->GuestCheckout = jget($json, 'GuestCheckout');
         $this->CreatedAt = jget($json, 'CreatedAt');
         $this->ValidUntil = jget($json, 'ValidUntil');
         $this->CompletedAt = jget($json, 'CompletedAt');
         $this->ReservedUntil = jget($json, 'ReservedUntil');
         $this->Total = jget($json, 'Total');
         $this->AllowedFundingSources = jget($json, 'AllowedFundingSources');
         $this->RecurrenceResult = jget($json, 'RecurrenceResult');
         $this->Transactions = array();
         if (!empty($json['Transactions'])) {
             foreach ($json['Transactions'] as $key => $value) {
                 $tr = new TransactionDetailModel();
                 $tr->fromJson($value);
                 array_push($this->Transactions, $tr);
             }
         }
     }
 }
Example #9
0
 function Main()
 {
     $cids = jget('cids');
     $id = jget('id');
     if (is_array($cids)) {
         foreach ($cids as $val) {
             if ($val) {
                 $cid = $val;
             }
         }
     } elseif ($id) {
         $rowd = $this->CpLogic->Getrow($id, 'department');
         $cid = $rowd['cid'];
         $row = $this->CpLogic->Getrow($rowd['cid'], 'company');
         if ($rowd['upid']) {
             $ids = $rowd['upid'];
         }
         $cids = explode(',', $row['upid']);
         if ($cids[0] > 0) {
             $cids[] = $cid;
         } else {
             $cids[0] = $cid;
         }
     } else {
         $cids = array(0);
         $cid = 0;
     }
     if (@is_file(ROOT_PATH . 'include/logic/cp.logic.php') && $this->Config['company_enable'] && $this->Config['department_enable']) {
         $selectco = '';
         $i = 0;
         foreach ($cids as $k => $v) {
             $j = $k + 1;
             if ($v || $i == 0) {
                 $company = $this->CpLogic->get_list_company($i, 'id ASC');
                 $selectco .= '<span id="nextcompany_' . $k . '"><select name="cids[]" onchange="listnextc(this,\'' . $j . '\');"><option value="">请选择...</option>';
                 foreach ($company as $val) {
                     if ($val['id'] == $v) {
                         $selectco .= '<option value="' . $val['id'] . '" selected>' . $val['name'] . '</option>';
                     } else {
                         $selectco .= '<option value="' . $val['id'] . '">' . $val['name'] . '</option>';
                     }
                 }
                 $selectco .= '</select></span>';
             }
             $i = $v;
         }
         if ($cid) {
             $lists = $this->CpLogic->GetTable('department', 0, $cid);
         } else {
             $lists = '';
         }
         $action = '';
         include template('admin/department');
     } else {
         if (!is_file(ROOT_PATH . 'include/logic/cp.logic.php')) {
             $cp_not_install = true;
         }
         include template('admin/cp_ad');
     }
 }
 function delete()
 {
     $ip = jget('ip', 'txt');
     if ($ip) {
         jtable('failedlogins')->delete(array('ip' => $ip));
     }
     $this->Messager('操作成功', 'admin.php?mod=failedlogins&code=index');
 }
Example #11
0
 function ModuleObject($config)
 {
     $this->MasterObject($config);
     $this->TopicLogic = jlogic('topic');
     $this->ID = jget('id', 'int');
     $this->Member = $this->_member();
     $this->Execute();
 }
Example #12
0
 function TopNotice()
 {
     $type = jget('display', 'int', 'P');
     if ($type) {
         jsg_setcookie('topnotice', 'block');
     } else {
         jsg_setcookie('topnotice', 'none');
     }
 }
Example #13
0
 function ModuleObject($config)
 {
     $this->MasterObject($config);
     $this->ID = jget('id', 'int');
     $this->TopicLogic = jlogic('topic');
     $this->CacheConfig = jconf::get('cache');
     $this->ShowConfig = jconf::get('show');
     $this->Execute();
 }
Example #14
0
 function del()
 {
     $ids = jget('ids');
     if ($ids) {
         jlogic('feed')->delete_feed(array('ids' => $ids));
         $this->Messager("删除成功", 'admin.php?mod=feed');
     } else {
         $this->Messager("请选择要删除的对象", 'admin.php?mod=feed');
     }
 }
Example #15
0
 function ModuleObject($config)
 {
     $this->MasterObject($config);
     $this->ID = jget('id', 'int');
     Mobile::logic('mblog');
     $this->MblogLogic = new MblogLogic();
     $this->CacheConfig = jconf::get('cache');
     $this->ShowConfig = jconf::get('show');
     Mobile::is_login();
     $this->Execute();
 }
Example #16
0
 function ModuleObject($config)
 {
     $this->MasterObject($config);
     $this->ID = jget('id', 'int');
     Load::logic("topic");
     $this->TopicLogic = new TopicLogic();
     $this->ShowConfig = jconf::get('show');
     if ($this->Code != 'login') {
         Mobile::is_login();
     }
     $this->Execute();
 }
Example #17
0
 function Domodfeature()
 {
     $tid = jget('tid');
     $relateid = jget('replyid');
     $featureid = jget('featureid');
     if ($tid > 0) {
         jlogic('feature')->set_topic_feature($tid, $relateid, $featureid);
         json_result('操作成功');
     } else {
         json_result('没做任何处理');
     }
 }
Example #18
0
 public function fromJson($json)
 {
     if (!empty($json)) {
         $this->Name = jget($json, 'Name');
         $this->Description = jget($json, 'Description');
         $this->Quantity = jget($json, 'Quantity');
         $this->Unit = jget($json, 'Unit');
         $this->UnitPrice = jget($json, 'UnitPrice');
         $this->ItemTotal = jget($json, 'ItemTotal');
         $this->SKU = jget($json, 'SKU');
     }
 }
Example #19
0
 function ModuleObject($config)
 {
     $this->MasterObject($config);
     $this->ID = jget('id', 'int');
     Load::logic('topic');
     $this->TopicLogic = new TopicLogic($this);
     Mobile::logic('tag');
     $this->MTagLogic = new MTagLogic();
     $this->CacheConfig = jconf::get('cache');
     $this->ShowConfig = jconf::get('show');
     Mobile::is_login();
     $this->Execute();
 }
Example #20
0
 function index()
 {
     $uid = jget('uid', 'int');
     $p = array('page_num' => 8, 'uid' => $uid);
     $p['page_url'] = 'index.php?mod=follow' . ($uid > 0 && MEMBER_ID != $uid ? '&uid=' . $uid : '');
     $rets = jlogic('buddy_follow')->get($p);
     if (is_array($rets) && $rets['error']) {
         $this->Messager($rets['result'], null);
     }
     $member = $rets['member'];
     $this->Title = "{$member['nickname']}关注的人";
     include template();
 }
Example #21
0
 function login()
 {
     $this->Title = "用户登录";
     if (jget('referer')) {
         $referer = jget('referer');
     } else {
         $referer = referer($this->Config['site_url'] . '/admin.php');
     }
     if (jsg_getcookie('referer') == '') {
         jsg_setcookie('referer', $referer);
     }
     $action = "admin.php?mod=login&code=dologin";
     include template("admin/login");
 }
 public function fromJson($json)
 {
     if (!empty($json)) {
         parent::fromJson($json);
         $this->PaymentId = jget($json, 'PaymentId');
         $this->RefundedTransactions = array();
         if (!empty($json['RefundedTransactions'])) {
             foreach ($json['RefundedTransactions'] as $key => $value) {
                 $tr = new TransactionDetailModel();
                 $tr->fromJson($value);
                 array_push($this->RefundedTransactions, $tr);
             }
         }
     }
 }
Example #23
0
 function ModuleObject($config)
 {
     $this->MasterObject($config);
     $this->ID = jget('id', 'int');
     Mobile::logic('mblog');
     $this->MblogLogic = new MblogLogic();
     $this->CacheConfig = jconf::get('cache');
     if (!in_array($this->Code, array('new', 'hot_comments', 'hot_forwards'))) {
         Mobile::is_login();
     }
     if (empty($this->Code)) {
         $this->Code = "home";
     }
     $this->Execute();
 }
Example #24
0
 public function main()
 {
     if ($this->check_signature()) {
         if (jget('echostr')) {
             echo jget('echostr');
             exit;
         } else {
             $this->get_input();
             $this->execute();
             exit;
         }
     } else {
         jlog('wechat', 'check_signature is invalid');
     }
     exit;
 }
Example #25
0
 function notice_index()
 {
     $this->Title = '网站公告';
     $id = jget('id', 'int');
     if ($id < 1) {
         $id = jget('ids', 'int');
         if ($id < 1) {
             $id = jget('code', 'int');
         }
     }
     if ($id > 0) {
         $notice_info = jtable('notice')->info($id);
         $this->Title .= ' - ' . $notice_info['title'];
     }
     $notice_data = jtable('notice')->get_data();
     include template('notice_index');
 }
Example #26
0
 function index()
 {
     $uid = jget('uid', 'int');
     $page_num = (int) jconf::get('show', 'topic', 'fans');
     if ($page_num < 1) {
         $page_num = 10;
     }
     $p = array('page_num' => $page_num, 'uid' => $uid, 'nickname' => jget('nickname', 'txt'), 'order' => jget('order', 'txt'));
     $p['page_url'] = 'index.php?mod=fans' . ($uid > 0 && MEMBER_ID != $uid ? '&uid=' . $uid : '') . ($uid > 0 && MEMBER_ID == $uid ? ($p['nickname'] ? '&nickname=' . $p['nickname'] : '') . ($p['order'] ? '&order=' . $p['order'] : '') : '');
     $rets = jlogic('buddy_fans')->get($p);
     if (is_array($rets) && $rets['error']) {
         $this->Messager($rets['result'], null);
     }
     $member = $rets['member'];
     $this->Title = "关注{$member['nickname']}的人 - {$member['nickname']}的粉丝";
     include template();
 }
 function qun_announcement_index()
 {
     $this->Title = $this->Config['changeword']['weiqun'] . '公告';
     $qid = jget('qid', 'int');
     $id = jget('id', 'int');
     if ($id < 1) {
         $id = jget('ids', 'int');
         if ($id < 1) {
             $id = jget('code', 'int');
         }
     }
     if ($id > 0) {
         $qun_announcement_info = jtable('qun_announcement')->info($id);
         $author_member = jsg_member_info($qun_announcement_info['author_id']);
         $this->Title .= ' - ' . cutstr(trim(strip_tags($qun_announcement_info['message'])), 30);
     }
     include template('qun/qun_announcement_index');
 }
 public function fromJson($json)
 {
     if (!empty($json)) {
         parent::fromJson($json);
         $this->IsSuccessful = jget($json, 'IsSuccessful');
         $this->PaymentId = jget($json, 'PaymentId');
         $this->PaymentRequestId = jget($json, 'PaymentRequestId');
         $this->Status = jget($json, 'Status');
         $this->Transactions = array();
         if (!empty($json['Transactions'])) {
             foreach ($json['Transactions'] as $key => $value) {
                 $tr = new TransactionResponseModel();
                 $tr->fromJson($value);
                 array_push($this->Transactions, $tr);
             }
         }
     }
 }
Example #29
0
 function goodsinfo()
 {
     $id = jget('id');
     $info = jlogic('mall')->get_info($id);
     if ($info) {
         $config = jconf::get('mall');
         $member = jsg_member_info(MEMBER_ID);
         if ($info['expire'] < TIMESTAMP) {
             $info['exp'] = '商品已过期';
         } elseif ($info['price'] > $member[$config['credits']]) {
             $info['exp'] = '您的' . $config['credits_name'] . '不够';
         } elseif ($info['credit'] > $member['credits']) {
             $info['exp'] = '您的总积分不够';
         } else {
             $info['exp'] = '';
         }
         $info['expire'] = my_date_format($info['expire']);
         $info['desc'] = nl2br($info['desc']);
         $this->Title = '商品详情 —— ' . $info['name'];
         $this->MetaKeywords = '积分兑换,商品详情';
         $this->MetaDescription = $info['name'];
         $top_credit_members = jlogic('mall')->get_top_member_credits();
         $feeds = jlogic('feed')->get_feed(5, "`action`='兑换了'");
         $css['mall'] = ' class="current"';
         $this->item = 'mall';
         $this->item_id = $id;
         $h_key = 'mall';
         $gets = array('mod' => 'mall', 'code' => 'goodsinfo', 'id' => $id);
         $page_url = 'index.php?' . url_implode($gets);
         $tids = jlogic('mall')->get_topic_by_goodsid($id);
         $options = array('tid' => $tids, 'perpage' => 5, 'page_url' => $page_url);
         $topic_info = jlogic('topic_list')->get_data($options);
         $topic_list = array();
         if (!empty($topic_info)) {
             $topic_list = $topic_info['list'];
             $page_arr['html'] = $topic_info['page']['html'];
         }
         $albums = jlogic('image')->getalbum();
         include template('mall_info');
     } else {
         header('Location: ' . jurl('index.php?mod=mall'));
     }
 }
Example #30
0
 function Topic()
 {
     if (MEMBER_ID < 1) {
         response_text('您是游客,没有权限举报');
     }
     $tid = jget('totid', 'int', 'P');
     $report_reason = $this->Post['report_reason'];
     $report_content = $this->Post['report_content'];
     $data = array('uid' => MEMBER_ID, 'username' => MEMBER_NICKNAME, 'ip' => $GLOBALS['_J']['client_ip'], 'reason' => (int) $report_reason, 'content' => strip_tags($report_content), 'tid' => (int) $tid, 'dateline' => time());
     $result = jtable('report')->insert($data);
     if ($notice_to_admin = $this->Config['notice_to_admin']) {
         $message = "用户" . MEMBER_NICKNAME . "举报了微博ID:{$tid}(" . $data['content'] . "),<a href='admin.php?mod=report&code=report_manage' target='_blank'>点击</a>进入管理。";
         $pm_post = array('message' => $message, 'to_user' => str_replace('|', ',', $notice_to_admin));
         $admin_info = DB::fetch_first('select `uid`,`username`,`nickname` from `' . TABLE_PREFIX . 'members` where `uid` = 1');
         load::logic('pm');
         $PmLogic = new PmLogic();
         $PmLogic->pmSend($pm_post, $admin_info['uid'], $admin_info['username'], $admin_info['nickname']);
     }
     response_text('举报成功');
 }