function __construct() { parent::__construct(); $user = $this->input['user'] ? $this->input['user'] : hg_get_cookie('user'); $pass = $this->input['pass'] ? $this->input['pass'] : hg_get_cookie('pass'); $this->setUser($user, $pass); }
function __construct() { parent::__construct(); include_once ROOT_PATH . '/lib/user/user.class.php'; $this->mUser = new user(); $user = urldecode($_SERVER['PHP_AUTH_USER'] ? $_SERVER['PHP_AUTH_USER'] : hg_get_cookie('user')); $pass = urldecode($_SERVER['PHP_AUTH_PW'] ? $_SERVER['PHP_AUTH_PW'] : hg_get_cookie('pass')); $this->setUser($user, $pass); }
public function LoadSession($user = '', $pass = '', $sessionid = '') { $this->user = $this->set_up_guest(); $user = $user ? $user : hg_get_cookie('user'); $pass = $pass ? $pass : hg_get_cookie('pass'); if ($user && $pass) { $this->load_user(); } return $this->user; }
function __construct() { parent::__construct(); $user = urldecode($_SERVER['PHP_AUTH_USER'] ? $_SERVER['PHP_AUTH_USER'] : hg_get_cookie('user')); if (!$user) { $user = $this->input['user']; } $pass = urldecode($_SERVER['PHP_AUTH_PW'] ? $_SERVER['PHP_AUTH_PW'] : hg_get_cookie('pass')); if (!$pass) { $pass = $this->input['pass']; } $this->setUser($user, $pass); }
public function setUser() { global $gUser; if ($gUser) { $pass = $this->input['pass'] ? $this->input['pass'] : hg_get_cookie('pass'); $this->addCookie('user', $gUser['username']); $this->addCookie('pass', $pass); } else { $user = $this->input['user'] ? $this->input['user'] : hg_get_cookie('user'); $pass = $this->input['pass'] ? $this->input['pass'] : hg_get_cookie('pass'); $this->addCookie('user', $user); $this->addCookie('pass', $pass); } }
public function create() { $reffer_user = hg_get_cookie('reffer_user'); $userInfo = array('email' => $this->input['email'], 'username' => $this->input['username'], 'password' => $this->input['password'], 'digital_tv' => $this->input['digital_tv'], 'location' => $this->input['location'], 'location_code' => $this->input['location_code'], 'invite_code' => $this->input['invite_code'], 'reffer_user' => $reffer_user, 'verifycode' => $this->input['verifycode']); if (!$userInfo['verifycode']) { echo json_encode('验证码不为空!'); exit; } if (!$_SESSION['hg_verifycode'] || $userInfo['verifycode'] != $_SESSION['hg_verifycode']) { $ret = array('retcode' => '验证码不符!'); echo json_encode($ret); exit; } $rets = $this->info->createUser($userInfo); if ($rets['register']) { $ret = array('retcode' => $rets['reason']); echo json_encode($ret); exit; } if ($rets['banword']) { $ret = array('retcode' => '有禁止词: ' . $rets[0]); echo json_encode($ret); exit; } if ($rets['user_exist']) { $ret = array('retcode' => '用户名已存在'); echo json_encode($ret); exit; } $user_name = addslashes($this->input['username']); $password = addslashes($this->input['password']); $email = addslashes($this->input['email']); include_once './uclient/client.php'; $member = uc_user_login($user_name, $password); // uid 大于0 登录成功,-1 : 用户不存在,或者被删除 -2:密码错误 其他:未定义 if ($member[0] > 0) { //同步登录 $ucsynlogin = uc_user_synlogin($member[0]); hg_set_cookie('user', $member[1], $timestamp + 31536000); hg_set_cookie('pass', $member[4], $timestamp + 31536000); hg_set_cookie('member_id', $member[0], $timestamp + 31536000); $ret = array(); $ret['script'] = $ucsynlogin; $ret['retcode'] = 1; $ret['email_action'] = $rets['email_action']; } else { $ret = array('retcode' => '注册失败'); } echo json_encode($ret); }
} if (!$gGlobalConfig['App_auth'] && !in_array(SCRIPT_NAME, array('login', 'appstore'))) { header('Location:' . ROOT_DIR . 'appstore.php?app=auth'); } register_shutdown_function('hg_done'); function hg_done() { global $gDB; if ($gDB) { $gDB->close(); } } //hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'global.js'); hg_add_head_element('js-c', "\r\nvar ROOT_PATH = '" . ROOT_DIR . "';\r\nvar RESOURCE_DIR = '" . RESOURCE_DIR . "';\r\nvar cookie_id = '" . $gGlobalConfig['cookie_prefix'] . "';\r\nvar cookie_path = '" . $gGlobalConfig['cookie_path'] . "';\r\nvar cookie_domain = '" . $gGlobalConfig['cookie_domain'] . "';\r\nvar TIME_OUT = '" . $gGlobalConfig['time_out'] . "';\r\nvar ACCESS_TOKEN = '" . $gUser['token'] . "';\r\nvar DEBUG_MODE = " . intval(DEBUG_MODE) . ";\r\nvar ISIOS = " . intval(ISIOS) . ";\r\nvar ISANDROID = " . intval(ISANDROID) . ";\r\nvar gAdmin = {group_type : '" . $gUser['group_type'] . "',admin_id : '" . $gUser['id'] . "', admin_user : '******'user_name'] . "', admin_pass : '******'password'] . "'};\r\nwindow.onbeforeunload = function(){hg_window_destruct();};\r\n"); $gTpl->addHeaderCode(hg_add_head_element('echo')); $gGlobalConfig['liv_client_info'] = hg_get_cookie('client_info'); if (!is_writeable(CACHE_DIR)) { $uiview = new uiview(); $uiview->ReportError('请将缓存目录' . realpath(CACHE_DIR) . '设置为可写!'); } if (!is_file(CACHE_DIR . 'expire.m2o')) { $needUpAuth = true; } else { $content = file_get_contents(CACHE_DIR . 'expire.m2o'); if (!$content) { $needUpAuth = true; } else { $license = hoge_de($content); if (!$license['appid']) { $needUpAuth = true; } else {
button_placeholder_id : 'choice_button', button_width : 68, button_height : 22, button_image_url : './res/img/button_up.png', file_types :'<?php echo $upload_limit; ?> ', post_params : { 'a' : 'deal_upload', 'user' : '<?php echo hg_get_cookie('user'); ?> ', 'pass' : '<?php echo hg_get_cookie('pass'); ?> ' }, use_query_string : false, swfupload_loaded_handler : swfupload_loaded_function, file_dialog_start_handler : file_dialog_start_function, file_queued_handler : file_queued_function, file_dialog_complete_handler : file_dialog_complete_function, upload_start_handler : upload_start_function, upload_progress_handler : upload_progress_function, upload_error_handler : upload_error_function, upload_success_handler : upload_success_function, upload_complete_handler : upload_complete_function, debug: true
$list = $vodinfo_list; //hg_pre($list); //hg_pre($vod_config); $image_resource = RESOURCE_URL; $vodPlayerSwf = RESOURCE_URL . 'swf/'; if (!isset($_INPUT['trans_status'])) { $_INPUT['trans_status'] = -2; } if (!isset($_INPUT['date_search'])) { $_INPUT['date_search'] = 1; } if (isset($_INPUT['id'])) { $id = $_INPUT['id']; } else { $id = ''; } $hg_vod_list_mode = hg_get_cookie('hg_vod_list_mode'); if ($hg_vod_list_mode) { $mode_show_text = '切换至列表'; $vod_mode_class = 'list_img'; } else { $mode_show_text = '切换至列表'; $vod_mode_class = 'list'; } $status_key = 'status_display'; $audit_value = 2; $back_value = 3; $back_label = '被打回'; $attrs_for_edit = array('frame_rate', 'bitrate', 'download', 'retranscode_url', 'vod_leixing', 'aspect', 'format_duration', 'video_duration', 'video_totalsize', 'video_resolution', 'aspect', 'audio', 'sampling_rate', 'video_audio_channels', 'video', 'isfile_name', 'is_allow', 'pub_url', 'is_do_morebit', 'is_morebitrate_ok', 'is_forcecode_ok', 'is_forcecode', 'app_uniqueid', 'object_id', 'video_m3u8', 'catalog', 'is_link', 'swf', 'status'); //print_r($list); ?>
public function show() { if ($this->user['id'] > 0) { $user_info = $this->info->getUserById($this->user['id']); $user_info = $user_info[0]; $count = 50; $total = 'gettotal'; $page = intval($this->input['pp']) / $count; $statusline = $this->status->friends_timeline($this->user['id'], $total, $page, $count); if (is_array($statusline)) { $data['totalpages'] = $statusline[0]['total']; unset($statusline[0]); $data['perpage'] = $count; $data['curpage'] = $this->input['pp']; $showpages = hg_build_pagelinks($data); if (!$page) { $onload = 'setTimeout("get_new_status(' . $statusline[1]["id"] . ')",3000);'; hg_set_cookie('since_id', $statusline[1]["id"], time() + 31536000); } else { $onload = 'setTimeout("get_new_status(' . hg_get_cookie('since_id') . ')",3000);'; } } $topic_follow = $this->status->getTopicFollow(); /** * 添加登录积分 */ $this->info->add_credit_log(LOGIN); /** * 取出会员 */ $vipUser = $this->info->getVip(0, 8); if (is_array($vipUser)) { $vip_nums = $vipUser[count($vipUser) - 1]; $total = ceil($vip_nums / 8); unset($vipUser[count($vipUser) - 1]); } $search_friend_ids = array(); foreach ($vipUser as $k => $v) { $search_friend_ids[] = $v['id']; } $ids = implode(',', $search_friend_ids); $relation = $this->relation->get_relation($this->user['id'], $ids); $len = count($vipUser); for ($i = 0; $i < $len; $i++) { $vipUser[$i]['is_friend'] = $relation[$i]; } //print_r($vipUser); } else { $statusline = $this->status->public_timeline($page); } $topic = $this->status->getTopic(); $this->page_title = $this->lang['pageTitle']; $gScriptName = SCRIPTNAME; hg_add_foot_element("js-c", "\r\t\n" . 'window.onload=function(){' . $onload . ' if(parseInt(now_uid,10)>0){setTimeout("check_new_msg()",5000);setTimeout("getnotify()",3000);}}'); hg_add_head_element('js-c', "\r\n\t\t\tvar re_back = 'index.php';\r\n\t\t\tvar re_back_login = '******';\r\n\t\t\tvar PUBLISH_TO_MULTI_GROUPS = " . PUBLISH_TO_MULTI_GROUPS . ";\r\n\t\t"); hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'index.js'); hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'jquery.form.js'); hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'dispose.js'); //转发和关注话题 hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'rotate.js'); $this->tpl->addVar('gScriptName', $gScriptName); $this->tpl->addVar('user_info', $user_info); $this->tpl->addVar('statusline', $statusline); $this->tpl->addVar('relation', $relation); $this->tpl->addVar('topic', $topic); $this->tpl->addVar('showpages', $showpages); $this->tpl->addVar('vipUser', $vipUser); $this->tpl->addVar('topic_follow', $topic_follow); $this->tpl->addVar('total', $total); $this->tpl->addHeaderCode(hg_add_head_element('echo')); $this->tpl->setTemplateTitle($this->page_title); $this->tpl->outTemplate('index'); }
public function show() { //$this->ReportError(var_export($this->user['prms_menus'],1)); session_start(); $default_page = $_SESSION['livmcp_userinfo']['default_page'] ? $_SESSION['livmcp_userinfo']['default_page'] : './default.php'; if ($_SESSION['livmcp_userinfo']['open_way'] == 1 && $_SESSION['livmcp_userinfo']['default_page']) { header('Location:' . $_SESSION['livmcp_userinfo']['default_page']); } //$default_page = './default.php'; $default_module_id = hg_get_cookie('lastVMod'); $this->cache->check_cache('menu_group', 'menu_recache'); $this->cache->check_cache('menu_apps', 'menu_recache'); $menu_group = $this->cache->cache['menu_group']; $menu_apps = $this->cache->cache['menu_apps']; #####菜单权限检测开始 if ($this->user['group_type'] > MAX_ADMIN_TYPE && $menu_apps) { $authored_apps = @array_keys($this->user['prms_menus']); if (!$authored_apps) { $this->ReportError('没有授权的应用'); } foreach ($menu_apps as $k => $v) { if ($v) { foreach ($v as $kk => $vv) { if (!in_array($vv['app_uniqueid'], $authored_apps)) { unset($menu_apps[$k][$kk]); } } } } if ($menu_group) { foreach ($menu_group as $k => $v) { if (!$menu_apps[$k]) { unset($menu_group[$k]); } } } } if ($this->input['referto'] && !strpos($this->input['referto'], 'login.php') && !strpos($this->input['referto'], 'index.php') && strpos($this->input['referto'], '.php')) { $default_page = $this->input['referto']; } if (DEVELOP_MODE) { //$sql = $ } include_once ROOT_PATH . 'lib/class/curl.class.php'; if ($this->settings['App_settings']) { $this->curl = new curl($this->settings['App_settings']['host'], $this->settings['App_settings']['dir']); $this->curl->setSubmitType('post'); $this->curl->setReturnFormat('json'); $this->curl->initPostData(); $this->curl->addRequestData('a', 'show'); $ret = $this->curl->request('weight.php'); $this->tpl->addVar('weight', $ret); } $_m2ocode = array('customer_id' => CUSTOM_APPID, 'customer_appkey' => CUSTOM_APPKEY, 'user_name' => $this->user['user_name'], 'user_id' => $this->user['user_id'], 'time' => TIMENOW); $_m2ocode = hoge_en(json_encode($_m2ocode)); $this->tpl->addVar('_settings', $this->settings); $this->tpl->addVar('_m2ocode', $_m2ocode); $this->tpl->addVar('menu_group', $menu_group); $this->tpl->addVar('menu_apps', $menu_apps); $this->tpl->outTemplate('index'); }
<div class="pop" id="pop"> <span style="font-size:12px;color:#0082CB;width:auto;" onclick="closevideo()">关闭</span> <div id="pop_s"></div> </div> <div class="news-latest"> <?php echo hg_advert('index_1'); ?> <div class="tp"></div> <div class="md"><img style="display:none;" id="new_img" src="./res/img/loading.gif"/><a style="display:none;" id="new_st" href="javascript:void(0);" onclick="new_status(<?php echo hg_get_cookie('since_id'); ?> );">有新点滴,点击查看</a></div> </div> <ul id="list" class="list clear"> <?php foreach ($statusline as $key => $value) { $user_url = hg_build_link('user.php', array('user_id' => $value['member_id'])); $text = hg_verify($value['text']); $text_show = ':' . ($value['text'] ? $value['text'] : $this->lang['forward_null']); if ($value['reply_status_id']) { $forward_show = '//@' . $value['user']['username'] . ' ' . $text_show; $title = $this->lang['forward_one'] . $value['retweeted_status']['text']; $status_id = $value['reply_user_id']; } else { $forward_show = ''; $title = $this->lang['forward_one'] . $value['text']; $status_id = $value['member_id']; } $text_show = hg_verify($text_show); $transmit_info = $value['retweeted_status'];