Example #1
0
 protected function checkUserRights()
 {
     if (!User::check_cookie()) {
         die("You should log in");
     }
 }
Example #2
0
	}

	div.login_form div.error_msg {
		border: 1px solid #ff0000;
		background-color: #efbdbd;
		width: 260px;
		padding: 4px;
		margin: 0px auto;
	}
</style>


<?php 
/*! Show login form if user isn't logged and admin panel if he's logged
 */
if (!User::check_cookie() || isset($_GET['logout'])) {
    ?>
<body onload="doOnLoad();">
	<script>
		function doOnLoad() {
			var top = (document.body.clientHeight - 200)/2;
			document.getElementById("login_form").style.top = top + "px";
			document.getElementById("username").focus();;
		}
	</script>
	<div class="login_form" id="login_form">
		<form method="post">
			<div class="line"></div>
			<div class="line <?php 
    echo $error != false ? "error" : "error_none";
    ?>