CMS ultra léger au style oldschool, projet de la communauté Kalaïn Hundin.

index.php 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <?php
  2. require_once('config.php');
  3. if(!@$_SESSION['session']){
  4. session_start();
  5. }
  6. if(@$_SESSION['session']){
  7. require_once('verifications.php');
  8. }
  9. include("".$MainDir."files/navheader.php");
  10. ?>
  11. <!DOCTYPE html>
  12. <html>
  13. <head>
  14. </head>
  15. <body>
  16. <center>
  17. <section>
  18. <?php
  19. if(!@$_SESSION['session'])
  20. {
  21. $page_name='Connexion';
  22. include_once('top.php');
  23. if(isset($_GET['error']))
  24. {
  25. echo'<span class="error">';
  26. $error=$_GET['error'];
  27. if($error=="username")
  28. {
  29. echo'Error : Your username is invalid';
  30. }
  31. if($error=="pass")
  32. {
  33. echo'error : Your password is invalid';
  34. }
  35. if($error=="connection")
  36. {
  37. echo"error : Your password don't match with your username";
  38. }
  39. echo'</span>';
  40. }
  41. ?>
  42. <form method="post" action="login.php">
  43. <table width="300" border="0" align="center">
  44. <tr>
  45. <td colspan="2" >Login</td>
  46. </tr>
  47. <tr>
  48. <td><label for="username">Username : </label></td>
  49. <td><input type="text" name="username" id="username" /></td>
  50. </tr>
  51. <tr>
  52. <td><label for="passwd">Password : </label></td>
  53. <td><input type="password" name="passwd" id="passwd" />
  54. </td>
  55. </tr>
  56. <tr>
  57. <td>
  58. <input type="submit" value="Login" class="addbutton" />
  59. </td>
  60. </tr>
  61. </table>
  62. </form>
  63. <div align="center"><a href="register.php"> &rarr; Register !</a>
  64. <?php
  65. if($localite != 'local')
  66. echo'<br /><a href="lost.php">Lost Password ?</a>';
  67. echo'</div>';
  68. }
  69. else
  70. {
  71. require_once('config.php');
  72. $page_name='Panneau Utilisateur';
  73. include_once('top.php');
  74. ?>
  75. <div align="center"><strong>Welcome in your user panel <?php echo htmlspecialchars($username) ?> !</strong></br ></br>
  76. Your e-mail : <?php echo htmlspecialchars($email) ?><br />
  77. Your id : <?php echo htmlspecialchars($id_user) ?> <br />
  78. <a href="profile.php">Profile Modification</a><br />
  79. <a href="logout.php">Logout</a></div>
  80. <?php
  81. mysql_connect(DB_HOST,DB_LOGIN,DB_PASS);
  82. mysql_select_db(DB_DB);
  83. $sql="SELECT user_rank FROM user WHERE id_user=$id_user";
  84. $req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
  85. $user_ranking = mysql_fetch_assoc($req);
  86. echo "<br>";
  87. echo("Votre rang est : ".$user_ranking['user_rank'].". ");
  88. $user_rank="$user_ranking[user_rank]";
  89. if($user_rank==1){
  90. echo("Vous êtes administrateur.");
  91. }
  92. ?>
  93. <?php
  94. }
  95. include_once('bottom.php');
  96. ?>
  97. </div>
  98. </section>
  99. </center>
  100. </body>
  101. </html>