/**
  * 更新配置信息
  * @param HttpRequest $request
  */
 public function update(HttpRequest $request)
 {
     $data = $request->getParameter('data');
     $mediaService = Beans::get($this->getServiceBean());
     $result = $mediaService->setMediaData('configs', cn_json_encode($data), $this->loginMedia['id']);
     //更新媒体信息
     if ($result) {
         $this->updateLoginMedia(array('configs' => $data));
         AjaxResult::ajaxSuccessResult();
     } else {
         AjaxResult::ajaxFailtureResult();
     }
 }
Exemplo n.º 2
0
 /**
  * 更新权限
  * @param HttpRequest $request
  */
 public function updatePermission(HttpRequest $request)
 {
     $id = $request->getParameter('id', 'intval');
     $data = $request->getParameter('data');
     if ($id <= 0) {
         AjaxResult::ajaxResult('error', INVALID_ARGS);
     }
     $service = Beans::get($this->getServiceBean());
     $data = cn_json_encode($data);
     if ($service->set('permissions', $data, $id)) {
         $adminService = Beans::get('admin.admin.service');
         $adminService->updateUserPermission($this->loginUser);
         AjaxResult::ajaxSuccessResult();
     } else {
         AjaxResult::ajaxFailtureResult();
     }
 }
 /**
  * 更新媒体管理员角色操作
  * @param HttpRequest $request
  */
 public function update(HttpRequest $request)
 {
     $data = $request->getParameter('data');
     $data['permission'] = cn_json_encode($data['permission']);
     parent::update($data, $request);
 }