Esempio n. 1
0
}
// deprecated. remove for 1.5 and clean up the /scripts/ directory
if (!isset($kfm_parameters['version_db']) || $kfm_parameters['version_db'] != KFM_VERSION_DB) {
    require KFM_BASE_PATH . 'scripts/dbupdates.php';
}
// }
// { JSON
if (!function_exists('json_encode')) {
    // php-json is not installed
    include_once 'JSON.php';
    include_once KFM_BASE_PATH . 'includes/json.php';
}
// }
// { start session
$session_id = isset($_REQUEST['kfm_session']) ? $_REQUEST['kfm_session'] : '';
$kfm_session = new kfmSession($session_id);
if (isset($_GET['logout']) || isset($_GET['log_out'])) {
    $kfm_session->set('loggedin', 0);
}
$kfm->defaultSetting('kfm_session_id', $kfm_session->key);
// }
// { check authentication
if (isset($use_kfm_security) && !$use_kfm_security) {
    $kfm_session->setMultiple(array('loggedin' => 1, 'user_id' => 1, 'username' => 'CMS user', 'user_status' => 1), false);
}
if (!$kfm_session->get('loggedin') && (!isset($kfm_api_auth_override) || !$kfm_api_auth_override)) {
    $err = '';
    if (isset($_POST['username']) && isset($_POST['password'])) {
        $res = db_fetch_row('SELECT id, username, password, status FROM ' . KFM_DB_PREFIX . 'users WHERE username="******" AND password="******"');
        if ($res && count($res)) {
            $kfm_session->setMultiple(array('user_id' => $res['id'], 'username' => $_POST['username'], 'password' => $_POST['password'], 'user_status' => $res['status'], 'loggedin' => 1));
Esempio n. 2
0
    $kfm_parameters[$r['name']] = $r['value'];
}
if ($kfm_parameters['version'] != KFM_VERSION && file_exists(KFM_BASE_PATH . 'scripts/update.' . KFM_VERSION . '.php')) {
    require KFM_BASE_PATH . 'scripts/update.' . KFM_VERSION . '.php';
}
// }}}
// {{{ JSON
if (!function_exists('json_encode')) {
    // php-json is not installed
    include_once 'JSON.php';
    include_once KFM_BASE_PATH . 'includes/json.php';
}
// }}}
// {{{ start session
$session_id = isset($_GET['kfm_session']) ? $_GET['kfm_session'] : '';
$kfm_session = new kfmSession($session_id);
if ($kfm_session->isNew) {
    $kfm_session->setMultiple(array('cwd_id' => 1, 'language' => '', 'username' => '', 'password' => '', 'loggedin' => 0, 'theme' => $kfm_theme));
}
if (isset($_GET['theme'])) {
    $kfm_session->set('theme', $_GET['theme']);
}
if (isset($_GET['logout']) || isset($_GET['log_out'])) {
    $kfm_session->set('loggedin', 0);
}
$kt = $kfm_session->get('theme');
if ($kt) {
    $kfm_theme = $kt;
} else {
    $kfm_session->set('theme', $kfm_theme);
}