| | |
| | | return $ErrlogM -> addErrorLog($uid, $type, $content); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 获取邮件、短信模板 |
| | | * @param array $data 传入参数 |
| | |
| | | return array('status' => -1, 'msg' => '信息模板有误,请联系管理员'); |
| | | } |
| | | } |
| | | |
| | | //替换模板中的变量 |
| | | private function _tpl($tpl, $data){ |
| | | unset($data['type']); |
| | |
| | | } |
| | | return $retval; |
| | | } |
| | | |
| | | function insertEmail($data){ |
| | | return $this -> insert_into('email_msg',$data); |
| | | } |
| | | |
| | | function insertMsg($data){ |
| | | return $this -> insert_into('moblie_msg',$data); |
| | | } |
| | | |
| | | /** |
| | | * @desc 根据业务类型,判断后台设置是否开启该类型email提醒,选择设定好的email模板,发送指定类型的邮件 |
| | | * |
| | |
| | | * moblie要发送的手机用户 |
| | | * |
| | | */ |
| | | public function sendEmailType($data, $tpl = NULL) |
| | | { |
| | | public function sendEmailType($data, $tpl = NULL) { |
| | | if (! $this->_isKey('type', $data) || ! $this->_isKey('sy_email_'.$data['type'], $this->config) || $this->config['sy_email_'.$data['type']] != 1) { |
| | | return array( |
| | | 'status' => - 1, |
| | |
| | | private function checkPhone($phone){ |
| | | |
| | | |
| | | $url='https://u.phpyun.com/phone'; |
| | | $url = ''; |
| | | |
| | | $url.='?appSecret='.$this -> config['sy_kh_appsecret'].'&appKey='.$this -> config['sy_kh_appkey'].'&phone='.$phone; |
| | | if (extension_loaded('curl')){ |
| | |
| | | $kh_province = str_replace(",",",",$this -> config['sy_kh_city']); |
| | | $kh_province_arr = explode(',',$kh_province); |
| | | |
| | | foreach($kh_province_arr as $key => $value) |
| | | { |
| | | foreach ($kh_province_arr as $key => $value) { |
| | | $kh_city = @explode('/',$value); |
| | | |
| | | //设定市级地区的情况下优先判断 |
| | |
| | | return array('status' => -1, 'msg' => '发送失败!状态:'.$re['code']."," . $re['message']); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param array $data 传入参数 |
| | |
| | | * @param array $data |
| | | * @return boolean |
| | | */ |
| | | public function checkTime($data) |
| | | { |
| | | public function checkTime($data) { |
| | | $cert_validity = $this->config['moblie_codetime'] * 60; // 验证码有效时间 |
| | | $time = time(); |
| | | $ctime = bcsub($time, $data); |
| | |
| | | * @param string $port 端口:1-PC;2-WAP;5-ADMIN |
| | | * @return array|number[]|string[] |
| | | */ |
| | | public function sendCode($sended, $type, $port='', $user = array(), $length = 6, $validity = 120, $kind = 'msg') |
| | | { |
| | | public function sendCode($sended, $type, $port = '', $user = array(), $length = 6, $validity = 120, $kind = 'msg') { |
| | | |
| | | $time = time(); |
| | | $overtime = $time - $validity; |
| | |
| | | if($num>=5){ |
| | | $data['errmsg'] = '请不要频繁发送邮件!'; |
| | | $data['error'] = 17; |
| | | echo json_encode($data);die; |
| | | echo json_encode($data); |
| | | die; |
| | | } |
| | | |
| | | if ($type == 'getpass'){ |
| | |
| | | } |
| | | return array('error' => $result['status'], 'msg' => $result['msg']); |
| | | } |
| | | |
| | | //按类别发送验证码 |
| | | private function sendType($sended, $type, $code, $kind = 'msg',$user = array(), $port = null){ |
| | | |
| | |
| | | } |
| | | return $result; |
| | | } |
| | | |
| | | //手机验证码类型 |
| | | private function codeType($type){ |
| | | $status = array( |
| | |
| | | 'getpass' => '找回密码' |
| | | ); |
| | | } |
| | | |
| | | //查询接收短信、邮件用户信息 |
| | | private function forsend($user){ |
| | | $info = array( |
| | |
| | | * @param $tag |
| | | * @return array |
| | | */ |
| | | function jycheck($authcode, $tag) |
| | | { |
| | | function jycheck($authcode, $tag) { |
| | | |
| | | $image = false; |
| | | session_start(); |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | ?> |