public function updateAction()
 {
     /**
      * 记录日志
      */
     $log = "数据用户组修改入库\n\nServerIp:\n" . $this->request->getServer('SERVER_ADDR') . "\n\nGET:\n" . var_export($_GET, true) . "\n\nPOST:\n" . var_export($_POST, true);
     $this->oLogManager->push('log', $log);
     //检查权限
     $this->manager->checkMenuPermission($this->sign, Widget_Manager::MENU_PURVIEW_UPDATE);
     $data = $this->request->from('name', 'ClassId');
     $group_id = $this->request->group_id;
     if (!intVal($group_id)) {
         echo json_encode(array('errno' => 1));
         return false;
     }
     if (empty($data['name'])) {
         echo json_encode(array('errno' => 2));
         return false;
     }
     $oGroup = new Widget_Group();
     $res = $oGroup->update($group_id, $data);
     if (!$res) {
         echo json_encode(array('errno' => 9));
         return false;
     }
     echo json_encode(array('errno' => 0));
     return true;
 }
Пример #2
0
 /**
  *
  * 修改管理员组执行页面
  */
 public function updateAction()
 {
     /**
      * 记录日志
      */
     $log = "修改管理员组执行页面\n\nServerIp:\n" . $this->request->getServer('SERVER_ADDR') . "\n\nGET:\n" . var_export($_GET, true) . "\n\nPOST:\n" . var_export($_POST, true);
     $this->oLogManager->push('log', $log);
     $this->manager->checkMenuPermission($this->sign, Widget_Manager::MENU_PURVIEW_UPDATE);
     $group_id = $this->request->group_id;
     $name = $this->request->name;
     $comment = $this->request->comment;
     $bind['name'] = $name;
     if (empty($name)) {
         $response = array('errno' => 1);
         echo json_encode($response);
         return false;
     }
     $Widget_Group = new Widget_Group();
     $res = $Widget_Group->update($group_id, $bind);
     if (!$res) {
         $response = array('errno' => 9);
         echo json_encode($response);
         return false;
     }
     $response = array('errno' => 0);
     echo json_encode($response);
     return true;
 }