예제 #1
0
<?php

session_start();
require_once '../lib/class.dbConnect.php';
require_once '../lib/class.members.php';
$DB = new dbConn();
$Member = new clsMembers($DB->getConnection());
if ($Member->confirmPasswd(trim($_POST['email']), trim($_POST['currentPasswd'])) === true) {
    echo "true";
} else {
    echo "false";
}
예제 #2
0
require_once '../../../../lib/class.members.php';
require_once '../../../../lib/class.favorites.php';
// Create our Application instance (replace this with your appId and secret).
$facebook = new Facebook(array('appId' => FACEBOOK_APPID, 'secret' => FACEBOOK_SECRET));
$return_url = $_SESSION['return_url'] != "" ? $_SESSION['return_url'] : "/index.php";
$user = $facebook->getUser();
if ($user) {
    try {
        // Proceed knowing you have a logged in user who's authenticated.
        $user_profile = $facebook->api('/me');
    } catch (FacebookApiException $e) {
        error_log($e);
        $user = null;
    }
    $DB = new dbConn();
    $Member = new clsMembers($DB->getConnection());
    $oauth_type = "facebook";
    $result = $Member->getOauthMemberIdx($oauth_type, $user);
    if ($result['r'] == 'success') {
        $_SESSION['USER_IDX'] = $result['idx'];
        $_SESSION['USER_TYPE'] = $oauth_type;
        $_SESSION['USER_ID'] = $user;
        $_SESSION['USER_NAME'] = $user_profile['name'];
        $_SESSION['USER_IMAGE'] = "https://graph.facebook.com/" . $user . "/picture";
        $_SESSION['USER_AGREE'] = $result['policy_agree'];
        $c_idx = "";
        $keyword = "";
        if (!isset($_SESSION['favorite_cidx']) || $_SESSION['favorite_cidx'] != "") {
            $c_idx = $_SESSION['favorite_cidx'];
            $keyword = $_SESSION['favorite_keyword'];
            $_SESSION['favorite_cidx'] = "";
예제 #3
0
/* Create TwitteroAuth object with app key/secret and token key/secret from default phase */
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $_SESSION['oauth_token'], $_SESSION['oauth_token_secret']);
/* Request access tokens from twitter */
$access_token = $connection->getAccessToken($_REQUEST['oauth_verifier']);
/* Save the access tokens. Normally these would be saved in a database for future use. */
$_SESSION['access_token'] = $access_token;
$return_url = $_SESSION['return_url'] != "" ? $_SESSION['return_url'] : "/index.php";
/* Remove no longer needed request tokens */
unset($_SESSION['oauth_token']);
unset($_SESSION['oauth_token_secret']);
/* If HTTP response is 200 continue otherwise send to connect page to retry */
if (200 == $connection->http_code) {
    /* The user has been verified and the access tokens can be saved for future use */
    $content = $connection->get('account/verify_credentials');
    $DB = new dbConn();
    $Member = new clsMembers($DB->getConnection());
    $oauth_type = "twitter";
    $result = $Member->getOauthMemberIdx($oauth_type, $content->id_str);
    if ($result['r'] == 'success') {
        $_SESSION['USER_IDX'] = $result['idx'];
        $_SESSION['USER_TYPE'] = $oauth_type;
        $_SESSION['USER_ID'] = $content->id_str;
        $_SESSION['USER_NAME'] = $content->name;
        $_SESSION['USER_IMAGE'] = $content->profile_image_url;
        $_SESSION['USER_AGREE'] = $result['policy_agree'];
        $c_idx = "";
        $keyword = "";
        if (!isset($_SESSION['favorite_cidx']) || $_SESSION['favorite_cidx'] != "") {
            $c_idx = $_SESSION['favorite_cidx'];
            $keyword = $_SESSION['favorite_keyword'];
            $_SESSION['favorite_cidx'] = "";
예제 #4
0
<?php

session_start();
$re_url = trim($_POST["re_url"]) ? trim($_POST["re_url"]) : trim($_GET["re_url"]);
if ($re_url == "") {
    $re_url = "/";
}
$_SESSION['return_url'] = $re_url;
require_once '../lib/config.php';
require_once '../lib/class.dbConnect.php';
require_once '../lib/class.members.php';
require_once '../lib/class.favorites.php';
$DB = new dbConn();
$Member = new clsMembers($DB->getConnection());
$Favorite = new clsFavorites($DB->getConnection());
$c_idx = trim($_POST['c_idx']);
$keyword = trim($_POST['keyword']);
if (trim($_POST['loginEmail']) == "" || trim($_POST['loginPasswd']) == "") {
    $result['r'] == 'error';
    $DB->historyBackNoMsg();
    return;
}
$arr = array("email" => trim($_POST['loginEmail']), "passwd" => trim($_POST['loginPasswd']));
$result = $Member->loginMember($arr);
if ($result['r'] == 'success') {
    $result['f_idx'] = "";
    $_SESSION['USER_IDX'] = $result['idx'];
    $_SESSION['USER_TYPE'] = "letscc";
    $_SESSION['USER_ID'] = $_POST['loginEmail'];
    $_SESSION['USER_NAME'] = $_POST['loginEmail'];
    $_SESSION['USER_AGREE'] = $result['policy_agree'];
예제 #5
0
<?php

session_start();
require_once 'lib/config.php';
require_once 'lib/class.dbConnect.php';
require_once 'lib/class.members.php';
$DB = new dbConn();
$Member = new clsMembers($DB->getConnection());
if (isset($_COOKIE['userinfo']) || $_COOKIE['userinfo'] != "") {
    if (!isset($_SESSION['USER_IDX']) || $_SESSION['USER_IDX'] == "") {
        if ($memberData = $Member->getDataFromAutoKey($_COOKIE['userinfo'])) {
            $_SESSION['USER_IDX'] = $memberData->idx;
            $_SESSION['USER_TYPE'] = $memberData->type;
            $_SESSION['USER_ID'] = $memberData['email'];
            $_SESSION['USER_NAME'] = $memberData['email'];
            $_SESSION['USER_AGREE'] = $memberData['policy_agree'];
            setcookie("userinfo", $key, time() + 60 * 60 * 24 * 30, "/", ".mistyhand.com");
        }
    }
}
예제 #6
0
<?php

session_start();
$_SESSION['return_url'] = $_SERVER['HTTP_REFERER'];
require_once '../lib/class.dbConnect.php';
require_once '../lib/class.members.php';
$DB = new dbConn();
$Member = new clsMembers($DB->getConnection());
if (trim($_POST['joinEmail'])) {
    if ($Member->existEmail(trim($_POST['joinEmail'])) === false) {
        echo "true";
    } else {
        echo "false";
    }
} else {
    if ($_POST['loginEmail']) {
        if ($Member->existEmail(trim($_POST['loginEmail'])) === false) {
            echo "false";
        } else {
            echo "true";
        }
    } else {
        if ($_POST['passwdEmail']) {
            if ($Member->existEmail(trim($_POST['passwdEmail'])) === false) {
                echo "false";
            } else {
                echo "true";
            }
        }
    }
}
예제 #7
0
<?php

session_start();
$_SESSION['return_url'] = $_SERVER['HTTP_REFERER'];
require_once '../lib/class.dbConnect.php';
require_once '../lib/class.members.php';
$DB = new dbConn();
$Member = new clsMembers($DB->getConnection());
if (trim($_POST['email']) == "") {
    $DB->historyBackNoMsg();
    return;
}
$arr = array("email" => trim($_POST['email']));
$result = $Member->changePasswd($arr);
if ($result['r'] == 'success') {
    $subject = "LetsCC password guide.";
    $content = "<div style='width:80%; height:300px; border:1px solid black;text-align:center; margin:0 auto; overflow:hidden; border:1px solid red;>";
    $content = "<div style='width:80%; margin-top:150px; background-color:#eee;' >Your temporary password is : [" . $result['passwd'] . "] </div>";
    $content .= "</div>";
    if ($Member->sendMail($arr['email'], $subject, $content)) {
        $result['msg'] = "We sent your temporary password to your mail account.";
        $result['passwd'] = "";
    } else {
        $result['r'] = "error";
        $result['msg'] = "Error : Sorry, mail sending is failed.";
        $result['passwd'] = "";
    }
}
echo json_encode($result);
예제 #8
0
<?php

session_start();
$re_url = trim($_POST["re_url"]) ? trim($_POST["re_url"]) : trim($_GET["re_url"]);
if ($re_url == "") {
    $re_url = "/";
}
require_once '../lib/class.dbConnect.php';
require_once '../lib/class.members.php';
$DB = new dbConn();
$Member = new clsMembers($DB->getConnection());
$policy_agree = $_POST['policyAgree'] == 'y' ? $_POST['policyAgree'] : 'n';
if (trim($_POST['joinEmail']) == "" || trim($_POST['joinPasswd']) == "") {
    $DB->historyBackNoMsg();
    return;
}
$arr = array("email" => trim($_POST['joinEmail']), "passwd" => trim($_POST['joinPasswd']), "policy_agree" => trim($policy_agree));
$result = $Member->joinMember($arr);
if ($result['r'] == 'success') {
    $_SESSION['USER_IDX'] = $result['idx'];
    $_SESSION['USER_TYPE'] = "letscc";
    $_SESSION['USER_ID'] = $_POST['joinEmail'];
    $_SESSION['USER_AGREE'] = $result['policy_agree'];
}
header('Location: ' . $re_url);
예제 #9
0
<?php

session_start();
$re_url = trim($_POST["re_url"]) ? trim($_POST["re_url"]) : trim($_GET["re_url"]);
if ($re_url == "") {
    $re_url = "/";
}
$_SESSION['return_url'] = $re_url;
require_once '../lib/class.dbConnect.php';
require_once '../lib/class.members.php';
$DB = new dbConn();
$Member = new clsMembers($DB->getConnection());
if (trim($_POST['email']) == "" || trim($_POST['passwd']) == "") {
    $DB->historyBackNoMsg();
    return;
}
$arr = array("email" => trim($_POST['email']), "passwd" => trim($_POST['passwd']));
$result = $Member->changePasswd($arr);
echo json_encode($result);
예제 #10
0
파일: proc.php 프로젝트: neomparam/letscc
<?php

session_start();
require_once '../../lib/class.dbConnect.php';
require_once '../../lib/class.members.php';
require_once '../../lib/class.favorites.php';
require_once '../../lib/class.contents.php';
$DB = new dbConn();
$Member = new clsMembers($DB->getConnection());
$Favorite = new clsFavorites($DB->getConnection());
$Content = new clsContents($DB->getConnection());
$type = trim($_POST['type']);
$member_idx = trim($_POST['idx']);
$result = array();
if ($type == "del") {
    $f_result = $Favorite->getDatasFromMemberIdx($member_idx);
    for ($i = 0; $i < count($f_result); $i++) {
        $c_idx = $f_result[$i]['c_idx'];
        $Content->decrementFavorite($c_idx);
    }
    $Favorite->delDatasFromMemberIdx($member_idx);
    if ($Member->delMember($member_idx)) {
        $result['r'] = "success";
        $result['msg'] = "Your member information no longer exists.";
    } else {
        $result['r'] = "error";
        $result['msg'] = "Sorry, we failed to delete your member information.";
    }
}
echo json_encode($result);