TESTLINK验证机制

OpenTest, Solution Add comments |

上篇讲到testlink登陆机制很简单,再看时发现它的验证机制也非常简单。

在一个通用包含的common.php文件里面,testlink设计了个testlinkInitPage函数:

/**
* General page initialization procedure
*
* @param boolean $initProduct (optional) Set true if adjustment of Product or
* Test Plan is required; default is FALSE
* @param boolean $bDontCheckSession (optional) Set to true if no session should be
* started
*/
function testlinkInitPage(&$db,$initProduct = FALSE, $bDontCheckSession = false)
{
doSessionStart() or die(”Could not start session”);
doDBConnect($db) or die(”Could not connect to DB”);

setPaths();
set_dt_formats();//时间格式化
if (!$bDontCheckSession)
checkSessionValid();

checkUserRights($db);

if ($initProduct)
doInitSelection($db) or die(”Could not set session variables”);
}

checkSessionValid来检查session中是否存在$_SESSION['userID'])验证

Leave a Reply

You must be logged in to post a comment.


Powered byWordPress 2.6.2 | Theme by N.Design Studio | Processed in 0.27 秒 苏ICP备07500719号

Entries RSS Comments RSS 登录
Links to Page