public function act_updateUserCompetence()
 {
     function removeEmpty($v)
     {
         if (trim($v) !== '') {
             return true;
         }
     }
     $nameList = urldecode($_GET['nameList']);
     $nameList = explode(",", $nameList);
     $nameList = array_filter($nameList, "removeEmpty");
     $smsnum = trim($_GET['smsnum']);
     return UserCompetenceModel::updateUserCompetence($nameList, $smsnum);
 }
 /**
  * UserCompetenceAct::act_updateUserCompetence()
  * 修改用户开放授权
  * @param string $competence 授权内容
  * @param int $gid 开放权限ID
  * @return  bool
  */
 public function act_updateUserCompetence()
 {
     $gid = isset($_POST["gid"]) ? intval($_POST["gid"]) : 0;
     $competence = isset($_POST["competence"]) ? post_check($_POST["competence"]) : "";
     $act = isset($_REQUEST["act"]) ? post_check($_REQUEST["act"]) : "";
     $mod = isset($_REQUEST["mod"]) ? post_check($_REQUEST["mod"]) : "";
     if (!AuthUser::checkLogin($mod, $act)) {
         self::$errCode = 20000;
         self::$errMsg = "对不起,您无数据编辑权限!";
         return false;
     }
     if (empty($gid)) {
         self::$errCode = 20001;
         self::$errMsg = "用户开放权限ID有误!";
         return false;
     }
     if (empty($competence)) {
         self::$errCode = 20002;
         self::$errMsg = "用户开放权限内容有误!";
         return false;
     }
     $competence = explode(",", $competence);
     $competences = array();
     foreach ($competence as $v) {
         $vals = explode(":", $v);
         if (!is_array($competences[$vals[0]])) {
             $competences[$vals[0]] = array();
         }
         array_push($competences[$vals[0]], $vals[1]);
     }
     $competences = json_encode($competences);
     $uid = $_SESSION[C('USER_AUTH_SYS_ID')];
     $data = array("gid" => $gid, "competence" => $competences, "editTime" => time(), "edit_user_id" => $uid);
     $res = UserCompetenceModel::updateUserCompetence($gid, $data);
     self::$errCode = UserCompetenceModel::$errCode;
     self::$errMsg = UserCompetenceModel::$errMsg;
     return $res;
 }