Exemplo n.º 1
0
#######################################################################################

header("Content-Type: text/html;charset=UTF-8");
header("Expires: Thu, 01 Dec 1994 16:00:00 GMT");
header("Last-Modified: ". gmdate("D, d M Y H:i:s"). " GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");

#設定ファイルインクルード
require_once('./config.php');
//----------------------------------------------------------------------
//  ログイン処理 (START)
//----------------------------------------------------------------------
session_start();
authAdmin($userid,$password);
//----------------------------------------------------------------------
//  ログイン処理 (END)
//----------------------------------------------------------------------

//----------------------------------------------------------------------
//  データ保存用ファイル、画像保存ディレクトリのパーミッションチェック (START)
//----------------------------------------------------------------------
$messe = permissionCheck($file_path,$img_updir,$perm_check01,$perm_check02,$perm_check03);
//----------------------------------------------------------------------
//  データ保存用ファイルのパーミッションチェック (END)
//----------------------------------------------------------------------

//モードを取得
$mode = '';
if(!empty($_GET['mode'])){
Exemplo n.º 2
0
<?php

include "../include/common.php";
include "../config.php";
include "../include/session.php";
include "../include/dbconnect.php";
include "../include/auth.php";
if (isset($_SESSION['admin'])) {
    if (isset($_REQUEST['action']) && $_REQUEST['action'] == "logout") {
        session_unset();
        header("Location: ./");
    } else {
        get_page("index", "admin", array());
    }
} else {
    if (isset($_POST['username']) && isset($_POST['password'])) {
        if (authAdmin($_POST['username'], $_POST['password'])) {
            $_SESSION['admin'] = $_POST['username'];
            header("Location: index.php");
        } else {
            header("Location: index.php?message=" . urlencode("Login failed."));
        }
    } else {
        $message = "";
        if (isset($_REQUEST['message'])) {
            $message = $_REQUEST['message'];
        }
        get_page("index_login", "admin", array('message' => $message));
    }
}