inc.php
/* Check the password of the management page */
Check the password of the management page
Check the password of the management page
function checkmanagepassword()
    {
?>
<div class="table-responsive">
        <table class="table table-striped table-sm">
            <thead>
                <tr>
                    <th class="d-table-cell">
                        <div class="container">
                            <p class="lead text-center">A <strong>password</strong> verification is required to access this page. <br></p>
<?php
        $passvld=true;
        if(isset($_POST['manage']))
        {
            $_SESSION['manage']=gethashedpass($_POST['manage']);
            $_SESSION['expired']=time();
        }
        if(!isset($_SESSION['expired']))
            $passvld=false;
        else if(abs(time()-$_SESSION['expired'])>=3600*24)
        {
            $passvld=false;
            echo '<p class="lead text-center">Verification <span style="color: red;"><strong>expired</strong></span>.</p>';
        }
        else
        {
            if($_SESSION['manage']===MANAGE_PASSWORD)
            {
                $passvld=true;
                echo '<p class="lead text-center">Verification <span style="color: green;"><strong>passed</strong></span>.</p>';
            }
            else
            {
                $passvld=false;
                echo '<p class="lead text-center">Verification <span style="color: red;"><strong>failed</strong></span>.</p>';
            }
        }
        if(!$passvld)
        {
?>
<form action="#" method="post">
    <div class="table-responsive">
        <table class="table table-borderless">
            <thead>
                <tr>
                    <th style="width:432px;"><input class="form-control d-table ml-auto text-center" type="password" name="manage" autofocus="" autocomplete="off" style="width:441px;"></th>
                    <th style="width:191px;"><button class="btn btn-dark" type="submit">Verify</button></th>
                </tr>
            </thead>
            <tbody></tbody>
        </table>
    </div>
</form>
<?php
        }
?>
                        </div>
                    </th>
                </tr>
            </thead>
            <tbody></tbody>
        </table>
    </div>
<?php
        return $passvld;
    }
function checkmanagepassword ( ) { ?> <div class="table-responsive">
        <table class="table table-striped table-sm">
            <thead>
                <tr>
                    <th class="d-table-cell">
                        <div class="container">
                            <p class="lead text-center">A <strong>password</strong> verification is required to access this page. <br></p>
 <?php $ passvld = true ; if ( isset ( $ _POST [ 'manage' ] ) ) { $ _SESSION [ 'manage' ] = gethashedpass ( $ _POST [ 'manage' ] ) ; $ _SESSION [ 'expired' ] = time ( ) ; } if ( ! isset ( $ _SESSION [ 'expired' ] ) ) $ passvld = false ; else if ( abs ( time ( ) - $ _SESSION [ 'expired' ] ) >= 3600 * 24 ) { $ passvld = false ; echo '<p class="lead text-center">Verification <span style="color: red;"><strong>expired</strong></span>.</p>' ; } else { if ( $ _SESSION [ 'manage' ] === MANAGE_PASSWORD ) { $ passvld = true ; echo '<p class="lead text-center">Verification <span style="color: green;"><strong>passed</strong></span>.</p>' ; } else { $ passvld = false ; echo '<p class="lead text-center">Verification <span style="color: red;"><strong>failed</strong></span>.</p>' ; } } if ( ! $ passvld ) { ?> <form action="#" method="post">
    <div class="table-responsive">
        <table class="table table-borderless">
            <thead>
                <tr>
                    <th style="width:432px;"><input class="form-control d-table ml-auto text-center" type="password" name="manage" autofocus="" autocomplete="off" style="width:441px;"></th>
                    <th style="width:191px;"><button class="btn btn-dark" type="submit">Verify</button></th>
                </tr>
            </thead>
            <tbody></tbody>
        </table>
    </div>
</form>
 <?php } ?> </div>
                    </th>
                </tr>
            </thead>
            <tbody></tbody>
        </table>
    </div>
 <?php return $ passvld ; }
Check the password of the management page
Check the password of the management page