?> <form class="form-signin" method="post" action="./login.php"> <h2 class="form-signin-heading">Please sign in</h2> <label for="username" class="sr-only">username</label> <input type="text" id="username" name="username" class="form-control" placeholder="Username" required autofocus> <label for="password" class="sr-only">Password</label> <input type="password" id="password" name="password" class="form-control" placeholder="Password" required> <div class="checkbox"> <label> <input type="checkbox" value="remember-me" name="remember_me"> Remember me </label> </div> <button class="btn btn-lg btn-primary btn-block" type="submit" name="submit">Sign in</button> <?php echo add_csrf('login_page'); ?> </form> <?php } ?> <!-- show this after the user signed in --> <?php if ($show_after_login) { ?> <div class="alert alert-success"> Welcome again ... <a href="./">[ Home ]</div> </div>
function human_check($flag, $csrf, $flag_name = "flag") { if (!$flag) { $htmlsrc = add_csrf("<h2>Human Check</h2>please input the string in the picture below<br><form action=\"/admin/clogin\" method=\"POST\"><img src=\"/out/get_image?" . time() . "\"><br><input type=text name=\"image\"><input type=submit><input type=hidden name=c value=\"{$flag_name}\"><input type=hidden name=backurl value=\"" . htmlspecialchars($_SERVER['REQUEST_URI']) . "\"></form>", $csrf); echo $htmlsrc; exit; } }