1 <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML
4.0//EN'
>
4 Copyright (C) 2006-2010 Jonathan Zarate
5 http://www.polarcloud.com/tomato/
7 For use with Tomato Firmware only.
8 No part of this file may be used without permission.
12 <meta http-equiv='content-type' content='text/html;charset=utf-
8'
>
13 <meta name='robots' content='noindex,nofollow'
>
14 <title>[<%
ident(); %>] Admin: CIFS Client
</title>
15 <link rel='stylesheet' type='text/css' href='tomato.css'
>
16 <link rel='stylesheet' type='text/css' href='color.css'
>
17 <script type='text/javascript' src='tomato.js'
></script>
21 <script type='text/javascript' src='debug.js'
></script>
23 <script type='text/javascript'
>
25 // <% nvram("cifs1,cifs2"); %>
27 function verifyFields(focused
, quiet
)
30 var unc
, user
, pass
, dom
, exec
, servern
, sec
;
32 for (i
= 1; i
<= 2; ++i
) {
35 user
= E(p
+ '_user');
36 pass
= E(p
+ '_pass');
38 exec
= E(p
+ '_exec');
39 servern
= E(p
+ '_servern');
42 b
= !E(p
+ '_enable').checked
;
51 if ((!v_nodelim(unc
, quiet
, 'UNC')) || (!v_nodelim(user
, quiet
, 'username')) || (!v_nodelim(pass
, quiet
, 'password')) ||
52 (!v_nodelim(servern
, quiet
, 'Netbios name')) ||
53 (!v_nodelim(dom
, quiet
, 'domain')) || (!v_nodelim(exec
, quiet
, 'exec path'))) return 0;
54 if ((!v_length(user
, quiet
, 1)) || (!v_length(pass
, quiet
, 1))) return 0;
55 unc
.value
= unc
.value
.replace(/\//g, '\\');
56 if (!unc
.value
.match(/^\\\\.+\\/)) {
57 ferror
.set(unc
, 'Invalid UNC', quiet
);
62 ferror
.clear(unc
, user
, pass
, dom
, exec
, servern
, sec
);
73 if (!verifyFields(null, 0)) return;
75 for (i
= 1; i
<= 2; ++i
) {
77 E('cifs' + i
).value
= (E(p
+ '_enable').checked
? '1' : '0') + '<' + E(p
+ '_unc').value
+ '<' +
78 E(p
+ '_user').value
+ '<' + E(p
+ '_pass').value
+ '<' + E(p
+ '_dom').value
+ '<' + E(p
+ '_exec').value
79 + '<' + E(p
+ '_servern').value
+ '<' + E(p
+ '_sec').value
;
81 form
.submit('_fom', 0);
87 <form id='_fom' method='post' action='tomato.cgi'
>
88 <table id='container' cellspacing=
0>
89 <tr><td colspan=
2 id='header'
>
90 <div class='title'
>Tomato
</div>
91 <div class='version'
>Version <%
version(); %></div>
93 <tr id='body'
><td id='navi'
><script type='text/javascript'
>navi()</script></td>
95 <div id='ident'
><%
ident(); %></div>
99 <input type='hidden' name='_nextpage' value='admin-cifs.asp'
>
100 <input type='hidden' name='_nextwait' value='
10'
>
101 <input type='hidden' name='_service' value='cifs-restart'
>
103 <input type='hidden' name='cifs1' id='cifs1'
>
104 <input type='hidden' name='cifs2' id='cifs2'
>
106 <div class='section-title'
>CIFS Client
</div>
107 <div class='section'
>
108 <script type='text/javascript'
>
109 a
= b
= [0, '\\\\192.168.1.5\\shared_example', '', '', '', '', '', ''];
111 if (r
= nvram
.cifs1
.match(/^(0|1)<(\\\\.+)<(.*)<(.*)<(.*)<(.*)<(.*)<(.*)$/)) a
= r
.splice(1, 8);
112 if (r
= nvram
.cifs2
.match(/^(0|1)<(\\\\.+)<(.*)<(.*)<(.*)<(.*)<(.*)<(.*)$/)) b
= r
.splice(1, 8);
114 // <% statfs("/cifs1", "cifs1"); %>
115 // <% statfs("/cifs2", "cifs2"); %>
117 createFieldTable('', [
119 { title
: 'Enable', indent
: 2, name
: 'f_cifs1_enable', type
: 'checkbox', value
: a
[0]*1 },
120 { title
: 'UNC', indent
: 2, name
: 'f_cifs1_unc', type
: 'text', maxlen
: 128, size
: 64, value
: a
[1] },
121 { title
: 'Netbios Name', indent
: 2, name
: 'f_cifs1_servern', type
: 'text', maxlen
: 128, size
: 64, value
: a
[6] },
122 { title
: 'Username', indent
: 2, name
: 'f_cifs1_user', type
: 'text', maxlen
: 32, size
: 34, value
: a
[2] },
123 { title
: 'Password', indent
: 2, name
: 'f_cifs1_pass', type
: 'password', maxlen
: 32, size
: 34, peekaboo
: 1, value
: a
[3] },
124 { title
: 'Domain', indent
: 2, name
: 'f_cifs1_dom', type
: 'text', maxlen
: 32, size
: 34, value
: a
[4] },
125 { title
: 'Execute When Mounted', indent
: 2, name
: 'f_cifs1_exec', type
: 'text', maxlen
: 64, size
: 34, value
: a
[5] },
126 { title
: 'Security', indent
: 2, name
: 'f_cifs1_sec', type
: 'select',
127 options
: [['','Default (NTLM)'],['ntlmi','NTLM and packet signing'],['ntlmv2','NTLMv2'],['ntlmv2i','NTLMv2 and packet signing'],['nontlm','No NTLM'],['lanman','LANMAN'],['none','None']],
129 { title
: 'Total / Free Size', indent
: 2, text
: cifs1
.size
? (scaleSize(cifs1
.size
) + ' / ' + scaleSize(cifs1
.free
)) : '(not mounted)' },
132 { title
: 'Enable', indent
: 2, name
: 'f_cifs2_enable', type
: 'checkbox', value
: b
[0]*1 },
133 { title
: 'UNC', indent
: 2, name
: 'f_cifs2_unc', type
: 'text', maxlen
: 128, size
: 64, value
: b
[1] },
134 { title
: 'Netbios Name', indent
: 2, name
: 'f_cifs2_servern', type
: 'text', maxlen
: 128, size
: 64, value
: b
[6] },
135 { title
: 'Username', indent
: 2, name
: 'f_cifs2_user', type
: 'text', maxlen
: 32, size
: 34, value
: b
[2] },
136 { title
: 'Password', indent
: 2, name
: 'f_cifs2_pass', type
: 'password', maxlen
: 32, size
: 34, peekaboo
: 1, value
: b
[3] },
137 { title
: 'Domain', indent
: 2, name
: 'f_cifs2_dom', type
: 'text', maxlen
: 32, size
: 34, value
: b
[4] },
138 { title
: 'Execute When Mounted', indent
: 2, name
: 'f_cifs2_exec', type
: 'text', maxlen
: 64, size
: 34, value
: b
[5] },
139 { title
: 'Security', indent
: 2, name
: 'f_cifs2_sec', type
: 'select',
140 options
: [['','Default (NTLM)'],['ntlmi','NTLM and packet signing'],['ntlmv2','NTLMv2'],['ntlmv2i','NTLMv2 and packet signing'],['nontlm','No NTLM'],['lanman','LANMAN'],['none','None']],
142 { title
: 'Total / Free Size', indent
: 2, text
: cifs2
.size
? (scaleSize(cifs2
.size
) + ' / ' + scaleSize(cifs2
.free
)) : '(not mounted)' }
147 <script type='text/javascript'
>show_notice1('<% notice("cifs"); %>');</script>
153 <tr><td id='footer' colspan=
2>
154 <span id='footer-msg'
></span>
155 <input type='button' value='Save' id='save-button' onclick='save()'
>
156 <input type='button' value='Cancel' id='cancel-button' onclick='javascript:reloadPage();'
>
160 <script type='text/javascript'
>verifyFields(null, 1);</script>