Ejemplo n.º 1
0
<?php
include 'vars.php';

$connect = new Connect;

	if($_GET['action'] == 0)
		$connect->login($_POST['login'], $users);

	elseif($_GET['action'] == 1)
		$connect->logout();

	header("Location: connection.php");

class Connect
{
	//Verification du login(Connection)
	public function login($log, $users)
	{
		foreach ($users as $key_user => $value_user) {
			if($key_user == $log){
				$_SESSION['Profil'] = $value_user;
			}
		}
	}

	//Deconection
	public function logout()
	{
		unset($_SESSION['Profil']);
	}
}
Ejemplo n.º 2
0
 public static function login()
 {
     global $params;
     echo Connect::login($params['code'], $params['pass']);
 }