login.template.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <?php defined("NET2FTP") or die("Direct access to this location is not allowed."); ?>
  2. <!-- Template /skins/iphone/login.template.php begin -->
  3. <form id="LoginForm" action="" method="post" onsubmit="return CheckInput(this);">
  4. <div style="display: table; width:100%;">
  5. <div style="display: table-cell; text-align: left; font-weight: bold;">
  6. Open Game Panel FTP Client
  7. </div>
  8. <div style="display: table-cell; text-align: right;">
  9. Change Language to: <?php printLanguageSelect("language", $language_onchange, "width: 90px;", ""); ?><input type="submit"/>
  10. </div>
  11. </div>
  12. </form>
  13. <div class="page">
  14. <?php
  15. $home_id = $_GET['home_id'];
  16. $user_homes = $_SESSION['user_homes'];
  17. $isAdmin = $_SESSION['isAdmin'];
  18. foreach($user_homes as $ftp_info)
  19. {
  20. if($ftp_info['home_id'] == $home_id OR !$home_id)
  21. {
  22. if( $isAdmin )
  23. {
  24. $access_rights = true;
  25. }
  26. else
  27. {
  28. if( preg_match("/t/",$ftp_info['access_rights']) > 0 )
  29. $access_rights = true;
  30. else
  31. $access_rights = false;
  32. }
  33. $ftp_login = isset($ftp_info['ftp_login']) ? $ftp_info['ftp_login'] : $ftp_info['home_id'];
  34. $isFtpEnabled = $ftp_info['ftp_status'] == 1 ? TRUE : FALSE;
  35. $ftp_ip = empty($ftp_info['ftp_ip']) ? $ftp_info['agent_ip'] : $ftp_info['ftp_ip'];
  36. $display_ip = ip2long($ftp_info['display_public_ip']) && $ftp_info['display_public_ip']!=$ftp_info['agent_ip'] ? $ftp_info['display_public_ip'] : $ftp_ip;
  37. ?><table style="text-align:center;width:100%;border:1px solid black;background-image:url(../../themes/Revolution/images/wrapper-bg.png);">
  38. <tr>
  39. <td colspan="3">
  40. <h1><?php echo htmlentities($ftp_info['home_name']); ?></h1>
  41. </td>
  42. </tr>
  43. <?php
  44. if ( $access_rights && $isFtpEnabled )
  45. {
  46. ?>
  47. <tr>
  48. <td colspan="3">
  49. <table>
  50. <tr >
  51. <td style='width: 50%;'>
  52. <?php echo "".__("FTP server").":</td><td style='width: 50%;'><input type='text' readonly='readonly' size='26' onclick='select()' value='".$display_ip.":".$ftp_info['ftp_port']."'/></td></tr><tr><td>".__("Username").":</td><td><input type='text' readonly='readonly' size='26' onclick='select()' value=\"".str_replace('"', "&quot;", $ftp_login)."\"/></td></tr><tr><td>".__("Password").":</td><td><input type='text' readonly='readonly' size='26' onclick='select()' value=\"".str_replace('"', "&quot;", $ftp_info['ftp_password'])."\"/>"; ?>
  53. </td>
  54. </tr>
  55. </table>
  56. </td>
  57. </tr>
  58. <tr>
  59. <?php
  60. echo "<td><a style='text-decoration:none;color:black;' href=\"ftp://".str_replace('"', "&quot;", $ftp_login).":".str_replace('"', "&quot;", $ftp_info['ftp_password'])."@".$ftp_ip.":".$ftp_info['ftp_port']."\" TARGET='_blank'><img style='border:1px solid transparent' width=64px src='../../images/ftp.png'/><br><b>FTP Link</b></a></td>";
  61. ?>
  62. </tr>
  63. <tr>
  64. <td colspan="3">
  65. <form id="LoginForm" action="<?php echo $net2ftp_globals["action_url"]; ?>" method="post" onsubmit="return CheckInput(this);">
  66. <input type="hidden" name="language" value="<?php echo $_POST['language']; ?>">
  67. <input type="hidden" name="ftpserverport" value="<?php echo $ftp_info['ftp_port']; ?>">
  68. <input type="hidden" name="ftpserver" value="<?php echo $ftp_ip; ?>">
  69. <input type="hidden" name="username" value="<?php echo $ftp_login; ?>" autocorrect="off" autocapitalize="off" style="width: 80%;" />
  70. <input type="hidden" name="password" value="<?php echo $ftp_info['ftp_password']; ?>" autocorrect="off" autocapitalize="off" style="width: 80%;" />
  71. <input type="hidden" name="directory" value="/">
  72. <input type="hidden" name="state" value="browse" />
  73. <input type="hidden" name="state2" value="main" />
  74. <input type="submit" value="<?php echo __("Login"); ?>" style="margin-bottom: 30px; margin-top: 10px;" />
  75. </form>
  76. </td>
  77. </tr><?php
  78. }
  79. else
  80. {
  81. ?>
  82. <tr>
  83. <td colspan="3">
  84. <center>
  85. <b style="color:red;">There Is No Login Available For This Game Server.</b><br><br>
  86. </center>
  87. </td>
  88. </tr>
  89. <?php
  90. }
  91. ?></table><?php
  92. }
  93. }
  94. ?>
  95. </div>
  96. <?php require_once($net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/footer.template.php"); ?>
  97. <!-- Template /skins/iphone/login.template.php end -->