index-unlogged-dist.php 4.3 KB

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