Beispiel #1
0
 /**
  * @brief	[Passgate]根据uname获取用户信息
  * @param	var		$varUserName	用户名[字符串|字符串数组]
  * @param	array	$arrFields		指定获取的字段
  * @return	用户不存在或交互失败返回false,否则返回关联数组
  * @note 
  * @author fanmengzhe 
  * @date 2011/06/06 14:20:35
  **/
 public static function getInfoByun($varUserName, $arrFields)
 {
     $ins = Bd_Passport_Passgate::getInstance();
     $ret = $ins->getUserInfoByUname($varUserName, $arrFields);
     if ($ins->isError()) {
         self::$_errno = $ins->getCode();
         self::$_errmsg = $ins->getMessage();
         return false;
     } else {
         return $ret;
     }
 }
Beispiel #2
0
 /**
  * @brief	Talk With Passgate
  * @author	fanmengzhe
  * @param	string	$strMethod	[batget]
  * @param	array	$arrInput	输入数组
  * @return	
  */
 protected static function _____($strMethod, $arrInput)
 {
     $ins = Bd_Passport_Interact::getEngine('Ral');
     $retry = 1;
     while ($retry-- >= 0) {
         $ret = $ins->Call('passgate', $strMethod, $arrInput);
         // Return false when Ral Failed
         if (!is_array($ret)) {
             self::$_errno = -1;
             Bd_Passport_Log::warning('Communication with Passgate failed.', self::$_errno);
             continue;
         }
         if (isset($ret['header']['err_no'])) {
             self::$_errno = $ret['header']['err_no'];
             self::$_errmsg = $ret['header']['errno_info'];
             Bd_Passport_Log::warning("[Input :" . json_encode($arrInput) . "]", -1);
             Bd_Passport_Log::warning("[Output:" . json_encode($ret) . "]", self::$_errno);
             continue;
         } else {
             self::$_errno = 0;
         }
         if (!isset($ret['content'])) {
             Bd_Passport_Log::warning("[Input :" . json_encode($arrInput) . "]", -1);
             Bd_Passport_Log::warning("[Output:" . json_encode($ret) . "]", self::$_errno);
             continue;
         }
         foreach ($ret['content'] as &$content) {
             if (!isset($content['result_params'])) {
                 Bd_Passport_Log::warning("[Input :" . json_encode($arrInput) . "]", -1);
                 Bd_Passport_Log::warning("[Output:" . json_encode($ret) . "]", self::$_errno);
                 continue;
             }
             foreach ($content['result_params'] as $key => &$val) {
                 if (isset($val['taginfo'])) {
                     $val['taginfo'] = self::_parseTagInfo($val['taginfo']);
                 }
                 if (isset($val['taginfo_ex'])) {
                     $val['taginfo_ex'] = self::_parseTagInfoEx($val['taginfo_ex']);
                 }
             }
         }
         return $ret;
     }
     //retry once
     return false;
 }