Exemplo n.º 1
0
 /**
  * 发送文字短信
  * @param unknown $mobile
  * @param unknown $data
  * @param unknown $step
  */
 function send_text($mobile, $data, $step)
 {
     global $_CFG;
     $rest = new REST($this->config['server_domain'], $this->config['server_port'], $this->config['soft_version']);
     $rest->setAccount($this->config['account_sid'], $this->config['account_token']);
     $rest->setAppId($this->config['appId']);
     if ($this->config['debug'] == 1) {
         $rest->setLog(TRUE, ROOT_PATH . '/data/yuntongxun_sms.log');
     }
     $param = array($data['verifycode'], intval($_CFG['ecsdxt_sms_validtime'] / 60), $_CFG['service_phone']);
     // 发送模板短信
     $result = $rest->sendTemplateSMS($mobile, $param, $this->config[$step . '_tmpl']);
     if ($result == NULL) {
         return array('errcode' => 1, 'errmsg' => 'unknown error');
     }
     if ($result->statusCode != 0) {
         return array('errcode' => $result->statusCode, 'errmsg' => $result->statusMsg);
     } else {
         return true;
     }
 }