目的:會員登陸須要 用戶名、密碼、身份識別碼(新增字段)
效果: ![QQ截圖20130104154619.jpg QQ截圖20130104154619.jpg](http://static.javashuo.com/static/loading.gif)
解決方法:
目前數據庫中macaddress字段已經添加,修改了phpcms\modules\member\index.php 635行左右:php
- if($r['macaddress'] != $macaddress) {
- $ip = ip();
- if($rtime && $rtime['times'] < 5) {
- $times = 5 - intval($rtime['times']);
- $this->times_db->update(array('ip'=>$ip, 'times'=>'+=1'), array('username'=>$username));
- } else {
- $this->times_db->insert(array('username'=>$username, 'ip'=>$ip, 'logintime'=>SYS_TIME, 'times'=>1));
- $times = 5;
- }
- showmessage(L('macaddress_error', array('times'=>$times)), 'index.php?m=member&c=index&a=login', 3000);
- } www.bbscms.net
www.bbscms.net
還有:
- //驗證用戶macaddress
- //$macaddress = md5(md5(trim($macaddress)).$r['encrypt']);
- if($_POST['macaddress'] != $macaddress) {
- showmessage(L('macaddress_error', array('times'=>$times)), 'index.php?m=member&c=index&a=login', 3000);
- }
以及phpcms\modules\member\classes\client.class.php 40行左右:html
- public function ps_member_login($macaddress, $username, $password, $isemail=0) {
- if($isemail) {
- if(!$this->_is_email($username)) {
- return -3;
- }
- $return = $this->_ps_send('login', array('macaddress'=>$macaddress, 'email'=>$username, 'password'=>$password));
- } 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綁定訪問技術實現