]>
Softwares of Agnibho - simpleipd.git/blob - www/login.php
2 require(dirname(__DIR__
)."/require.php");
4 if(!empty($_GET["action"]) && $_GET["action"]=="logout"){
5 $_SESSION["user"]=null;
6 $_SESSION["group"]=null;
8 if(!empty($_POST["username"]) && !empty($_POST["password"])){
9 if($db->checkUser($_POST["username"], $_POST["password"])){
10 $_SESSION["user"]=$_POST["username"];
11 $_SESSION["group"]=$db->getGroup($_SESSION["user"])->fetchArray()["usergroup"];
12 $_SESSION["department"]=$db->getDepartment($_SESSION["user"])->fetchArray()["department"];
13 header("Location: index.php");
17 $error="<div class='alert alert-danger'>Username or password is incorrect.</div>";
20 //header("Location: view.php?pid=".$_GET["pid"]);
26 <?php
include(CONFIG_LIB
."head.php");?
>
30 <div
class="container">
31 <?php
include(CONFIG_LIB
."top.php");?
>
34 <input
class="m-2 form-control" type
="text" name
="username" placeholder
="Username" required
>
35 <input
class="m-2 form-control" type
="password" name
="password" placeholder
="Password" required
>
36 <button
class="m-2 btn btn-primary" type
="submit">Login
</button
>
39 <?php
include(CONFIG_LIB
."foot.php");?
>