Ejemplo n.º 1
0
function checklogin()
{
    $login = new Login();
    $json = new JSON();
    if (!$login->check($_POST['sid'])) {
        $code = '200';
        $data_array[0] = array('result' => 'login first');
        $json_string = $json->ArrayGetjson($data_array, $code);
        echo $json_string;
        die;
    }
    return true;
}
Ejemplo n.º 2
0
 public function xlogin($code = null)
 {
     if ($this->GetData('code')) {
         $code = $this->GetData('code');
     }
     $login = Login::check($code, Site::RemoteIP());
     if (!$login) {
         Site::Flash('error', 'Unable to login');
         Redirect('login');
     }
     $this->site['user'] = $login->user;
     $_SESSION['user'] = $login->user->id;
     setcookie("userkey", $login->user->cookie, time() + 31536000, "/");
     // Get a new Session ID
     session_regenerate_id(true);
     Redirect($login->destination);
 }
Ejemplo n.º 3
0
        $query_result = $this->usuario->getByUsuario($data['usuario'], $data['contrasena']);
        $query_object = $query_result->fetch_object();
        if (is_object($query_object)) {
            if ($query_object->id > 0) {
                $exist = true;
                $this->loguear($query_object);
            } else {
                $exist = false;
            }
        } else {
            $exist = false;
        }
        return $exist;
    }
    private function loguear($usuario)
    {
        if (session_id() == "") {
            session_start();
        }
        $_SESSION['logueado'] = true;
        $_SESSION['usuario'] = array('usuario' => $usuario->usuario, 'tipo_usuario' => $usuario->tipo_usuario, 'id' => $usuario->id);
    }
}
$login = new Login();
if ($login->check($_REQUEST)) {
    header('Location: ../index.php');
    die;
} else {
    header('Location: ../index.php?login=false');
    die;
}
Ejemplo n.º 4
0
if (isset($_POST['login']) && isset($_POST['password']) && $_POST['login'] != '' && $_POST['password'] != '') {
    $loggedstatus = $loginP->islogged($_POST['login']);
    if ($loggedstatus === "not.found") {
        //$loginP->start("null");
        $loggedstatus = "notexist";
        $check_L = false;
    } else {
        if ($loggedstatus === "notlogged") {
            $check_L = $loginP->login($_POST['login'], $_POST['password']);
            echo $check_L;
        } else {
            $check_L = false;
        }
    }
    if ($check_L) {
        $t_login = $loginP->check();
        if ($t_login) {
            $conexion = new MySQL(0);
            $query = 'call GetHomeURL(' . $_SESSION['pais'] . ');';
            $result1 = $conexion->consulta($query);
            $row = $conexion->fetch_row($result1);
            $conexion->MySQLClose();
            switch ($_SESSION['access']) {
                case 1:
                case 2:
                case 3:
                    if (!isset($_SESSION['home'])) {
                        $_SESSION['home'] = 'http://' . URL . DS . 'dashboard' . DS . 'metricas';
                    }
                    break;
                default:
Ejemplo n.º 5
0
<?php

header("Content-type: text/html; charset=utf-8");
/**
 * Start  测试执行代码 
 * 1、游戏客户端向AnySDK框架请求登录验证,AnySDK框架会往登录回调地址(游戏服务端提供并填写到AnySDK打包工具配置中)请求登录验证;
 * 2、游戏服务端在AnySDK框架请求的参数转发到AnySDK统一登录验证服务http://oauth.anysdk.com/api/User/LoginOauth/;
 * 3、由AnySDK统一登录验证服务处理各个渠道的登录验证并返回渠道服务器返回的原始信息及通用信息如channel标识、用户标识uid等;
 * 4、游戏服务端在接收到AnySDK返回的信息后就可以后续游戏逻辑处理,并将渠道返回的原始信息返回给客户端;
 * 5、详细参见http://play.cocos.com/docs/%E7%BB%9F%E4%B8%80%E7%99%BB%E5%BD%95%E9%AA%8C%E8%AF%81
 */
error_reporting(E_ALL);
$login = new Login();
$login->check();
/**
 * End 测试执行代码
 */
class Login
{
    /**
     * debug 模式
     */
    const DEBUG_MODE = TRUE;
    /**
     * anysdk统一登录地址
     * @var string
     */
    private $_loginCheckUrl = 'http://callback-play.cocos.com/api/User/LoginOauth/';
    /**
     * check login
     * 检查登录合法性及返回sdk返回的用户id或部分用户信息
Ejemplo n.º 6
0
	}

} // end Login class

$error="";

$page = new Login();

if (isset($_GET['action']) && $_GET['action']=='logout'){
	$page->logout();
}
if (isset($_SESSION['uid'])){
	$page->go("admin.php");
}else{
	if (isset($_POST['login']) && isset($_POST['password'])){
		if($uid = $page->check($_POST['login'], $_POST['password'])){
				$page->prepare($uid);
				$page->go("admin.php");
		}else{
			$error = "Incorrect login or password";
		}
	}
}
?>
<!DOCTYPE html>
<html lang="eus">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="../../favicon.ico">
<title> External Evidence Based Evaluation - Login </title>
Ejemplo n.º 7
0
 */
require_once dirname(__FILE__) . '/../inc/Login.php';
require_once dirname(__FILE__) . '/../inc/EntriesManager.php';
require_once dirname(__FILE__) . '/../inc/MemberManager.php';
require_once dirname(__FILE__) . '/../inc/MemberByJson.php';
try {
    $act = filter_input(INPUT_GET, 'act');
    $login = new Login(new MemberByJson(MEMBER_REPO_BASE_DIR));
    if ($act == 'login') {
        $login->login(filter_input(INPUT_POST, 'name'), filter_input(INPUT_POST, 'pass'));
    } elseif ($act == 'loginpage') {
        $login->page();
    } elseif ($act == 'logout') {
        $login->logout();
    } else {
        Login::check();
        $user = $login->getInfo('name');
        $entries = new EntriesManager(md5($user));
        switch ($act) {
            case 'add':
                $member = new MemberManager();
                $member->add();
                break;
            case 'detail':
                $entries->getLang();
                break;
            case 'new':
                $entries->addTemp();
                break;
            case 'trans':
                $entries->addLang();
Ejemplo n.º 8
0
<?php

include '../../../josys/koneksi.php';
include '../../c_post.php';
include '../../c_login.php';
$module = $_GET['module'];
$act = $_GET['act'];
$users = new Post('users');
if ($module == 'users') {
    // UPDATE DATA
    if ($act == 'update') {
        $condition = array('username' => $_POST['condition']);
        $check_password = new Login();
        $check_exist = new Post('users');
        $isExist = array('username' => $_POST['condition'], 'password' => md5($_POST['password_users_lama']));
        $hasil_check_exist = $check_exist->get_db('users', $isExist);
        if (!empty($hasil_check_exist) and !empty($_POST['password_users_baru'])) {
            $password_baru = '';
            if ($check_password->check($_POST['condition'], $_POST['password_users_baru'])) {
                $password_baru = md5($_POST['password_users_baru']);
            }
            $p_record = array('password' => $password_baru);
            $users->update_db('users', $condition, 'username', $p_record);
        } else {
            header('location:../../media.php?module=' . $module . "&salah=yes");
            exit;
        }
    }
}
header('location:../../media.php?module=' . $module);