-
Notifications
You must be signed in to change notification settings - Fork 3
/
smbwebclient.php
1611 lines (1439 loc) · 76.6 KB
/
smbwebclient.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
###################################################################
# smbwebclient.php
# This script is a web interface to a Windows Network.
#
# Installation:
# 1. You will need smbclient (from SAMBA package) and PHP 4.1+.
# 2. Change your settings (editing this file) -- see below
# 3. Copy it to your web server path as smbwebclient.php and run it
# from your web browser. That's all.
#
# Putting settings in another file:
#
# 1) /var/www/smbwebclient.php
#
# (?php
# $SMBWEBCLIENT_CLASS = 'smbwebclient_config';
# include '/usr/share/samba/smbwebclient.php';
# include '/etc/samba/smbwebclient.conf';
# $swc = new smbwebclient_config;
# $swc->Run();
# ?)
#
# 2) /etc/samba/smbwebclient.conf:
#
# (?php
# class smbwebclient_config extends smbwebclient {
# var $cfgSambaRoot = 'MYDOMAIN/MYSERVER';
# var $cfgDefaultLanguage = 'es';
# // all your settings ...
# }
# ?)
#
# 3) /usr/share/samba/smbwebclient.php (this file)
#
# Homepage: http://smbwebclient.sourceforge.net
#
# Copyright (C) 2003-2005 Victor M. Varela <[email protected]>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
$SMBWEBCLIENT_VERSION = '2.9.1';
###################################################################
class smbwebclient extends samba {
###################################################################
# CONFIGURATION SECTION - Change for your needs
###################################################################
###################################################################
# You can set this constant to see a single domain (or workgroup),
# a domain and a server, a domain/server/shared resource
# and (even) a path into a domain/server/shared.
# For example to see only folder Bilbo in 'Bolson' shared resource
# at 'HOBBIT' server in 'TIERRAMEDIA' domain would be:
# var $cfgSambaRoot = 'TIERRAMEDIA/HOBBIT/Bolson/Bilbo';
# Note: Do not put any slash at beginning/end.
# Tip: To share only their home directory in your SAMBA server to
# users (auth req.) you must set cfgSambaRoot to
# 'DOMAIN/SERVER/homes'
var $cfgSambaRoot = '';
###################################################################
# Anonymoys login is disallowed by default.
# If you have public shares in your network, turn on this flag
# i.e. var $cfgAnonymous = true;
var $cfgAnonymous = false;
###################################################################
# Path at web server to store downloaded files. This script will
# check when it need to update the cached file. This path must be
# writable to the user that runs your web server.
# If you set this value to '' cache will be disabled.
# Note: this feature is a security risk.
var $cfgCachePath = false;
###################################################################
# This script try to set language from web browser. If browser
# language is not supported you can set a default language.
var $cfgDefaultLanguage = 'en';
###################################################################
# Default charset (as suggested by Norbert Malecki)
var $cfgDefaultCharset = 'ISO-8859-1';
###################################################################
# Default browse server for your network. A browse server is where
# you run smbclient -L subcommand to read available domains and/or
# workgroups. Set to 'localhost' if you are running SAMBA server
# in your web server. Maybe you will need cfgDefaultUser and
# cfgDefaultPassword if no anonymous browsing is allowed.
var $cfgDefaultServer = 'localhost';
###################################################################
# Path to smbclient program.
# i.e. var $cfgSmbClient = '/usr/bin/smbclient';
var $cfgSmbClient = 'smbclient';
###################################################################
# Authentication method with smbclient
# 'SMB_AUTH_ENV' USER environment variable (more secure)
# 'SMB_AUTH_ARG' smbclient -U param
var $cfgAuthMode = 'SMB_AUTH_ARG';
###################################################################
# If you have Apache mod_rewrite installed you can put this
# .htaccess file in same path of smbwebclient.php:
#
# <IfModule mod_rewrite.c>
# RewriteEngine on
# RewriteCond %{REQUEST_FILENAME} -d
# RewriteRule ^(.*/[^\./]*[^/])$ $1/
# RewriteRule ^(.*)$ smbwebclient.php?path=$1 [QSA,L]
# </IfModule>
#
# Then you will be able to access to use "pretty" URLs
# i.e: http://server/windows-network/DOMAIN/SERVER/SHARE/PATH
#
# To do this, all you have to set is cfgBaseUrl and set
# cfgModRewrite = true
# (i.e. http://server/windows-network/)
#
# Note - Change this if you want to use mod_rewrite
var $cfgModRewrite = false;
var $cfgBaseUrl = '';
###################################################################
# Do not show dot files (like .cshrc)
#
var $cfgHideDotFiles = true;
###################################################################
# Do not show system shared resources (like admin$ or C$)
#
var $cfgHideSystemShares = true;
###################################################################
# Do not show printer resources
#
var $cfgHidePrinterShares = false;
###################################################################
# Log level
# -1 = no messages
# 0 = log actions performed
# 1 = smbclient calls
# >1 = smbclient output
#
var $cfgLogLevel = 0;
###################################################################
# Log facility (User authentication: BasicAuth or FormAuth)
#
var $cfgFacility = LOG_DAEMON;
###################################################################
# User authentication (BasicAuth or FormAuth)
#
var $cfgUserAuth = 'BasicAuth';
###################################################################
# Change PHP session name ('' to use default session name)
#
var $cfgSessionName = 'SMBWebClientID';
###################################################################
# Virus scanner to upload files -- suggested by Bill R <[email protected]>
# Only ClamAV is available in this revision, set to false to
# disable virus scanning.
#
# var $cfgAntivirus = 'ClamAV';
var $cfgAntivirus = false;
###################################################################
# Format to upload compressed folders: tar, tgz or zip
#
# var $cfgArchiver = 'tgz';
var $cfgArchiver = 'zip';
var $archiverPlugins = array(
'tar' => '',
'tgz' => '| gzip -q -c - ',
'zip' => '| ( cat - > @f.tar; mkdir @f.zip.$$; cd @f.zip.$$; tar xf @f.tar; zip -r -q @f.zip *; cd ..; rm -rf @f.tar @f.zip.$$; cat @f.zip; rm @f.zip )'
);
###################################################################
# INTERFACE CLASS
###################################################################
# inline files (included using base64_encode PHP function)
var $cfgInlineFiles = true;
var $inlineFiles = array (
'data/languages.csv' => 'YWY7YWZ8YWZyaWthYW5zCmFyO2FyKFstX11bWzphbHBoYTpdXXsyfSk/fGFyYWJpYwphejthenxhemVyYmFpamFuaQpiZztiZ3xidWxnYXJpYW4KYnM7YnN8Ym9zbmlhbgpjYTtjYXxjYXRhbGFuCmNzO2NzfGN6ZWNoCmRhO2RhfGRhbmlzaApkZTtkZShbLV9dW1s6YWxwaGE6XV17Mn0pP3xnZXJtYW4KZWw7ZWx8Z3JlZWsKZW47ZW4oWy1fXVtbOmFscGhhOl1dezJ9KT98ZW5nbGlzaAplbztlb3xlc3BlcmFudG8KZXM7ZXMoWy1fXVtbOmFscGhhOl1dezJ9KT98c3BhbmlzaApldDtldHxlc3RvbmlhbgpldTtldXxiYXNxdWUKZmE7ZmF8cG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Lxu9lbcFxmSRGXqJH6fi6oJdSXHyorC1FQMALfbPZRRlNdAT/69Qt/LkK10Cplmg0DpAa8eOjjq9QxlNE07eLVhhZ68eI732lcAXr6psXDu3siK+6L+Qr++vSMej/NZnkWSZB49niU1ouIB0SlXg6i9QqlYJZ/doVBNkUgkiMVieDweivrPAabY+IQQV7qiZ08XzZtXj7Nt1NG+/MZi1vD4bhAKTZBMJi17zO07033Mdfx+R1d05uw07z9k2dysdBatu+h6hq2tSfL5vBkMBi2jmFJpsltNiICQpBJOZwPTrLG6qtBq/cDr9SLL8trfGOj5RnRdX1RV9ZaqqjSbTYQQRKNRwuHwoZh/Hn8AelUdaSkrxgYAAAAASUVORK5CYII=',
'style/down.png' => 'iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAYAAACprHcmAAAABmJLR0QA6wDqANsTMxObAAAACXBIWXMAAAsQAAALEAGtI711AAAAB3RJTUUH1AUHCyYmDcqqaAAAADhJREFUeJxjYKAUrFkx8z82cUZ8CkMi0hlxKsZmIrIGRnwK0TUwElKIrAHZZHwKEc7ApxBdwyAAAB3iGPP2uU9fAAAAAElFTkSuQmCC',
'style/up.png' => 'iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAYAAACprHcmAAAABmJLR0QA6wDqANsTMxObAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAAB3RJTUUH1AUHCyYQwnA/8QAAAEhJREFUeJxjYCABMDIwMDCsWTHzPyGFIRHpjIwwDj4NIRHpjMgmw8SxaWCEamBANhmbBrhCOAeHBhSFGIrRNKAoxAmQNQxCAABCrxj04y1lDgAAAABJRU5ErkJggg==',
'style/rename.png' => 'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsSAAALEgHS3X78AAAAB3RJTUUH1QEcDB4AdNMgEAAAAe9JREFUOI2tk01IFHEYxn+zM7vKmvshuCghaVuHIPpYlHIPIZQQVAgRxOYWoplCW0JEx/DQJYIgMPTSB2i3KKKLuUF1SetUeIgObrGHwAppG2dlZ2bn32HZdaeYZRZ6jg8PP573ff9/+E+S3IQSZxJiR3QnkfYo3QcP8erFU0KhIJbUQGo86YoBwK2bN0QuVxCLix/F2NhFsbS0IrJZIQ73HxfljOIGFG7bw9nhEeI93UxOTnFpIsH3tQKBlo5KRgFIDo0LRwrwMv2cgm6gaTkymQyrP/N0bOvEI3ROJq+IJ3O3pUqj2QfTjiBdN1DXNe5OzWAYEAgGeHT/DqcSwxTlpn9Hkw88c4QV3w0AYBigyHIpL8sYlgWAp9ZIf8sSJZDHUzqUBJR3UhdICDDNKqPq8PWBLGEHVanuRoZh9ySpVMu27PJCnWSaRUwTNC1f8RRF2QTNPZyRfuv+mm8JoLO1CV2HL9lvDAxeRaKZQPMWe6PLqVRNyEZe5f2bBcBLe6SVvbt3sW9/jJZwmNnp65ugI/Htjp/vwvmU8DV20ds7gs8XJt5zjs8f5lGsdfqPnY7aGtXS2q8f9PWNsrz8mKJYxShsJRa7xkJ6An+obQWQXIGOnhhkPn0PS2rA6/Xib/zKp7evCUa6UFXVDcK9/gBonqZcTQIbiwAAAABJRU5ErkJggg==',
);
var $strings = array (
'es' => array(
'Red Windows',
'Nombre',
'Tamaño',
'Comentarios',
'Modificado',
'Tipo',
'd/m/Y H:i',
'Imprimir un archivo',
'Borrar elementos seleccionados',
'Nuevo archivo (subir)',
'Cancelar trabajos seleccionados',
'Carpeta',
'Archivo %s',
'Enviar un mensaje',
'Subir',
'Nueva carpeta',
'Descargar esta carpeta',
'Desconectar'
),
'no' => array('Windowsnettverk','Navn','Størrelse','Kommentar','Endret','','d-m-Y h:i','Utskrift','Slett valgte','Ny fil','Avbryt valgte','Filmappe','Fil %s','Send popup-melding','Opp','Ny mappe'),
'eu' => array('Windows Sarea','Izena','Tamaina','Komentarioak','Aldatua','','Y/m/d h:i','Inprimatu','Ezabatu aukeratuak','Fitxategi berria','Ezeztatu hautespena','','','','',''),
'fr' => array(
'Réseau Windows',
'Nom',
'Taille',
'Commentaire',
'Modifié',
'Type',
'd/m/Y h:i',
'Imprimer',
'Effacer la sélection',
'Nouveau fichier (envoi)',
'Annuler la sélection',
'Dossier',
'Fichier %s',
'Envoyer un message popup',
'Remonter',
'Nouveau dossier',
'Télécharger ce dossier',
'Déconnexion',
'Renommer la sélection'
),
'gl' => array('Rede Windows','Nome','Tamaño','Comentarios','Modificado','Tipo','d/m/Y h:i','Imprimir un arquivo','Borrar elementos seleccionados','Novo arquivo (subir)','Cancelar traballos seleccionados','Carpeta','Arquivo %s','Enviar unha mensaxe','Subir','Nova carpeta'),
'el' => array('Δίκτυο Windows','Όνομα','Μέγεθος','Σχόλια','Τροποποιήθηκε','Τύπος','m/d/Y h:i','Εκτύπωση','Διαγραφή Επιλεγμένων','Νέο Αρχείο','Ακύρωση Επιλεγμένων','Φάκελος Αρχείων','Αρχείο %s','Αποστολή μηνύματος','Επάνω','Νέος Φάκελος'),
'it' => array('Rete Windows','Nome','Dimensione','Commenti','Modificato','Tipo','d/m/Y h:i','Stampa un file','Rimuovi l\'oggetto selezionato','Nuovo file (upload)','Cancella l\'oggetto selezionato','Cartella','','Manda un messaggio popup','Su','Nuova cartella'),
'pl' => array(
'Sieć Windows',
'Nazwa',
'Rozmiar',
'Komentarz',
'Zmodyfikowany',
'Typ','d/m/Y h:i',
'Drukuj',
'Usuń zaznaczone',
'Nowy plik',
'Anuluj zaznaczone',
'Katalog',
'Plik %s',
'Wyślij wiadomość',
'Powrót',
'Nowy katalog',
'Sciagnij ten plik'
),
'ro' => array('Reteaua Windows','Nume','Marime','Comentarii','Modificat','Tip','m/d/Y h:i','Print','Sterge selectia','Fisier Nou','Renunta','Fisier Director','Fisier %s','Trimite mesaj popup','Sus','Director nou'),
'nl' => array('Windows Netwerk','Naam','Grootte','Commentaar','Gewijzigd','Soort','d/m/Y h:i','Afdrukken','Selectie verwijderen','Nieuw bestand','Selectie afbreken','Bestandsmap','Bestand %s','Stuur een popup bericht','Omhoog','Nieuwe map'),
'cs' => array('Síť Windows','Název','Velikost','Poznámka','Změněno','Typ','měsíc/den/rok hodina:minuta','Tisk','Smazat vybrané','Nový soubor (nahrát)','Zruit výber','Nový adresář','Soubor %s','Poslat zprávu','Nahoru','Nový adresář'),
'da' => array('Windows Netværk','Navn','Størelse','Kommentar','Sidst ændret','Type','d.m.Y t:i','Print fil','Slet valgte emner','Ny fil (upload)','Afbryd valgte job','Fil mappe','File %s','Send popup besked','Up','Ny mappe'),
'sv' => array('Windows Nätverk','Namn','Storlek','Kommentar','Ändrad','Typ','Y/m/d H:i','Skriv ut','Ta bort markerad','Ny fil','Avbryt markerad','Filkatalog','Fil %s','Skicka ett popup-meddelande','Upp','Ny katalog'),
'de' => array(
'Windows Netzwerk',
'Name',
'Größe',
'Bemerkung',
'Geändert',
'Typ',
'd.m.Y H:i',
'Datei drucken',
'Markierte Datei(en) löschen',
'Neue Datei (hochladen)',
'Abbruch der ausgewählten Aktion',
'Dateiordner',
'Datei %s',
'Nachricht senden',
'Aufwärts',
'Neuer Ordner',
'Dieser Ordner herunterladen',
'Abmelden',
'Markierte Datei(en) umbenennen'
),
'ja' => array('ネットワーク','名前','サイズ','コメント','更新日時','タイプ','Y/m/d H:i','プリント','選択したものを削除','新規作成','選択したものをキャンセル','','','ポップアップメッセージの送信','','新規フォルダ'),
'tr' => array('Windows Ağı','İsim','Boyut','Yorumlar','Değiştirilme Tarihi','Tip','m/d/Y h:i','Yazdır','Seçimi sil','Yeni dosya','Seçim İptal','Dosya Dizini','Dosya boyu','Uyari iletisi gonder','Yukari','Yeni dizin'),
'ca' => array('Xarxa Windows','Nom','Tamany','Comentaris','Modificat','Tipus','','Imprimeix','Esborra els seleccionats','Nou arxiu','Cancel·la selecció','Carpeta','Fitxer %s','Enviar un missatge','Pujar','Nova carpeta'),
'eo' => array('Reto de Windows','Nomo','Grandeco','komentaroj','Modifii','','','Presi','','Nova dosiero','Nuligi','','','','',''),
'et' => array('Windowsi võrk','Nimi','Suurus','Kommentaarid','Muudetud','','d/m/Y h:i','Trüki','Kustuta valitud','Uus fail','Tühista valitud','Kataloog','Fail %s','Saada popup teade','Üles','Uus kataloog'),
'uk' => array('Мережа Віндовз','Ім\'я','Розмір','Коментарі','Змінений','','d.m.Y h:i','Друкувати','Видалити відмічене','Новий файл','Відмінити відмічене','','','','',''),
'bg' => array('Уиндоус мрежа','Име','Размер','Коментар','Промяна','Тип','м/д/г Ч:мин','Печат','Изтрий избраните','Нов файл','Откажи избор','Папка','Файл %','Изпрати съобщение','Нагоре','Нова папка'),
'sr' => array('Windows mrea','Ime','veličina','komentari','promenjen','tip','d/m/Y h:i','Odtampaj','Obrii selektovano','Nova datoteka','Odustajem od izabranog','Direktorijum','','Poalji poruku','Nazad','Novi direktorijum'),
'hr' => array('Windows mrea','Naziv','Veličina','Komentar','Modificirano','','','Ispii','Obrii selektirano','Nova datoteka','','','','','',''),
'lv' => array('Windows Tīkls','Nosaukums','Izmērs','Komentāri','Izmainīts','','m/d/g s:m','Drukāt','Dzēst izvēlētos','Jauns fails','Atcelt izvēlētos','','','','',''),
'fi' => array('Windows Verkko','Nimi','Koko','Kommentit','Muokattu','Tyyppi','p/k/v t:m','Tulosta','Poista valitut','Uusi tiedosto','Peruuta valinta','Tiedosto kansio','Tiedosto %s','Lähetä popup viesti','Ylös','Uusi kansio'),
'hu' => array('Windows hálózat','Név','Méret','Megjegyzés','Módosítva','Típus','h/n/É ó:p','Nyomtat','Kiválasztottak törlése','Új állomány','Kijelölés elvetése','Mappa','Fájl','Előugró üzenet küldése','Fel','Új mappa'),
'pt-br' => array('Rede Windows','Nome','Tamanho','Comentários','Modificado','Tipo','d/m/Y h:i','Imprimir','Apagar selecionados','Novo arquivo','Cancelar Seleção','Pasta de arquivo','Arquivo %s','Enviar Mensagem','Acima','Nova Pasta'),
'th' => array('Samba Server','ชื่อ','ขนาด','หมายเหตุ','ปรับปรุงล่าสุด','ชนิด','เดือน/วัน/ปี ชั่วโมง','พิมพ์ File','ลบสิ่งที่เลือกไว้','ส่ง File เข้าไปเก็บ','ยกเลิกสิ่งที่เลือกไว้','','','ส่งข้อความ Popup','กลับไปก่อนหน้า','สร้าง Folder ใหม่'),
'zh-tw' => array('視窗網路','名稱','大小','說明','修正','型式','','檔案列印','刪除選項','新檔案(上傳)','取消所選的工作','檔案資料夾','檔案%s','傳送訊息','上一頁','新資料夾'),
'sl' => array('Windows Omreje','Ime','Velikost','Komentarji','Sprememba','Tip','m/d/y H:i','Natisni','Izbrii izbrano','Nova datoteka','Prekliči izbrano','Mapa','Datoteka %s','Polji sporočilo','Gor','Nova mapa'),
'id' => array('Jaringan Windows','Nama','Ukuran','Komentar','Terakhir diubah','Tipe','bulan/tanggal/tahun Jam:menit','Cetak file ini','Hapus item yang dipilih','File baru ( upload )','Batalkan pekerjaan yang dipilih','File dalam folder','','Kirim pesan popup','Naik','Folder baru'),
'lt' => array('Windows Tinklas','Vardas','Dydis','Komentarai','Pakeista','Tipas','m/d/Y H:i','Spausdinti bylą','Trinti parinktus','Įkelti bylą','Nutraukti parinktas uduotis','Katalogas','Byla %s','Siųsti inutę','Auktyn','Naujas katalogas'),
'pt' => array('rede windows','Nome','Tamanho','Comentario','Modificado','Tipo','d/m/Y h:i','Imprimir Ficheiro','Apagar a Selecção','Novo Ficheiro','Cancelar a Selecção','Ficheiro','Ficheiro %s','Enviar uma mensagem Instantanea','Para Cima','Nova Pasta'),
'sk' => array('Sieť Windows','Meno','Veľkosť','Poznámky','Zmenené','Typ','m/d/Y H:i','Vytlačiť súbor','Vymazať vybrané položky','Nový súbor (upload)','Zrušiť vybrané úlohy','Adresár','Súbor %s','Poslať popup správu','Hore','Nový adresár'),
'zh' => array('Windows 网络','姓名','大小','注释','修改','类型','月/日/年 时:分','打印一个文件','删除选择项目','新建文件(上传)','取消选择对象','文件夹','文件','发送一个弹出消息','向上','新建文件夹'),
'ru' => array('Сеть Windows','Название','Размер','Комментарии','Изменен','Тип','d/m/Y H:i','Печать','Удалить выделенные','Новый файл (поместить)','Отменить','Папка файла','Файл %s','Послать сообщение','Вверх','Новая папка'),
'en' => array(
'Windows Network',
'Name',
'Size',
'Comments',
'Modified',
'Type',
'm/d/Y H:i',
'Print a file',
'Delete selected items',
'New file (upload)',
'Cancel selected jobs',
'File Folder',
'File %s',
'Send a popup message',
'Up',
'New folder',
'Download this folder',
'Logout',
'Rename selected items'
),
);
# constructor
function smbwebclient ()
{
$this->InitSession ();
$this->InitLanguage();
if (isset($_GET['O'])) {
$_SESSION['swcOrder'] = $_GET['O'];
unset($_GET['O']);
}
$this->debug = $this->cfgLogLevel;
$this->order = @$_SESSION['swcOrder'];
# load MIME types
foreach (preg_split('/\n/',$this->GetInlineFile('data/mime.types')) as $line) {
$a = preg_split('/ /', $line);
$this->mimeTypes[$a[0]] = $a[1];
}
}
function Run ()
{
$this->where = $path = stripslashes(@$_REQUEST['path']);
if (isset($this->inlineFiles[$path])) {
$this->DumpInlineFile($path);
exit;
}
$this->Go(preg_replace('/\/$/','',preg_replace('/^\//','',$this->cfgSambaRoot.'/'.$path)));
$this->GetCachedAuth();
if (isset($_REQUEST['action'])) {
if (preg_match('/^UpAction([0-9]+)$/', $_REQUEST['action'], $regs)) {
$this->UpAction($regs[1]);
} elseif (method_exists($this, $_REQUEST['action'])) {
$action = $_REQUEST['action'];
$this->$action ();
}
}
$this->Debug($path);
switch ($this->Browse()) {
case '': break;
case 'ACCESS_DENIED':
case 'LOGON_FAILURE':
$this->CleanCachedAuth();
header('Location: '.$this->GetUrl($path, 'auth', '1'));
exit;
default:
$this->ErrorMessage($this->status);
header('Location: '.$this->FromPath('..'));
exit;
}
$this->View ();
}
function InitSession ()
{
set_time_limit(1200);
error_reporting(E_ALL ^ E_NOTICE);
openlog("smbwebclient", LOG_ODELAY | LOG_PID, $this->cfgFacility);
if ($this->cfgSessionName <> '') session_name($this->cfgSessionName);
session_start();
}
function InitLanguage ()
{
# load languages
foreach (preg_split('/\n/',$this->GetInlineFile('data/languages.csv')) as $line) {
$a = preg_split('/;/', $line);
$this->languages[$a[0]] = $a[1];
}
# default language
$this->lang = $this->cfgDefaultLanguage;
$langOK = false;
# param from GET
if (isset($_REQUEST['lang']) AND isset($this->strings[$_REQUEST['lang']])) {
$this->lang = $_REQUEST['lang'];
$langOK = true;
# current session
} elseif (isset($_SESSION['swcLanguage']) AND isset($this->strings[$_SESSION['swcLanguage']])) {
$this->lang = $_SESSION['swcLanguage'];
} else {
# take a look at HTTP_ACCEPT_LANGUAGE
foreach (preg_split('/,/', $_SERVER['HTTP_ACCEPT_LANGUAGE']) as $lang)
foreach ($this->languages as $key => $filter)
if (isset($this->strings[$key]) AND preg_match('/^('.$filter.')(;q=[0-9]\\.[0-9])?$/i', $lang)) {
$this->lang = $key;
$langOK = true;
}
# look at HTTP_USER_AGENT
if (! $langOK) {
reset($this->languages);
foreach ($this->languages as $key => $filter)
if (isset($this->strings[$key])
AND preg_match('/(\(|\[|;[[:space:]])(' . $filter . ')(;|\]|\))/i', $_SERVER['HTTP_USER_AGENT'])) {
$this->lang = $key;
$langOK = true;
}
}
}
if ($langOK) $_SESSION['swcLanguage'] = $this->lang;
}
# returns a string in a given language
function _($str)
{
# for english, all is done !
if ($this->lang == 'en') return $str;
# search string at english list (get position)
$pos = array_search ($str, $this->strings['en']);
if (($pos = array_search ($str, $this->strings['en'])) === FALSE)
return $str;
# found position at current language (ok!)
if ($this->strings[$this->lang][$pos] <> '')
return $this->strings[$this->lang][$pos];
# found position at default language (better than nothing!)
if ($this->strings[$this->cfgDefaultLanguage][$pos] <> '')
return $this->strings[$this->cfgDefaultLanguage][$pos];
# well, I cannot do anything better !
return $str;
}
function DumpFile($file='', $name='', $isAttachment=false, $isCacheable=false)
{
if ($name == '') $name = basename($file);
$pi = pathinfo(strtolower($name));
$mimeType = @$this->mimeTypes[@$pi['extension']];
if ($mimeType == '') $mimeType = 'application/octet-stream';
# dot bug with IE
if (strstr($_SERVER['HTTP_USER_AGENT'], "MSIE")) {
$name = preg_replace('/\./','%2e', $name, substr_count($name, '.') - 1);
}
header("Cache-control: ".($isCacheable ? "public" : "private"));
header("Pragma: public");
header('MIME-Version: 1.0');
header("Content-Type: $mimeType; name =\"".$name."\"");
if ($isAttachment)
header("Content-Disposition: attachment; filename=\"".$name."\"");
else
header("Content-Disposition: filename=\"".$name."\"");
if ($file <> '' AND is_readable($file)) {
$fp = fopen($file, "r");
while (! feof($fp)) {
print fread($fp,65536);
flush();
}
fclose($fp);
}
}
function GetInlineFile ($file)
{
if (! $this->cfgInlineFiles) {
# if does not exists, write from inline file ! (devel)
if (! is_readable($file)) {
$f = fopen($file, 'wb');
fwrite($f, base64_decode($this->inlineFiles[$file]));
fclose($f);
}
$f = fopen($file, 'r');
$data = fread ($f, filesize($file));
fclose ($f);
} else {
if (isset($_SESSION['swcUncodedInlineFiles'][$file])) {
$data = $_SESSION['swcUncodedInlineFiles'][$file];
} else {
$data = base64_decode($this->inlineFiles[$file]);
$_SESSION['swcUncodedInlineFiles'][$file] = $data;
}
}
return $data;
}
function DumpInlineFile ($file)
{
$this->DumpFile('',$file,false,true);
print $this->GetInlineFile ($file);
}
function GetIP()
{
foreach (array('HTTP_X_FORWARDED','HTTP_VIA','REMOTE_ADDR') as $var) {
if (isset($_SERVER[$var])) return $_SERVER[$var];
}
return 'unknown';
}
# debugging messages
function Debug ($message, $level=0)
{
if ($level <= $this->debug) {
foreach (preg_split('/\n/',$message) as $line) {
syslog(LOG_INFO, $this->user.'['.$this->GetIP().']: '.$line);
}
}
}
# HTML page
function Page ($title='', $content='')
{
if (@$_SESSION['swcErrorMessage'] <> '') {
$content .= "\n<script language=\"Javascript\">alert(\"{$_SESSION['swcErrorMessage']}\")</script>\n";
$_SESSION['swcErrorMessage'] = '';
}
return $this->Template('style/page.thtml', array(
'{title}' => $title,
'{charset}' => $this->cfgDefaultCharset,
'{content}' => $content,
'{style}' => $this->GetUrl('style/'),
'{favicon}' => $this->GetUrl('style/favicon.ico')
));
}
# loads an HTML template
function Template ($file, $vars=array())
{
return str_replace(array_keys($vars), array_values($vars), $this->GetInlineFile($file));
}
# HTML a href
function Link ($title, $url='', $name='')
{
if ($name <> '') $name = "name = \"{$name}\"";
return ($url == '') ? $title : "<a href=\"{$url}\" {$name}>{$title}</a>";
}
# HTML img
function Image ($url, $alt='', $extra='')
{
return ($url == '') ? $title : "<img src=\"{$url}\" alt=\"{$alt}\" border=\"0\" {$extra} />";
}
# HTML select (combo)
function Select ($name, $value, $options)
{
$html = "<select name=\"{$name}\">\n";
foreach ($options as $key => $description) {
$selected = ($key == $value) ? "selected" : "";
$html .= "<option value=\"{$key}\" $selected>{$description}</option>\n";
}
$html .= "</select>\n";
return $html;
}
# HTML check box
function CheckBox ($name, $value, $checked = false)
{
return $this->Input($name, $value, 'checkbox', $checked ? "checked" : "");
}
function Input ($name, $value = '', $type = 'text', $extra = '')
{
return "<input type=\"{$type}\" name=\"{$name}\" value=\"".htmlentities($value, ENT_COMPAT, $this->cfgDefaultCharset)."\" {$extra}/>";
}
# return an URL (adding a param)
function GetUrl ($path='', $arg='', $val='')
{
$get = $_GET;
$get['path'] = $path;
# delete switches from URL
$get['lang'] = $get['auth'] = '';
if ($arg <> '') {
if (! is_array($arg)) $get[$arg] = $val;
else foreach ($arg as $key=>$value) $get[$key] = $value;
}
# build query string
$query = array();
foreach ($get as $key=>$value) if ($value <> '') {
if ($this->cfgModRewrite <> true OR $key <> 'path') {
$query[] = urlencode($key).'='.urlencode($value);
}
}
if (($query = join('&',$query)) <> '') $query = '?'.$query;
if ($this->cfgModRewrite) {
return $this->cfgBaseUrl.str_replace('%2F','/',urlencode($get['path'])).$query;
} else {
return $_SERVER['PHP_SELF'].$query;
}
}
function ErrorMessage ($msg)
{
$_SESSION['swcErrorMessage'] = @$_SESSION['swcErrorMessage'] . $msg;
}
function CleanCachedAuth ()
{
$mode = $this->type;
@$_SESSION['swcCachedAuth'][$mode][$this->$mode] = '';
}
function GetAuth ($command)
{
$fn = $this->cfgUserAuth;
return $this->$fn($command);
}
# basic auth
function BasicAuth ($command = 'get')
{
switch ($command) {
case 'get':
if (@$_GET['auth'] == 1 OR ($this->cfgAnonymous <> true AND !isset($_SERVER['PHP_AUTH_USER']))) {
$_SESSION['swcAuthSubmit'] = true;
$time = date("h:i:s");
$path = $this->PrintablePath();
header("WWW-Authenticate: Basic realm=\"{$path} ($time)\"");
header("HTTP/1.0 401 Unauthorized");
print $this->Page('unauthorized');
exit;
}
$this->user = stripslashes(@$_SERVER['PHP_AUTH_USER']);
$this->pw = stripslashes(@$_SERVER['PHP_AUTH_PW']);
break;
case 'submit':
if (@$_SESSION['swcAuthSubmit']) {
$_SESSION['swcAuthSubmit'] = false;
$this->user = stripslashes(@$_SERVER['PHP_AUTH_USER']);
$this->pw = stripslashes(@$_SERVER['PHP_AUTH_PW']);
return true;
}
return false;
}
}
# form auth
function FormAuth ($command = 'get')
{
switch ($command) {
case 'get':
if (@$_GET['auth'] == 1 OR ($this->cfgAnonymous <> true AND !isset($_SESSION['swcUser']))) {
$time = date("h:i:s");
$path = $this->PrintablePath();
$action = $this->GetUrl($this->where);
$page = $this->Page('unauthorized',
"<p>{$path}</p><p class=\"authform\"><form name=\"authForm\" method=\"post\" action=\"{$action}\">".
$this->Input('swcUser', $_SESSION['swcUser']).'<br />'.
$this->Input('swcPw', '', 'password').'<br />'.
$this->Input('swcSubmit',$this->_('Ok'),'submit').
"</form></p>");
$page = str_replace("<body>", "<body onload=\"document.authForm.swcUser.focus()\">", $page);
print $page;
exit;
}
$this->user = @$_SESSION['swcUser'];
$this->pw = @$_SESSION['swcPw'];
break;
case 'submit':
if (isset($_POST['swcSubmit'])) {
$this->user = @$_POST['swcUser'];
$this->pw = @$_POST['swcPw'];
$_SESSION['swcUser'] = $this->user;
$_SESSION['swcPw'] = $this->pw;
return true;
}
return false;
}
}
function GetCachedAuth ()
{
$this->user = $this->pw = '';
$nextLevel = array('network'=>'','workgroup'=>'network','server'=>'workgroup','share'=>'server');
if ($this->GetAuth('submit')) {
# store auth in cache
$mode = $this->type;
$_SESSION['swcCachedAuth'][$mode][$this->$mode]['User'] = $this->user;
$_SESSION['swcCachedAuth'][$mode][$this->$mode]['Password'] = $this->pw;
for ($mode = $nextLevel[$mode]; $mode <> ''; $mode = $nextLevel[$mode]) {
if (! isset($_SESSION['swcCachedAuth'][$mode][$this->$mode])) {
$_SESSION['swcCachedAuth'][$mode][$this->$mode]['User'] = $this->user;
$_SESSION['swcCachedAuth'][$mode][$this->$mode]['Password'] = $this->pw;
}
}
} elseif (@$_GET['auth'] <> 1) {
# get auth from cache
for ($mode = $this->type; $mode <> ''; $mode = $nextLevel[$mode]) {
if (isset($_SESSION['swcCachedAuth'][$mode][$this->$mode])) {
$this->user = $_SESSION['swcCachedAuth'][$mode][$this->$mode]['User'];
$this->pw = $_SESSION['swcCachedAuth'][$mode][$this->$mode]['Password'];
break;
}
}
if ($this->user == '') $this->GetAuth('get');
} else $this->GetAuth('get');
}
function View ()
{
$selected = (is_array(@$_POST['selected'])) ? $_POST['selected'] : array();
switch ($this->type) {
case 'file': exit;
case 'network':
case 'workgroup':
case 'server':
$headers = array ('Name' => 'N', 'Comments' => 'C');
break;
case 'printer':
$headers = array ('Name' => 'N', 'Size' => 'S');
break;
default:
$headers = array ('Name' => 'N', 'Size' => 'S', 'Type' => 'T', 'Modified' => 'D');
}
$icons = array ('A' => 'up', 'D' => 'down');
foreach ($headers as $title => $order) {
if ($this->order[0] == $order) {
$ad = ($this->order[1] == 'A') ? 'D' : 'A';
$icon = $this->Icon($icons[$ad],'',11);
$style[$title] = 'class="order-by"';
} else {
$ad = 'A';
$icon = '';
$style[$title] = '';
}
$url = $this->GetUrl($this->where, 'O', $order.$ad);
$header .= "<th>".$this->Link($this->_($title), $url).' '.$icon."</th>";
}
$lang = $this->Link(strtoupper($this->lang),$this->GetUrl($this->where,'action','ChangeLanguageInput'));
$time = date("H:i");
$logout = $this->Icon('logout', $this->GetUrl($this->where, 'auth', '1'));
$header .= "<th width=\"100%\"> </th><th class=\"language\">{$lang}</th><th class=\"toolbar\"><nobr>{$logout} {$time}</nobr></th></tr>";
$lines = $this->ViewForm ($this->type, $style, $headers);
foreach ($this->results as $file => $data) {
if ($this->cfgHideDotFiles AND $file[0] == '.') continue;
if ($data['type']=='file' OR $data['type']=='printjob') {
$size = $this->PrintableBytes($data['size']);
$pi = pathinfo(strtolower($file));
if (@$this->mimeTypes[$pi['extension']] <> '') {
$type = sprintf($this->_("File %s"), strtoupper($pi['extension']));
} else {
$type = '';
}
} else {
$size = '';
$type = $this->_("File Folder");
}
$modified = date($this->_("m/d/Y h:i"), @$data['time']);
$check = $this->CheckBox("selected[]", ($data['type'] <> 'printjob') ? $file : $data['id'], in_array($file, $selected));
$icon = $this->Icon($data['type']);
$comment = @$data['comment'];
if ($data['type'] <> 'printjob') {
$filelink = $this->Link(htmlentities($file, ENT_COMPAT, $this->cfgDefaultCharset), $this->FromPath($file));
}
$lines .= "<tr>".
"<td class=\"checkbox\">{$check}</td>".
"<td {$style['Name']}><nobr>{$icon} {$filelink}</nobr></td>".
(isset($headers['Size']) ? "<td {$style['Size']} align=\"right\"><nobr>{$size}</nobr></td>" : "").
(isset($headers['Type']) ? "<td {$style['Type']}><nobr>{$type}</nobr></td>" : "").
(isset($headers['Comments']) ? "<td {$style['Comments']}><nobr>{$comment}</nobr></td>" : "").
(isset($headers['Modified']) ? "<td {$style['Modified']}><nobr>{$modified}</nobr></td>" : "").
"<td width=\"100%\" colspan=\"3\">{$renamelink}</td>".
"</tr>\n";
}
$macros['{action}'] = $this->GetUrl($this->where);
$macros['{ok}'] = $this->_("Ok");
$macros['{header}'] = $header;
$macros['{lines}'] = $lines;
print $this->Page($this->name, $this->Template("style/view.thtml", $macros));
}
function ViewForm ($type, $style, $headers)
{
$icon = $this->Icon('dotdot');
$amenu = array();
$html = $widget = '';
$where = $this->_DirectoryName($this->where);
$n = 0;
while ($where <> '') {
$amenu['UpAction'.$n] = $where;
$where = $this->_DirectoryName($where);
$n++;
}
if ($this->where <> '') {
$amenu['UpAction'.$n] = $this->_("Windows Network");
}
if (isset($amenu['UpAction0'])) {
$amenu['UpAction0'] .= ' ('.$this->_("Up").')';
}
switch ($type) {
case 'network':
case 'server': break;
case 'printer':
switch (@$_REQUEST['action']) {
case 'PrintFileInput':
$amenu = array();
$icon = $this->Icon('file');
$widget = $this->Input("action", "PrintFileAction", "hidden").
$this->Input("file","", "file").
$this->Input('ok', $this->_("Ok"), 'submit').
' (max. '.ini_get('post_max_size').')';
break;
default:
if (count($amenu) > 0) $amenu['--'] = '--';
$amenu['PrintFileInput'] = $this->_("Print a file");
$amenu['CancelSelectedAction'] = $this->_("Cancel selected jobs");
}
break;
case 'share':
switch (@$_REQUEST['action']) {
case 'NewFolderInput':
$amenu = array();
$icon = $this->Icon('folder');
$widget = $this->Input("action", "NewFolderAction", "hidden").
$this->Input("folder","").
$this->Input('ok', $this->_("Ok"), 'submit');
break;
case 'NewFileInput':
$amenu = array();
$icon = $this->Icon('file');
$widget = $this->Input("action", "NewFileAction", "hidden").
$this->Input("file","", "file").
$this->Input('ok', $this->_("Ok"), 'submit').
' (max. '.ini_get('post_max_size').')';
break;
case 'RenameSelectedInput':
if (is_array(@$_POST['selected'])) {
$amenu = array();
$icon = $this->Icon('rename');
$widget = '';
$i = 0;
foreach ($_POST['selected'] as $file) {
$widgets[] .= $icon.' '.$this->Input("oldname[{$i}]", $file, "hidden").
$this->Input("renameto[{$i}]",$file);
$i++;
}
$widget .= join("<br />", $widgets).$this->Input('ok', $this->_("Ok"), 'submit');
$widget .= $this->Input("action", "RenameSelectedAction", "hidden");
$icon = '';
break;
}
default:
if (count($amenu) > 0) $amenu['--'] = '--';
$amenu['NewFolderInput'] = $this->_("New folder");
$amenu['NewFileInput'] = $this->_("New file (upload)");
$amenu['DeleteSelectedAction'] = $this->_("Delete selected items");
$amenu['RenameSelectedInput'] = $this->_("Rename selected items");
$amenu['DownloadFolderAction'] = $this->_("Download this folder")." (".$this->cfgArchiver.")";
}
break;
case 'workgroup':
if (@$_REQUEST['action'] == 'SendMessageInput') {
$amenu = array();
$icon = $this->Icon('file');
$widget = $this->Input("action", "SendMessageAction", "hidden").
$this->Input("message","").
$this->Input('ok', $this->_("Ok"), 'submit');
} else {
if (count($amenu) > 0) $amenu['--'] = '--';
$amenu['SendMessageInput'] = $this->_("Send a popup message");
}
break;
default: print $type;
}
if (@$_REQUEST['action'] == 'ChangeLanguageInput') {
$amenu = array();
foreach (array_keys($this->strings) as $lang) $amenu[$lang] = strtoupper($lang);
$widget = $this->Select("lang", "", $amenu) . $this->Input('ok', $this->_("Ok"), 'submit');
$_GET['action'] = '';
} elseif (count($amenu)) {
$amenu['---'] = '--';
$amenu['LogoutAction'] = $this->_("Logout");
$widget = $this->Select("action", "", $amenu) . $this->Input('ok', $this->_("Ok"), 'submit');
}
if ($widget <> '') {
$html = "<tr>".
"<td> </td>".
"<td {$style['Name']}><nobr>{$icon} {$widget}</nobr></td>".
(isset($headers['Size']) ? "<td {$style['Size']} align=\"right\"> </td>" : "").
(isset($headers['Type']) ? "<td {$style['Type']}> </td>" : "").
(isset($headers['Comments']) ? "<td {$style['Comments']}> </td>" : "").
(isset($headers['Modified']) ? "<td {$style['Modified']}> </td>" : "").
"<td width=\"100%\" colspan=\"3\"> </td>".
"</tr>\n";
}
return $html;
}