index-unlogged-dist.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. <!--[if !IE 6]><!-->
  44. <link rel="stylesheet" type="text/css" href="<?php echo $rootWeb ?>custompages/style.css" />
  45. <!--<![endif]-->
  46. <!--[if IE 6]>
  47. <link rel="stylesheet" type="text/css" href="/custompages/style-ie6.css" />
  48. <![endif]-->
  49. <script type="text/javascript" src="<?php echo $rootWeb ?>web/assets/jquery/jquery.min.js"></script>
  50. <script type="text/javascript">
  51. $(document).ready(function() {
  52. if (top.location != location) {
  53. top.location.href = document.location.href;
  54. }
  55. // Handler pour la touche retour
  56. $('input').keyup(function(e) {
  57. if (e.keyCode == 13) {
  58. $('#login-form').submit();
  59. }
  60. });
  61. });
  62. </script>
  63. </head>
  64. <body>
  65. <div id="backgroundimage">
  66. <img src="<?php echo api_get_path(WEB_PATH)?>/custompages/images/page-background.png" class="backgroundimage" />
  67. </div>
  68. <div id="wrapper">
  69. <div id="header">
  70. <img src="<?php echo api_get_path(WEB_PATH)?>/custompages/images/header.png" alt="Logo" />
  71. </div> <!-- #header -->
  72. <div id="login-form-box" class="form-box">
  73. <div id="login-form-info" class="form-info">
  74. <?php if (isset($content['info']) && !empty($content['info'])) {
  75. echo $content['info'];
  76. }
  77. ?>
  78. </div>
  79. <?php if (isset($error_message)) {
  80. echo '<div id="login-form-info" class="form-error">'.$error_message.'</div>';
  81. }
  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('Password'); ?></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. <?php if (api_get_setting('allow_registration') === 'true') { ?>
  96. <a href="<?php echo api_get_path(WEB_CODE_PATH); ?>auth/inscription.php?language=<?php echo api_get_interface_language(); ?>">
  97. <?php echo custompages_get_lang('Registration')?>
  98. </a><br />
  99. <?php } ?>
  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>