public function before() { parent::before(); $action = $this->request->action(); if ($action == 'index') { $param = $this->params['action']; $right = array('read' => 'slook', 'save' => 'smodify', 'delete' => 'sdelete', 'update' => 'smodify'); $user_action = $right[$param]; if (!empty($user_action)) { Common::getUserRight('advertise', $user_action); } } if ($action == 'add') { Common::getUserRight('advertise', 'sadd'); } if ($action == 'edit') { Common::getUserRight('advertise', 'smodify'); } if ($action == 'ajax_save') { Common::getUserRight('advertise', 'smodify'); } $this->assign('cmsurl', URL::site()); $this->assign('parentkey', $this->params['parentkey']); $this->assign('itemid', $this->params['itemid']); $this->assign('weblist', Common::getWebList()); }
public function before() { parent::before(); $action = $this->request->action(); if ($action == 'destination') { $right_arr = array('1' => 'linedest', '2' => 'hoteldest', '3' => 'cardest', '4' => 'articledest', '5' => 'spotdest', '6' => 'photodest'); $type_id = Arr::get($_GET, 'typeid'); if (!empty($type_id) && $type_id < 14) { //其它模型判断. $right_moduleid = $right_arr[$type_id]; } else { $right_moduleid = 'destination'; } //主目的地权限 $param = $this->params['action']; if (!empty($param)) { $right = array('read' => 'slook', 'save' => 'smodify', 'delete' => 'sdelete', 'update' => 'smodify', 'addsub' => 'sadd'); $user_action = $right[$param]; if (!empty($user_action)) { Common::getUserRight($right_moduleid, $user_action); } } } $this->assign('parentkey', $this->params['parentkey']); $this->assign('itemid', $this->params['itemid']); $this->assign('templetlist', Common::getUserTemplteList('dest_index')); //获取上传的用户模板 }
public function before() { parent::before(); $action = $this->request->action(); if ($action == 'index') { Common::getUserRight('footernav', 'slook'); } if ($action == 'addnav') { Common::getUserRight('footernav', 'sadd'); } if ($action == 'editnav') { Common::getUserRight('footernav', 'smodify'); } if ($action == 'ajax_del') { Common::getUserRight('footernav', 'sdelete'); } if ($action == 'ajax_savefooternav') { Common::getUserRight('footernav', 'sdelete'); } $this->assign('parentkey', $this->params['parentkey']); $this->assign('itemid', $this->params['itemid']); $this->parentkey = $this->params['parentkey']; $this->itemid = $this->params['itemid']; $weblist = Common::getWebList(); $this->assign('weblist', $weblist); $this->assign('helpico', Common::getIco('help')); $this->model = new Model_FooterNav(); }
public function before() { parent::before(); $action = $this->request->action(); if ($action == 'store') { $param = $this->params['action']; $right = array('read' => 'slook', 'save' => 'smodify', 'delete' => 'sdelete', 'update' => 'smodify'); $user_action = $right[$param]; if (!empty($user_action)) { Common::getUserRight('module', $user_action); } } if ($action == 'index') { Common::getUserRight('module', 'slook'); } if ($action == 'list') { Common::getUserRight('module', 'slook'); } if ($action == 'add') { Common::getUserRight('module', 'smodify'); } if ($action == 'ajax_add_save' || $action == 'ajax_edit_save') { Common::getUserRight('module', 'smodify'); } $this->assign('parentkey', $this->params['parentkey']); $this->assign('itemid', $this->params['itemid']); $weblist = Common::getWebList(); $this->assign('weblist', $weblist); }
public function before() { parent::before(); $action = $this->request->action(); if ($action == 'index') { Common::getUserRight('site', 'slook'); } if ($action == 'add') { Common::getUserRight('site', 'sadd'); } if ($action == 'ajax_addsave') { Common::getUserRight('site', 'smodify'); } if ($action == 'ajax_editsave') { Common::getUserRight('site', 'smodify'); } if ($action == 'ajax_del') { Common::getUserRight('site', 'smodify'); } $this->assign('parentkey', $this->params['parentkey']); $this->assign('itemid', $this->params['itemid']); $this->parentkey = $this->params['parentkey']; $this->itemid = $this->params['itemid']; $weblist = Common::getWebList(); $this->assign('weblist', $weblist); $this->assign('helpico', Common::getIco('help')); }
public function before() { parent::before(); $action = $this->request->action(); if ($action == 'article') { $param = $this->params['action']; $right = array('read' => 'slook', 'save' => 'smodify', 'delete' => 'sdelete', 'update' => 'smodify'); $user_action = $right[$param]; if (!empty($user_action)) { Common::getUserRight('article', $user_action); } } else { if ($action == 'add') { Common::getUserRight('article', 'sadd'); } else { if ($action == 'edit') { Common::getUserRight('article', 'smodify'); } else { if ($action == 'ajax_save') { Common::getUserRight('article', 'smodify'); } } } } $this->assign('parentkey', $this->params['parentkey']); $this->assign('itemid', $this->params['itemid']); $this->assign('weblist', Common::getWebList()); $this->assign('templetlist', Common::getUserTemplteList('article_show')); //获取上传的用户模板 }
public function before() { parent::before(); //$this->request->controller, $action = $this->request->action(); if ($action == 'line') { $param = $this->params['action']; $right = array('read' => 'slook', 'save' => 'smodify', 'delete' => 'sdelete', 'update' => 'smodify'); $user_action = $right[$param]; if (!empty($user_action)) { Common::getUserRight('line', $user_action); } } else { if ($action == 'add') { Common::getUserRight('line', 'sadd'); } else { if ($action == 'edit') { Common::getUserRight('line', 'smodify'); } else { if ($action == 'day') { $param = $this->params['action']; $right = array('add' => 'slook', 'save' => 'smodify', 'del' => 'sdelete'); $user_action = $right[$param] ? $right[$param] : 'slook'; if (!empty($user_action)) { Common::getUserRight('lineday', $user_action); } } else { if ($action == 'price') { $param = $this->params['action']; $right = array('add' => 'slook', 'save' => 'smodify', 'del' => 'sdelete'); $user_action = $right[$param] ? $right[$param] : 'slook'; if (!empty($user_action)) { Common::getUserRight('lineprice', $user_action); } } else { if ($action == 'content') { $param = $this->params['action']; $right = array('save' => 'smodify'); $user_action = $right[$param] ? $right[$param] : 'slook'; if (!empty($user_action)) { Common::getUserRight('linejieshao', $user_action); } } else { if ($action == 'ajax_linesave') { Common::getUserRight('line', 'smodify'); } } } } } } } $this->assign('parentkey', $this->params['parentkey']); $this->assign('itemid', $this->params['itemid']); $this->assign('weblist', Common::getWebList()); $this->assign('sysjiaotong', $this->jiaotong); //交通 $this->assign('templetlist', Common::getUserTemplteList('line_show')); }
public function before() { parent::before(); Common::getUserRight('exchange', 'smodify'); $this->assign('parentkey', $this->params['parentkey']); $this->assign('itemid', $this->params['itemid']); $this->assign('weblist', Common::getWebList()); }
public function before() { parent::before(); Common::getUserRight('databack', 'smodify'); $this->assign('cmsurl', URL::site()); $this->assign('parentkey', $this->params['parentkey']); $this->assign('itemid', $this->params['itemid']); $this->assign('weblist', Common::getWebList()); }
public function before() { parent::before(); $this->assign('parentkey', $this->params['parentkey']); $this->assign('itemid', $this->params['itemid']); Common::getUserRight('email', 'smodify'); $configinfo = ORM::factory('sysconfig')->getConfig(0); $this->assign('configinfo', $configinfo); }
public function before() { parent::before(); $action = $this->request->action(); Common::getUserRight('kefu', 'smodify'); $this->assign('parentkey', $this->params['parentkey']); $this->assign('itemid', $this->params['itemid']); $this->parentkey = $this->params['parentkey']; $this->itemid = $this->params['itemid']; $weblist = Common::getWebList(); $this->assign('weblist', $weblist); $this->assign('helpico', Common::getIco('help')); }
public function before() { parent::before(); $action = $this->request->action(); if ($action == 'car') { $param = $this->params['action']; $right = array('read' => 'slook', 'save' => 'smodify', 'delete' => 'sdelete', 'update' => 'smodify'); $user_action = $right[$param]; if (!empty($user_action)) { Common::getUserRight('car', $user_action); } } else { if ($action == 'add') { Common::getUserRight('car', 'sadd'); } else { if ($action == 'edit') { Common::getUserRight('car', 'smodify'); } else { if ($action == 'kind') { $param = $this->params['action']; $right = array('add' => 'sadd', 'save' => 'smodify', 'del' => 'sdelete'); $user_action = $right[$param] ? $right[$param] : 'slook'; if (!empty($user_action)) { Common::getUserRight('cartype', $user_action); } } else { if ($action == 'price') { $param = $this->params['action']; $right = array('add' => 'sadd', 'save' => 'smodify', 'del' => 'sdelete'); $user_action = $right[$param] ? $right[$param] : 'slook'; if (!empty($user_action)) { Common::getUserRight('carprice', $user_action); } } else { if ($action == 'ajax_carsave') { Common::getUserRight('car', 'smodify'); } } } } } } $this->assign('parentkey', $this->params['parentkey']); $this->assign('itemid', $this->params['itemid']); $this->assign('weblist', Common::getWebList()); $this->assign('carkindidlist', ORM::factory('car_kind')->where('webid=0')->get_all()); $this->assign('templetlist', Common::getUserTemplteList('car_show')); //获取上传的用户模板 }
public function before() { parent::before(); $action = $this->request->action(); if ($action == 'list') { $param = $this->params['action']; $right = array('read' => 'slook', 'save' => 'smodify', 'delete' => 'sdelete', 'update' => 'smodify'); $user_action = $right[$param]; if (!empty($user_action)) { Common::getUserRight('help', $user_action); } } else { if ($action == 'add') { Common::getUserRight('help', 'sadd'); } else { if ($action == 'edit') { Common::getUserRight('help', 'smodify'); } else { if ($action == 'ajax_save') { Common::getUserRight('help', 'smodify'); } else { if ($action == 'kind') { $op = $this->params['action']; if ($op == 'add') { Common::getUserRight('helpattr', 'sadd'); } else { if ($op == 'save') { Common::getUserRight('helpattr', 'smodify'); } else { if ($op == 'del') { Common::getUserRight('helpattr', 'sdelete'); } else { Common::getUserRight('helpattr', 'slook'); } } } } } } } } $this->assign('parentkey', $this->params['parentkey']); $this->assign('itemid', $this->params['itemid']); $this->assign('weblist', Common::getWebList()); $allmodule = ORM::factory('Model')->get_all(); foreach ($allmodule as $item) { $this->type_arr[$item['id']] = $item['modulename']; } }
public function before() { parent::before(); $action = $this->request->action(); if ($action == 'index') { $param = $this->params['action']; $right = array('read' => 'slook', 'addsub' => 'sadd', 'save' => 'smodify', 'delete' => 'sdelete', 'update' => 'smodify'); $user_action = $right[$param]; if (!empty($user_action)) { Common::getUserRight('startplace', $user_action); } } $this->assign('parentkey', $this->params['parentkey']); $this->assign('itemid', $this->params['itemid']); }
public function before() { parent::before(); $action = $this->request->action(); if ($action == 'list') { $param = $this->params['action']; $right = array('read' => 'slook', 'save' => 'smodify', 'delete' => 'sdelete', 'update' => 'smodify'); $user_action = $right[$param]; if (!empty($user_action)) { Common::getUserRight('ticket', $user_action); } } $this->assign('parentkey', $this->params['parentkey']); $this->assign('itemid', $this->params['itemid']); $this->assign('weblist', Common::getWebList()); }
public function before() { parent::before(); $this->assign('parentkey', $this->params['parentkey']); $this->assign('itemid', $this->params['itemid']); Common::getUserRight('msg', 'smodify'); include BASEPATH . '/include/msg.class.php'; $configinfo = ORM::factory('sysconfig')->getConfig(0); $this->assign('configinfo', $configinfo); $uname = $configinfo['cfg_sms_username']; $upass = $configinfo['cfg_sms_password']; $this->uname = $uname; $this->upass = $upass; $sms = new Msg($uname, $upass); $this->sms = $sms; }
public function before() { parent::before(); $action = $this->request->action(); if ($action == 'index') { $param = $this->params['action']; $right = array('read' => 'slook', 'save' => 'smodify', 'delete' => 'sdelete', 'update' => 'smodify'); $user_action = $right[$param]; if (!empty($user_action)) { Common::getUserRight('jieban', $user_action); } } $status = array(array('status' => 0, 'statusname' => '未审核'), array('status' => 1, 'statusname' => '已开启'), array('status' => 2, 'statusname' => '已成团')); $this->assign('parentkey', $this->params['parentkey']); $this->assign('itemid', $this->params['itemid']); $this->assign('typeid', 11); $this->assign('statuslist', json_encode($status)); }
public function before() { parent::before(); $action = $this->request->action(); $type_id = $this->params['typeid'] ? $this->params['typeid'] : 1; $right_arr = array('1' => 'lineattr', '2' => 'hotelattr', '3' => 'carattr', '4' => 'articleattr', '5' => 'spotattr', '6' => 'photoattr', '12' => 'destattr', '13' => 'tuanattr'); $right_moduleid = $right_arr[$type_id]; if ($type_id < 14) { if ($action == 'list') { $param = $this->params['action']; if (!empty($param)) { $right = array('read' => 'slook', 'save' => 'smodify', 'delete' => 'sdelete', 'update' => 'smodify', 'addsub' => 'sadd'); $user_action = $right[$param]; if (!empty($user_action)) { Common::getUserRight($right_moduleid, $user_action); } } } } $this->assign('parentkey', $this->params['parentkey']); $this->assign('itemid', $this->params['itemid']); $this->assign('typeid', $this->params['typeid']); }
public function action_topusernav() { $action = $this->params['action']; $param = $this->params['action']; $right = array('read' => 'slook', 'save' => 'smodify', 'addsub' => 'sadd', 'delete' => 'sdelete', 'update' => 'smodify'); $user_action = $right[$param]; if (!empty($user_action)) { Common::getUserRight('usernav', $user_action); } $attrtable = 'startplace'; //当前操作表 if (empty($action)) { $this->display('stourtravel/app/top_user_nav'); } else { if ($action == 'read') { $node = Arr::get($_GET, 'node'); $list = array(); if ($node == 'root') { $list = ORM::factory('plugin_leftnav')->where('pid', '=', '0')->get_all(); $list[] = array('leaf' => true, 'id' => '0add', 'kindname' => '<button class="dest-add-btn df-add-btn" onclick="addSub(0)">添加</button>', 'allowDrag' => false, 'allowDrop' => false, 'litpic' => 'add', 'displayorder' => 'add'); } else { $list = ORM::factory('plugin_leftnav')->where('pid', '=', $node)->get_all(); foreach ($list as $k => $v) { //$list[$k]['leaf']=true; $list[$k][] = array('leaf' => true, 'id' => $node . 'add', 'kindname' => '<button class="dest-add-btn df-add-btn" onclick="addSub(' . $list[$k]['id'] . ')">添加</button>', 'allowDrag' => false, 'allowDrop' => false, 'litpic' => 'add', 'displayorder' => 'add'); } $list[] = array('leaf' => true, 'id' => $node . 'add', 'kindname' => '<button class="dest-add-btn df-add-btn" onclick="addSub(' . $node . ')">添加</button>', 'allowDrag' => false, 'allowDrop' => false, 'litpic' => 'add', 'displayorder' => 'add'); } echo json_encode(array('success' => true, 'text' => '', 'children' => $list)); } else { if ($action == 'addsub') { $pid = Arr::get($_POST, 'pid'); $model = ORM::factory('plugin_leftnav'); $model->pid = $pid; $model->kindname = "自定义"; $model->displayorder = '9999'; $model->save(); if ($model->saved()) { $model->reload(); echo json_encode($model->as_array()); } } else { if ($action == 'save') { $rawdata = file_get_contents('php://input'); $field = Arr::get($_GET, 'field'); $data = json_decode($rawdata); $id = $data->id; if ($field) { $model = ORM::factory('plugin_leftnav', $id); if ($model->id) { $model->{$field} = $data->{$field}; $model->save(); if ($model->saved()) { echo 'ok'; } else { echo 'no'; } } } } else { if ($action == 'drag') { $moveid = Arr::get($_POST, 'moveid'); $overid = Arr::get($_POST, 'overid'); $position = Arr::get($_POST, 'position'); $movemodel = ORM::factory($attrtable, $moveid); $overmodel = ORM::factory($attrtable, $overid); if ($position == 'append') { $movemodel->pid = $overid; } else { $movemodel->pid = $overmodel->pid; } $movemodel->save(); if ($movemodel->saved()) { echo 'ok'; } else { echo 'no'; } } else { if ($action == 'delete') { $rawdata = file_get_contents('php://input'); $data = json_decode($rawdata); $id = $data->id; if (!is_numeric($id)) { echo json_encode(array('success' => false)); exit; } $model = ORM::factory('plugin_leftnav', $id); $model->delete(); } else { if ($action == 'update') { $id = Arr::get($_POST, 'id'); $field = Arr::get($_POST, 'field'); $val = Arr::get($_POST, 'val'); $model = ORM::factory('plugin_leftnav', $id); if ($model->id) { $model->{$field} = $val; $model->save(); if ($model->saved()) { echo 'ok'; } else { echo 'no'; } } } } } } } } } }
public function before() { parent::before(); $action = $this->request->action(); $moduleids = array('1' => 'lineorder', '2' => 'hotelorder', '3' => 'carorder', '5' => 'spotorder', '8' => 'visaorder', '13' => 'tuanorder'); if ($action == 'index') { $param = $this->params['action']; $typeid = $this->params['typeid']; $right = array('read' => 'slook', 'save' => 'smodify', 'delete' => 'sdelete', 'update' => 'smodify'); $user_action = $right[$param]; $moduleid = $moduleids[$typeid]; if (!empty($user_action)) { Common::getUserRight($moduleid, $user_action); } } else { if ($action == 'view') { $type = $this->params['type']; //订单类型 $typeid = $this->params['typeid']; if (!empty($typeid)) { $moduleid = $moduleids[$typeid]; } else { if ($type == 'dz') { $moduleid = 'dzorder'; } else { if ($type == 'xy') { $moduleid = 'xyorder'; } } } Common::getUserRight($moduleid, 'slook'); } else { if ($action == 'ajax_save') { $type = Arr::get($_POST, 'type'); //订单类型 $typeid = Arr::get($_POST, 'typeid'); if (!empty($typeid)) { $moduleid = $moduleids[$typeid]; } else { if ($type == 'dz') { $moduleid = 'dzorder'; } else { if ($type == 'xy') { $moduleid = 'xyorder'; } } } Common::getUserRight($moduleid, 'smodify'); } else { if ($action == 'dz') { $param = $this->params['action']; $right = array('read' => 'slook', 'save' => 'smodify', 'delete' => 'sdelete', 'update' => 'smodify'); $user_action = $right[$param]; if (!empty($user_action)) { Common::getUserRight('dzorder', $user_action); } } else { if ($action == 'xy') { $param = $this->params['action']; $right = array('read' => 'slook', 'save' => 'smodify', 'delete' => 'sdelete', 'update' => 'smodify'); $user_action = $right[$param]; if (!empty($user_action)) { Common::getUserRight('xyorder', $user_action); } } } } } } $this->assign('parentkey', $this->params['parentkey']); $this->assign('itemid', $this->params['itemid']); }
public function before() { parent::before(); $action = $this->request->action(); if ($action == 'visa') { $param = $this->params['action']; $right = array('read' => 'slook', 'save' => 'smodify', 'delete' => 'sdelete', 'update' => 'smodify'); $user_action = $right[$param]; if (!empty($user_action)) { Common::getUserRight('visa', $user_action); } } else { if ($action == 'add') { Common::getUserRight('visa', 'sadd'); } else { if ($action == 'edit') { Common::getUserRight('visa', 'smodify'); } else { if ($action == 'ajax_save') { Common::getUserRight('visa', 'smodify'); } else { if ($action == 'ajax_visatype_list') { Common::getUserRight('visatype', 'slook'); } else { if ($action == 'ajax_visatype_save') { Common::getUserRight('visatype', 'smodify'); } else { if ($action == 'ajax_visatype_del') { Common::getUserRight('visatype', 'sdelete'); } else { if ($action == 'ajax_visacity_list') { Common::getUserRight('visacity', 'slook'); } else { if ($action == 'ajax_visacity_save') { Common::getUserRight('visacity', 'smodify'); } else { if ($action == 'ajax_visacity_del') { Common::getUserRight('visacity', 'sdelete'); } else { if ($action == 'ajax_visacity_add') { Common::getUserRight('visacity', 'sadd'); } else { if ($action == 'visaarea') { $param = $this->params['action']; $right = array('read' => 'slook', 'addsub' => 'sadd', 'save' => 'smodify', 'delete' => 'sdelete', 'update' => 'smodify'); $user_action = $right[$param]; if (!empty($user_action)) { Common::getUserRight('visaarea', $user_action); } } } } } } } } } } } } } $arealist = ORM::factory('visa_area')->where('pid', '=', 0)->get_all(); $visatypelist = ORM::factory('visa_kind')->get_all(); $citylist = ORM::factory('visa_city')->get_all(); $this->assign('arealist', $arealist); $this->assign('visatypelist', $visatypelist); $this->assign('citylist', $citylist); $this->assign('parentkey', $this->params['parentkey']); $this->assign('itemid', $this->params['itemid']); $this->assign('weblist', Common::getWebList()); $this->assign('templetlist', Common::getUserTemplteList('visa_show')); //获取上传的用户模板 }
public function before() { parent::before(); $action = $this->request->action(); if ($action == 'base') { Common::getUserRight('index', 'smodify'); } if ($action == 'mainnav') { Common::getUserRight('nav', 'slook'); } if ($action == 'addnav') { Common::getUserRight('nav', 'sadd'); } if ($action == 'ajax_addnavsave') { Common::getUserRight('nav', 'smodify'); } if ($action == 'ajax_delnav') { Common::getUserRight('nav', 'sdelete'); } if ($action == 'footer') { Common::getUserRight('nav', 'smodify'); } if ($action == 'logo') { Common::getUserRight('logo', 'smodify'); } if ($action == 'nopic') { Common::getUserRight('nophoto', 'smodify'); } if ($action == 'wx') { Common::getUserRight('weibo', 'smodify'); } if ($action == 'payment') { Common::getUserRight('payment', 'smodify'); } if ($action == 'payment') { Common::getUserRight('payment', 'smodify'); } if ($action == 'ordermail') { Common::getUserRight('ordermail', 'smodify'); } if ($action == 'thirdpart') { Common::getUserRight('thirdpart', 'smodify'); } if ($action == 'watermark') { Common::getUserRight('water', 'smodify'); } if ($action == 'tongji') { Common::getUserRight('tongji', 'smodify'); } if ($action == 'robots') { Common::getUserRight('robots', 'smodify'); } if ($action == 'gonggao') { Common::getUserRight('gonggao', 'smodify'); } if ($action == 'syspara') { Common::getUserRight('sys', 'smodify'); } if ($action == 'payset') { Common::getUserRight('pay', 'smodify'); } if ($action == 'ucenter') { Common::getUserRight('ucenter', 'smodify'); } if ($action == 'webico') { Common::getUserRight('webico', 'smodify'); } if ($action == 'mailport') { Common::getUserRight('mailport', 'smodify'); } $this->assign('parentkey', $this->params['parentkey']); $this->assign('itemid', $this->params['itemid']); $this->parentkey = $this->params['parentkey']; $this->itemid = $this->params['itemid']; $weblist = Common::getWebList(); $this->assign('weblist', $weblist); $this->assign('helpico', Common::getIco('help')); }