1
difenduandada
2024-10-15 7fd2948ee35c8e147ed35ce6d8502f94a98ddd22
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
 
session_start();
 
require( "config.php" );
require( "init.php" );
require( 'includes/plugin.php' );
 
$action = isset( $_GET['action'] ) ? $_GET['action'] : "";
$username = isset( $_SESSION['username'] ) ? $_SESSION['username'] : "";
 
if ( $action != "logout" && !$username ) {
    require("includes/page-login.php" );
    exit;
}
 
switch ( $action ) {
    case 'logout':
        logout();
        break;
    default:
        header( "Location: admin/dashboard.php" );
}
 
function logout() {
    CA_Auth::delete();
    unset( $_SESSION['username'] );
    header( "Location: ".DOMAIN );
    return;
}
 
?>