PHP Classes

File: admin/valida.php

Recommend this page to a friend!
  Classes of António Lira Fernandes   PHP Google Login   admin/valida.php   Download  
File: admin/valida.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Google Login
Authenticate site users with Google accounts
Author: By
Last change:
Date: 2 years ago
Size: 871 bytes
 

Contents

Class file image Download
<?php
 


require_once __DIR__ . '/../config.php';
 require_once
__DIR__ . '/../bootstrap.php';
require_once
__DIR__ . '/../autoload.php';
 use
classes\authentication\Authentication;
use
classes\authentication\Users;
 
//use classes\members\Members;
   //echo "sdsdasd";
 
  
 
$email = filter_input (INPUT_POST, 'userEmail', FILTER_SANITIZE_STRING);
 
$foto= filter_input(INPUT_POST, 'userImageURL', FILTER_SANITIZE_STRING);
 
$p['email'] = $email;
//echo "aqui: ";
//echo 'Erro'
 
$user = new Users("loginGoogle",$p);
 
$aut= new Authentication();
 
//print_r ($user->results);

if($user->results[0]['numElements']!=0){
 
$aut->setAuthentication($user->results[0]['username'],$user->results[0]['name'],$email,$foto, $user->results[0]['id'], $user->results[0]['usertype']); //($user, $name,$email, $level=1)
 
echo $user->results[0]['usertype'];
}else {
  echo
"Erro";
}


?>