function showPage($configItems, $typeOfDemo)
{
    global $manifest;
    global $paths;
    // paths related to the environment
    global $typeOfDemo;
    $paths["webDefault"] = $paths["webHome"] . "/default/templates/" . $typeOfDemo;
    include $paths["templates"] . "/manifest.php";
    $manifest = getManifest($typeOfDemo);
    $basicHTMLstrings = getHTMLstrings($configItems);
    // grab any simple HTML
    //strings from the list of configurations
    $thesePaths = setPaths();
    // paths to all of the needed files
    $finalPaths = evaluatePaths($thesePaths);
    // files opened, html tags added
    $basicHTMLstrings["navigation"] = getNav();
    $finalHTML = getFinalHTML($finalPaths, $basicHTMLstrings);
    $htmlTemplate = getHTMLtemplate($configItems);
    $htmlString = buildPage($htmlTemplate, $finalHTML);
    echo $htmlString;
}
예제 #2
0
파일: login.php 프로젝트: tamtrong/testlink
                $doRender = true;
            }
        } else {
            $args->currentUser = $_SESSION['currentUser'];
            logAuditEvent(TLS("audit_login_succeeded", $args->login, $_SERVER['REMOTE_ADDR']), "LOGIN", $args->currentUser->dbID, "users");
            if ($args->action == 'ajaxlogin') {
                echo json_encode(array('success' => true));
            } else {
                redirect($_SESSION['basehref'] . "index.php" . ($args->preqURI ? "?reqURI=" . urlencode($args->preqURI) : ""));
            }
        }
        break;
    case 'ajaxcheck':
        doSessionStart();
        unset($_SESSION['basehref']);
        setPaths();
        $validSession = checkSessionValid($db, false);
        // Send a json reply, include localized strings for use in js to display a login form.
        echo json_encode(array('validSession' => $validSession, 'username_label' => lang_get('login_name'), 'password_label' => lang_get('password'), 'login_label' => lang_get('btn_login')));
        break;
    case 'loginform':
        $doRender = true;
        break;
}
// BUGID 0003129
if ($doRender) {
    $logPeriodToDelete = config_get('removeEventsOlderThan');
    $g_tlLogger->deleteEventsFor(null, strtotime("-{$logPeriodToDelete} days UTC"));
    $smarty = new TLSmarty();
    $smarty->assign('gui', $gui);
    $smarty->display($templateCfg->default_template);
예제 #3
0
/**
 * General GUI page initialization procedure
 * - init session
 * - init database
 * - check rights
 * - initialize project data (if requested)
 * 
 * @param integer $db DB connection identifier
 * @param boolean $initProject (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, $initProject = FALSE, $bDontCheckSession = false, $userRightsCheckFunction = null)
{
    doSessionStart();
    setPaths();
    set_dt_formats();
    doDBConnect($db);
    static $pageStatistics = null;
    if (!$pageStatistics && config_get('log_level') == 'EXTENDED') {
        $pageStatistics = new tlPageStatistics($db);
    }
    if (!$bDontCheckSession) {
        checkSessionValid($db);
    }
    if ($userRightsCheckFunction) {
        checkUserRightsFor($db, $userRightsCheckFunction);
    }
    // adjust Product and Test Plan to $_SESSION
    if ($initProject) {
        initProject($db, $_REQUEST);
    }
    // used to disable the attachment feature if there are problems with repository path
    /** @TODO this check should not be done anytime but on login and using */
    global $g_repositoryType;
    global $g_attachments;
    global $g_repositoryPath;
    $g_attachments->disabled_msg = "";
    if ($g_repositoryType == TL_REPOSITORY_TYPE_FS) {
        $ret = checkForRepositoryDir($g_repositoryPath);
        if (!$ret['status_ok']) {
            $g_attachments->enabled = FALSE;
            $g_attachments->disabled_msg = $ret['msg'];
        }
    }
}
예제 #4
0
function dashboardInit()
{
    # connect to the datbase
    doDBConnect() or die("Could not connect to DB");
    ini_set('session.gc_maxlifetime', 7200);
    ini_set('session.gc_probability', 1);
    ini_set('session.gc_divisor', 1);
    ini_set('session.bug_compat_42', 0);
    ini_set('session.bug_compat_warn', 0);
    session_save_path("/var/lib/php5/");
    session_get_cookie_params();
    session_start();
    setPaths();
    checkSessionValid();
}
예제 #5
0
/**
 * General GUI page initialization procedure
 * - init session
 * - init database
 * 
 * @param integer $db DB connection identifier
 * @param boolean $checkSession (optional) 
 */
function testlinkInitPage(&$db, $checkSession = true)
{
    doSessionStart();
    setPaths();
    set_dt_formats();
    doDBConnect($db);
    static $pageStatistics = null;
    if (!$pageStatistics && config_get('log_level') == 'EXTENDED') {
        $pageStatistics = new tlPageStatistics($db);
    }
    if ($checkSession) {
        checkSessionValid($db);
    }
}