Exemplo n.º 1
0
function initEnv(&$dbHandler)
{
    testlinkInitPage($dbHandler);
    $argsObj = init_args();
    $guiObj = init_gui($dbHandler, $argsObj);
    return array($argsObj, $guiObj);
}
Exemplo n.º 2
0
/**
 * 
 *
 */
function initEnv(&$dbHandler)
{
    testlinkInitPage($dbHandler);
    $argsObj = init_args();
    checkPageAccess($dbHandler, $argsObj);
    // Will exit if check failed
    $guiObj = init_gui($dbHandler, $argsObj);
    return array($argsObj, $guiObj);
}
Exemplo n.º 3
0
require_once 'common.php';
require_once 'doAuthorize.php';
$templateCfg = templateConfiguration();
$doRender = false;
// BUGID 0003129
$op = doDBConnect($db);
if (!$op['status']) {
    $smarty = new TLSmarty();
    $smarty->assign('title', lang_get('fatal_page_title'));
    $smarty->assign('content', $op['dbms_msg']);
    $smarty->display('workAreaSimple.tpl');
    tLog('Connection fail page shown.', 'ERROR');
    exit;
}
$args = init_args();
$gui = init_gui($db, $args);
switch ($args->action) {
    case 'doLogin':
    case 'ajaxlogin':
        doSessionStart();
        unset($_SESSION['basehref']);
        setPaths();
        $op = doAuthorize($db, $args->login, $args->pwd);
        if ($op['status'] < tl::OK) {
            $gui->note = is_null($op['msg']) ? lang_get('bad_user_passwd') : $op['msg'];
            if ($args->action == 'ajaxlogin') {
                echo json_encode(array('success' => false, 'reason' => $gui->note));
            } else {
                $doRender = true;
            }
        } else {
 *  20120703 - kinow - TICKET 4977 - CSRF - Advisory ID: HTB23088
 *
 **/
require_once 'config.inc.php';
require_once 'common.php';
function init_args()
{
    $iParams = array('message' => array(tlInputParameter::STRING_N, 0, 255));
    $pParams = R_PARAMS($iParams);
    $args = new stdClass();
    if (isset($pParams['message'])) {
        $args->message = $pParams['message'];
    }
    return $args;
}
function init_gui($args)
{
    $gui = new stdClass();
    if (isset($args->message)) {
        $gui->message = $args->message;
    } else {
        $gui->message = '';
    }
    return $gui;
}
$templateCfg = templateConfiguration();
$args = init_args();
$gui = init_gui($args);
$smarty = new TLSmarty();
$smarty->assign('gui', $gui);
$smarty->display($templateCfg->default_template);
Exemplo n.º 5
0
require_once 'exttable.class.php';
testlinkInitPage($db, false, false, "checkRights");
$templateCfg = templateConfiguration();
$smarty = new TLSmarty();
$tproject_mgr = new testproject($db);
$tplan_mgr = new testplan($db);
$req_mgr = new requirement_mgr($db);
$req_spec_mgr = new requirement_spec_mgr($db);
$title_sep = config_get('gui_title_separator_1');
$charset = config_get('charset');
$req_cfg = config_get('req_cfg');
list($req_spec_type_labels, $req_type_labels, $status_labels, $labels) = setUpLabels($req_cfg);
list($results_cfg, $status_code_map, $code_status_map, $eval_status_map) = setUpReqStatusCfg();
$args = init_args($tproject_mgr, $tplan_mgr, $req_cfg);
$images = $smarty->getImages();
$gui = init_gui($args, $tplan_mgr);
$i2u = array('edit_icon', 'exec_icon', 'history_small');
foreach ($i2u as $ik) {
    $images[$ik] = $gui->baseHref . $images[$ik];
}
$reqContext = array('tproject_id' => $args->tproject_id, 'tplan_id' => $args->tplan_id, 'platform_id' => $args->platform);
$reqSetX = (array) $req_mgr->getAllByContext($reqContext);
$req_ids = array_keys($reqSetX);
$prefix = $tproject_mgr->getTestCasePrefix($args->tproject_id) . config_get('testcase_cfg')->glue_character;
$req_spec_map = array();
$testcases = array();
// first step: get the requirements and linked testcases with which we have to work,
// order them into $req_spec_map by spec
$gui->total_reqs = 0;
if (count($req_ids)) {
    list($gui->total_reqs, $req_spec_map, $testcases) = buildReqSpecMap($req_ids, $req_mgr, $req_spec_mgr, $tplan_mgr, $args->states_to_show->selected, $args);