index-unlogged-dist.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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 ?>web/assets/jquery/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. }
  58. // Handler pour la touche retour
  59. $('input').keyup(function(e) {
  60. if (e.keyCode == 13) {
  61. $('#login-form').submit();
  62. }
  63. });
  64. });
  65. </script>
  66. </head>
  67. <body>
  68. <div id="backgroundimage">
  69. <img src="<?php echo api_get_path(WEB_PATH)?>/custompages/images/page-background.png" class="backgroundimage" />
  70. </div>
  71. <div id="wrapper">
  72. <div id="header">
  73. <img src="<?php echo api_get_path(WEB_PATH)?>/custompages/images/header.png" alt="Logo" />
  74. </div> <!-- #header -->
  75. <div id="login-form-box" class="form-box">
  76. <div id="login-form-info" class="form-info">
  77. <?php if (isset($content['info']) && !empty($content['info'])) {
  78. echo $content['info'];
  79. }
  80. ?>
  81. </div>
  82. <?php if (isset($error_message)) {
  83. echo '<div id="login-form-info" class="form-error">'.$error_message.'</div>';
  84. }
  85. ?>
  86. <form id="login-form" class="form" action="<?php echo api_get_path(WEB_PATH)?>index.php" method="post">
  87. <div>
  88. <label for="login">*<?php echo custompages_get_lang('User');?></label>
  89. <input name="login" type="text" /><br />
  90. <label for="password">*<?php echo custompages_get_lang('Password');?></label>
  91. <input name="password" type="password" /><br />
  92. </div>
  93. </form>
  94. <div id="login-form-submit" class="form-submit" onclick="document.forms['login-form'].submit();">
  95. <span><?php echo custompages_get_lang('LoginEnter');?></span>
  96. </div> <!-- #form-submit -->
  97. <div id="links">
  98. <?php if (api_get_setting('registration.allow_registration') === 'true') { ?>
  99. <a href="<?php echo api_get_path(WEB_PATH); ?>main/auth/inscription.php?language=<?php echo api_get_interface_language(); ?>">
  100. <?php echo custompages_get_lang('Registration')?>
  101. </a><br />
  102. <?php } ?>
  103. <a href="<?php echo api_get_path(WEB_PATH); ?>main/auth/lostPassword.php?language=<?php echo api_get_interface_language(); ?>">
  104. <?php echo custompages_get_lang('LostPassword')?>
  105. </a>
  106. </div>
  107. </div> <!-- #form -->
  108. <div id="footer">
  109. <img src="<?php echo api_get_path(WEB_PATH); ?>/custompages/images/footer.png" />
  110. </div> <!-- #footer -->
  111. </div> <!-- #wrapper -->
  112. </body>
  113. </html>