PHPCMS V9实现硬件地址MAC绑定访问技术实现

目的:会员登录需要 用户名、密码、身份识别码(新增字段)

效果: QQ截图20130104154619.jpg

解决方法:


目前数据库中macaddress字段已经添加,修改了phpcmsmodulesmemberindex.php 635行左右:

  1. if($r['macaddress'] != $macaddress) {                               
  2.                                         $ip = ip();
  3.                                         if($rtime && $rtime['times'] < 5) {
  4.                                                 $times = 5 - intval($rtime['times']);
  5.                                                 $this->times_db->update(array('ip'=>$ip, 'times'=>'+=1'), array('username'=>$username));
  6.                                         } else {
  7.                                                 $this->times_db->insert(array('username'=>$username, 'ip'=>$ip, 'logintime'=>SYS_TIME, 'times'=>1));
  8.                                                 $times = 5;
  9.                                         }
  10.                                         showmessage(L('macaddress_error', array('times'=>$times)), 'index.php?m=member&c=index&a=login', 3000);
  11.                                 }  www.bbscms.net
www.bbscms.net 
还有:
  1. //验证用户macaddress
  2.                                 //$macaddress = md5(md5(trim($macaddress)).$r['encrypt']);
  3.                                 if($_POST['macaddress'] != $macaddress) {                               
  4.                                         showmessage(L('macaddress_error', array('times'=>$times)), 'index.php?m=member&c=index&a=login', 3000);
  5.                                 }

 

以及phpcmsmodulesmemberclassesclient.class.php 40行左右:

  1. public function ps_member_login($macaddress, $username, $password, $isemail=0) {
  2.                 if($isemail) {
  3.                         if(!$this->_is_email($username)) {
  4.                                 return -3;
  5.                         }
  6.                         $return = $this->_ps_send('login', array('macaddress'=>$macaddress, 'email'=>$username, 'password'=>$password));
  7.                 } else {
  •                     $return = $this->_ps_send('login', array('macaddress'=>$macaddress, 'username'=>$username, 'password'=>$password));
  •                 }
  •                 return $return;
  •         }
  • 转自模板超市,原文链接:http://www.bbscms.net/html/website/jiaocheng/20130104/6089_2.html
  • PHPCMS V9实现硬件地址MAC绑定访问技术实现
原文地址:https://www.cnblogs.com/doophp/p/3668375.html