Пример #1
0
        $msg = "Google Authentication failed!";
    }
}
// Perform login
if (isset($_GET['openid_mode'])) {
    $id = null;
    $ext = new Agency_OpenId_Extension_Ax(array('email' => true), null, 1.0);
    $consumer = new Agency_OpenId_Consumer();
    // we try to verify the user with the information of the openid provider
    if ($consumer->verify($_GET, $id, $ext)) {
        // user verified do we have a database entry?
        $result = mysql_query('SELECT * FROM `' . USERS . '` WHERE `openid` = "' . $id . '";');
        if ($result && mysql_num_rows($result) == 1) {
            $row = mysql_fetch_array($result);
            if ($row['confirmed'] == 1) {
                initSessionData($row);
                if ($_POST['redir']) {
                    header("Location:" . urldecode($_POST['redir']));
                    exit;
                } else {
                    if (!empty($_POST['reauth'])) {
                        header("Location:" . urldecode($_POST['reauth']));
                        exit;
                    } else {
                        header("Location: tofor.php");
                        exit;
                    }
                }
            } else {
                $msg = "Your email is not verified yet. Check your inbox for an email to verify your account first.<br />OR<br /><a href=\"resend.php\">Re-Send Email Confirmation</a>";
            }
Пример #2
0
<?php

include_once '../config.php';
require_once "../class.session_handler.php";
include "check_session.php";
mysql_connect(DB_SERVER, DB_USER, DB_PASSWORD) or die(mysql_error());
mysql_select_db(DB_NAME) or die(mysql_error());
if (!empty($_SESSION['username']) && empty($_SESSION['nickname'])) {
    // setting up session.
    initSessionData($_SESSION['username']);
}
$error = "";
$msg = "";
$filename = "";
$imgWidth = 0;
$imgHeight = 0;
$fileElementName = 'attachment';
if (empty($_SESSION['username'])) {
    $error = 'You need to be logged in to upload a file';
} else {
    if (!empty($_FILES[$fileElementName]['error'])) {
        switch ($_FILES[$fileElementName]['error']) {
            case '1':
                $error = 'The uploaded file exceeds the upload_max_filesize directive in php.ini';
                break;
            case '2':
                $error = 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form';
                break;
            case '3':
                $error = 'The uploaded file was only partially uploaded';
                break;