A simple PHP user authentication library. There is no support for roles/rights.
Copy alibaba_config.sample.php to alibaba_config.php and edit it to match your app.
<?php
include_once "Alibaba.class.php";
Alibaba::AlibabaInit($alibabaParams);
Alibaba::forceAuthentication();
// The rest of your page
?> <?php
include_once "Alibaba.class.php";
Alibaba::initAlibaba($alibabaParams);
$username = $_POST["username"];
$password = $_POST["password"];
if (Alibaba::login($username, $password)) {
header("Location: index.php");
} else {
Alibaba::redirectToLogin("Login failed");
}
?> <?php
include_once "Alibaba.class.php";
Alibaba::initAlibaba($alibabaParams);
Alibaba::logout();
?>