ftp.php 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. /*
  3. *
  4. * OGP - Open Game Panel
  5. * Copyright (C) 2008 - 2013 The OGP Development Team
  6. *
  7. * http://www.opengamepanel.org/
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * as published by the Free Software Foundation; either version 2
  12. * of the License, or any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  22. *
  23. */
  24. function exec_ogp_module()
  25. {
  26. global $db,$view,$settings;
  27. if ( is_readable("includes/config.inc.php") ) require("includes/config.inc.php");
  28. $isAdmin = $db->isAdmin( $_SESSION['user_id'] );
  29. if ( $isAdmin )
  30. {
  31. $user_homes = $db->getHomesFor('admin', $_SESSION['user_id']);
  32. }
  33. else
  34. {
  35. $user_homes = $db->getHomesFor('user_and_group', $_SESSION['user_id']);
  36. }
  37. echo "<h2>".get_lang('ftp')."</h2>";
  38. if( $user_homes === FALSE )
  39. {
  40. // If there are no games, then there can not be any mods either.
  41. print_failure('No game homes assigned');
  42. if ( $isAdmin )
  43. {
  44. echo "<p><a href='?m=user_games&amp;p=assign&amp;user_id=$_SESSION[user_id]'>Assign game homes</a></p>";
  45. }
  46. return;
  47. }
  48. if( empty( $_GET['home_id'] ) )
  49. {
  50. unset($_GET['home_id']);
  51. }
  52. if (!isset($_GET['home_id']))
  53. {
  54. create_home_selector($_GET['m'], FALSE, $user_homes);
  55. $show_all = TRUE;
  56. }
  57. else
  58. {
  59. create_home_selector($_GET['m'], FALSE, $user_homes);
  60. create_home_selector($_GET['m'], FALSE, "show_all");
  61. $show_all = FALSE;
  62. }
  63. if( isset($_GET['home_id']) ) $_SESSION['home_id'] = $_GET['home_id'];
  64. $_SESSION['settings'] = $settings;
  65. $_SESSION['remote_servers'] = $db->getRemoteServers();
  66. $_SESSION['isAdmin'] = $isAdmin;
  67. $_SESSION['user_homes'] = $user_homes;
  68. ?> <IFRAME SRC="modules/ftp/index.php<?php if( isset($_GET['home_id']) ) echo "?home_id=".$_GET['home_id']; ?>" ALIGN=center WIDTH=100% HEIGHT=460 style="border:1px solid transparent;background-color:white" > </IFRAME> <?php
  69. if($show_all == FALSE)
  70. {
  71. echo "<form action='' method='get'>
  72. <input type='hidden' name='m' value='gamemanager' />
  73. <input type='hidden' name='p' value='game_monitor' />
  74. <input type='hidden' name='home_id' value='".$_GET['home_id']."' />
  75. <input type='submit' value='".get_lang('back')."' />
  76. </form>";
  77. }
  78. }
  79. ?>