コード例 #1
0
ファイル: login.php プロジェクト: nickfun/newlifeblogger
$b = new nlb_blog($db);
include $config->langfile();
if ($user->isLogedIn) {
    $b->setDateOffset($config->get('server_timezone'), $user->get('timezone'));
}
$action = 'login';
if (isset($_GET['action'])) {
    $action = $_GET['action'];
}
switch ($action) {
    // build login form.
    default:
    case 'login':
        $ets_outter->main_title = $config->get('site_name') . ": " . $l['title-login'];
        $ets_outter->page_title = $l['title-login'];
        $logedin = $user->checklogin();
        if ($logedin) {
            jsRedirect('index.php');
            // we are already loged in.
        }
        $text = new text($_POST, array('username', 'password'));
        $text->validate();
        $text->makeClean('slash_if_needed', 'trim');
        $clean = $text->clean;
        $errors = array();
        $baddata = false;
        if (!empty($_POST)) {
            // data was submitted, check to see if it's good
            $clean = $text->clean;
            if ($text->is_missing_required) {
                $baddata = true;
コード例 #2
0
ファイル: index.php プロジェクト: nickfun/newlifeblogger
require_once 'system/nlb_user.class.php';
require_once 'system/nlb_config.class.php';
require_once 'ets.php';
// Sweet template library
$start = mymicrotime();
$db = new sqldb2($DB_CONFIG);
$config = new nlb_config($db);
$user = new nlb_user($db);
// is someone trying to access a persons blog
$_SERVER['QUERY_STRING'] = urldecode($_SERVER['QUERY_STRING']);
if (!empty($_SERVER['QUERY_STRING']) && ($id = $user->getIdByName($_SERVER['QUERY_STRING'])) > -1) {
    // 	die($id);
    //jsRedirect( script_path . 'blog.php/user/' . $id );
    jsRedirect(build_link('blog.php', array('user' => $id)));
}
$user->checklogin();
require_once $config->langfile();
// include lang file
$b = new nlb_blog($db);
if ($user->isLogedIn) {
    // timezone settings
    $b->setDateOffset($config->get('server_timezone'), $user->get('timezone'));
}
$script_path = script_path;
$_PATH = fetch_url_data();
$action = 'news';
if (isset($_PATH['action'])) {
    $action = $_PATH['action'];
}
$ets = new stdClass();
switch ($action) {