Ecshop二次開發如何實現用戶名或Email雙登錄
更新時間:2016-08-08 點擊量:820
Tag關鍵詞: 登錄 ecshop模板 ecshop4.0模板 二次開發 ecshop3.6模板 ecshop小程序
ecshop二次開發實現用戶名和Email能雙登錄,能給廣大的ecshop用戶日常登錄操作帶來便利,那么如何去實現這樣一個功能呢?
下面優易軟件為大家提供解答,方法也比較簡單,已在ecshop2.7.2版測試通過。
打開 /includes/modules/integrates/integrate.php 文件。
找到
if ($this->check_user($username, $password) > 0) |
在它上面添加下面代碼段
if(is_email($username)) { $sql = "select ".$this->field_name." from ".$this->table($this->user_table)." where ".$this->field_email."='".$username."'"; $username = $this->db->getOne($sql); if(!$username) return false; } |
其他版本的ecshop,站長沒有親自測試,相信也可以用此方法來解決。
如果文章對您有幫助,就打賞一個吧