This repository has been archived by the owner on Apr 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdialog.php
executable file
·125 lines (121 loc) · 7.43 KB
/
dialog.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<!--
Copyright (c) Codiad & Andr3as, distributed
as-is and without warranty under the MIT License.
See [root]/license.md for more information. This information must remain intact.
-->
<?php
error_reporting(0);
require_once('../../common.php');
checkSession();
switch($_GET['action']) {
case 'switch':
echo '
<form>
<p>Choose transfer mode:</p>
<button onclick="codiad.CodeTransfer.showDialog(\'ftp\'); return false;">FTP</button>
<button onclick="codiad.CodeTransfer.showDialog(\'scp\'); return false;">SCP</button>
<button onclick="codiad.CodeTransfer.closeDialog(); return false;">Close</button>
</form>
';
break;
case 'ftp':
case 'scp':
?>
<div id="transfer_form_div">
<form id="transfer_form">
<table>
<tr>
<td>Host:<input type="text" id="transfer_host"></td>
<td>User:<input type="text" id="transfer_user"></td>
<td>Password:<input type="password" id="transfer_password"></td>
<?php
if ($_GET['action'] == 'ftp') {
$mode = 21;
} else {
$mode = 22;
}
echo '<td id="transfer_port_td">Port:<input type="number" value="'.$mode.'" id="transfer_port"></td>';
if ($_GET['action'] == 'ftp') {
echo '<td>SSL<br><input type="checkbox" name="ftps" id="ftps"></td>';
}
?>
<td id="transfer_connect_td">
<button id="transfer_connect" onclick="codiad.CodeTransfer.connect(); return false;">Connect</button>
</td>
<?php
if ($_GET['action'] == 'ftp') {
echo '
<td>Transfer Type<select id="transfer_mode">
<option value="FTP_ASCII">ASCII</option>
<option value="FTP_BINARY">Binary</option>
</select>
</td>
';
}
?>
</tr>
</table>
<hr>
<table id="transfer_list">
<tr>
<td>
<i class="icon-folder" onclick='codiad.CodeTransfer.createFolder("localSel");' title="Create folder"></i>
<i class="icon-trash" onclick='codiad.CodeTransfer.deleteSel("localSel");' title="Delete"></i>
<i class="icon-info" onclick='codiad.CodeTransfer.localInfo();' title="Information"></i>
<i class="icon-key" onclick='codiad.CodeTransfer.fileModeSel("localSel");' title="Change permissions"></i>
<i class="icon-pencil" onclick='codiad.CodeTransfer.renameSel("localSel");' title="Rename"></i>
<i class="icon-upload" onclick='codiad.CodeTransfer.transferSel("localSel");' title="Upload"></i>
<i class="icon-arrows-ccw" onclick='codiad.CodeTransfer.updateLocalFiles(codiad.CodeTransfer.cDir);' title="Update"></i>
Codiad Server: <span id="local_path"></span>
</td>
<td style="width: 12px;">
<i class="icon-lock-open big-icon" id="ct_mirror_icon" style="margin-right: -10px;" onclick="codiad.CodeTransfer.mirror();" title="Mirror navigation"></i>
</td>
<td>
<i class="icon-folder" onclick='codiad.CodeTransfer.createFolder("serverSel");' title="Create Folder"></i>
<i class="icon-trash" onclick='codiad.CodeTransfer.deleteSel("serverSel");' title="Delete"></i>
<i class="icon-info" onclick='codiad.CodeTransfer.serverInfo();' title="Information"></i>
<i class="icon-key" onclick='codiad.CodeTransfer.fileModeSel("serverSel");' title="Change permissions"></i>
<?php
if ($_GET['action'] == 'scp') {
echo '<i class="icon-users" onclick="codiad.CodeTransfer.changeGroupSel(\'serverSel\');" title="Change group"></i>';
}
?>
<i class="icon-pencil" onclick='codiad.CodeTransfer.renameSel("serverSel");' title="Rename"></i>
<i class="icon-download" onclick='codiad.CodeTransfer.transferSel("serverSel")' title="Download"></i>
<i class="icon-export" onclick='codiad.CodeTransfer.editSel("serverSel")' title="Edit locally"></i>
<i class="icon-arrows-ccw" onclick='codiad.CodeTransfer.updateServerFiles(codiad.CodeTransfer.sDir);' title="Update"></i>
<?php
if ($_GET['action'] == "ftp") {
echo "FTP Server: ";
} else {
echo "SSH Server: ";
}
?>
<span id="server_path"></span>
</td>
</tr>
<tr>
<td colspan="2" class="fileList"><div class="file_list_div"><ul id="transfer_localList"></ul></div></td>
<td class="fileList"><div class="file_list_div"><ul id="transfer_serverList"></ul></div></td>
</tr>
</table>
<hr>
<div class="loading">
<ul class="drops">
<li></li><li></li><li></li><li></li><li></li>
</ul>
</div>
<hr>
<h2>Log:</h2>
<div id="transfer_log_div">
<table id="transfer_log"></table>
</div>
<button onclick="codiad.CodeTransfer.hide(); return false;">Hide</button>
<button onclick="codiad.CodeTransfer.closeDialog(); return false;">Logout</button>
</form>
</div>
<?php
break;
}
?>