示例#1
0
<?php

include_once 'config.php';
include_once 'lib/function.php';
include_once 'lib/mailaddrlib.php';
include_once 'lib/accountlib.php';
session_start();
$errormode = 0;
isset($_SESSION['name']) ? $name = $_SESSION['name'] : ($name = '');
isset($_GET['sid']) ? $sid = h($_GET['sid']) : ($sid = '');
if ($name !== '' || $sid === '') {
    //  header('Location:' . $CFG['HOMEPATH'] . '/index.php');
}
$mail = new MailAddr();
$ac = new ACCOUNT();
$errormode = $ac->chkMailSid($sid);
// 1: SID がDBにない
// 2: 通常ユーザとして登録済
// 3: SIDの登録日が $CFG['LIMITDATE'] より古い
// 4: メールアドレス認証未認証
if ($errormode === 1 || $errormode === 2) {
    header('Location:' . $CFG['HOMEPATH'] . '/index.php');
} else {
    if ($errormode === 3) {
        $ac->delAccountSid($sid);
    }
}
// チェックして問題なかったので、SID を有効化
if ($errormode === 4) {
    $ac->AuthMailAddr($sid);
}