作者Jun1004 (孔雀跑到企鹅国)
看板PHP
标题Re: [请益] 请问phpMyadmin的验证机制
时间Thu Jan 11 10:55:46 2007
phpmyadmin 页面都有 include common.lib.php
require_once('./libraries/common.lib.php');
common.lib.php 依照你的设定的 auth_type 去读取不同的lib
require_once './libraries/auth/'.$cfg['Server']['auth_type'].'.auth.lib.php';
登入状态有四个 function
PMA_auth_check : Gets advanced authentication settings
PMA_auth : Displays authentication form
PMA_auth_set_user : Set the user and password after last checkings if required
PMA_auth_fails : User is not allowed to login to MySQL -> authentication
failed
在 phpmyadmin/libraries/auth 资料夹下有三支php,分别是config、cookie、http
config.auth.lib.php
cookie.auth.lib.php
http.auth.lib.php
cookie的方式是第一次打帐号密码後资料存在cookie,下次不用再打,
cookie清掉後就要在打帐号密码
http的方式是每次都会验证帐号密码
如果你想要用phpmyadmin的login验证方式,很简单,只要include common.lib.php
<?php
require_once('./libraries/common.lib.php');
echo "test";
?>
※ 引述《jimshsu (jims)》之铭言:
: 依据你的建议
: 我找到这两个档
: config.inc.php user_password.php
: $cfg['Servers'][$i]['auth_type'] = 'config';
: // Authentication method (config, http or cookie based)?
: $cfg['Servers'][$i]['user'] = 'root'; // MySQL user
: $cfg['Servers'][$i]['password'] = ''; // MySQL password (only needed
: // with 'config' auth_type)
: 我搞不太清楚cookie跟http模式的差别
: 不知道是否有版友了解?
: 因为不同的帐号有不同的资料表
: 所以在我的案例预先写好帐号密码的config显然不行
: 我现在问题是不知道要写什麽变数到session或cookie让myadmin直接可以针测到变数
: 因为phpMyAdmin在http的登入方式~~到底登入後
: 在各个操作页面~~他是如何确认使用者的登入状态?~
: 这点我还搞不懂~~XD
: 若有其他建议~~请多指教
: 谢谢
※ 编辑: Jun1004 来自: 203.95.196.252 (01/11 11:16)