国产在线愉拍视频_亚洲人片在线观看天堂无码_国产一区二区精选_麻豆av免费观看

關閉X
您當前位置:溧陽安靠信息技術網(wǎng)絡公司 > 常見問題 > 常見問題 > 瀏覽常見問題

modoer點評系統(tǒng)防止注冊機惡意注冊解決辦法

發(fā)布時間:2014年10月26日    作者:溧陽安靠信息技術原創(chuàng)   key:點擊:
modoer點評系統(tǒng)防止注冊機惡意注冊解決辦法

解決辦法:在注冊時添加一個必填的選項,同理可增加其它選項來防止注冊

1.在數(shù)據(jù)表modoer_member里添加字段mobile,字段類型如下

`mobile` varchar(20) NOT NULL DEFAULT ''
2.找到文件/templates/main/default/member_reg.htm,在相應位置(不出意外的話在30行左右)添加
  1. <tr>
2.                          <td align="right" width="100" valign="top">手機號碼:</td>
  1.                         <td width="*">
  2.                             <input type="text" onblur="check_mobile(this);" name="mobile" class="t_input" style="width:200px;" validator="{'empty':'N','errmsg':'請?zhí)顚懩氖謾C號碼。'}" />
  3.                             <span id="msg_mobile" class="formmessage none"></span>
  4.                             <div class="formtip">手機號碼為<span class="font_2">11</span>或<span class="font_2">12</span>個字符</div>
  5.                         </td>
  6.                     </tr>
復制代碼
3.找到文件/static/javascript/member.js,在相應位置(應該在22行左右)添加
  1. function check_mobile(obj) {
  2.         if(!obj.value) {
  3.                 $('#msg_mobile').html('<span class="font_1">請輸入手機號碼.</span>').show();
  4.                 return;
  5.         }
  6.         $.post(Url('member/reg/op/check_mobile'), {'mobile':obj.value,'in_ajax':1}, function(data) {
  7.                 $('#msg_mobile').html(data).show();
  8.         });
  9. }
復制代碼
4.找到文件/core/modules/member/reg.php,在相應位置(48行左右)添加
  1. case 'check_mobile':
  2.     if(!$mobile = trim($_POST['mobile'])) {
  3.         echo lang('member_reg_ajax_mobile_empty'); exit;
  4.     }
  5.     if(!validate::is_mobile($mobile)) {
  6.         echo lang('member_reg_ajax_mobile_invalid'); exit;
  7.     }
  8.     if(!$MOD['existsmobilereg'] && $user->check_mobile_exists($mobile)) {
  9.         echo lang('member_reg_ajax_mobile_exists');
  10.         exit;
  11.     }
  12.     echo lang('member_reg_ajax_mobile_normal'); exit;
  13.     break;
復制代碼
5.找到文件/core/modules/member/model/member_class.php
28行,將
  1. $this->add_field('uid,username,password,password2,email,groupid,nexttime,nextgroupid,point,coin');
復制代碼
修改為
  1. $this->add_field('uid,username,password,password2,email,mobile,groupid,nexttime,nextgroupid,point,coin');
復制代碼
31行,將
  1. $this->add_field_fun('password,email', 'trim');
復制代碼
修改為
  1. $this->add_field_fun('password,email,mobile', 'trim');
復制代碼
150行左右,添加
  1.        $this->loader->helper('validate');
  2.         if(!$post['mobile'] || !validate::is_mobile($post['mobile'])) {
  3.             redirect('member_post_empty_mobile');
  4.         }
復制代碼

163行左右,添加
  1.                 if($this->check_mobile_exists($post['mobile'])) 
  2.                     redirect('member_post_exists_mobile');
復制代碼
182行左右,添加
  1.     function check_mobile_exists($mobile, $without_uid = null) {
  2.         $this->db->from($this->table);
  3.         $this->db->where('mobile',$mobile);
  4.         if($without_uid > 0) $this->db->where_not_equal('uid', $without_uid);
  5.         return $this->db->count() > 0;
  6.     }
復制代碼
6.找到/core/helper/validate.php,在12行左右添加
  1.         function is_mobile($str) {
  2.                 if(strlen($str) == 11){
  3.                         return preg_match('/^(13[0-9]|15[0-9]|153|156|18[0-9])[0-9]{8}$/', $str);
  4.                 }elseif(strlen($str) == 12){
  5.                         return preg_match('/^0(13[0-9]|15[0-9]|153|156|18[0-9])[0-9]{8}$/', $str);
  6.                 }else{
  7.                         return false;
  8.                 }
  9.     }
復制代碼
7.找到/core/modules/member/helper/query.php,在19行,將
  1. $db->select($select?$select:'uid,username,email,groupid,coin,point,reviews,subjects,responds,flowers');
復制代碼
修改為
  1. $db->select($select?$select:'uid,username,email,mobile,groupid,coin,point,reviews,subjects,responds,flowers');
復制代碼
8.找到/core/lang/CH/member.php,在30行左右和45行左右,添加
  1.     'member_reg_ajax_mobile_empty' => '<font color="red">您未填寫手機號碼</font>',
  2.     'member_reg_ajax_mobile_invalid' => '<font color="red">您填寫的手機號碼格式不正確</font>',
  3.     'member_reg_ajax_mobile_exists' => '<font color="red">您填寫的手機號碼已存在</font>',
  4.     'member_reg_ajax_mobile_normal' => '<font color="green">您可以使用這個手機號碼</font>',
復制代碼
  1. 'member_post_empty_mobile' => '對不起,您未填寫手機號碼或者格式錯誤,請返回重寫。',
  2.     'member_post_exists_mobile' => '對不起,您填寫的手機號碼已存在,請返回重寫。',
除非注明,文章均為安靠信息技術原創(chuàng),轉載請注明本文地址:m.wiseohd.com/FAQ/question_33.html

上一篇:modoer點評系統(tǒng)地圖出現(xiàn)亂碼的解決辦法
下一篇:網(wǎng)站設計制作合作須知

安靠首頁 | 服務項目 | 解決方案 | 常見問題 | 溧陽網(wǎng)站建設 | 優(yōu)惠政策 | 友情鏈接 | 申請友鏈 | 網(wǎng)站地圖 最新新聞

安靠信息技術是一家集互聯(lián)網(wǎng)及移動APP應用開發(fā)、網(wǎng)站建設運營、電子商務、企業(yè)服務器技術文件共享安全vpn域應用、

弱電監(jiān)控安裝綜合布線、企業(yè)管理軟件OA、ERP、CRM財務軟件等IT服務于一體的高科技服務型網(wǎng)絡公司。
Copyright 2013 m.wiseohd.com 常州溧陽安靠信息技術