<?php
include_once "./_common.php";

$g4['title'] = "로그인";
include_once("./_head.php");
// 이미 로그인 중이라면
if ($member['mb_id']) {
    if ($url)
        goto_url($url);
    else
        goto_url($g4['g4m_path']);
}
if ($url)
    $urlencode = urlencode($url);
else
    $urlencode = urlencode($_SERVER['REQUEST_URI']);

if ($g4['https_url']) {
    $login_url = $_GET['url'];
    if ($login_url) {
        if (preg_match("/^\.\.\//", $url)) {
            $login_url = urlencode($g4['url'] . "/" . preg_replace("/^\.\.\//", "", $login_url));
        } else {
            $purl = parse_url($g4['url']);
            if ($purl['path']) {
                $path = urlencode($purl['path']);
                $urlencode = preg_replace("/" . $path . "/", "", $urlencode);
            }
            $login_url = $g4['url'] . $urlencode;
        }
    } else {
        $login_url = $g4['url'];
    }
} else {
    $login_url = $urlencode;
}

$member_skin_path = "{$g4['g4m_path']}/skin/member/{$config['cf_m_member_skin']}";

include_once("{$member_skin_path}/login.skin.php");

include_once("./_tail.php");