index-unlogged.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Redirect script
  5. * @package chamilo.custompages
  6. */
  7. /**
  8. * Initialization
  9. */
  10. //require_once('main/inc/global.inc.php');
  11. require_once('language.php');
  12. /**
  13. * Homemade micro-controller
  14. */
  15. if (isset($_GET['loginFailed'])){
  16. if (isset($_GET['error'])) {
  17. switch ($_GET['error']) {
  18. case 'account_expired':
  19. $error_message = custompages_get_lang('AccountExpired');
  20. break;
  21. case 'account_inactive':
  22. $error_message = custompages_get_lang('AccountInactive');
  23. break;
  24. case 'user_password_incorrect':
  25. $error_message = custompages_get_lang('InvalidId');
  26. break;
  27. case 'access_url_inactive':
  28. $error_message = custompages_get_lang('AccountURLInactive');
  29. break;
  30. default :
  31. $error_message = custompages_get_lang('InvalidId');
  32. }
  33. } else {
  34. $error_message = get_lang('InvalidId');
  35. }
  36. }
  37. $rootWeb = api_get_path('WEB_PATH');
  38. /**
  39. * HTML output
  40. */
  41. ?>
  42. <html>
  43. <head>
  44. <title>Custompage - login</title>
  45. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  46. <!--[if !IE 6]><!-->
  47. <link rel="stylesheet" type="text/css" href="<?php echo $rootWeb ?>custompages/style.css" />
  48. <!--<![endif]-->
  49. <!--[if IE 6]>
  50. <link rel="stylesheet" type="text/css" href="/custompages/style-ie6.css" />
  51. <![endif]-->
  52. <script type="text/javascript" src="<?php echo $rootWeb ?>main/inc/lib/javascript/jquery.min.js"></script>
  53. <script type="text/javascript">
  54. $(document).ready(function() {
  55. if (top.location != location)
  56. top.location.href = document.location.href ;
  57. // Handler pour la touche retour
  58. $('input').keyup(function(e) {
  59. if (e.keyCode == 13) {
  60. $('#login-form').submit();
  61. }
  62. });
  63. });
  64. </script>
  65. </head>
  66. <body>
  67. <div id="backgroundimage">
  68. <img src="<?php echo api_get_path(WEB_PATH)?>/custompages/images/page-background.png" class="backgroundimage" />
  69. </div>
  70. <div id="wrapper">
  71. <div id="header">
  72. <img src="<?php echo api_get_path(WEB_PATH)?>/custompages/images/header.png" alt="Logo" />
  73. </div> <!-- #header -->
  74. <div id="login-form-box" class="form-box">
  75. <div id="login-form-info" class="form-info">
  76. <?php if (isset($content['info']) && !empty($content['info'] )) {
  77. echo $content['info'];
  78. }?>
  79. </div>
  80. <?php if (isset($error_message)) {
  81. echo '<div id="login-form-info" class="form-error">'.$error_message.'</div>';
  82. }?>
  83. <form id="login-form" class="form" action="<?php echo api_get_path(WEB_PATH)?>index.php" method="post">
  84. <div>
  85. <label for="login">*<?php echo custompages_get_lang('User');?></label>
  86. <input name="login" type="text" /><br />
  87. <label for="password">*<?php echo custompages_get_lang('langPass');?></label>
  88. <input name="password" type="password" /><br />
  89. </div>
  90. </form>
  91. <div id="login-form-submit" class="form-submit" onclick="document.forms['login-form'].submit();">
  92. <span><?php echo custompages_get_lang('LoginEnter');?></span>
  93. </div> <!-- #form-submit -->
  94. <div id="links">
  95. <a href="<?php echo api_get_path(WEB_PATH)?>main/auth/inscription.php"><?php echo custompages_get_lang('langReg')?></a><br />
  96. <a href="<?php echo api_get_path(WEB_PATH)?>main/auth/lostPassword.php"><?php echo custompages_get_lang('langLostPassword')?></a>
  97. </div>
  98. </div> <!-- #form -->
  99. <div id="footer">
  100. <img src="<?php echo api_get_path(WEB_PATH)?>/custompages/images/footer.png" />
  101. </div> <!-- #footer -->
  102. </div> <!-- #wrapper -->
  103. </body>
  104. </html>