home *** CD-ROM | disk | FTP | other *** search
/ grafika-wolowiec.cba.pl / grafika-wolowiec.cba.pl.tar / grafika-wolowiec.cba.pl / admin / login.php < prev    next >
PHP Script  |  2014-01-24  |  2KB  |  45 lines

  1. <?php
  2.     require_once("../res/x5engine.php");
  3.     $login_error = "";
  4.     if (isset($_GET['logout'])) {
  5.         $login = new imPrivateArea();
  6.         $login->logout();
  7.         @header("Location: ../");
  8.     }
  9.     if (isset($_GET['error']))
  10.         $login_error = $l10n['private_area_login_error'];
  11.     if (isset($_POST['uname']) && $_POST['uname'] != "" && isset($_POST['pwd']) && $_POST['pwd'] != "") {
  12.         $login = new imPrivateArea();
  13.         if ($login->login($_POST['uname'], $_POST['pwd']) == 0) {
  14.                $url = $login->getSavedPage() ? $login->getSavedPage() : "index.php";
  15.                exit('<!DOCTYPE html><html><head><title>Loading...</title><meta http-equiv="refresh" content="1; url=' . $url . '"></head><body><p style="text-align: center;">Loading...</p></body></html>');
  16.         } else
  17.             $login_error = $l10n['private_area_login_error'];
  18.     }
  19.     require_once("header.php");
  20. ?>
  21. <div id="imLoginPage">
  22.     <div id="imHeader">
  23.     </div>
  24.     <div id="imBody">
  25.         <div class="imContent">
  26.             <div class="imBlogAdminLoginForm">
  27.                 <form action="<?php echo basename($_SERVER['PHP_SELF']) ?>" method="post">
  28.                     <?php echo ($login_error != "") ? $login_error . "<br />" : ""; ?>
  29.                     <fieldset>
  30.                         Username: <input type="text" name="uname" id="uname"/>
  31.                         Password: <input type="password" name="pwd" />
  32.                         <div style="text-align: right; width: 255px; margin: 0; padding: 2px 0;"><input type="submit" value="<?php echo l10n('blog_login'); ?>" /></div>
  33.                     </fieldset>
  34.                 </form>
  35.                 <script type="text/javascript">
  36.                     $("#uname").focus();
  37.                 </script>
  38.             </div>
  39.         </div>
  40.     </div>
  41. </div>        
  42. <?php
  43.     require_once("footer.php");
  44. ?>
  45.