/gui/tools/filemanager/modules/admin/admin.inc.php

https://github.com/BenBE/ispCP · PHP · 189 lines · 29 code · 64 blank · 96 comment · 6 complexity · e325d7cb1863f51c29cc68ebbcb452b9 MD5 · raw file

  1. <?php
  2. // -------------------------------------------------------------------------------
  3. // | net2ftp: a web based FTP client |
  4. // | Copyright (c) 2003-2009 by David Gartner |
  5. // | |
  6. // | This program is free software; you can redistribute it and/or |
  7. // | modify it under the terms of the GNU General Public License |
  8. // | as published by the Free Software Foundation; either version 2 |
  9. // | of the License, or (at your option) any later version. |
  10. // | |
  11. // -------------------------------------------------------------------------------
  12. // **************************************************************************************
  13. // **************************************************************************************
  14. // ** **
  15. // ** **
  16. function net2ftp_module_sendHttpHeaders() {
  17. // --------------
  18. // This function sends HTTP headers
  19. // --------------
  20. // global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
  21. // -------------------------------------------------------------------------
  22. // Check Admin username and password
  23. // Redirect to the login_small page if needed
  24. // -------------------------------------------------------------------------
  25. checkAdminUsernamePassword();
  26. // -------------------------------------------------------------------------
  27. // Send XHTML header
  28. // -------------------------------------------------------------------------
  29. // header("Content-type: application/xhtml+xml; charset=" . __("iso-8859-1"));
  30. } // end net2ftp_sendHttpHeaders
  31. // ** **
  32. // ** **
  33. // **************************************************************************************
  34. // **************************************************************************************
  35. // **************************************************************************************
  36. // **************************************************************************************
  37. // ** **
  38. // ** **
  39. function net2ftp_module_printJavascript() {
  40. // --------------
  41. // This function prints Javascript code and includes
  42. // --------------
  43. // global $net2ftp_settings, $net2ftp_globals;
  44. // Code
  45. // echo "<script type=\"text/javascript\"><!--\n";
  46. // echo "//--></script>\n";
  47. // Include
  48. // echo "<script type=\"text/javascript\" src=\"". $net2ftp_globals["application_rootdir_url"] . "/modules/login/login.js\"></script>\n";
  49. } // end net2ftp_printJavascript
  50. // ** **
  51. // ** **
  52. // **************************************************************************************
  53. // **************************************************************************************
  54. // **************************************************************************************
  55. // **************************************************************************************
  56. // ** **
  57. // ** **
  58. function net2ftp_module_printCss() {
  59. // --------------
  60. // This function prints CSS code and includes
  61. // --------------
  62. global $net2ftp_settings, $net2ftp_globals;
  63. // Include
  64. echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"". $net2ftp_globals["application_rootdir_url"] . "/skins/" . $net2ftp_globals["skin"] . "/css/main.css.php?ltr=" . __("ltr") . "&amp;image_url=" . urlEncode2($net2ftp_globals["image_url"]) . "\" />\n";
  65. } // end net2ftp_printCssInclude
  66. // ** **
  67. // ** **
  68. // **************************************************************************************
  69. // **************************************************************************************
  70. // **************************************************************************************
  71. // **************************************************************************************
  72. // ** **
  73. // ** **
  74. function net2ftp_module_printBodyOnload() {
  75. // --------------
  76. // This function prints the <body onload="" actions
  77. // --------------
  78. // global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
  79. // echo "";
  80. } // end net2ftp_printBodyOnload
  81. // ** **
  82. // ** **
  83. // **************************************************************************************
  84. // **************************************************************************************
  85. // **************************************************************************************
  86. // **************************************************************************************
  87. // ** **
  88. // ** **
  89. function net2ftp_module_printBody() {
  90. // --------------
  91. // This function prints the login screen
  92. // --------------
  93. // -------------------------------------------------------------------------
  94. // Global variables
  95. // -------------------------------------------------------------------------
  96. global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
  97. if (isset($_POST["input_admin_username"]) == true) { $input_admin_username = htmlEncode2(validateGenericInput($_POST["input_admin_username"])); }
  98. else { $input_admin_username = ""; }
  99. if (isset($_POST["input_admin_password"]) == true) { $input_admin_password = htmlEncode2(validateGenericInput($_POST["input_admin_password"])); }
  100. else { $input_admin_password = ""; }
  101. // -------------------------------------------------------------------------
  102. // Variables
  103. // -------------------------------------------------------------------------
  104. // Title
  105. $title = __("Admin functions");
  106. // Form name, back and forward buttons
  107. $formname = "AdminForm";
  108. $back_onclick = "document.forms['" . $formname . "'].state.value='login';document.forms['" . $formname . "'].submit();";
  109. // Current build number
  110. $application_build_nr = $net2ftp_settings["application_build_nr"];
  111. // Date from and to
  112. $today = date("Y-m-d");
  113. $oneweekago = date("Y-m-d", time() - 3600*24*7);
  114. $datefrom = $oneweekago;
  115. $dateto = $today;
  116. // -------------------------------------------------------------------------
  117. // Print the output
  118. // -------------------------------------------------------------------------
  119. require_once($net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/manage.template.php");
  120. } // End net2ftp_printBody
  121. // ** **
  122. // ** **
  123. // **************************************************************************************
  124. // **************************************************************************************
  125. ?>