Exemple #1
0
 public function order()
 {
     $this->Purview_model->checkPurviewAjax($this->tablefunc, 'order');
     $this->Data_model->listorder($this->input->post('ids', true), $this->input->post('listorder', true));
     $this->Cache_model->delete($this->tablefunc);
     show_jsonmsg(array('status' => 205));
 }
Exemple #2
0
 public function restore()
 {
     $this->Purview_model->checkPurviewAjax($this->tablefunc, 'restore');
     $file = read_file($this->defaultpath);
     write_file($this->filepath, $file);
     show_jsonmsg(array('status' => 205));
 }
Exemple #3
0
 public function save()
 {
     $this->Purview_model->checkPurviewAjax($this->tablefunc, 'save');
     $post = $this->input->post(NULL, TRUE);
     $data = elements($this->fields, $post);
     $data['updatetime'] = time();
     $data['lastip'] = $this->input->ip_address();
     $this->Data_model->editData(array('id' => $this->session->userdata('uid')), $data, 'user');
     show_jsonmsg(array('status' => 200));
 }
Exemple #4
0
 public function save()
 {
     $this->Purview_model->checkPurviewAjax($this->tablefunc, 'save');
     $post = $this->input->post(NULL, TRUE);
     $user = $this->Data_model->getSingle(array('id' => $this->session->userdata('uid')), 'user');
     if ($user['password'] != md5pass($post['oldpassword'], $user['salt'])) {
         show_jsonmsg(array('status' => 207, 'remsg' => lang('user_oldpasserror')));
     }
     if (trim($post['password']) != trim($post['password1'])) {
         show_jsonmsg(array('status' => 207, 'remsg' => lang('user_confirmerror')));
     }
     $data = array('password' => md5pass(trim($post['password']), $user['salt']), 'updatetime' => time(), 'lastip' => $this->input->ip_address());
     $this->Data_model->editData(array('id' => $this->session->userdata('uid')), $data, 'user');
     show_jsonmsg(array('status' => 205));
 }
Exemple #5
0
 public function editfile()
 {
     $this->Purview_model->checkPurviewAjax($this->tablefunc, 'edit');
     $post = $this->input->post(NULL, TRUE);
     if ($post['actiontype'] == 1) {
         write_file($post['page'], $this->input->post('content'));
         show_jsonmsg(array('status' => 200));
     } else {
         $content = read_file($post['page']);
         if ($content) {
             $res = array('tpl' => 'view', 'tablefunc' => $this->tablefunc, 'page' => $post['page'], 'content' => $content);
             show_jsonmsg(array('status' => 200, 'remsg' => $this->load->view($this->tablefunc, $res, TRUE)));
         } else {
             show_jsonmsg(203);
         }
     }
 }
Exemple #6
0
 function checkPurviewAjax($class, $method = 'index')
 {
     $status = $this->isPurview($class, $method);
     switch ($status) {
         case '200':
             return true;
             break;
         case '201':
             show_jsonmsg(array('status' => 201, 'remsg' => lang('login_lose')));
             break;
         case '202':
             show_jsonmsg(array('status' => 202, 'remsg' => lang('nopurview')));
             break;
         default:
             show_jsonmsg(array('status' => 202, 'remsg' => lang('nopurview')));
             break;
     }
 }
Exemple #7
0
 public function del()
 {
     $this->Purview_model->checkPurviewAjax($this->tablefunc, 'del');
     $ids = $this->input->post('optid', true);
     if ($ids) {
         $this->Data_model->delData($ids);
         show_jsonmsg(array('status' => 200, 'remsg' => lang('delok'), 'ids' => $ids));
     } else {
         show_jsonmsg(array('status' => 203));
     }
 }
Exemple #8
0
 public function setlang()
 {
     $this->load->model('Lang_model');
     $lang = $this->input->post('lang');
     $this->Lang_model->setLang('edit', $lang);
     show_jsonmsg(200);
 }
Exemple #9
0
 public function del()
 {
     $this->Purview_model->checkPurviewAjax($this->tablefunc, 'del');
     $ids = $this->input->post('optid');
     if ($ids) {
         if (is_array($ids)) {
             foreach ($ids as $item) {
                 @unlink($this->backuppath . base64_decode($item));
             }
         } else {
             @unlink($this->backuppath . base64_decode($ids));
         }
         show_jsonmsg(array('status' => 200, 'remsg' => lang('delok'), 'ids' => $ids));
     } else {
         show_jsonmsg(203);
     }
 }
Exemple #10
0
 public function del()
 {
     $this->Purview_model->checkPurviewAjax($this->tablefunc, 'del');
     $ids = $this->input->post('optid', true);
     if ($ids) {
         $this->Data_model->delData($ids);
         $this->Cache_model->delete($this->tablefunc . '_' . $this->editlang . '_base');
         show_jsonmsg(array('status' => 205));
     } else {
         show_jsonmsg(array('status' => 203));
     }
 }
Exemple #11
0
 public function grant()
 {
     $this->Purview_model->checkPurviewAjax($this->tablefunc, 'grant');
     $post = $this->input->post(NULL, TRUE);
     if ($post['id'] && $post['action'] == site_aurl($this->tablefunc)) {
         $purviewids = $this->input->post('purviewid');
         if ($purviewids) {
             $arr = $this->Data_model->getData(array('status' => 1, 'id' => $purviewids), 'listorder', 0, 0, 'purview');
             $newpurviewid = array();
             $newpurviewarr = array();
             foreach ($arr as $key => $item) {
                 $newpurviewid[] = $item['id'];
                 $newpurviewarr[$item['class']]['id'] = $item['id'];
                 $newpurviewarr[$item['class']]['class'] = $item['class'];
                 $newpurviewarr[$item['class']]['method'] = $this->input->post($item['class'] . '_method');
                 $grouppurview[$item['parent']][] = $item;
                 if ($item['parent'] == 0) {
                     $parentpurview[$item['id']] = $item;
                 }
             }
             $purview = array(0 => $newpurviewid, 1 => $newpurviewarr, 2 => $grouppurview, 3 => $parentpurview);
         } else {
             $purview = array();
         }
         $this->Data_model->editData(array('id' => $post['id']), array('purview' => serialize($purview)));
         show_jsonmsg(200);
     } else {
         $id = $this->uri->segment(4);
         if ($id > 0 && ($view = $this->Data_model->getSingle(array('id' => $id)))) {
             $purview = unserialize($view['purview']);
             $arr = $this->Data_model->getData(array('status' => 1), '', 0, 0, 'purview');
             foreach ($arr as $item) {
                 $item['checkid'] = '<input type=checkbox ' . (isset($purview[0]) && $purview[0] && @in_array($item['id'], $purview[0]) ? 'checked' : '') . ' name=\'purviewid[]\' value=' . $item['id'] . '>';
                 $item['title'] = lang('func_' . $item['class']);
                 if ($item['method'] != '') {
                     $item['methodcheck'] = '<input type="checkbox"  name="' . $item['class'] . '_method[]"  onclick="checkAll(this,\'' . $item['class'] . '_method[]\')">' . lang('checkall');
                     $item['method'] = explode(',', $item['method']);
                     foreach ($item['method'] as $methodview) {
                         $item['methodcheck'] .= '<input type="checkbox" ' . (isset($purview[1][$item['class']]['method']) && $purview[1][$item['class']]['method'] && in_array($methodview, $purview[1][$item['class']]['method']) ? 'checked' : '') . '  name="' . $item['class'] . '_method[]" value="' . $methodview . '">' . lang('btn_' . $methodview);
                     }
                 } else {
                     $item['methodcheck'] = '';
                 }
                 $newarr[] = $item;
             }
             $str = "<tr>" . "<td width=30>\$checkid</td>" . "<td width=150>\$spacer \$title</td>" . "<td>\$methodcheck</td>";
             $arr = array('listarr' => $newarr, 'liststr' => $str);
             $this->load->library('tree', $arr);
             $res = array('tpl' => 'grant', 'tablefunc' => $this->tablefunc, 'view' => $view, 'liststr' => $this->tree->getlist());
             show_jsonmsg(array('status' => 200, 'remsg' => $this->load->view($this->tablefunc, $res, true)));
         } else {
             show_jsonmsg(array('status' => 203));
         }
     }
 }
Exemple #12
0
$params['screenOrientation'] = isset($_GET['so']) ? intval($_GET['so']) : 0;
//1:portrait,2:landscape
$params['winOrientation'] = isset($_GET['wo']) ? intval($_GET['wo']) : 0;
//0,90,-90,180...
$params['flashVersion'] = isset($_GET['fl']) ? rawurldecode($_GET['fl']) : '';
$params['referrer'] = isset($_GET['rf']) ? rawurldecode($_GET['rf']) : '';
$params['uvid'] = isset($_GET['uv']) ? rawurldecode($_GET['uv']) : '';
$params['uid'] = isset($_GET['ud']) ? intval($_GET['ud']) : 0;
$params['cflag1'] = isset($_GET['c1']) ? rawurldecode($_GET['c1']) : '';
$params['cflag2'] = isset($_GET['c2']) ? rawurldecode($_GET['c2']) : '';
$params['cflag3'] = isset($_GET['c3']) ? rawurldecode($_GET['c3']) : '';
if ($url) {
    $vid = V($url, $params);
    show_jsonmsg(array('vid' => $vid));
}
show_jsonmsg(array('vid' => 0));
/**
 * new insert or update `{visiting}` table
 *
 * if $url is a numeric, then for editing;
 * else for new insert, while $url is a string.
 *
 * @param mixed $url
 *   may be a url or a numeric id
 * @param array $params
 *   containing browser extra info, for example:
 *   $params['browserName']
 *   $params['browserVersion']
 *   $params['browserCodeName']
 *   $params['browserLanguage']
 *   $params['userAgent']
Exemple #13
0
 public function ajaxlogin()
 {
     $remsg = $this->load->view('ajaxlogin', '', true);
     show_jsonmsg(200, $remsg);
 }