コード例 #1
0
ファイル: AuthController.php プロジェクト: rk4an/centreon
 /**
  * 
  * @method get
  * @route /auth/[i:id]/[a:name]
  */
 public function getDefaultAuthValuesAction()
 {
     $requestParam = $this->getParams('named');
     $auth_id = $requestParam['id'];
     $param_name = strtolower(CamelCaseTransformation::camelCaseToCustom($requestParam['name'], '_'));
     $data = array();
     if (in_array($param_name, self::$authInfosFields)) {
         $contact_template = AuthResourcesInfoRepository::getInfosFromName($param_name, $auth_id);
         if (!empty($contact_template)) {
             $data = array('id' => $contact_template['ar_id'], 'text' => $contact_template['ari_value']);
         }
     }
     return $this->router->response()->json($data);
 }