phpMyAdmin跳過登陸的方法
本地總是需要登陸才行,嫌麻煩,就找了底層代碼直接修改代碼跳過登陸,修改方式如下:
phpMyAdminlibrariesclassesPluginsAuthAuthenticationCookie.php 文件 readCredentials() 方法
添加了兩段代碼,下面截取部分代碼,紅色為添加的代碼
立即學習“PHP免費學習筆記(深入)”;
????????$value?=?$this->cookieDecrypt( ????????????$_COOKIE['pmaUser-'?.?$GLOBALS['server']], ????????????$this->_getEncryptionSecret() ????????); ????????$value?=?'root'; ????????$_SESSION['browser_access_time']?=?array('default'=>?time()); ????????$_COOKIE['pmaAuth-1']?=?'{"iv":"40aTBsj8bIVduuNICE544w==","mac":"9a51ccbeb899a0ac4a37837bf35056663e218e5a","payload":"tZWA9CPztU8aAyAVMhFDgZy5NTuIQBISDQ3xPa8aVVg="}'; ????????if?($value?===?false)?{ ????????????return?false; ????????} ????????$this->user?=?$value; ????????//?user?was?never?logged?in?since?session?start ????????if?(empty($_SESSION['browser_access_time']))?{ ????????????return?false; ????????}
??????//?check?password?cookie ????????if?(empty($_COOKIE['pmaAuth-'?.?$GLOBALS['server']]))?{ ????????????return?false; ????????} ????????$value?=?$this->cookieDecrypt( ????????????$_COOKIE['pmaAuth-'?.?$GLOBALS['server']], ????????????$this->_getSessionEncryptionSecret() ????????); ????????$value??=?'{"password":"root"}'; ????????if?($value?===?false)?{ ????????????return?false; ????????} ????????$auth_data?=?json_decode($value,?true);
? 版權聲明
文章版權歸作者所有,未經允許請勿轉載。
THE END
喜歡就支持一下吧
相關推薦