Ejemplo n.º 1
0
" style="display: inline-block;height: 43px;width: 98%;margin: 0px;padding: 0px 20px 0px 90px;font-family: 'Ubuntu', sans-serif;font-size: 18px;font-weight: 400;color: #fff;line-height: 41px;background:rgb(231, 38, 54) url(<?php 
        echo $this->srcURL;
        ?>
/src/image/plus_icon.png) no-repeat 35% 7px scroll;border: none;-webkit-border-radius: 4px;-moz-border-radius: 4px;border-radius: 4px;text-decoration: none;cursor:pointer;">Login With Google +</a>
    </div>
  </div>
<?php 
    } else {
        if ($node == "open") {
            \Response::setTitle("Open Auth");
            if (isset($_GET['c'])) {
                $_SESSION['c'] = urldecode($_GET['c']);
            }
            require_once $this->dir . "/src/inc/open.auth.php";
            $Opth = new OpenAuth("EAtGbLfgxiCJxhwWfsLsyxA0p8Zj4oUyOd4POaVc", "80d23edfa535caf4cc44b91e16c55c0f09e3bed927fecff96b092df0f517f410");
            $access_token = $Opth->login("http://server.lobby.sim/me/open", array("email-send", "read-name"), isset($_GET['facebook']) ? "facebook" : (isset($_GET['google']) ? "google" : "open"));
            if (is_array($access_token)) {
                if ($access_token["error"] == "obtain_failed") {
                    \Response::redirect("/me/login");
                }
            } else {
                if ($access_token != false) {
                    $info = json_decode($Opth->get("info"), true);
                    $status = \Fr\LS2::register($access_token, "", array("name" => $info['name'], "display_name" => $info['name'], "registered" => time()));
                    if (isset($_SESSION['c']) && $_SESSION['c'] != "") {
                        \Fr\LS2::$config['pages']['home_page'] = $_SESSION['c'];
                    }
                    \Fr\LS2::login($access_token, "", true);
                }
            }
            exit;