j2u5jw
Last Updated: February 25, 2016
·
607
· noidhoon

CockPit CMS, Auth module.

Init CockPit

include_once('cockpit/bootstrap.php');
$app = cockpit();

Retrieve current user

$user = $app -> module("auth") -> getUser();

Login an user

$account = ["user" => "login_username", "password" => "login_password"];
$check = $app -> module("auth") -> authenticate( $account );
$app -> module("auth") -> setUser( $check );

Logout current user

$app -> module("auth") -> logout();