Esempio n. 1
0
 public function addpoint()
 {
     /*********************权限管理*****************/
     if ($this->user['group_type'] > MAX_ADMIN_TYPE) {
         $this->verify_content_prms(array('_action' => 'manage'));
     }
     /*********************权限管理*****************/
     if (!isset($this->input['videoid'])) {
         return false;
     }
     if (!isset($this->input['point'])) {
         return false;
     }
     $datas['videoid'] = intval($this->input['videoid']);
     $datas['point'] = intval($this->input['point']);
     //$datas['precent'] = $this->input['precent'];
     if (isset($this->input['brief'])) {
         $datas['brief'] = $this->input['brief'];
     }
     $datas['user_id'] = $this->user['id'];
     $datas['create_time'] = TIMENOW;
     $datas['ip'] = hg_getip();
     $datas['appid'] = intval($this->user['appid']);
     $datas['appname'] = trim($this->user['display_name']);
     $return = $this->obj->insert('point', $datas);
     $this->addItem($return);
     $this->output();
     if (!$return) {
         return false;
     }
     return true;
 }
Esempio n. 2
0
 public function create()
 {
     if (!isset($this->input['name'])) {
         $this->errorOutput("NO_NAME");
     }
     $params['name'] = trim($this->input['name']);
     if (isset($this->input['desc'])) {
         $params['desc'] = trim($this->input['desc']);
     }
     //如果参数设置state=0表示审核未通过,则数据库中该字段默认为1表示审核通过
     if (isset($this->input['state'])) {
         $params['state'] = intval($this->input['state']);
     }
     //如果参数设置type=2表示用户自定义,则数据库中该字段默认为1表示系统用户设置
     if (isset($this->input['type'])) {
         $params['type'] = intval($this->input['type']);
     }
     if (isset($this->input['cate_mark_id'])) {
         $params['cate_mark_id'] = intval($this->input['cate_mark_id']);
     }
     if (isset($this->input['sort_id'])) {
         $params['sort_id'] = intval($this->input['sort_id']);
     }
     $params['user_id'] = $this->user['user_id'];
     $params['org_id'] = $this->user['org_id'];
     $params['user_name'] = $this->user['user_name'];
     $params['appid'] = $this->user['appid'];
     $params['appname'] = trim($this->user['display_name']);
     $params['create_time'] = TIMENOW;
     $params['id'] = $this->obj->insert($this->tbname, $params);
     $params['ip'] = hg_getip();
     $this->addItem($params);
     $this->output();
 }
Esempio n. 3
0
 public function create()
 {
     if (empty($this->input['name'])) {
         $this->errorOutput('分类名称不能为空');
     }
     $info = array('title' => $this->input['name'], 'color' => $this->input['color'], 'create_time' => TIMENOW, 'update_time' => TIMENOW, 'ip' => hg_getip(), 'user_id' => intval($this->user['user_id']), 'user_name' => trim(urldecode($this->user['user_name'])), 'log' => htmlspecialchars_decode(urldecode($this->input['log'])), 'status' => $this->input['status']);
     $info['log'] = json_decode($info['log'], 1);
     $info['log'] = array('id' => $info['log'][0]['id'], 'host' => $info['log'][0]['host'], 'dir' => $info['log'][0]['dir'], 'filepath' => $info['log'][0]['filepath'], 'filename' => $info['log'][0]['filename']);
     //file_put_contents('info.txt',var_export($info,1));
     $info['log'] = json_encode($info['log']);
     $sql = "INSERT INTO " . DB_PREFIX . "group SET ";
     $space = '';
     foreach ($info as $k => $v) {
         $sql .= $space . $k . "='" . $v . "'";
         $space = ',';
     }
     $this->db->query($sql);
     $id = $this->db->insert_id();
     $sql = "UPDATE " . DB_PREFIX . "group SET order_id = " . $id . " WHERE id = " . $id;
     $this->db->query($sql);
     if ($id) {
         $this->addLogs('添加路况分类', '', $info, $info['title']);
         $this->addItem($id);
         $this->output();
     }
     $this->errorOutput('添加失败');
 }
Esempio n. 4
0
 public function show()
 {
     $data = array('template_id' => $this->input['template_id'], 'member_id' => $this->input['member_id'], 'member_name' => $this->input['member_name'], 'ip' => hg_getip(), 'create_time' => TIMENOW, 'enterprise' => $this->input['enterprise'], 'cost' => 0);
     $erro_text = array('template_id' => '未知的模板');
     $this->curd->set_table('templates');
     $template_info = $this->curd->detail($data['template_id']);
     if (!$template_info) {
         $this->errorOutput("模板不存在");
     }
     foreach (array('video_preview', 'index_pic', 'material') as $key) {
         $template_info[$key] = unserialize($template_info['material']);
     }
     //$template_info['material'] = unserialize($template_info['material']);
     foreach ($data as $key => $val) {
         if (!$val && $erro_text[$key]) {
             $this->errorOutput($erro_text[$key]);
         }
     }
     $this->curd->set_table('member_order');
     if ($id = $this->curd->create($data)) {
         //模板下载计数
         $sql = 'UPDATE ' . DB_PREFIX . 'templates SET record=record+1 WHERE id=' . $template_info['id'];
         $this->db->query($sql);
         $data['id'] = $id;
         $this->addItem($template_info);
         $this->output();
     }
     $this->errorOutput('下载失败');
 }
Esempio n. 5
0
 public function create()
 {
     if (!isset($this->input['tag_id'])) {
         $this->errorOutput("NO_TAG_ID");
     }
     //boke中视频表的id
     if (!isset($this->input['video_id'])) {
         $this->errorOutput("NO_VIDEO_ID");
     }
     $result = $this->exist_favor($tag_id, $video_id);
     if ($result[0]['total']) {
         $this->errorOutput("FAVOR_EXIST");
     }
     $parmas['tag_id'] = intval($this->input['tag_id']);
     $parmas['video_id'] = intval($this->input['video_id']);
     $params['user_id'] = $this->user['user_id'];
     $params['org_id'] = $this->user['org_id'];
     $params['user_name'] = $this->user['user_name'];
     $params['appid'] = $this->user['appid'];
     $params['appname'] = trim($this->user['display_name']);
     $params['create_time'] = TIMENOW;
     $params['ip'] = hg_getip();
     $params['id'] = $this->obj->insert($this->tbname, $params);
     $this->addItem($params);
     $this->output();
 }
Esempio n. 6
0
 /**
  * 创建相册
  */
 public function create()
 {
     $user_info = array('user_id' => $this->user['user_id'], 'user_name' => $this->user['user_name'], 'org_id' => $this->user['org_id'], 'appid' => $this->user['appid'], 'appname' => $this->user['display_name'], 'create_time' => TIMENOW, 'ip' => hg_getip());
     if ($_FILES['Filedata']) {
         //上传相册封面
         include_once ROOT_PATH . 'lib/class/material.class.php';
         $material = new material();
         $cover_info = $material->addMaterial($_FILES);
     }
     $albums_name = trim(urldecode($this->input['albums_name']));
     if (empty($albums_name)) {
         $this->errorOutput(PARAM_WRONG);
     }
     //判断是否重名
     $info = $this->api->detail(array('albums_name' => $albums_name, 'user_id' => $this->user['user_id']), 'id');
     if ($info) {
         $this->errorOutput(NAME_EXISTS);
     }
     $insertData = array('albums_name' => $albums_name, 'albums_cover' => $cover_info ? serialize($cover_info) : '');
     $cate_id = intval($this->input['cate_id']);
     $cate_info = $this->api->get_category($cate_id);
     if ($cate_info) {
         $insertData['cate_id'] = $cate_id;
     }
     $insertData = array_merge($insertData, $user_info);
     $result = $this->api->create('albums', $insertData);
     if ($cate_info) {
         //更新数据
         $this->api->update('category', array('albums_num' => 1), array('id' => $cate_id), true);
     }
     $this->addItem($result);
     $this->output();
 }
Esempio n. 7
0
 public function update()
 {
     if (!$this->input['id']) {
         $this->errorOutput(NOID);
     }
     $data = array('name' => $this->input['name'], 'description' => $this->input['description'], 'need_update' => intval($this->input['need_update']));
     //处理logo图片
     if ($_FILES['map_marker']) {
         $_FILES['Filedata'] = $_FILES['map_marker'];
         $material_pic = new material();
         $img_info = $material_pic->addMaterial($_FILES);
         if ($img_info) {
             $map_marker = array('host' => $img_info['host'], 'dir' => $img_info['dir'], 'filepath' => $img_info['filepath'], 'filename' => $img_info['filename']);
             $data['map_marker'] = @serialize($map_marker);
         }
     }
     $ret = $this->mode->update($data, $this->input['id']);
     if ($ret) {
         $update_data = array('user_id' => $this->user['user_id'], 'user_name' => $this->user['user_name'], 'update_time' => TIMENOW, 'ip' => hg_getip());
         $pre_data = $this->mode->update($update_data, $this->input['id']);
         $up_data = $data + $update_data;
         $this->addLogs('更新停车场类型', $pre_data, $up_data, $up_data['name']);
     }
     $this->addItem('success');
     $this->output();
 }
Esempio n. 8
0
 public function update()
 {
     $info = array('url' => trim($this->input['url']), 'source' => $this->input['source'], 'sid' => intval($this->input['sid']), 'ip' => hg_getip(), 'create_time' => TIME_NOW);
     if (empty($info['url']) || empty($this->input['id'])) {
         return false;
     }
     include_once ROOT_PATH . 'lib/class/videoUrlParser.class.php';
     $obj = new VideoUrlParser();
     $tmp = $obj->parse($info['url']);
     if (empty($tmp)) {
         return false;
     }
     $info['title'] = $tmp['title'];
     $info['img'] = $tmp['img'];
     $info['url'] = $tmp['url'];
     $info['swf'] = $tmp['swf'];
     $info['object'] = addslashes($tmp['object']);
     $sql = "UPDATE " . DB_PREFIX . "video SET ";
     $space = "";
     foreach ($info as $k => $v) {
         $sql .= $space . $k . "='" . $v . "'";
         $space = ',';
     }
     $sql .= " WHERE id=" . intval($this->input['id']);
     $this->db->query($sql);
     return array('img' => $info['img'], 'title' => $info['title'], 'url' => $info['url'], 'id' => $info['id']);
 }
Esempio n. 9
0
 public function create()
 {
     if ($this->mNeedCheckIn && !$this->prms['manage']) {
         $this->errorOutput(NO_OPRATION_PRIVILEGE);
     }
     if (empty($this->input['config_name'])) {
         $this->errorOutput('配置名称不能为空');
     }
     if (intval($this->input['water_type']) == 1 && empty($this->input['water_filename'])) {
         $this->errorOutput('水印图片不能为空');
     }
     if (intval($this->input['water_type']) == 0 && empty($this->input['water_text'])) {
         $this->errorOutput('水印文字不能为空');
     }
     $config_name = urldecode($this->input['config_name']);
     switch (intval($this->input['water_type'])) {
         case 0:
             //文字水印
             if (empty($this->input['water_text'])) {
                 $this->errorOutput('水印文字不能为空');
             }
             $water = array('config_name' => $config_name, 'type' => 0, 'position' => intval($this->input['get_photo_waterpos']), 'filename' => '', 'margin_x' => intval($this->input['margin_x']), 'margin_y' => intval($this->input['margin_y']), 'condition_x' => intval($this->input['condition_x']), 'condition_y' => intval($this->input['condition_y']), 'water_text' => urldecode($this->input['water_text']), 'water_angle' => intval($this->input['water_angle']) ? intval($this->input['water_angle']) : 1, 'water_font' => urldecode($this->input['water_font']), 'font_size' => intval($this->input['font_size']), 'opacity' => urldecode($this->input['opacity']), 'water_color' => urldecode($this->input['water_color']), 'create_time' => TIMENOW, 'update_time' => TIMENOW, 'ip' => hg_getip(), 'user_name' => trim(urldecode($this->user['user_name'])), 'global_default' => $this->input['default'] ? 1 : '');
             $this->obj->create($water);
             $insert_id = $this->db->insert_id();
             if ($water['global_default']) {
                 $this->obj->update_water_nodefault($insert_id);
             }
             break;
         case 1:
             //图片水印
             if (empty($this->input['water_filename'])) {
                 $this->errorOutput('水印图片不能为空');
             }
             $water_name = urldecode($this->input['water_filename']);
             $water = array('config_name' => $config_name, 'type' => 1, 'position' => intval($this->input['get_photo_waterpos']), 'filename' => $water_name, 'margin_x' => intval($this->input['margin_x']), 'margin_y' => intval($this->input['margin_y']), 'condition_x' => intval($this->input['condition_x']), 'condition_y' => intval($this->input['condition_y']), 'water_text' => '', 'water_angle' => '', 'water_font' => '', 'font_size' => '', 'opacity' => urldecode($this->input['opacity']), 'water_color' => '', 'create_time' => TIMENOW, 'update_time' => TIMENOW, 'ip' => hg_getip(), 'user_name' => trim(urldecode($this->user['user_name'])), 'global_default' => $this->input['default'] ? 1 : '');
             $this->obj->create($water);
             $insert_id = $this->db->insert_id();
             if ($water['global_default']) {
                 $this->obj->update_water_nodefault($insert_id);
             }
             //移动水印图片
             $temp_file = hg_getimg_default_dir() . MATERIAL_TMP_PATH . $water_name;
             $path = hg_getimg_default_dir() . WATER_PATH;
             if (!hg_mkdir($path)) {
                 return false;
             }
             if (file_exists($temp_file)) {
                 copy($temp_file, $path . $water_name);
             }
             break;
         default:
             break;
     }
     hg_unlink_file(CACHE_DIR, '.water.cache.php');
     //删除水印缓存文件
     $water['id'] = $insert_id;
     $this->addLogs('添加水印配置', '', $water, $water['config_name']);
     $this->addItem($water);
     $this->output();
 }
Esempio n. 10
0
 public function create()
 {
     if (!$this->input['name']) {
         $this->errorOutput(NO_NAME);
     }
     if (!$this->input['market_id']) {
         $this->errorOutput('门店所属的商店不能为空');
     }
     if ($this->input['tel']) {
         $tel = implode(',', array_filter($this->input['tel']));
     }
     if ($this->input['logo_id']) {
         $img_id = implode(',', array_filter($this->input['logo_id']));
         //多图图片数组去空
     }
     $data = array('name' => trim($this->input['name']), 'logo_id' => isset($img_id) ? $img_id : '', 'index_pic' => intval($this->input['logo']), 'market_id' => intval($this->input['market_id']), 'address' => trim($this->input['address']), 'tel' => isset($tel) ? $tel : '', 'opening_time' => trim($this->input['opening_time']), 'parking_num' => $this->input['parking_num'], 'brief' => trim($this->input['brief']), 'traffic' => trim($this->input['traffic']), 'free_bus' => $this->input['free_bus'], 'baidu_longitude' => $this->input['baidu_longitude'], 'baidu_latitude' => $this->input['baidu_latitude'], 'ip' => hg_getip(), 'create_time' => TIMENOW, 'update_time' => TIMENOW, 'user_name' => $this->user['user_name'], 'user_id' => $this->user['user_id'], 'org_id' => $this->user['org_id'], 'update_user_name' => $this->user['user_name'], 'update_user_id' => $this->user['user_id']);
     //如果百度坐标存在的话,就转换为gps坐标也存起来
     if ($data['baidu_latitude'] && $data['baidu_longitude']) {
         $gps = FromBaiduToGpsXY($data['baidu_longitude'], $data['baidu_latitude']);
         $data['gps_x'] = $gps['gps_x'];
         $data['gps_y'] = $gps['gps_y'];
     } else {
         $data['gps_x'] = 0;
         $data['gps_y'] = 0;
     }
     $ret = $this->mode->create($data);
     if ($ret) {
         $this->addLogs('创建门户信息', '', $ret, '创建门户信息' . $ret['id']);
         $this->addItem('success');
         $this->output();
     }
 }
Esempio n. 11
0
 public function update()
 {
     //检测是否具有配置权限
     if ($this->user['group_type'] > MAX_ADMIN_TYPE) {
         if (!$this->user['prms']['app_prms'][APP_UNIQUEID]['setting']) {
             $this->errorOutput(NO_PRIVILEGE);
         }
         $this->verify_create_node(intval($this->input['fid']));
     }
     if (!$this->input['id']) {
         $this->errorOutput(NOID);
         return;
     }
     if (!$this->input['name']) {
         $this->errorOutput(NOSORTNAME);
     }
     $data = array('id' => intval($this->input['id']), 'name' => trim(urldecode($this->input['name'])), 'brief' => trim(urldecode($this->input['brief'])), 'update_time' => TIMENOW, 'user_name' => $this->user['user_name'], 'ip' => hg_getip(), 'fid' => intval($this->input['fid']));
     //初始化
     $this->initNodeData();
     //设置新增或者需要更新的节点数据
     $this->setNodeData($data);
     //设置操作的节点ID
     $this->setNodeID($data['id']);
     //更新方法
     $this->updateNode();
     $this->addItem($data);
     $this->output();
 }
Esempio n. 12
0
 /**
  */
 public function logout()
 {
     if ($access_token = $this->input['access_token']) {
         $data['access_token'] = $access_token;
     } else {
         $this->errorOutput(NO_ACCESS_TOKEN);
     }
     $Members = new members();
     $device_token = $Members->check_device_token(trim($this->input['device_token']));
     $udid = $Members->check_udid(trim($this->input['uuid']));
     if ($device_token === 0) {
         $this->errorOutput(ERROR_DEVICE_TOKEN);
     }
     if ($udid === 0) {
         $this->errorOutput(ERROR_UDID);
     }
     $auth = new auth();
     $logoutInfo = $auth->logout($data);
     //会员痕迹
     $member_trace_data = array('member_id' => $logoutInfo['user_id'], 'member_name' => $logoutInfo['user_name'], 'content_id' => $logoutInfo['user_id'], 'title' => $logoutInfo['user_name'], 'type' => 'logout', 'op_type' => '退出', 'appid' => $logoutInfo['appid'], 'appname' => $logoutInfo['display_name'], 'create_time' => TIMENOW, 'ip' => hg_getip(), 'device_token' => $device_token, 'udid' => $udid);
     $mMember = new member();
     $mMember->member_trace_create($member_trace_data);
     $_logoutInfo = array('member_id' => $logoutInfo['user_id'], 'member_name' => $logoutInfo['user_name'], 'is_member' => $logoutInfo['is_member'], 'logout' => $logoutInfo['logout']);
     $this->addItem($_logoutInfo);
     $this->output();
 }
Esempio n. 13
0
 function get_content()
 {
     $id = intval($this->input['from_id']);
     $sort_id = intval($this->input['sort_id']);
     $offset = $this->input['offset'] ? intval($this->input['offset']) : 0;
     $num = $this->input['num'] ? intval($this->input['num']) : 10;
     $data_limit = ' LIMIT ' . $offset . ' , ' . $num;
     if ($id) {
         $sql = "SELECT * FROM " . DB_PREFIX . "feedback WHERE id = {$id}";
     } else {
         $sql = "SELECT * FROM " . DB_PREFIX . "feedback WHERE node_id = {$sort_id}";
     }
     $info = $this->db->query($sql);
     $ret = array();
     while ($row = $this->db->fetch_array($info)) {
         $row['bundle_id'] = APP_UNIQUEID;
         $row['module_id'] = MOD_UNIQUEID;
         $row['struct_id'] = 'feedback';
         $row['struct_ast_id'] = '';
         $row['expand_id'] = '';
         $row['content_fromid'] = $row['id'];
         $row['ip'] = hg_getip();
         $row['user_id'] = $row['user_id'];
         $row['create_user'] = $row['user_name'];
         unset($row['id']);
         $ret[] = $row;
     }
     $this->addItem($ret);
     $this->output();
 }
 public function update()
 {
     if ($this->mNeedCheckIn && !$this->prms['manage']) {
         $this->errorOutput(NO_OPRATION_PRIVILEGE);
     }
     $id = intval($this->input['id']);
     if (!$id) {
         $this->errorOutput('未传入ID');
     }
     $name = trim($this->input['name']);
     if (!$name) {
         $this->errorOutput('名称不能为空');
     }
     if (!($subject = trim($this->input['subject']))) {
         $this->errorOutput('请填写邮件标题');
     }
     if (!($body = trim($this->input['body']))) {
         $this->errorOutput('请填写邮件内容');
     }
     $content_template_info = $this->ect->detail($id);
     $appuniqueid = trim($this->input['appuniqueid']);
     if ($appuniqueid != $content_template_info['appuniqueid']) {
         $this->errorOutput('请勿修改应用标识');
     }
     $status = $this->user['group_type'] <= MAX_ADMIN_TYPE ? 1 : 0;
     $data = array('name' => $name, 'subject' => strip_tags($subject), 'body' => $body, 'user_id' => $this->user['user_id'], 'user_name' => $this->user['user_name'], 'update_time' => TIMENOW, 'ip' => hg_getip(), 'status' => $status);
     $info = $this->ect->update(array('id' => $id), $data);
     $this->addItem($info);
     $this->output();
 }
Esempio n. 15
0
 public function insert_plan_set()
 {
     $set_fid = urldecode($this->input['set_fid']);
     $name = urldecode($this->input['name']);
     $bundle_id = urldecode($this->input['bundle_id']);
     $module_id = urldecode($this->input['module_id']);
     $struct_id = urldecode($this->input['struct_id']);
     $struct_ast_id = urldecode($this->input['struct_ast_id']);
     $num = intval($this->input['num']) ? intval($this->input['num']) : 10;
     $host = urldecode($this->input['host']);
     $path = urldecode($this->input['path']);
     $filename = urldecode($this->input['filename']);
     $action_get_content = urldecode($this->input['action_get_content']);
     $action_insert_contentid = urldecode($this->input['action_insert_contentid']);
     if (empty($name) || empty($num) || empty($host) || empty($path) || empty($filename) || empty($action_get_content) || empty($action_insert_contentid)) {
         $this->errorOutput('缺少相关参数');
     }
     //先插入节点
     $sort_data = array('ip' => hg_getip(), 'create_time' => TIMENOW, 'fid' => $set_fid, 'update_time' => TIMENOW, 'name' => $name, 'brief' => '', 'user_name' => '');
     $this->initNodeData();
     $this->setNodeTable('plan_set');
     $this->setCondition(",bundle_id='" . $bundle_id . "',module_id='" . $module_id . "',struct_id='" . $struct_id . "',struct_ast_id='" . $struct_ast_id . "',host='" . $host . "',path='" . $path . "',filename='" . $filename . "',action_insert_contentid='" . $action_insert_contentid . "',action_get_content='" . $action_get_content . "',num='" . $num . "'");
     $this->setNodeData($sort_data);
     $fid = $this->addNode();
 }
Esempio n. 16
0
 public function verifyToken()
 {
 }
 private function publish_video($id, $op, $column_id = array())
 {
     $id = intval($id);
     if (empty($id)) {
         return false;
     }
     if (empty($op)) {
         return false;
     }
     $sql = "select * from " . DB_PREFIX . "vodinfo where id = " . $id;
     $info = $this->db->query_first($sql);
     if (empty($column_id)) {
         $info['column_id'] = unserialize($info['column_id']);
         if (is_array($info['column_id'])) {
             $column_id = array_keys($info['column_id']);
             $column_id = implode(',', $column_id);
         }
     } else {
         $column_id = implode(',', $column_id);
     }
     require_once ROOT_PATH . 'lib/class/publishplan.class.php';
     $plan = new publishplan();
     $data = array('set_id' => PUBLISH_SET_ID, 'from_id' => $info['id'], 'class_id' => 0, 'column_id' => $column_id, 'title' => $info['title'], 'action_type' => $op, 'publish_time' => $info['pub_time'], 'publish_people' => $this->user['user_name'], 'ip' => hg_getip());
Esempio n. 17
0
 public function create()
 {
     $app_id = $this->input['app_id'];
     $device_token = $this->input['device_token'];
     //应用的id
     if (!$app_id) {
         $this->errorOutput(NO_APP_ID);
     }
     //device_token
     if (!$device_token) {
         $this->errorOutput(NO_DEVICE_TOKEN);
     }
     //激活
     if (!$this->mode->isHasStatistic($app_id, $device_token)) {
         $data = array('device_token' => $device_token, 'app_id' => $app_id, 'source' => $this->input['source'], 'debug' => $this->input['debug'] ? 1 : 0, 'gps_long' => $this->input['gps_long'], 'gps_lati' => $this->input['gps_lati'], 'iccid' => $this->input['iccid'], 'imei' => $this->input['imei'], 'phone_num' => $this->input['phone_num'], 'update_time' => TIMENOW, 'create_time' => TIMENOW, 'ip' => hg_getip(), 'activate_num' => 1);
         $this->mode->create($data);
         //如果是ios客户端同时更新app_info表中 对应的IOS测试安装数量或者发布安装数量+1
         $source = intval($this->input['source']);
         $debug = intval($data['debug']);
         if ($source == 2) {
             $this->applant->updateIosCounts($app_id, $debug);
         }
     }
     //判断今天有没有活跃
     if ($this->mode->isTodayHasLiveness($app_id, $device_token)) {
         $this->errorOutput(TODAY_HAS_LIVENESS);
     } else {
         //记录活跃
         $ret = $this->mode->addLiveness($app_id, $device_token, $this->input['source']);
         if ($ret) {
             $this->addItem('success');
             $this->output();
         }
     }
 }
Esempio n. 18
0
 public function create()
 {
     if (!isset($this->input['name'])) {
         $this->errorOutput(NO_NAME);
     }
     $name = trim($this->input['name']);
     if (!$name) {
         $this->errorOutput(NO_NAME);
     }
     $result = $this->check_exist($name);
     if ($result[0]['total']) {
         $this->errorOutput("NO_DATA_EXIST");
     }
     //专辑类别
     if (isset($this->input['type'])) {
         $params['type'] = intval($this->input['type']);
     } else {
         $params['type'] = 2;
         //用户自定义
     }
     $params['name'] = $name;
     $params['user_id'] = $this->user['user_id'];
     $params['org_id'] = $this->user['org_id'];
     $params['user_name'] = $this->user['user_name'];
     $params['appid'] = $this->user['appid'];
     $params['appname'] = trim($this->user['display_name']);
     $params['create_time'] = TIMENOW;
     $params['ip'] = hg_getip();
     $params['id'] = $this->obj->insert($this->tbname, $params);
     $this->addItem($params);
     $this->output();
 }
Esempio n. 19
0
     }
     $this->addItem($ret);
     $this->output();
 }
 //获取图集里面的图片
 public function get_tuji_pics_content()
 {
     $id = intval($this->input['from_id']);
     $offset = $this->input['offset'] ? intval($this->input['offset']) : 0;
     $num = $this->input['num'] ? intval($this->input['num']) : 10;
     $data_limit = ' LIMIT ' . $offset . ' , ' . $num;
     $sql = "SELECT * FROM " . DB_PREFIX . "tuji WHERE 1 AND id=" . $id;
     $tuji_info = $this->db->query_first($sql);
     if ($this->input['is_update']) {
         $sql = "SELECT * FROM " . DB_PREFIX . "pics WHERE id = {$id} " . $data_limit;
     } else {
         $sql = "SELECT * FROM " . DB_PREFIX . "pics WHERE tuji_id = {$id} AND expand_id = ''" . $data_limit;
     }
     $info = $this->db->query($sql);
     $ret = array();
     while ($row = $this->db->fetch_array($info)) {
         $row['expand_id'] = $tuji_info['expand_id'];
         $row['content_fromid'] = $row['id'];
         $row['indexpic'] = '';
         $row['ip'] = hg_getip();
         $row['user_id'] = $this->user['user_id'];
         $row['user_name'] = $this->user['user_name'];
         $row['pic'] = $row['img_info'];
         $row['title'] = $row['old_name'];
         $row['brief'] = $row['description'];
         unset($row['id'], $row['img_info']);
Esempio n. 20
0
 /**
  * 同步直播服务器数据
  * $is_cache 缓存一份数据到cache目录
  * Enter description here ...
  */
 public function sys_server()
 {
     $is_cache = isset($this->input['is_cache']) ? intval($this->input['is_cache']) : 1;
     $timenow = TIMENOW;
     $server_config = $this->get_server_config($timenow, $is_cache);
     if (empty($server_config)) {
         $this->errorOutput('直播服务器配置不存在,无法同步数据');
     }
     //检测直播服务器是否通路
     foreach ($server_config as $v) {
         $application_data = array('action' => 'select');
         $host = $v['core_in_host'] ? $v['core_in_host'] : $v['host'];
         $input_port = $v['core_in_port'] ? $v['core_in_port'] : $v['input_port'];
         $host = $host . ':' . $input_port;
         $ret_select = $this->mLivemms->outputApplicationOperate($host, $v['output_dir'], $application_data);
         if (!$ret_select) {
             $this->errorOutput($host . ' 这台直播服务器配置有误或者已停止服务');
         }
     }
     //入新直播服务器库
     foreach ($server_config as $v) {
         $data = array('name' => $v['name'], 'brief' => $v['brief'], 'counts' => $v['counts'] ? $v['counts'] : 100, 'protocol' => $protocol ? $protocol : 'http://', 'host' => $v['core_in_host'] ? $v['core_in_host'] : $v['host'], 'input_port' => $v['core_in_port'] ? $v['core_in_port'] : $v['input_port'], 'output_port' => $v['core_out_port'] ? $v['core_out_port'] : $v['output_port'], 'input_dir' => $v['input_dir'] ? $v['input_dir'] : 'inputmanager/', 'output_dir' => $v['output_dir'] ? $v['output_dir'] : 'outputmanager/', 'output_append_host' => $v['dvr_append_host'] ? @serialize($v['dvr_append_host']) : @serialize($v['output_append_host']), 'user_id' => $v['user_id'] ? $v['user_id'] : $this->user['user_id'], 'user_name' => $v['user_name'] ? $v['user_name'] : $this->user['user_name'], 'appid' => $v['appid'] ? $v['appid'] : $this->user['appid'], 'appname' => $v['display_name'] ? $v['display_name'] : $this->user['display_name'], 'create_time' => $v['create_time'] ? $v['create_time'] : TIMENOW, 'update_time' => $v['update_time'] ? $v['update_time'] : TIMENOW, 'ip' => $v['ip'] ? $v['ip'] : hg_getip());
         if ($v['id']) {
             $data['id'] = $v['id'];
             $ret = $this->update('server_config', $data);
         } else {
             $data['id'] = 1;
             $ret = $this->create('server_config', $data);
         }
         $this->addItem($ret);
     }
     $this->output();
 }
Esempio n. 21
0
 public function upload()
 {
     $this->user_unique = $this->settings['cloud_user'];
     $this->secret_key = $this->settings['cloud_secret_key'];
     $title = trim($this->input['title']);
     if (!$title) {
         $title = rawurldecode($this->mFiles['name']);
     }
     $ret = $this->videoUploadInit($title, hg_getip(), $this->mFiles['size']);
     $ret = json_decode($ret, 1);
     file_put_contents(CACHE_DIR . 'le.txt', var_export($ret, 1));
     if ($ret['code']) {
         return $ret['message'];
     }
     $video = array('content_id' => $ret['data']['video_id'], 'extend_data' => $ret['data']['video_unique'], 'notranscode' => 1);
     $this->setVideoInfo($video);
     $upload_url = $ret['data']['upload_url'];
     $ret = $this->videoUpload($this->mFiles['tmp_name'], $upload_url);
     $ret = json_decode($ret, 1);
     if ($ret['code']) {
         return $ret['message'];
     }
     return 'success';
     exit;
 }
Esempio n. 22
0
 public function create()
 {
     if (!isset($this->input['video_id'])) {
         $this->errorOutput("NO_VIDEO_ID");
     }
     $params['video_id'] = intval($this->input['video_id']);
     if (isset($this->input['title'])) {
         $params['title'] = trim($this->input['title']);
     }
     if (isset($this->input['content'])) {
         $params['content'] = trim($this->input['content']);
     }
     //如果参数设置state=0表示审核未通过,则数据库中该字段默认为1表示审核通过
     if (isset($this->input['state'])) {
         $params['state'] = intval($this->input['state']);
     }
     $params['user_id'] = $this->user['user_id'];
     $params['org_id'] = $this->user['org_id'];
     $params['user_name'] = $this->user['user_name'];
     $params['appid'] = $this->user['appid'];
     $params['appname'] = trim($this->user['display_name']);
     $params['create_time'] = TIMENOW;
     $params['id'] = $this->obj->insert($this->tbname, $params);
     $params['ip'] = hg_getip();
     $this->addItem($params);
     $this->output();
 }
Esempio n. 23
0
 public function create()
 {
     if (!$this->user['user_id']) {
         $this->errorOutput(NO_LOGIN);
     }
     if ($this->user['group_type'] == 1) {
         $tmp_bool = $this->obj->checkRight($this->user['org_id']);
         if (isset($tmp_bool['error']) && $tmp_bool['error']) {
             $this->errorOutput($tmp_bool['error']);
             //COMPANY_HAVE_ONLY_ONE);
         }
     }
     if (empty($this->input['name'])) {
         $this->errorOutput(NO_NAME);
     }
     $data = array('name' => trim($this->input['name']) ? trim($this->input['name']) : '', 'tel' => trim($this->input['tel']) ? trim($this->input['tel']) : '', 'address' => trim($this->input['address']) ? trim($this->input['address']) : '', 'legal' => trim($this->input['legal']) ? trim($this->input['legal']) : '', 'token' => hg_generate_user_salt(8), 'create_time' => TIMENOW, 'update_time' => TIMENOW, 'ip' => hg_getip());
     $ret = $this->obj->create($data);
     if ($ret['id']) {
         include_once ROOT_PATH . 'lib/class/auth.class.php';
         $auth = new auth();
         $auth_info = array('name' => $ret['name'], 'fid' => 0);
         $auth_ret = $auth->create_org($auth_info);
         $org_id = $auth_ret['id'];
         if ($org_id) {
             $this->obj->update_org($org_id, $ret['id']);
         }
         $ret['org_id'] = $org_id;
     }
     $this->addItem($ret);
     $this->output();
 }
Esempio n. 24
0
 public function memberAvatarCreate($member_id, $files)
 {
     if ($_FILES['avatar']['tmp_name']) {
         $avatar['Filedata'] = $files;
         //$_FILES['avatar'];
         $material = $this->mMaterial->addMaterial($avatar, $member_id);
         if (!empty($material)) {
             $data = array('member_id' => $member_id, 'imgid' => $material['id'], 'name' => $material['name'], 'filename' => $material['filename'], 'type' => $material['type'], 'filepath' => $material['filepath'], 'url' => $material['url'], 'host' => $material['host'], 'dir' => $material['dir'], 'create_time' => TIMENOW, 'update_time' => TIMENOW, 'ip' => hg_getip());
             $sql = "INSERT INTO " . DB_PREFIX . "member_avatar SET ";
             $space = "";
             foreach ($data as $key => $value) {
                 $sql .= $space . $key . "=" . "'" . $value . "'";
                 $space = ",";
             }
             $this->db->query($sql);
             $data['avatar_id'] = $this->db->insert_id();
             if ($data['avatar_id']) {
                 $sql = "UPDATE " . DB_PREFIX . "member SET avatar = 1 WHERE id = " . $member_id;
                 $this->db->query($sql);
             }
             if ($data['avatar_id']) {
                 return $data;
             }
             return false;
         }
     }
     return false;
 }
Esempio n. 25
0
 /**
  * 创建公告
  * @name create
  * @param $title string 标题
  * @param $content string 正文内容
  * @param $user_id int
  * @param $user_name string
  * @param $content string 正文内容
  * @param $appid int 
  * @param $appname string 
  * @param $sendto int 发送到的组织结构 
  * @param $create_time int 创建时间
  * @param $due_time int 有效时间
  * @param $update_time int 更新时间
  * @param $type int 
  */
 public function create()
 {
     if (!$this->input['title']) {
         $this->errorOutput("标题不能为空");
     }
     if (!$this->input['content']) {
         $this->errorOutput('内容不能为空');
     }
     $userinfo = $this->user;
     $user_id = $userinfo['user_id'];
     $user_name = $userinfo['user_name'];
     $sendto = $this->input['sendto'];
     if (empty($sendto)) {
         $this->errorOutput("没有选择组织机构");
     }
     $info_content = array('title' => $this->input['title'], 'content' => $this->input['content'], 'user_id' => intval($user_id), 'user_name' => $user_name, 'appid' => intval($this->user['appid']), 'appname' => trim($this->user['display_name']), 'ip' => hg_getip(), 'create_time' => TIMENOW, 'due_time' => strtotime($this->input['due_time']), 'update_time' => TIMENOW);
     $notice_content_id = $this->obj->create_notice_content($info_content);
     if (!$notice_content_id) {
         $this->errorOutput('添加公告失败');
     }
     //send to many orgs
     foreach ($sendto as $sendto_org_id => $sendto_org_name) {
         $info = array('notice_id' => $notice_content_id, 'sendto_org_id' => $sendto_org_id, 'sendto_org_name' => $sendto_org_name);
         $notice_id = $this->obj->create_notice($info);
     }
     $this->addItem($notice_id);
     $this->output();
 }
Esempio n. 26
0
 public function get_content()
 {
     $id = intval($this->input['from_id']);
     $offset = $this->input['offset'] ? intval($this->input['offset']) : 0;
     $num = $this->input['num'] ? intval($this->input['num']) : 10;
     $data_limit = ' LIMIT ' . $offset . ' , ' . $num;
     $sql = "select * from " . DB_PREFIX . "article where 1 and id=" . $id;
     $article_info = $this->db->query_first($sql);
     $sql = "SELECT *,host pic_host,dir pic_dir,filepath pic_filepath,filename pic_filename FROM " . DB_PREFIX . "material where 1 and cid=" . $id . " and expand_id = '' and isdel = 1 " . $data_limit;
     $info = $this->db->query($sql);
     $ret = array();
     while ($row = $this->db->fetch_array($info)) {
         $row['bundle_id'] = APP_UNIQUEID;
         $row['module_id'] = MOD_UNIQUEID;
         $row['struct_id'] = 'article';
         $row['struct_ast_id'] = 'material';
         $row['expand_id'] = $article_info['expand_id'];
         $row['content_fromid'] = $row['id'];
         $row['indexpic'] = 'index.php';
         $row['ip'] = hg_getip();
         $row['user_id'] = $this->user['user_id'];
         $row['user_name'] = $this->user['user_name'];
         $row['pic'] = unserialize($row['pic']);
         unset($row['id']);
         $ret[] = $row;
     }
     $this->addItem($ret);
     $this->output();
 }
Esempio n. 27
0
 public function get_status_content()
 {
     $id = intval($this->input['from_id']);
     $sort_id = intval($this->input['sort_id']);
     $offset = $this->input['offset'] ? intval($this->input['offset']) : 0;
     $num = $this->input['num'] ? intval($this->input['num']) : 10;
     $data_limit = ' LIMIT ' . $offset . ' , ' . $num;
     if ($id) {
         $sql = "SELECT * FROM " . DB_PREFIX . "status WHERE 1 AND id = {$id}";
     } else {
         $sql = "SELECT * FROM " . DB_PREFIX . "status WHERE 1 AND type = {$sort_id}";
     }
     $q = $this->db->query($sql);
     $ret = array();
     while ($row = $this->db->fetch_array($q)) {
         $info = array();
         $info['content_fromid'] = $row['id'];
         $info['indexpic'] = '';
         $info['ip'] = hg_getip();
         $info['user_id'] = $this->user['user_id'];
         $info['user_name'] = $this->user['user_name'];
         $info['title'] = $row['text'];
         $info['brief'] = '';
         $info['outlink'] = MOD_UNIQUEID;
         $ret[] = $info;
     }
     $this->addItem($ret);
     $this->output();
 }
Esempio n. 28
0
 /**
  * 串联单生成节目单
  * $channel_id 频道id
  * $dates 日期
  * $theme 节目
  * $start_time 开始时间
  * $end_time 结束时间
  * $schedule_id 串联单id
  * Enter description here ...
  */
 public function schedule2program()
 {
     $channel_id = intval($this->input['channel_id']);
     $dates = trim($this->input['dates']);
     $theme = explode(',|', $this->input['theme']);
     $start_time = explode(',|', $this->input['start_time']);
     $end_time = explode(',|', $this->input['end_time']);
     $schedule_id = explode(',|', $this->input['schedule_id']);
     if (!$channel_id) {
         $this->errorOutput('未传入频道id');
     }
     if (!$dates) {
         $this->errorOutput('未传入日期');
     }
     if (empty($start_time)) {
         $this->errorOutput('开始时间不能为空');
     }
     if (empty($end_time)) {
         $this->errorOutput('结束时间不能为空');
     }
     foreach ($start_time as $k => $v) {
         if ($end_time[$k] <= $start_time[$k]) {
             $this->errorOutput('结束时间不能小于开始时间');
         }
     }
     $weeks = date('W', strtotime($dates));
     $return = array();
     foreach ($start_time as $k => $v) {
         $data = array('channel_id' => $channel_id, 'schedule_id' => $schedule_id[$k], 'start_time' => $start_time[$k], 'toff' => $end_time[$k] - $start_time[$k], 'theme' => $theme[$k] ? $theme[$k] : '精彩节目', 'type_id' => 1, 'weeks' => $weeks, 'dates' => $dates, 'create_time' => TIMENOW, 'update_time' => TIMENOW, 'ip' => hg_getip(), 'is_show' => 1);
         $return[] = $this->mProgram->create($data);
     }
     $this->addItem($return);
     $this->output();
 }
Esempio n. 29
0
 public function show()
 {
     $openid = $this->input['openid'];
     if (!$openid) {
         $this->errorOutput('OPENID IS LOST');
     }
     $sql = 'SELECT id as member_id,uc_id,nick_name,openid FROM ' . DB_PREFIX . 'member WHERE openid = "' . $openid . '"';
     $member = $this->db->query_first($sql);
     if (!$member) {
         $this->errorOutput('User is not bind');
     } else {
         $appid = $this->input['appid'];
         $appkey = $this->input['appkey'];
         $this->curlAuth->setSubmitType('post');
         $this->curlAuth->setReturnFormat('json');
         $this->curlAuth->addRequestData('a', 'show');
         $this->curlAuth->addRequestData('appid', $appid);
         $this->curlAuth->addRequestData('appkey', $appkey);
         $this->curlAuth->addRequestData('ip', hg_getip());
         $this->curlAuth->addRequestData('user_name', $member['nick_name']);
         $this->curlAuth->addRequestData('id', $member['member_id']);
         $this->curlAuth->addRequestData('admin_group_id', 0);
         $this->curlAuth->addRequestData('group_type', 0);
         $ret = $this->curlAuth->request('get_access_token.php');
         $token = $ret[0];
     }
     unset($member['openid']);
     $member['token'] = $token['token'];
     $this->addItem($member);
     $this->output();
 }
Esempio n. 30
0
 public function create()
 {
     $info = array('name' => trim($this->input['name']) ? trim($this->input['name']) : '', 'mark' => trim($this->input['mark']) ? trim($this->input['mark']) : '', 'protocol' => trim($this->input['protocol']) ? trim($this->input['protocol']) : 'http://', 'host' => trim($this->input['host']) ? trim($this->input['host']) : '', 'port' => intval($this->input['port']) ? intval($this->input['port']) : 0, 'dir' => trim($this->input['dir']) ? trim($this->input['dir']) : '/control/recordserver/task', 'state' => intval($this->input['state']) ? intval($this->input['state']) : 0, 'create_time' => TIMENOW, 'ip' => hg_getip());
     if (empty($info['name'])) {
         $this->errorOutput('请传入服务器名');
     }
     if (empty($info['host'])) {
         $this->errorOutput('请传入服务器地址');
     }
     $nodes = array('nodes' => array('program_record_node' => array()));
     $this->verify_content_prms($nodes);
     $record_server = array('protocol' => $info['protocol'], 'host' => $info['host'], 'dir' => $info['dir'], 'port' => $info['port']);
     $check_server = $this->checkServer($info['host'] . ':' . $info['port'] . $info['dir']);
     if ($check_server) {
         $ret_mediaserver = $this->record_server_edit($record_server);
         if (!$ret_mediaserver['result']) {
             $this->errorOutput('修改录制服务器路径失败');
         }
         $ret = $this->obj->create($info);
         if (empty($ret)) {
             $this->errorOutput('更新有误!');
         }
         $this->sys_data($ret['id'], $info['state']);
         //防止老数据没制定录制服务器
         $this->addLogs('新增录制服务配置', '', $ret, '', '', $ret['name']);
         $this->addItem($ret);
         $this->output();
     }
 }