Ejemplo n.º 1
0
 public function uk86_send($param = array())
 {
     $msg_tpl = uk86_rkcache('store_msg_tpl', true);
     if (!isset($msg_tpl[$this->code]) || $this->store_id <= 0) {
         return false;
     }
     $tpl_info = $msg_tpl[$this->code];
     $setting_info = Model('store_msg_setting')->getStoreMsgSettingInfo(array('smt_code' => $this->code, 'store_id' => $this->store_id));
     // 发送站内信
     if ($tpl_info['smt_message_switch'] && ($tpl_info['smt_message_forced'] || $setting_info['sms_message_switch'])) {
         $message = uk86_ncReplaceText($tpl_info['smt_message_content'], $param);
         $this->uk86_sendMessage($message);
     }
     // 发送短消息
     if ($tpl_info['smt_short_switch'] && $setting_info['sms_short_number'] != '' && ($tpl_info['smt_short_forced'] || $setting_info['sms_short_switch'])) {
         $param['site_name'] = C('site_name');
         $message = uk86_ncReplaceText($tpl_info['smt_short_content'], $param);
         $this->uk86_sendShort($setting_info['sms_short_number'], $message);
     }
     // 发送邮件
     if ($tpl_info['smt_mail_switch'] && $setting_info['sms_mail_number'] != '' && ($tpl_info['smt_mail_forced'] || $setting_info['sms_mail_switch'])) {
         $param['site_name'] = C('site_name');
         $param['mail_send_time'] = date('Y-m-d H:i:s');
         $subject = uk86_ncReplaceText($tpl_info['smt_mail_subject'], $param);
         $message = uk86_ncReplaceText($tpl_info['smt_mail_content'], $param);
         $this->uk86_sendMail($setting_info['sms_mail_number'], $subject, $message);
     }
 }
Ejemplo n.º 2
0
 public function uk86_send($param = array())
 {
     $msg_tpl = uk86_rkcache('member_msg_tpl', true);
     if (!isset($msg_tpl[$this->code]) || $this->member_id <= 0) {
         return false;
     }
     $tpl_info = $msg_tpl[$this->code];
     $setting_info = Model('member_msg_setting')->getMemberMsgSettingInfo(array('mmt_code' => $this->code, 'member_id' => $this->member_id), 'is_receive');
     if (empty($setting_info) || $setting_info['is_receive']) {
         // 发送站内信
         if ($tpl_info['mmt_message_switch']) {
             $message = uk86_ncReplaceText($tpl_info['mmt_message_content'], $param);
             $this->uk86_sendMessage($message);
         }
         // 发送短消息
         if ($tpl_info['mmt_short_switch']) {
             $this->uk86_getMemberInfo();
             if (!empty($this->mobile)) {
                 $this->member_info['member_mobile'] = $this->mobile;
             }
             if ($this->member_info['member_mobile_bind'] && !empty($this->member_info['member_mobile'])) {
                 $param['site_name'] = C('site_name');
                 $message = uk86_ncReplaceText($tpl_info['mmt_short_content'], $param);
                 $this->uk86_sendShort($this->member_info['member_mobile'], $message);
             }
         }
         // 发送邮件
         if ($tpl_info['mmt_mail_switch']) {
             $this->uk86_getMemberInfo();
             if (!empty($this->email)) {
                 $this->member_info['member_email'] = $this->email;
             }
             if ($this->member_info['member_email_bind'] && !empty($this->member_info['member_email'])) {
                 $param['site_name'] = C('site_name');
                 $param['mail_send_time'] = date('Y-m-d H:i:s');
                 $subject = uk86_ncReplaceText($tpl_info['mmt_mail_subject'], $param);
                 $message = uk86_ncReplaceText($tpl_info['mmt_mail_content'], $param);
                 $this->uk86_sendMail($this->member_info['member_email'], $subject, $message);
             }
         }
     }
 }
Ejemplo n.º 3
0
 /**
  * 找回密码的发邮件处理
  */
 public function find_passwordOp()
 {
     Uk86Language::uk86_read('home_login_register');
     $lang = Uk86Language::uk86_getLangContent();
     $result = uk86_chksubmit(true, true, 'num');
     if ($result !== false) {
         if ($result === -11) {
             showDialog('非法提交');
         } elseif ($result === -12) {
             showDialog('验证码错误');
         }
     }
     if (empty($_POST['email'])) {
         showDialog($lang['login_password_input_email']);
     }
     if (Uk86process::uk86_islock('forget')) {
         showDialog($lang['nc_common_op_repeat'], 'reload');
     }
     $member_model = Model('member');
     $member = $member_model->getMemberInfo(array('member_email' => $_POST['email']));
     if (empty($member) or !is_array($member)) {
         Uk86process::uk86_addprocess('forget');
         showDialog($lang['login_password_email_not_exists'], 'reload');
     }
     // 		if(empty($_POST['email'])){
     // 			showDialog($lang['login_password_input_email'],'reload');
     // 		}
     // 		if(strtoupper($_POST['email'])!=strtoupper($member['member_email'])){
     // 		    Uk86process::uk86_addprocess('forget');
     // 			showDialog($lang['login_password_email_not_exists'],'reload');
     // 		}
     Uk86process::uk86_clear('forget');
     //产生密码
     // 	$new_password	= uk86_random(15);
     // if(!($member_model->editMember(array('member_id'=>$member['member_id']),array('member_passwd'=>md5($new_password))))){
     // 	showDialog($lang['login_password_email_fail'],'reload');
     // }
     $temp = uk86_random(14);
     $_SESSION['temp_identifying_code'] = $temp;
     $_SESSION['temp_identifying_time'] = time();
     //	当然这种机制是有缺陷的,可以扩展uuid等构建缓存等。
     $_SESSION['temp_user_id'] = $member['member_id'];
     $model_tpl = Model('mail_templates');
     $tpl_info = $model_tpl->getTplInfo(array('code' => 'reset_pwd'));
     $param = array();
     $param['site_name'] = C('site_name');
     $param['user_name'] = $member['member_name'];
     $param['site_url'] = SHOP_SITE_URL . '/index.php?act=login&op=forget_password_identify&identity_code=' . $temp;
     $subject = uk86_ncReplaceText($tpl_info['title'], $param);
     $message = uk86_ncReplaceText($tpl_info['content'], $param);
     $email = new Uk86Email();
     $result = $email->uk86_send_sys_email($_POST["email"], $subject, $message);
     showDialog('修改密码链接已经发送至您的邮箱,请在三十分钟内尽快更改密码!', '', 'succ', '', 5);
 }
Ejemplo n.º 4
0
 /**
  * 发送提货码短信消息
  */
 public function sendPickupcode($param)
 {
     $dorder_info = Model('delivery_order')->getDeliveryOrderInfo(array('order_id' => $param['order_id']), 'reciver_mobphone');
     $tpl_info = Model('mail_templates')->getTplInfo(array('code' => 'send_pickup_code'));
     $data = array();
     $data['site_name'] = C('site_name');
     $data['pickup_code'] = $param['pickup_code'];
     $message = uk86_ncReplaceText($tpl_info['content'], $data);
     $sms = new Uk86Sms();
     $result = $sms->uk86_send($dorder_info['reciver_mobphone'], $message);
     if (!$result) {
         return uk86_callback(false, '发送提货码短信消息失败order_id:' . $param['order_id']);
     } else {
         return uk86_callback(true);
     }
 }
Ejemplo n.º 5
0
 /**
  * 修改手机号 - 发送验证码
  */
 public function send_modify_mobileOp()
 {
     $obj_validate = new Uk86Validate();
     $obj_validate->validateparam = array(array("input" => $_GET["mobile"], "require" => "true", 'validator' => 'mobile', "message" => '请正确填写手机号码'));
     $error = $obj_validate->uk86_validate();
     if ($error != '') {
         exit(json_encode(array('state' => 'false', 'msg' => $error)));
     }
     $model_member = Model('member');
     $condition = array();
     $condition['member_mobile'] = $_GET['mobile'];
     $condition['member_id'] = array('neq', $_SESSION['member_id']);
     $member_info = $model_member->getMemberInfo($condition, 'member_id');
     if ($member_info) {
         exit(json_encode(array('state' => 'false', 'msg' => '该手机号已被使用,请更换其它手机号')));
     }
     $update = $model_member->editMember(array('member_id' => $_SESSION['member_id']), array('member_mobile' => $_GET['mobile']));
     if (!$update) {
         exit(json_encode(array('state' => 'false', 'msg' => '系统发生错误,如有疑问请与管理员联系')));
     }
     $verify_code = rand(100, 999) . rand(100, 999);
     $data = array();
     $data['auth_code'] = $verify_code;
     $data['send_acode_time'] = TIMESTAMP;
     $update = $model_member->editMemberCommon($data, array('member_id' => $_SESSION['member_id']));
     if (!$update) {
         exit(json_encode(array('state' => 'false', 'msg' => '系统发生错误,如有疑问请与管理员联系')));
     }
     $model_tpl = Model('mail_templates');
     $tpl_info = $model_tpl->getTplInfo(array('code' => 'modify_mobile'));
     $param = array();
     $param['site_name'] = C('site_name');
     $param['send_time'] = date('Y-m-d H:i', TIMESTAMP);
     $param['verify_code'] = $verify_code;
     $message = uk86_ncReplaceText($tpl_info['content'], $param);
     $sms = new Uk86Sms();
     $result = $sms->uk86_send($_GET["mobile"], $message);
     if ($result) {
         exit(json_encode(array('state' => 'true', 'msg' => '发送成功')));
     } else {
         exit(json_encode(array('state' => 'false', 'msg' => '发送失败')));
     }
 }