语言包加入:
<item id="addresserr"><![CDATA[不在允许签到范围内]]></item>
pper.inc.php文件中
将下边这段代码:- if(!empty($_G['gp_ajax']) && $_G['uid']){
- $_G['gp_formhash'] =strip_tags($_G['gp_formhash']);
- $formhash = 0;
- if($_G['gp_formhash'] == $_G['formhash']){$formhash = 1;}
- if($formhash){
- $dsu_amuppercked = dsu_amupper();
- if($dsu_amupperimage){
- $returnajax = $return_img;
- }else{
- $returnajax = $return_txt;
- }
- include template('dsu_amupper:ajax');
- }
- }
复制代码
改为:- if(!mip()){
- $returnajax = lang("plugin/dsu_amupper","addresserr");
- include template('dsu_amupper:ajax');
- }else if(!empty($_G['gp_ajax']) && $_G['uid']){
- $_G['gp_formhash'] =strip_tags($_G['gp_formhash']);
- $formhash = 0;
- if($_G['gp_formhash'] == $_G['formhash']){$formhash = 1;}
- if($formhash){
- $dsu_amuppercked = dsu_amupper();
- if($dsu_amupperimage){
- $returnajax = $return_img;
- }else{
- $returnajax = $return_txt;
- }
- include template('dsu_amupper:ajax');
- }
- }
- function mip(){
- if (!empty($_SERVER['HTTP_CLIENT_IP']))
- $ip=$_SERVER['HTTP_CLIENT_IP'];
- else if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
- $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
- else
- $ip=$_SERVER['REMOTE_ADDR'];
- if(substr($ip,0,2)=="127")
- return true;
- else
- return false;
- }
复制代码
下边这段代码中“if(substr($ip,0,2)=="127")”为检验来访IP头两位是不是127,可以按照自己的需求修改
|