index-unlogged-dist.php 3.9 KB

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