Example #1
0
 public function post()
 {
     $this->check_input();
     if (!(0 + $this->data('event'))) {
         $this->error(31);
     }
     $event = $this->event()->get($this->data('event'));
     if ($event['id'] != $this->data('event')) {
         $this->error(31);
     }
     if (!(0 + $this->data('persons'))) {
         $this->error(33);
     }
     $eventController = new eventController();
     $userController = new userController();
     $user = new userModel();
     $user->get($event['user']);
     $event = $eventController->public_data($event, true);
     $event['id'] = $this->data('event');
     $event['host'] = $userController->public_data($user->data(), true);
     $event['free_slots'] = $this->event()->getSlots();
     $data = ['event' => $event, 'persons' => $this->data('persons')];
     if ($event['fb_friends']) {
         Bootstrap::$main->session('fb_friends', 1);
     }
     return $this->status(Bootstrap::$main->session('book', $data));
 }
 public function testUnitStore()
 {
     $input = ['username' => 'foo.bar', 'email' => '*****@*****.**', 'password' => 'asdfg', 'name' => 'foo bar'];
     $request = Mockery::mock('Suitcoda\\Http\\Requests\\userRequest[all]');
     $request->shouldReceive('all')->once()->andReturn($input);
     $model = Mockery::mock('Suitcoda\\Model\\user[newInstance, save]');
     $model->shouldReceive('newInstance')->once()->andReturn($model);
     $model->shouldReceive('save')->once();
     $user = new userController($model);
     $this->assertInstanceOf('Illuminate\\Http\\RedirectResponse', $user->store($request));
 }
Example #3
0
 public function __construct($database, $username, $password)
 {
     $this->db = $database;
     $this->username = $username;
     $this->password = $password;
     $this->error = true;
     parent::__construct($this->db, '', 'insert');
     $this->init();
 }
 public function Run($action, $args)
 {
     $action = strtolower($action);
     if ($action == 'index') {
         userController::index();
     } elseif ($action == 'login') {
         userController::login();
     } elseif ($action == 'new') {
         userController::newUser();
     } elseif ($action == 'logout') {
         userController::logout();
     } elseif ($action == 'view') {
         userController::view((int) $args[0]);
     }
 }
Example #5
0
 public function __construct($database, $username, $password, $rep_password, $email, $phone, $adress, $zip, $area)
 {
     $this->db = $database;
     $this->username = $username;
     $this->password = $password;
     $this->rep_password = $rep_password;
     $this->email = $email;
     $this->phone = $phone;
     $this->adress = $adress;
     $this->zip = $zip;
     $this->area = $area;
     $this->error = true;
     parent::__construct($this->db, '', 'insert');
     $this->init();
 }
 function completeSale($saleID, $buyerID)
 {
     $sale = Sale::loadSale($saleID);
     $buyer = User::load($buyerID);
     $seller = User::load($sale->SellerID);
     if ($sale->ItemType == "Weapon") {
         //spend money
         $buyer->debit($sale->Price);
         $seller->credit($sale->Price);
         //transfer Item
         $sale->Item->UserID = $buyerID;
         $sale->Item->save();
         //send message to seller
         userController::sendMessage($seller->ID, $buyer->ID, "Your shop item " . $sale->Item->Name . " sold to " . $buyer->username . " for " . $sale->Price . "gp.", "What if you need that later?", 2);
         //delete sale
         $sale->delete();
     }
 }
Example #7
0
<?php

include_once "../../controller/user/userController.php";
session_start();
$user = $_SESSION["userSession"];
if (is_null($user)) {
    header("Location: http://www.andreseloysv.com/happy/index.php");
    die;
}
$userController = new userController();
try {
    $userController->follow($user->id, $_POST["wantToFollow_id"]);
    echo "Followed";
} catch (Exception $e) {
    echo "Follow";
    throw new Exception("Failed follow user: "******" Message: " . $e->getMessage());
}
        } else {
            header('Location: ./');
        }
    }
}
switch ($model) {
    case 'user':
        if (isset($_SESSION['user'])) {
            if ($_SESSION['user']->isloggedin()) {
                $u = $_SESSION['user'];
                $c = new userController($u);
                $c->action($action);
            }
        } elseif ($action == 'login') {
            $u = new user();
            $c = new userController($u);
            $c->action('login');
        } else {
            $u = new user();
            $v = new userView($u);
            $v->login();
        }
        break;
    case 'option':
        $u = $_SESSION['user']->username;
        $o = new option($u);
        $c = new optionController($o);
        $c->action($action);
        break;
    case 'none':
        break;
Example #9
0
<?php

include_once '/home/andreslaley/public_html/happy/controller/user/userController.php';
session_start();
$user = $_SESSION["userSession"];
$userController = new userController();
$friendAndFollowers = $userController->getFriendsAndFollowers($user->id);
$nFriend = $friendAndFollowers[0]["followers"];
$nFollowers = $friendAndFollowers[1]["followers"];
?>
<!DOCTYPE html>
<html >
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="description" content="CV, Lebenslauf">
        <meta name="keywords" content="Developer, Web developer, Web Entwickler">
        <meta name="author" content="Andres Sanchez">
        <title>Andres Sanchez</title>
        <link rel="icon" type="../../image/png" href="images/mifavicon.gif" />
        <link href="http://fonts.googleapis.com/css?family=Open+Sans:300,600,700" rel="stylesheet" type="text/css">
        <!-- Latest compiled and minified CSS -->
        <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" >
        <link rel="stylesheet" type="text/css" href="../../css/base.css" />
        <link rel="stylesheet" type="text/css" href="../../css/clubs.css" />
        <script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
    </head>

    <body>
        <!--        firs banner -->
        <nav class="navbar navbar-inverse" id="top-banner">
            <div class="container min-width">
Example #10
0
<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
session_start();
include "./libs/help.php";
$decodedRequest = explodeRequest(filter_input_array(INPUT_GET, $_GET));
// debug($decodedRequest);
$user = new userController();
/*
 * Content can be 3 Kinds of content.
 * 
 * User management -> We use the user controller
 * Content we have (we have a controller for this) -> We use ist
 * Unknown Content (we have no conrtoller -> We use render a failure message
 * 
 */
if ($decodedRequest['controller'] === 'user') {
    $controller = $user;
} else {
    $ctrl = $decodedRequest['controller'] . 'Controller';
    class_exists($ctrl) ? $controller = new $ctrl() : ($controller = new failureController());
}
//Das Layout bekommen und Inhalte setzen
$layout = file_get_contents("./views/layout.html");
$layout = preg_replace("/%CONTENT%/", $controller->{$decodedRequest}['action']($decodedRequest['args']), $layout);
$layout = preg_replace("/%USERACTIONS%/", $user->getMenu(), $layout);
$layout = preg_replace("/%CONTROLLERACTIONS%/", $controller->getMenu(), $layout);
Example #11
0
<?php

include "bootstrap.php";
//load User
include_once "user/user.php";
$user = new User();
$user = $user->load($currentUID);
//Create Hero Controller
include_once "hero/heroController.php";
$heroController = new heroController();
//Create User Controller
include_once "user/userController.php";
$userController = new userController();
//Page Header
$smarty->display("css/css.tpl");
//menu
$smarty->assign("currentpage", "user");
include_once "menu.php";
if (isset($_REQUEST['action'])) {
    if ($_REQUEST['action'] == "DeleteMessage") {
        //@TODO check message exists
        $deleteMessage = new Message();
        $deleteMessage = $deleteMessage->load($_REQUEST['MsgID']);
        if ($deleteMessage->ToID == $currentUID) {
            $deleteMessage->Delete();
        } else {
            $smarty->assign("error", "That message does not belong to you, you cant delete it.");
        }
    } else {
        if ($_REQUEST['action'] == "changePassword") {
            if ($_REQUEST['oldpassword'] != "pass") {
Example #12
0
}
include __DIR__ . '/base.php';
require_once __DIR__ . '/../rest/models/userModel.php';
require_once __DIR__ . '/../rest/models/eventModel.php';
require_once __DIR__ . '/../rest/controllers/userController.php';
if (Bootstrap::$main->isAdmin() && isset($_GET['pretend'])) {
    $id = null;
    $data = [];
    if ($_GET['pretend'] + 0 > 0) {
        $id = $_GET['pretend'];
    } elseif (strstr($_GET['pretend'], '@')) {
        $data['email'] = $_GET['pretend'];
    } else {
        $data['url'] = $_GET['pretend'];
    }
    $user = new userController($id, $data);
    $user->get_pretend();
    Tools::log('pretend', ['admin' => Bootstrap::$main->user['email'], 'id' => $id, 'data' => $data]);
    header('location: ' . Bootstrap::$main->getConfig('app.root') . 'profile');
    die;
}
if (Bootstrap::$main->isAdmin() && isset($_GET['vip'])) {
    $vip = explode(',', $_GET['vip']);
    $model = new userModel($vip[0]);
    $model->_vip = $vip[1] + 0;
    $model->save();
}
$us = false;
if (Bootstrap::$main->isAdmin() && isset($_GET['q'])) {
    $model = new userModel();
    if ($_GET['q'] + 0 > 0) {
Example #13
0
<?php

include_once "../../controller/user/userController.php";
session_start();
$user = $_SESSION["userSession"];
if (is_null($user)) {
    header("Location: http://www.andreseloysv.com/happy/index.php");
    die;
}
$userController = new userController();
try {
    $posts = $userController->getPost($user->id);
    for ($index = 0; $index < count($posts); $index++) {
        //var_dump($posts);
        ?>
 
        <li class="list-group-item old-post">
            <div class="media" data-happy="<?php 
        echo $posts[$index]['date'];
        ?>
">
                <div>
                    <div class="media-left">
                        <a href="#">
                            <img class="media-object img-profile-picture" src="../../image/users/<?php 
        echo $posts[$index]["nick"];
        ?>
/<?php 
        echo $posts[$index]["photo"];
        ?>
" height="64px" width="64px" alt="profile picture">
Example #14
0
<?php

include_once '/home/andreslaley/public_html/happy/controller/user/userController.php';
session_start();
$user = $_SESSION["userSession"];
$serchedUser = $_SESSION["serchedUser"];
$userController = new userController();
$areWeFriends = $userController->areWeFriends($user->id, $serchedUser->id);
if ($areWeFriends) {
    $css = "btn-danger";
    $function = "unFolow()";
    $amIFollow = "Followed";
} else {
    $css = "btn-default";
    $function = "follow()";
    $amIFollow = "Follow";
}
?>
<!DOCTYPE html>
<html >
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="description" content="CV, Lebenslauf">
        <meta name="keywords" content="Developer, Web developer, Web Entwickler">
        <meta name="author" content="Andres Sanchez">
        <title>Andres Sanchez</title>
        <link rel="icon" type="../../image/png" href="images/mifavicon.gif" />
        <link href="http://fonts.googleapis.com/css?family=Open+Sans:300,600,700" rel="stylesheet" type="text/css">
        <!-- Latest compiled and minified CSS -->
        <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" >
        <link rel="stylesheet" type="text/css" href="../../css/base.css" />
Example #15
0
<?php

include 'init.php';
if (isset($_GET['logout'])) {
}
if (isset($_POST['sso'])) {
    $controller = new userController();
    $result = $controller->login($_POST['sso'], $_POST['password']);
    if ($result == true) {
        header('location: index.php');
    }
    if ($result == false) {
        echo '<div class="alert alert-warning alert-dismissible" role="alert" style="width: 620px; margin: auto;">
								<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
								There was an error with your login, please try again.
								</div>';
    }
}
?>

<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="ITLP value reward system">
    <meta name="author" content="Purple B">
    <link rel="icon" href=""><!-- to fill in-->

    <title>ITLP Value Reward System</title>
Example #16
0
<?php

include "bootstrap.php";
include_once "user/user.php";
$smarty->display("css/css.tpl");
//menu
$smarty->assign("currentpage", "bug");
include_once "menu.php";
//check if form was submitted
if (isset($_REQUEST['submit'])) {
    include_once "user/userController.php";
    userController::sendMessage(1, $currentUID, '<span class="glyphicon glyphicon-asterisk"></span> BUG/SUGGESTION ' . $_REQUEST['subject'], $_REQUEST['body'], 3);
    $smarty->assign("message", "Your Bug / Suggestion '" . $_REQUEST['subject'] . "' has been submitted");
}
$smarty->display("bug.tpl");
Example #17
0
File: route.php Project: FebV/forum
if ($ctrl == 'posts' && $method == 'GET') {
    include 'view/post.php';
}
if ($ctrl == 'post' && $method == 'GET') {
    $con = new commentController();
    $con->return_comments_list($param);
}
if ($ctrl == 'post' && $method == 'POST') {
    $con = new postController();
    $con->new_post();
}
if ($ctrl == 'comment' && $method == 'POST') {
    $con = new commentController();
    $con->new_comment();
}
if ($ctrl == 'search' && $method == 'GET') {
    $con = new searchController();
    $con->search();
}
if ($ctrl == 'user' && $method == 'POST') {
    $con = new userController();
    $con->new_user();
}
if ($ctrl == 'user' && $method == 'GET') {
    $con = new userController();
    $con->get_profile();
}
if ($ctrl == 'login' && $method == 'POST') {
    $con = new authController();
    $con->login();
}
Example #18
0
<?php

include_once "bootstrap.php";
/*********Generate Hero*********/
include_once "hero/heroController.php";
$heroController = new heroController();
include_once "user/userController.php";
$userController = new userController();
$user = new User();
$user = $user->load($currentUID);
$newHeroCost = $heroController->getCostForNextHero($currentUID);
if ($user->canAfford($newHeroCost)) {
    $user->gold -= $newHeroCost;
    $user->Save();
    $Hero = new Hero();
    $Hero->GenerateHero(1);
    // $_REQUEST["level"]); //generate lvl1 Hero
    $Hero->GiveToUser($currentUID);
    $Hero->generateStartingWeapon();
    //@TODO move this into hero controller so it can follow the correct process (create, give, weapon, ect)
    //save hero
    $Hero->SaveHero();
    /***********end generate Hero *********/
    //check for referer bonus
    if ($newHeroCost > 0 && $user->refererID != 0) {
        $refererUser = new User();
        $refererUser = $refererUser->load($user->refererID);
        $recruitmentBonus = ceil($newHeroCost / 10);
        $refererUser->credit($recruitmentBonus);
        $userController->sendMessage($refererUser->ID, $user->ID, "Recruitment Bonus of " . $recruitmentBonus . " gp", $user->username . " hired a new hero, earning you " . $recruitmentBonus . "gp");
    }
Example #19
0
<?php

include_once "../../controller/user/userController.php";
session_start();
$user = $_SESSION["userSession"];
if (is_null($user)) {
    header("Location: http://www.andreseloysv.com/happy/index.php");
    die;
}
$date = $_POST['date'];
$userController = new userController();
try {
    $posts = $userController->getLastPost($user->id, $date);
    for ($index = 0; $index < count($posts); $index++) {
        ?>
 
        <li class="list-group-item old-post">
            <div class="media" data-happy="<?php 
        echo $posts[$index]['date'];
        ?>
">
                <div>
                    <div class="media-left">
                        <a href="#">
                            <img class="media-object img-profile-picture" src="../../image/users/<?php 
        echo $posts[$index]["nick"];
        ?>
/<?php 
        echo $posts[$index]["photo"];
        ?>
" height="64px" width="64px" alt="profile picture">
Example #20
0
<?php

//get messages and gold for current user
include_once "user/userController.php";
$userController = new userController();
$unreadMessages = $userController->countUnreadForUser($currentUID);
if (isset($_REQUEST['action'])) {
    if ($_REQUEST['action'] == "DeleteMessage") {
        $unreadMessages--;
    }
}
$smarty->assign("unreadMessages", $unreadMessages);
$smarty->assign("currentUserGold", User::load($currentUID)->gold);
$smarty->display("menu.tpl");
Example #21
0
<?php

include_once "../../controller/user/userController.php";
session_start();
$user = $_SESSION["userSession"];
if (is_null($user)) {
    header("Location: http://www.andreseloysv.com/happy/index.php");
    die;
}
$userController = new userController();
$target_dir = "/home/andreslaley/public_html/happy/image/users/" . $user->nick . "/";
$extension = pathinfo($target_dir . basename($_FILES["file"]["name"]), PATHINFO_EXTENSION);
$photo_name = $user->nick . "-logo." . $extension;
$target_file = $target_dir . $photo_name;
$uploadOk = 1;
$imageFileType = pathinfo($target_file, PATHINFO_EXTENSION);
// Check if image file is a actual image or fake image
//if(isset($_POST["submit"])) {
$check = getimagesize($_FILES["file"]["tmp_name"]);
if ($check !== false) {
    //       echo "File is an image - " . $check["mime"] . ".";
    $uploadOk = 1;
} else {
    echo "File is not an image.";
    $uploadOk = 0;
}
//}
// Check if file already exists
//if (file_exists($target_file)) {
//    echo "Sorry, file already exists.";
//    $uploadOk = 0;
Example #22
0
<?php

chdir("../");
include_once "bootstrap.php";
include_once "user/userController.php";
include_once "hero/heroController.php";
//html header
$smarty->display("css/css.tpl");
$userController = new userController();
$heroController = new heroController();
//menu
$smarty->display("menu.tpl");
/*********  show all Users  ***********/
$allUsers = $userController->getAll();
$smarty->assign("heroController", $heroController);
$smarty->assign("allUsers", $allUsers);
$smarty->display("admin/users.tpl");
/*********  end show all Users  ***********/
Example #23
0
<?php

include_once "../../controller/user/userController.php";
session_start();
$user = $_SESSION["userSession"];
if (is_null($user)) {
    header("Location: http://www.andreseloysv.com/happy/index.php");
    die;
}
$userController = new userController();
$searched_user = $userController->findMe("nick", $_GET["nick"]);
if (is_null($searched_user->id)) {
    echo "User not found.";
} else {
    $_SESSION["serchedUser"] = $searched_user;
    header("Location: http://www.andreseloysv.com/happy/view/user/index.php");
    die;
}
<?php

include "bootstrap.php";
//load User
include_once "user/userController.php";
$userController = new userController();
//include message class
include_once "user/message.php";
$message = new Message();
//check for ID
if (isset($_REQUEST['ID'])) {
    $message = $message->load($_REQUEST['ID']);
    if ($message->ToID == $currentUID) {
        $message->Read();
        //no problems to set it to Read
        $fromUser = new User();
        //load the from user
        $fromUser = $fromUser->load($message->FromID);
        $smarty->assign("fromUser", $fromUser);
    } else {
        $smarty->assign("error", "this does not belong to you");
    }
    if (isset($_REQUEST['action'])) {
        if ($_REQUEST['action'] == "reply") {
            $smarty->assign("reply", true);
        } else {
            if ($_REQUEST['action'] == "sendReply") {
                //@TODO check fields are not blank
                $userController->sendMessage($_REQUEST['toID'], $currentUID, $_REQUEST['subject'], $_REQUEST['body'], 2);
                // $To, $From, $Subject, $Body
                $smarty->assign("notification_message", "Reply sent.");
						<label class="control-label" for="basicinput">Level</label>
						<div class="controls">
							<select name="level">
								<option value="admin">Admin</option>
								<option value="operator" <?php 
if ($row['level'] == 'operator') {
    echo "selected";
}
?>
>Operator</option>
							</select>
						</div>
					</div>

					<div class="control-group">
						<div class="controls">
							<input type="submit" name="tambah" class="btn btn-success" value="Tambah">
							<button type="reset" class="btn btn-danger">Reset</button>
							<a href="?page=user" class="btn btn-warning">Kembali</a>
						</div>
					</div>
				</form>
			</div>
		</div>		
	</div>
</div>
<?php 
if (@$_POST['tambah']) {
    $main = new userController();
    $main->insert();
}
Example #26
0
<?php

include_once "../../controller/user/userController.php";
session_start();
$user = $_SESSION["userSession"];
if (is_null($user)) {
    header("Location: http://www.andreseloysv.com/happy/index.php");
    die;
}
$coment = $_POST["coment"];
$media = $_POST["media"];
$userController = new userController();
try {
    $userController->post($user->id, $coment, $media);
    ?>
    <li class="list-group-item" id="coment-li">
        <div class="media">
            <div>
                <div class="media-left">
                    <a href="#">
                        <img class="media-object img-profile-picture" src="../../image/users/<?php 
    echo $user->nick;
    ?>
/<?php 
    echo $user->photo;
    ?>
" height="64px" width="64px" alt="profile picture">
                    </a>
                </div>
                <div class="media-body">
                    <div id="big-coment">
Example #27
0
 public function update($id, $forceAdmin = true)
 {
     if (userController::isAdmin() == false and $forceAdmin == true) {
         return preg_replace('/%MESSAGE%/', "Updates not allowed here", file_get_contents('./views/message/failure.html'));
     }
     if (isset(filter_input_array(INPUT_POST)[$this->object])) {
         $inputForm = filter_input_array(INPUT_POST)[$this->object];
         $id = $inputForm['id'];
         unset($inputForm['id']);
         if ($this->model->update($inputForm, $id)) {
             return preg_replace("/%MESSAGE%/", "saved", file_get_contents('./views/message/info.html'));
         }
     } else {
         $data = $this->model->read($id);
         $form = $this->model->getForm("update", $data);
         return $this->getGeneratedView('./views/' . $this->object . '/formLayout.php', $form);
     }
 }
Example #28
0
 public function recalculate_fullhouse($event)
 {
     $slots = $this->event($event)->getSlots();
     $this->event()->fullhouse = $slots > 0 ? null : 1;
     $this->event()->_guest_count = $this->event()->max_guests - $slots;
     $this->event()->save();
     if ($this->event()->active == 1 || $this->event()->parent) {
         $lang = Bootstrap::$main->lang;
         foreach (Bootstrap::$main->langs() as $l) {
             Bootstrap::$main->lang = $l;
             if ($this->event()->parent) {
                 $this->getPublicEvent($this->event()->parent, null, true);
             } else {
                 $this->getPublicEvent($this->event()->data(), null, true);
             }
         }
         Bootstrap::$main->lang = $lang;
         $userController = new userController();
         $userController->getPublicUser($this->event()->user, true);
     }
 }
Example #29
0
<?php

error_reporting(1);
ob_start();
session_start();
include "model/commonFunctions.php";
include "controller/userController.php";
$userContObj = new userController();
if ($_POST['submits'] == "Sign In") {
    $countVal = $userContObj->userLogin($_POST);
    if ($countVal > 0 && $_SESSION['user_id'] != "") {
        header("location:index.php");
        exit;
    } else {
        header("location:login.php?err=done");
        exit;
    }
}
if ($_SESSION['user_id'] != "") {
    header("location:index.php");
}
?>
<!doctype html>
<html lang="en">
<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<!-- Remove Tap Highlight on Windows Phone IE -->
		<meta name="msapplication-tap-highlight" content="no"/>
Example #30
0
include_once "src/controllers/userLoginController.php";
$user_data;
$userProfile;
error_reporting(0);
if (isset($_REQUEST['code'])) {
    $gClient->authenticate();
    $_SESSION['token'] = $gClient->getAccessToken();
    header('Location: ' . filter_var($redirect_url, FILTER_SANITIZE_URL));
}
if (isset($_SESSION['token'])) {
    $gClient->setAccessToken($_SESSION['token']);
}
if ($gClient->getAccessToken()) {
    $userProfile = $google_oauthV2->userinfo->get();
    //DB Insert
    $controller = new userController();
    $user_data = $controller->getUser($userProfile['id'], $userProfile['first_name'], $userProfile['last_name'], "google", $userProfile['email'], $userProfile['picture']['data']['url']);
    $_SESSION['google_data'] = $userProfile;
    // Storing Google User Data in Session
    print_r($user_data);
    if ($user_data == null) {
        $user_data = $controller->save($userProfile['id'], $userProfile['given_name'], $userProfile['family_name'], "google", $userProfile['email'], $userProfile['picture']);
    }
    $_SESSION['userDetails'] = $user_data;
    $output = '<h1>Google Profile Details </h1>';
    $output .= '<img src="' . $user_data->getProfilePicLink() . '">';
    $output .= '<br/>Google ID : ' . $user_data->getauthID();
    $output .= '<br/>Name : ' . $user_data->getFirstName() . ' ' . $user_data->getLastName();
    $output .= '<br/>Email : ' . $user_data->getEmailId();
    $output .= '<br/>You are login with : Google';
    $output .= '<br/>Logout from <a href="googleLogout.php?logout">Google</a>';