@@ -1,74 +1,74 @@ |
||
1 | 1 | <?php |
2 | -define('lang_Select','Seç'); |
|
3 | -define('lang_Erase','Sil'); |
|
4 | -define('lang_Open','Aç'); |
|
5 | -define('lang_Confirm_del','Bu dosyayı silmek istediğinizden emin misiniz?'); |
|
6 | -define('lang_All','Tümü'); |
|
7 | -define('lang_Files','Dosyalar'); |
|
8 | -define('lang_Images','Resimler'); |
|
9 | -define('lang_Archives','Arşivler'); |
|
10 | -define('lang_Error_Upload','Yüklemeye çalıştığınız dosya maximum yükleme limitini aştı.'); |
|
11 | -define('lang_Error_extension','Dosya uzantısı izni yok.'); |
|
12 | -define('lang_Upload_file','Dosya Yükle'); |
|
13 | -define('lang_Filters','Filtreler'); |
|
14 | -define('lang_Videos','Videolar'); |
|
15 | -define('lang_Music','Müzikler'); |
|
16 | -define('lang_New_Folder','Yeni Klasör'); |
|
17 | -define('lang_Folder_Created','Klasör başarıyla oluşturuldu.'); |
|
18 | -define('lang_Existing_Folder','Mevcut klasör'); |
|
19 | -define('lang_Confirm_Folder_del','Bu klasörü ve içindekileri silmek istediğinizden emin misiniz?'); |
|
20 | -define('lang_Return_Files_List','Dosya listesine geri dön'); |
|
21 | -define('lang_Preview','Önizleme'); |
|
22 | -define('lang_Download','İndir'); |
|
23 | -define('lang_Insert_Folder_Name','Klasör adı ekle:'); |
|
24 | -define('lang_Root','kök'); |
|
25 | -define('lang_Rename','Yeniden Adlandır'); |
|
26 | -define('lang_Back','geri'); |
|
27 | -define('lang_View','Görünüm'); |
|
28 | -define('lang_View_list','Liste görünümü'); |
|
29 | -define('lang_View_columns_list','Kolonlu liste görünümü'); |
|
30 | -define('lang_View_boxes','Kutu görünümü'); |
|
31 | -define('lang_Toolbar','Araç Çubuğu'); |
|
32 | -define('lang_Actions','Eylemler'); |
|
33 | -define('lang_Rename_existing_file','Bu dosya zaten mevcut'); |
|
34 | -define('lang_Rename_existing_folder','Bu klasör zaten mevcut'); |
|
35 | -define('lang_Empty_name','İsim alanı boş.'); |
|
36 | -define('lang_Text_filter','filtrele...'); |
|
37 | -define('lang_Swipe_help','Seçenekleri görüntülemek için dosya/klasör ismine tıklayın'); |
|
38 | -define('lang_Upload_base','Normal Yükleme'); |
|
39 | -define('lang_Upload_java','JAVA Yükleme (Büyük dosyalar için)'); |
|
40 | -define('lang_Upload_java_help',"Eğer Java uygulaması yüklenmediyse; 1- Bilgisayarınızda Java yüklü olduğundan emin olun yada <a href='http://java.com/en/download/'>[Java'yı Buradan İndirin]</a> 2- Güvenlik duvarının hiçbir şeye engel olmadığından emin olun."); |
|
41 | -define('lang_Upload_base_help',"Dosyaları aşağıdaki alana Taşı & Bırak veya tıklayarak açılan pencereden dosyalarınızı seçin. Yükleme bittiğinde 'Return to files list' butonuna tıklayın."); |
|
42 | -define('lang_Type_dir','dizin'); |
|
43 | -define('lang_Type','Tür'); |
|
44 | -define('lang_Dimension','Ebat'); |
|
45 | -define('lang_Size','Boyut'); |
|
46 | -define('lang_Date','Tarih'); |
|
47 | -define('lang_Filename','Dosya adı'); |
|
48 | -define('lang_Operations','İşlemler'); |
|
49 | -define('lang_Date_type','d-m-Y'); |
|
50 | -define('lang_OK','Tamam'); |
|
51 | -define('lang_Cancel','İptal'); |
|
52 | -define('lang_Sorting','sıralama'); |
|
53 | -define('lang_Show_url','URL göster'); |
|
54 | -define('lang_Extract','buraya çıkart'); |
|
55 | -define('lang_File_info','dosya bilgisi'); |
|
56 | -define('lang_Edit_image','resmi düzenle'); |
|
57 | -define('lang_Duplicate','Çoğalt'); |
|
2 | +define('lang_Select', 'Seç'); |
|
3 | +define('lang_Erase', 'Sil'); |
|
4 | +define('lang_Open', 'Aç'); |
|
5 | +define('lang_Confirm_del', 'Bu dosyayı silmek istediğinizden emin misiniz?'); |
|
6 | +define('lang_All', 'Tümü'); |
|
7 | +define('lang_Files', 'Dosyalar'); |
|
8 | +define('lang_Images', 'Resimler'); |
|
9 | +define('lang_Archives', 'Arşivler'); |
|
10 | +define('lang_Error_Upload', 'Yüklemeye çalıştığınız dosya maximum yükleme limitini aştı.'); |
|
11 | +define('lang_Error_extension', 'Dosya uzantısı izni yok.'); |
|
12 | +define('lang_Upload_file', 'Dosya Yükle'); |
|
13 | +define('lang_Filters', 'Filtreler'); |
|
14 | +define('lang_Videos', 'Videolar'); |
|
15 | +define('lang_Music', 'Müzikler'); |
|
16 | +define('lang_New_Folder', 'Yeni Klasör'); |
|
17 | +define('lang_Folder_Created', 'Klasör başarıyla oluşturuldu.'); |
|
18 | +define('lang_Existing_Folder', 'Mevcut klasör'); |
|
19 | +define('lang_Confirm_Folder_del', 'Bu klasörü ve içindekileri silmek istediğinizden emin misiniz?'); |
|
20 | +define('lang_Return_Files_List', 'Dosya listesine geri dön'); |
|
21 | +define('lang_Preview', 'Önizleme'); |
|
22 | +define('lang_Download', 'İndir'); |
|
23 | +define('lang_Insert_Folder_Name', 'Klasör adı ekle:'); |
|
24 | +define('lang_Root', 'kök'); |
|
25 | +define('lang_Rename', 'Yeniden Adlandır'); |
|
26 | +define('lang_Back', 'geri'); |
|
27 | +define('lang_View', 'Görünüm'); |
|
28 | +define('lang_View_list', 'Liste görünümü'); |
|
29 | +define('lang_View_columns_list', 'Kolonlu liste görünümü'); |
|
30 | +define('lang_View_boxes', 'Kutu görünümü'); |
|
31 | +define('lang_Toolbar', 'Araç Çubuğu'); |
|
32 | +define('lang_Actions', 'Eylemler'); |
|
33 | +define('lang_Rename_existing_file', 'Bu dosya zaten mevcut'); |
|
34 | +define('lang_Rename_existing_folder', 'Bu klasör zaten mevcut'); |
|
35 | +define('lang_Empty_name', 'İsim alanı boş.'); |
|
36 | +define('lang_Text_filter', 'filtrele...'); |
|
37 | +define('lang_Swipe_help', 'Seçenekleri görüntülemek için dosya/klasör ismine tıklayın'); |
|
38 | +define('lang_Upload_base', 'Normal Yükleme'); |
|
39 | +define('lang_Upload_java', 'JAVA Yükleme (Büyük dosyalar için)'); |
|
40 | +define('lang_Upload_java_help', "Eğer Java uygulaması yüklenmediyse; 1- Bilgisayarınızda Java yüklü olduğundan emin olun yada <a href='http://java.com/en/download/'>[Java'yı Buradan İndirin]</a> 2- Güvenlik duvarının hiçbir şeye engel olmadığından emin olun."); |
|
41 | +define('lang_Upload_base_help', "Dosyaları aşağıdaki alana Taşı & Bırak veya tıklayarak açılan pencereden dosyalarınızı seçin. Yükleme bittiğinde 'Return to files list' butonuna tıklayın."); |
|
42 | +define('lang_Type_dir', 'dizin'); |
|
43 | +define('lang_Type', 'Tür'); |
|
44 | +define('lang_Dimension', 'Ebat'); |
|
45 | +define('lang_Size', 'Boyut'); |
|
46 | +define('lang_Date', 'Tarih'); |
|
47 | +define('lang_Filename', 'Dosya adı'); |
|
48 | +define('lang_Operations', 'İşlemler'); |
|
49 | +define('lang_Date_type', 'd-m-Y'); |
|
50 | +define('lang_OK', 'Tamam'); |
|
51 | +define('lang_Cancel', 'İptal'); |
|
52 | +define('lang_Sorting', 'sıralama'); |
|
53 | +define('lang_Show_url', 'URL göster'); |
|
54 | +define('lang_Extract', 'buraya çıkart'); |
|
55 | +define('lang_File_info', 'dosya bilgisi'); |
|
56 | +define('lang_Edit_image', 'resmi düzenle'); |
|
57 | +define('lang_Duplicate', 'Çoğalt'); |
|
58 | 58 | define('lang_Folders', 'Folders'); |
59 | -define('lang_Copy','Copy'); |
|
60 | -define('lang_Cut','Cut'); |
|
61 | -define('lang_Paste','Paste'); |
|
59 | +define('lang_Copy', 'Copy'); |
|
60 | +define('lang_Cut', 'Cut'); |
|
61 | +define('lang_Paste', 'Paste'); |
|
62 | 62 | define('lang_CB', 'CB'); // clipboard |
63 | -define('lang_Paste_Here','Paste to this directory'); |
|
64 | -define('lang_Paste_Confirm','Are you sure you want to paste to this directory? This will overwrite existing files/folders if encountered any.'); |
|
65 | -define('lang_Paste_Failed','Failed to paste file(s)'); |
|
66 | -define('lang_Clear_Clipboard','Clear clipboard'); |
|
67 | -define('lang_Clear_Clipboard_Confirm','Are you sure you want to clear the clipboard?'); |
|
68 | -define('lang_Files_ON_Clipboard','There are files on the clipboard.'); |
|
69 | -define('lang_Copy_Cut_Size_Limit','The selected files/folders are too big to %s. Limit: %d MB/operation'); // %s = cut or copy |
|
70 | -define('lang_Copy_Cut_Count_Limit','You selected too many files/folders to %s. Limit: %d files/operation'); // %s = cut or copy |
|
71 | -define('lang_Copy_Cut_Not_Allowed','You are not allowed to %s files.'); // %s(1) = cut or copy, %s(2) = files or folders |
|
63 | +define('lang_Paste_Here', 'Paste to this directory'); |
|
64 | +define('lang_Paste_Confirm', 'Are you sure you want to paste to this directory? This will overwrite existing files/folders if encountered any.'); |
|
65 | +define('lang_Paste_Failed', 'Failed to paste file(s)'); |
|
66 | +define('lang_Clear_Clipboard', 'Clear clipboard'); |
|
67 | +define('lang_Clear_Clipboard_Confirm', 'Are you sure you want to clear the clipboard?'); |
|
68 | +define('lang_Files_ON_Clipboard', 'There are files on the clipboard.'); |
|
69 | +define('lang_Copy_Cut_Size_Limit', 'The selected files/folders are too big to %s. Limit: %d MB/operation'); // %s = cut or copy |
|
70 | +define('lang_Copy_Cut_Count_Limit', 'You selected too many files/folders to %s. Limit: %d files/operation'); // %s = cut or copy |
|
71 | +define('lang_Copy_Cut_Not_Allowed', 'You are not allowed to %s files.'); // %s(1) = cut or copy, %s(2) = files or folders |
|
72 | 72 | define('lang_Aviary_No_Save', 'Could not save image'); |
73 | 73 | define('lang_Zip_No_Extract', 'Could not extract. File might be corrupt.'); |
74 | 74 | define('lang_Zip_Invalid', 'This extension is not supported. Valid: zip, gz, tar.'); |
@@ -1,74 +1,74 @@ |
||
1 | 1 | <?php |
2 | -define('lang_Select','Pilih'); |
|
3 | -define('lang_Erase','Hapus'); |
|
4 | -define('lang_Open','Buka'); |
|
5 | -define('lang_Confirm_del','Apakah anda yakin menghapus berkas ini?'); |
|
6 | -define('lang_All','Semua'); |
|
7 | -define('lang_Files','Berkas'); |
|
8 | -define('lang_Images','Gambar'); |
|
9 | -define('lang_Archives','Arsip'); |
|
10 | -define('lang_Error_Upload','Berkas yang diubah melebihi batas ukuran yang diperbolehkan.'); |
|
11 | -define('lang_Error_extension','Ekstensi berkas tidak diperbolehkan.'); |
|
12 | -define('lang_Upload_file','Unggah'); |
|
13 | -define('lang_Filters','Saring'); |
|
14 | -define('lang_Videos','Video'); |
|
15 | -define('lang_Music','Musik'); |
|
16 | -define('lang_New_Folder','Folder Baru'); |
|
17 | -define('lang_Folder_Created','Folder Telah Dibuat'); |
|
18 | -define('lang_Existing_Folder','Folder yang ada'); |
|
19 | -define('lang_Confirm_Folder_del','Apakah anda yakin menghapus folder dan semua isi didalamnya?'); |
|
20 | -define('lang_Return_Files_List','Kembali ke daftar'); |
|
21 | -define('lang_Preview','Pratampil'); |
|
22 | -define('lang_Download','Unduh'); |
|
23 | -define('lang_Insert_Folder_Name','Masukkan nama folder:'); |
|
24 | -define('lang_Root','root'); |
|
25 | -define('lang_Rename','Ubah nama'); |
|
26 | -define('lang_Back','kembali'); |
|
27 | -define('lang_View','lihat'); |
|
28 | -define('lang_View_list','Tampilan Daftar'); |
|
29 | -define('lang_View_columns_list','Tampilan Daftar kolom'); |
|
30 | -define('lang_View_boxes','Tampilan Kotak'); |
|
31 | -define('lang_Toolbar','Toolbar'); |
|
32 | -define('lang_Actions','Aksi'); |
|
33 | -define('lang_Rename_existing_file','Berkas Sudah ada'); |
|
34 | -define('lang_Rename_existing_folder','Folder sudah ada'); |
|
35 | -define('lang_Empty_name','Nama Kosong'); |
|
36 | -define('lang_Text_filter','saring teks'); |
|
37 | -define('lang_Swipe_help','Arahkan pada nama berkas/folder untuk melihat pilihan'); |
|
38 | -define('lang_Upload_base','Basis Unggah'); |
|
39 | -define('lang_Upload_java','Unggahan dengan JAVA (Berkas Ukuran Besar)'); |
|
40 | -define('lang_Upload_java_help',"Jika JAVA applet tidak muncul maka, 1. Pastikan JAVA sudah terinstal, jika tidak <a href='http://java.com/en/download/'>[download link]</a> 2. Pastikan firewall anda tidak memblok aksi tersebut"); |
|
41 | -define('lang_Upload_base_help',"Seret & letakkan berkas atau klik area di atas (browser terbaru) dan pilih berkasnya. ketika proses unggah selesai, Klik tombol 'Kembali ke daftar'."); |
|
42 | -define('lang_Type_dir','direktori'); |
|
43 | -define('lang_Type','Tipe'); |
|
44 | -define('lang_Dimension','Dimensi'); |
|
45 | -define('lang_Size','Ukuran'); |
|
46 | -define('lang_Date','Tanggal'); |
|
47 | -define('lang_Filename','Nama_berkas'); |
|
48 | -define('lang_Operations','Operasi'); |
|
49 | -define('lang_Date_type','y-m-d'); |
|
50 | -define('lang_OK','OK'); |
|
51 | -define('lang_Cancel','Cancel'); |
|
52 | -define('lang_Sorting','Sortir'); |
|
53 | -define('lang_Show_url','lihat URL'); |
|
54 | -define('lang_Extract','extract disini'); |
|
55 | -define('lang_File_info','info berkas'); |
|
56 | -define('lang_Edit_image','edit gambar'); |
|
57 | -define('lang_Duplicate','Duplikat'); |
|
2 | +define('lang_Select', 'Pilih'); |
|
3 | +define('lang_Erase', 'Hapus'); |
|
4 | +define('lang_Open', 'Buka'); |
|
5 | +define('lang_Confirm_del', 'Apakah anda yakin menghapus berkas ini?'); |
|
6 | +define('lang_All', 'Semua'); |
|
7 | +define('lang_Files', 'Berkas'); |
|
8 | +define('lang_Images', 'Gambar'); |
|
9 | +define('lang_Archives', 'Arsip'); |
|
10 | +define('lang_Error_Upload', 'Berkas yang diubah melebihi batas ukuran yang diperbolehkan.'); |
|
11 | +define('lang_Error_extension', 'Ekstensi berkas tidak diperbolehkan.'); |
|
12 | +define('lang_Upload_file', 'Unggah'); |
|
13 | +define('lang_Filters', 'Saring'); |
|
14 | +define('lang_Videos', 'Video'); |
|
15 | +define('lang_Music', 'Musik'); |
|
16 | +define('lang_New_Folder', 'Folder Baru'); |
|
17 | +define('lang_Folder_Created', 'Folder Telah Dibuat'); |
|
18 | +define('lang_Existing_Folder', 'Folder yang ada'); |
|
19 | +define('lang_Confirm_Folder_del', 'Apakah anda yakin menghapus folder dan semua isi didalamnya?'); |
|
20 | +define('lang_Return_Files_List', 'Kembali ke daftar'); |
|
21 | +define('lang_Preview', 'Pratampil'); |
|
22 | +define('lang_Download', 'Unduh'); |
|
23 | +define('lang_Insert_Folder_Name', 'Masukkan nama folder:'); |
|
24 | +define('lang_Root', 'root'); |
|
25 | +define('lang_Rename', 'Ubah nama'); |
|
26 | +define('lang_Back', 'kembali'); |
|
27 | +define('lang_View', 'lihat'); |
|
28 | +define('lang_View_list', 'Tampilan Daftar'); |
|
29 | +define('lang_View_columns_list', 'Tampilan Daftar kolom'); |
|
30 | +define('lang_View_boxes', 'Tampilan Kotak'); |
|
31 | +define('lang_Toolbar', 'Toolbar'); |
|
32 | +define('lang_Actions', 'Aksi'); |
|
33 | +define('lang_Rename_existing_file', 'Berkas Sudah ada'); |
|
34 | +define('lang_Rename_existing_folder', 'Folder sudah ada'); |
|
35 | +define('lang_Empty_name', 'Nama Kosong'); |
|
36 | +define('lang_Text_filter', 'saring teks'); |
|
37 | +define('lang_Swipe_help', 'Arahkan pada nama berkas/folder untuk melihat pilihan'); |
|
38 | +define('lang_Upload_base', 'Basis Unggah'); |
|
39 | +define('lang_Upload_java', 'Unggahan dengan JAVA (Berkas Ukuran Besar)'); |
|
40 | +define('lang_Upload_java_help', "Jika JAVA applet tidak muncul maka, 1. Pastikan JAVA sudah terinstal, jika tidak <a href='http://java.com/en/download/'>[download link]</a> 2. Pastikan firewall anda tidak memblok aksi tersebut"); |
|
41 | +define('lang_Upload_base_help', "Seret & letakkan berkas atau klik area di atas (browser terbaru) dan pilih berkasnya. ketika proses unggah selesai, Klik tombol 'Kembali ke daftar'."); |
|
42 | +define('lang_Type_dir', 'direktori'); |
|
43 | +define('lang_Type', 'Tipe'); |
|
44 | +define('lang_Dimension', 'Dimensi'); |
|
45 | +define('lang_Size', 'Ukuran'); |
|
46 | +define('lang_Date', 'Tanggal'); |
|
47 | +define('lang_Filename', 'Nama_berkas'); |
|
48 | +define('lang_Operations', 'Operasi'); |
|
49 | +define('lang_Date_type', 'y-m-d'); |
|
50 | +define('lang_OK', 'OK'); |
|
51 | +define('lang_Cancel', 'Cancel'); |
|
52 | +define('lang_Sorting', 'Sortir'); |
|
53 | +define('lang_Show_url', 'lihat URL'); |
|
54 | +define('lang_Extract', 'extract disini'); |
|
55 | +define('lang_File_info', 'info berkas'); |
|
56 | +define('lang_Edit_image', 'edit gambar'); |
|
57 | +define('lang_Duplicate', 'Duplikat'); |
|
58 | 58 | define('lang_Folders', 'Folders'); |
59 | -define('lang_Copy','Copy'); |
|
60 | -define('lang_Cut','Cut'); |
|
61 | -define('lang_Paste','Paste'); |
|
59 | +define('lang_Copy', 'Copy'); |
|
60 | +define('lang_Cut', 'Cut'); |
|
61 | +define('lang_Paste', 'Paste'); |
|
62 | 62 | define('lang_CB', 'CB'); // clipboard |
63 | -define('lang_Paste_Here','Paste to this directory'); |
|
64 | -define('lang_Paste_Confirm','Are you sure you want to paste to this directory? This will overwrite existing files/folders if encountered any.'); |
|
65 | -define('lang_Paste_Failed','Failed to paste file(s)'); |
|
66 | -define('lang_Clear_Clipboard','Clear clipboard'); |
|
67 | -define('lang_Clear_Clipboard_Confirm','Are you sure you want to clear the clipboard?'); |
|
68 | -define('lang_Files_ON_Clipboard','There are files on the clipboard.'); |
|
69 | -define('lang_Copy_Cut_Size_Limit','The selected files/folders are too big to %s. Limit: %d MB/operation'); // %s = cut or copy |
|
70 | -define('lang_Copy_Cut_Count_Limit','You selected too many files/folders to %s. Limit: %d files/operation'); // %s = cut or copy |
|
71 | -define('lang_Copy_Cut_Not_Allowed','You are not allowed to %s files.'); // %s(1) = cut or copy, %s(2) = files or folders |
|
63 | +define('lang_Paste_Here', 'Paste to this directory'); |
|
64 | +define('lang_Paste_Confirm', 'Are you sure you want to paste to this directory? This will overwrite existing files/folders if encountered any.'); |
|
65 | +define('lang_Paste_Failed', 'Failed to paste file(s)'); |
|
66 | +define('lang_Clear_Clipboard', 'Clear clipboard'); |
|
67 | +define('lang_Clear_Clipboard_Confirm', 'Are you sure you want to clear the clipboard?'); |
|
68 | +define('lang_Files_ON_Clipboard', 'There are files on the clipboard.'); |
|
69 | +define('lang_Copy_Cut_Size_Limit', 'The selected files/folders are too big to %s. Limit: %d MB/operation'); // %s = cut or copy |
|
70 | +define('lang_Copy_Cut_Count_Limit', 'You selected too many files/folders to %s. Limit: %d files/operation'); // %s = cut or copy |
|
71 | +define('lang_Copy_Cut_Not_Allowed', 'You are not allowed to %s files.'); // %s(1) = cut or copy, %s(2) = files or folders |
|
72 | 72 | define('lang_Aviary_No_Save', 'Could not save image'); |
73 | 73 | define('lang_Zip_No_Extract', 'Could not extract. File might be corrupt.'); |
74 | 74 | define('lang_Zip_Invalid', 'This extension is not supported. Valid: zip, gz, tar.'); |
@@ -1,74 +1,74 @@ |
||
1 | 1 | <?php |
2 | -define('lang_Select','Seleccionar'); |
|
3 | -define('lang_Erase','Eliminar'); |
|
4 | -define('lang_Open','Abrir'); |
|
5 | -define('lang_Confirm_del','Tem certeza que pretende eliminar este arquivo?'); |
|
6 | -define('lang_All','Todos'); |
|
7 | -define('lang_Files','Ficheiros'); |
|
8 | -define('lang_Images','Imagens'); |
|
9 | -define('lang_Archives','Compactados'); |
|
10 | -define('lang_Error_Upload','O ficheiro enviado é maior que o limite permitido.'); |
|
11 | -define('lang_Error_extension','Extensão não permitida.'); |
|
12 | -define('lang_Upload_file','Carregar ficheiro'); |
|
13 | -define('lang_Filters','Filtro'); |
|
14 | -define('lang_Videos','Vídeos'); |
|
15 | -define('lang_Music','Música'); |
|
16 | -define('lang_New_Folder','Nova pasta'); |
|
17 | -define('lang_Folder_Created','Pasta criada com sucesso'); |
|
18 | -define('lang_Existing_Folder','Pasta existente'); |
|
19 | -define('lang_Confirm_Folder_del','Tem certeza que pretende eliminar a pasta e todo o seu conteúdo?'); |
|
20 | -define('lang_Return_Files_List','Voltar à lista de ficheiros'); |
|
21 | -define('lang_Preview','Pré-visualizar'); |
|
22 | -define('lang_Download','Descarregar'); |
|
23 | -define('lang_Insert_Folder_Name','Insira o nome da pasta:'); |
|
24 | -define('lang_Root','root'); |
|
25 | -define('lang_Rename','Mudar o nome'); |
|
26 | -define('lang_Back','de volta'); |
|
27 | -define('lang_View','View'); |
|
28 | -define('lang_View_list','List view'); |
|
29 | -define('lang_View_columns_list','Columns list view'); |
|
30 | -define('lang_View_boxes','Box view'); |
|
31 | -define('lang_Toolbar','Toolbar'); |
|
32 | -define('lang_Actions','Actions'); |
|
33 | -define('lang_Rename_existing_file','The file is already existing'); |
|
34 | -define('lang_Rename_existing_folder','The folder is already existing'); |
|
35 | -define('lang_Empty_name','The name is empty'); |
|
36 | -define('lang_Text_filter','text filter'); |
|
37 | -define('lang_Swipe_help','Swipe the name of file/folder to show options'); |
|
38 | -define('lang_Upload_base','Base upload'); |
|
39 | -define('lang_Upload_java','JAVA upload (big size files)'); |
|
40 | -define('lang_Upload_java_help',"If the Java Applet don't load 1. make sure you have Java installed otherwise <a href='http://java.com/en/download/'>[download link]</a> 2. make sure nothing is blocked from firewall"); |
|
41 | -define('lang_Upload_base_help',"Drag & Drop file/s inside above area or click in it (for modern browsers) otherwise select the file and click on button. When the upload end, click on upper return button."); |
|
42 | -define('lang_Type_dir','dir'); |
|
43 | -define('lang_Type','Type'); |
|
44 | -define('lang_Dimension','Dimension'); |
|
45 | -define('lang_Size','Size'); |
|
46 | -define('lang_Date','Date'); |
|
47 | -define('lang_Filename','Name'); |
|
48 | -define('lang_Operations','Operations'); |
|
49 | -define('lang_Date_type','y-m-d'); |
|
50 | -define('lang_OK','OK'); |
|
51 | -define('lang_Cancel','Cancel'); |
|
52 | -define('lang_Sorting','sorting'); |
|
53 | -define('lang_Show_url','show URL'); |
|
54 | -define('lang_Extract','extract here'); |
|
55 | -define('lang_File_info','file info'); |
|
56 | -define('lang_Edit_image','edit image'); |
|
57 | -define('lang_Duplicate','Duplicate'); |
|
2 | +define('lang_Select', 'Seleccionar'); |
|
3 | +define('lang_Erase', 'Eliminar'); |
|
4 | +define('lang_Open', 'Abrir'); |
|
5 | +define('lang_Confirm_del', 'Tem certeza que pretende eliminar este arquivo?'); |
|
6 | +define('lang_All', 'Todos'); |
|
7 | +define('lang_Files', 'Ficheiros'); |
|
8 | +define('lang_Images', 'Imagens'); |
|
9 | +define('lang_Archives', 'Compactados'); |
|
10 | +define('lang_Error_Upload', 'O ficheiro enviado é maior que o limite permitido.'); |
|
11 | +define('lang_Error_extension', 'Extensão não permitida.'); |
|
12 | +define('lang_Upload_file', 'Carregar ficheiro'); |
|
13 | +define('lang_Filters', 'Filtro'); |
|
14 | +define('lang_Videos', 'Vídeos'); |
|
15 | +define('lang_Music', 'Música'); |
|
16 | +define('lang_New_Folder', 'Nova pasta'); |
|
17 | +define('lang_Folder_Created', 'Pasta criada com sucesso'); |
|
18 | +define('lang_Existing_Folder', 'Pasta existente'); |
|
19 | +define('lang_Confirm_Folder_del', 'Tem certeza que pretende eliminar a pasta e todo o seu conteúdo?'); |
|
20 | +define('lang_Return_Files_List', 'Voltar à lista de ficheiros'); |
|
21 | +define('lang_Preview', 'Pré-visualizar'); |
|
22 | +define('lang_Download', 'Descarregar'); |
|
23 | +define('lang_Insert_Folder_Name', 'Insira o nome da pasta:'); |
|
24 | +define('lang_Root', 'root'); |
|
25 | +define('lang_Rename', 'Mudar o nome'); |
|
26 | +define('lang_Back', 'de volta'); |
|
27 | +define('lang_View', 'View'); |
|
28 | +define('lang_View_list', 'List view'); |
|
29 | +define('lang_View_columns_list', 'Columns list view'); |
|
30 | +define('lang_View_boxes', 'Box view'); |
|
31 | +define('lang_Toolbar', 'Toolbar'); |
|
32 | +define('lang_Actions', 'Actions'); |
|
33 | +define('lang_Rename_existing_file', 'The file is already existing'); |
|
34 | +define('lang_Rename_existing_folder', 'The folder is already existing'); |
|
35 | +define('lang_Empty_name', 'The name is empty'); |
|
36 | +define('lang_Text_filter', 'text filter'); |
|
37 | +define('lang_Swipe_help', 'Swipe the name of file/folder to show options'); |
|
38 | +define('lang_Upload_base', 'Base upload'); |
|
39 | +define('lang_Upload_java', 'JAVA upload (big size files)'); |
|
40 | +define('lang_Upload_java_help', "If the Java Applet don't load 1. make sure you have Java installed otherwise <a href='http://java.com/en/download/'>[download link]</a> 2. make sure nothing is blocked from firewall"); |
|
41 | +define('lang_Upload_base_help', "Drag & Drop file/s inside above area or click in it (for modern browsers) otherwise select the file and click on button. When the upload end, click on upper return button."); |
|
42 | +define('lang_Type_dir', 'dir'); |
|
43 | +define('lang_Type', 'Type'); |
|
44 | +define('lang_Dimension', 'Dimension'); |
|
45 | +define('lang_Size', 'Size'); |
|
46 | +define('lang_Date', 'Date'); |
|
47 | +define('lang_Filename', 'Name'); |
|
48 | +define('lang_Operations', 'Operations'); |
|
49 | +define('lang_Date_type', 'y-m-d'); |
|
50 | +define('lang_OK', 'OK'); |
|
51 | +define('lang_Cancel', 'Cancel'); |
|
52 | +define('lang_Sorting', 'sorting'); |
|
53 | +define('lang_Show_url', 'show URL'); |
|
54 | +define('lang_Extract', 'extract here'); |
|
55 | +define('lang_File_info', 'file info'); |
|
56 | +define('lang_Edit_image', 'edit image'); |
|
57 | +define('lang_Duplicate', 'Duplicate'); |
|
58 | 58 | define('lang_Folders', 'Folders'); |
59 | -define('lang_Copy','Copy'); |
|
60 | -define('lang_Cut','Cut'); |
|
61 | -define('lang_Paste','Paste'); |
|
59 | +define('lang_Copy', 'Copy'); |
|
60 | +define('lang_Cut', 'Cut'); |
|
61 | +define('lang_Paste', 'Paste'); |
|
62 | 62 | define('lang_CB', 'CB'); // clipboard |
63 | -define('lang_Paste_Here','Paste to this directory'); |
|
64 | -define('lang_Paste_Confirm','Are you sure you want to paste to this directory? This will overwrite existing files/folders if encountered any.'); |
|
65 | -define('lang_Paste_Failed','Failed to paste file(s)'); |
|
66 | -define('lang_Clear_Clipboard','Clear clipboard'); |
|
67 | -define('lang_Clear_Clipboard_Confirm','Are you sure you want to clear the clipboard?'); |
|
68 | -define('lang_Files_ON_Clipboard','There are files on the clipboard.'); |
|
69 | -define('lang_Copy_Cut_Size_Limit','The selected files/folders are too big to %s. Limit: %d MB/operation'); // %s = cut or copy |
|
70 | -define('lang_Copy_Cut_Count_Limit','You selected too many files/folders to %s. Limit: %d files/operation'); // %s = cut or copy |
|
71 | -define('lang_Copy_Cut_Not_Allowed','You are not allowed to %s files.'); // %s(1) = cut or copy, %s(2) = files or folders |
|
63 | +define('lang_Paste_Here', 'Paste to this directory'); |
|
64 | +define('lang_Paste_Confirm', 'Are you sure you want to paste to this directory? This will overwrite existing files/folders if encountered any.'); |
|
65 | +define('lang_Paste_Failed', 'Failed to paste file(s)'); |
|
66 | +define('lang_Clear_Clipboard', 'Clear clipboard'); |
|
67 | +define('lang_Clear_Clipboard_Confirm', 'Are you sure you want to clear the clipboard?'); |
|
68 | +define('lang_Files_ON_Clipboard', 'There are files on the clipboard.'); |
|
69 | +define('lang_Copy_Cut_Size_Limit', 'The selected files/folders are too big to %s. Limit: %d MB/operation'); // %s = cut or copy |
|
70 | +define('lang_Copy_Cut_Count_Limit', 'You selected too many files/folders to %s. Limit: %d files/operation'); // %s = cut or copy |
|
71 | +define('lang_Copy_Cut_Not_Allowed', 'You are not allowed to %s files.'); // %s(1) = cut or copy, %s(2) = files or folders |
|
72 | 72 | define('lang_Aviary_No_Save', 'Could not save image'); |
73 | 73 | define('lang_Zip_No_Extract', 'Could not extract. File might be corrupt.'); |
74 | 74 | define('lang_Zip_Invalid', 'This extension is not supported. Valid: zip, gz, tar.'); |
@@ -1,74 +1,74 @@ |
||
1 | 1 | <?php |
2 | -define('lang_Select','Wybierz'); |
|
3 | -define('lang_Erase','Wyczyść'); |
|
4 | -define('lang_Open','Otwórz'); |
|
5 | -define('lang_Confirm_del','Czy jesteś pewien, że chcesz usunąć ten plik?'); |
|
6 | -define('lang_All','Wszystkie'); |
|
7 | -define('lang_Files','Pliki'); |
|
8 | -define('lang_Images','Zdjęcia'); |
|
9 | -define('lang_Archives','Archiwa'); |
|
10 | -define('lang_Error_Upload','Plik przekracza maksymalny dozwolony rozmiar.'); |
|
11 | -define('lang_Error_extension','Niedozwolone rozszerzenie pliku.'); |
|
12 | -define('lang_Upload_file','Wgraj plik'); |
|
13 | -define('lang_Filters','Filtr widoku'); |
|
14 | -define('lang_Videos','Filmy'); |
|
15 | -define('lang_Music','Muzyka'); |
|
16 | -define('lang_New_Folder','Dodaj nowy folder'); |
|
17 | -define('lang_Folder_Created','Folder został utworzony poprawnie'); |
|
18 | -define('lang_Existing_Folder','Istniejący folder'); |
|
19 | -define('lang_Confirm_Folder_del','Czy jesteś pewien, że chcesz usunąć folder i wszystko co znajduje się w nim?'); |
|
20 | -define('lang_Return_Files_List','Powrót do listy plików'); |
|
21 | -define('lang_Preview','Podgląd'); |
|
22 | -define('lang_Download','Pobierz'); |
|
23 | -define('lang_Insert_Folder_Name','Podaj nazwę folderu:'); |
|
24 | -define('lang_Root','root'); |
|
25 | -define('lang_Rename','Zmień nazwę'); |
|
26 | -define('lang_Back','[..]'); |
|
27 | -define('lang_View','Widok'); |
|
28 | -define('lang_View_list','Lista'); |
|
29 | -define('lang_View_columns_list','Kolumny'); |
|
30 | -define('lang_View_boxes','Bloki'); |
|
31 | -define('lang_Toolbar','Pasek'); |
|
32 | -define('lang_Actions','Opcje'); |
|
33 | -define('lang_Rename_existing_file','Ten plik już tutaj umieszczono'); |
|
34 | -define('lang_Rename_existing_folder','Ten folder już tutaj utworzono'); |
|
35 | -define('lang_Empty_name','Nie podano wymaganej nazwy'); |
|
36 | -define('lang_Text_filter','wpisz txt'); |
|
37 | -define('lang_Swipe_help','Kliknij w nazwę pliku/folderu by wyświetlić dostępne opcje'); |
|
38 | -define('lang_Upload_base','Wgrywanie standardowe'); |
|
39 | -define('lang_Upload_java','Wgrywanie przez skrypty JS (dla dużych plików)'); |
|
40 | -define('lang_Upload_java_help',"Jeżeli ten aplet JS nie powoduje wgrywania 1. Sprawdź czy masz pobraną i uruchomioną obsługę skryptów w JAVA na stronie JAVA <a href='http://java.com/en/download/'>[pobierz]</a> 2. Upewnij się, że nie jest to blokada wynikająca z ustawień zapory firewall"); |
|
41 | -define('lang_Upload_base_help',"Metoda zwana Przeciągnij & Upuść pliki w poniższy obszar, lub kliknij weń (dotyczy tylko najnowszych przeglądarek), lub wybierz plik i kliknij w przycisk. Kiedy zakończy się proces wgrywania, kliknij wyżej na przycisk by zakończyć."); |
|
42 | -define('lang_Type_dir','FLD'); |
|
43 | -define('lang_Type','wg. typu'); |
|
44 | -define('lang_Dimension','Wymiary'); |
|
45 | -define('lang_Size','wg. wagi'); |
|
46 | -define('lang_Date','wg. daty'); |
|
47 | -define('lang_Filename','wg. nazwy'); |
|
48 | -define('lang_Operations','Opcje'); |
|
49 | -define('lang_Date_type','d-m-y'); |
|
50 | -define('lang_OK','OK'); |
|
51 | -define('lang_Cancel','Anuluj'); |
|
52 | -define('lang_Sorting','SORTOWANIE'); |
|
53 | -define('lang_Show_url','show URL'); |
|
54 | -define('lang_Extract','extract here'); |
|
55 | -define('lang_File_info','file info'); |
|
56 | -define('lang_Edit_image','edit image'); |
|
57 | -define('lang_Duplicate','Duplicate'); |
|
2 | +define('lang_Select', 'Wybierz'); |
|
3 | +define('lang_Erase', 'Wyczyść'); |
|
4 | +define('lang_Open', 'Otwórz'); |
|
5 | +define('lang_Confirm_del', 'Czy jesteś pewien, że chcesz usunąć ten plik?'); |
|
6 | +define('lang_All', 'Wszystkie'); |
|
7 | +define('lang_Files', 'Pliki'); |
|
8 | +define('lang_Images', 'Zdjęcia'); |
|
9 | +define('lang_Archives', 'Archiwa'); |
|
10 | +define('lang_Error_Upload', 'Plik przekracza maksymalny dozwolony rozmiar.'); |
|
11 | +define('lang_Error_extension', 'Niedozwolone rozszerzenie pliku.'); |
|
12 | +define('lang_Upload_file', 'Wgraj plik'); |
|
13 | +define('lang_Filters', 'Filtr widoku'); |
|
14 | +define('lang_Videos', 'Filmy'); |
|
15 | +define('lang_Music', 'Muzyka'); |
|
16 | +define('lang_New_Folder', 'Dodaj nowy folder'); |
|
17 | +define('lang_Folder_Created', 'Folder został utworzony poprawnie'); |
|
18 | +define('lang_Existing_Folder', 'Istniejący folder'); |
|
19 | +define('lang_Confirm_Folder_del', 'Czy jesteś pewien, że chcesz usunąć folder i wszystko co znajduje się w nim?'); |
|
20 | +define('lang_Return_Files_List', 'Powrót do listy plików'); |
|
21 | +define('lang_Preview', 'Podgląd'); |
|
22 | +define('lang_Download', 'Pobierz'); |
|
23 | +define('lang_Insert_Folder_Name', 'Podaj nazwę folderu:'); |
|
24 | +define('lang_Root', 'root'); |
|
25 | +define('lang_Rename', 'Zmień nazwę'); |
|
26 | +define('lang_Back', '[..]'); |
|
27 | +define('lang_View', 'Widok'); |
|
28 | +define('lang_View_list', 'Lista'); |
|
29 | +define('lang_View_columns_list', 'Kolumny'); |
|
30 | +define('lang_View_boxes', 'Bloki'); |
|
31 | +define('lang_Toolbar', 'Pasek'); |
|
32 | +define('lang_Actions', 'Opcje'); |
|
33 | +define('lang_Rename_existing_file', 'Ten plik już tutaj umieszczono'); |
|
34 | +define('lang_Rename_existing_folder', 'Ten folder już tutaj utworzono'); |
|
35 | +define('lang_Empty_name', 'Nie podano wymaganej nazwy'); |
|
36 | +define('lang_Text_filter', 'wpisz txt'); |
|
37 | +define('lang_Swipe_help', 'Kliknij w nazwę pliku/folderu by wyświetlić dostępne opcje'); |
|
38 | +define('lang_Upload_base', 'Wgrywanie standardowe'); |
|
39 | +define('lang_Upload_java', 'Wgrywanie przez skrypty JS (dla dużych plików)'); |
|
40 | +define('lang_Upload_java_help', "Jeżeli ten aplet JS nie powoduje wgrywania 1. Sprawdź czy masz pobraną i uruchomioną obsługę skryptów w JAVA na stronie JAVA <a href='http://java.com/en/download/'>[pobierz]</a> 2. Upewnij się, że nie jest to blokada wynikająca z ustawień zapory firewall"); |
|
41 | +define('lang_Upload_base_help', "Metoda zwana Przeciągnij & Upuść pliki w poniższy obszar, lub kliknij weń (dotyczy tylko najnowszych przeglądarek), lub wybierz plik i kliknij w przycisk. Kiedy zakończy się proces wgrywania, kliknij wyżej na przycisk by zakończyć."); |
|
42 | +define('lang_Type_dir', 'FLD'); |
|
43 | +define('lang_Type', 'wg. typu'); |
|
44 | +define('lang_Dimension', 'Wymiary'); |
|
45 | +define('lang_Size', 'wg. wagi'); |
|
46 | +define('lang_Date', 'wg. daty'); |
|
47 | +define('lang_Filename', 'wg. nazwy'); |
|
48 | +define('lang_Operations', 'Opcje'); |
|
49 | +define('lang_Date_type', 'd-m-y'); |
|
50 | +define('lang_OK', 'OK'); |
|
51 | +define('lang_Cancel', 'Anuluj'); |
|
52 | +define('lang_Sorting', 'SORTOWANIE'); |
|
53 | +define('lang_Show_url', 'show URL'); |
|
54 | +define('lang_Extract', 'extract here'); |
|
55 | +define('lang_File_info', 'file info'); |
|
56 | +define('lang_Edit_image', 'edit image'); |
|
57 | +define('lang_Duplicate', 'Duplicate'); |
|
58 | 58 | define('lang_Folders', 'Folders'); |
59 | -define('lang_Copy','Copy'); |
|
60 | -define('lang_Cut','Cut'); |
|
61 | -define('lang_Paste','Paste'); |
|
59 | +define('lang_Copy', 'Copy'); |
|
60 | +define('lang_Cut', 'Cut'); |
|
61 | +define('lang_Paste', 'Paste'); |
|
62 | 62 | define('lang_CB', 'CB'); // clipboard |
63 | -define('lang_Paste_Here','Paste to this directory'); |
|
64 | -define('lang_Paste_Confirm','Are you sure you want to paste to this directory? This will overwrite existing files/folders if encountered any.'); |
|
65 | -define('lang_Paste_Failed','Failed to paste file(s)'); |
|
66 | -define('lang_Clear_Clipboard','Clear clipboard'); |
|
67 | -define('lang_Clear_Clipboard_Confirm','Are you sure you want to clear the clipboard?'); |
|
68 | -define('lang_Files_ON_Clipboard','There are files on the clipboard.'); |
|
69 | -define('lang_Copy_Cut_Size_Limit','The selected files/folders are too big to %s. Limit: %d MB/operation'); // %s = cut or copy |
|
70 | -define('lang_Copy_Cut_Count_Limit','You selected too many files/folders to %s. Limit: %d files/operation'); // %s = cut or copy |
|
71 | -define('lang_Copy_Cut_Not_Allowed','You are not allowed to %s files.'); // %s(1) = cut or copy, %s(2) = files or folders |
|
63 | +define('lang_Paste_Here', 'Paste to this directory'); |
|
64 | +define('lang_Paste_Confirm', 'Are you sure you want to paste to this directory? This will overwrite existing files/folders if encountered any.'); |
|
65 | +define('lang_Paste_Failed', 'Failed to paste file(s)'); |
|
66 | +define('lang_Clear_Clipboard', 'Clear clipboard'); |
|
67 | +define('lang_Clear_Clipboard_Confirm', 'Are you sure you want to clear the clipboard?'); |
|
68 | +define('lang_Files_ON_Clipboard', 'There are files on the clipboard.'); |
|
69 | +define('lang_Copy_Cut_Size_Limit', 'The selected files/folders are too big to %s. Limit: %d MB/operation'); // %s = cut or copy |
|
70 | +define('lang_Copy_Cut_Count_Limit', 'You selected too many files/folders to %s. Limit: %d files/operation'); // %s = cut or copy |
|
71 | +define('lang_Copy_Cut_Not_Allowed', 'You are not allowed to %s files.'); // %s(1) = cut or copy, %s(2) = files or folders |
|
72 | 72 | define('lang_Aviary_No_Save', 'Could not save image'); |
73 | 73 | define('lang_Zip_No_Extract', 'Could not extract. File might be corrupt.'); |
74 | 74 | define('lang_Zip_Invalid', 'This extension is not supported. Valid: zip, gz, tar.'); |
@@ -1,74 +1,74 @@ |
||
1 | 1 | <?php |
2 | -define('lang_Select','Избери'); |
|
3 | -define('lang_Erase','Изтрий'); |
|
4 | -define('lang_Open','Отвори'); |
|
5 | -define('lang_Confirm_del','Сигурни ли сте, че искате да изтриете този файл?'); |
|
6 | -define('lang_All','Всичко'); |
|
7 | -define('lang_Files','Файлове'); |
|
8 | -define('lang_Images','Изображения'); |
|
9 | -define('lang_Archives','Архиви'); |
|
10 | -define('lang_Error_Upload','Каченият файл надминава максимално разрешената големина.'); |
|
11 | -define('lang_Error_extension','Това файлово разширение не е позволено.'); |
|
12 | -define('lang_Upload_file','Качете файл'); |
|
13 | -define('lang_Filters','Папка'); |
|
14 | -define('lang_Videos','Видео'); |
|
15 | -define('lang_Music','Музика'); |
|
16 | -define('lang_New_Folder','Нова папка'); |
|
17 | -define('lang_Folder_Created','Папката е правилно създадена'); |
|
18 | -define('lang_Existing_Folder','Съществуваща папка'); |
|
19 | -define('lang_Confirm_Folder_del','Сигурни ли сте, че искате да изтриете папката и всичко, което се съдържа с нея?'); |
|
20 | -define('lang_Return_Files_List','Връщане към списъка с файлове'); |
|
21 | -define('lang_Preview','Преглед'); |
|
22 | -define('lang_Download','Свали'); |
|
23 | -define('lang_Insert_Folder_Name','Въведете име на папката:'); |
|
24 | -define('lang_Root','root'); |
|
25 | -define('lang_Rename','Преименуване'); |
|
26 | -define('lang_Back','обратно'); |
|
27 | -define('lang_View','View'); |
|
28 | -define('lang_View_list','List view'); |
|
29 | -define('lang_View_columns_list','Columns list view'); |
|
30 | -define('lang_View_boxes','Box view'); |
|
31 | -define('lang_Toolbar','Toolbar'); |
|
32 | -define('lang_Actions','Actions'); |
|
33 | -define('lang_Rename_existing_file','The file is already existing'); |
|
34 | -define('lang_Rename_existing_folder','The folder is already existing'); |
|
35 | -define('lang_Empty_name','The name is empty'); |
|
36 | -define('lang_Text_filter','text filter'); |
|
37 | -define('lang_Swipe_help','Swipe the name of file/folder to show options'); |
|
38 | -define('lang_Upload_base','Base upload'); |
|
39 | -define('lang_Upload_java','JAVA upload (big size files)'); |
|
40 | -define('lang_Upload_java_help',"If the Java Applet don't load 1. make sure you have Java installed otherwise <a href='http://java.com/en/download/'>[download link]</a> 2. make sure nothing is blocked from firewall"); |
|
41 | -define('lang_Upload_base_help',"Drag & Drop file/s inside above area or click in it (for modern browsers) otherwise select the file and click on button. When the upload end, click on upper return button."); |
|
42 | -define('lang_Type_dir','dir'); |
|
43 | -define('lang_Type','Type'); |
|
44 | -define('lang_Dimension','Dimension'); |
|
45 | -define('lang_Size','Size'); |
|
46 | -define('lang_Date','Date'); |
|
47 | -define('lang_Filename','Name'); |
|
48 | -define('lang_Operations','Operations'); |
|
49 | -define('lang_Date_type','y-m-d'); |
|
50 | -define('lang_OK','OK'); |
|
51 | -define('lang_Cancel','Cancel'); |
|
52 | -define('lang_Sorting','sorting'); |
|
53 | -define('lang_Show_url','show URL'); |
|
54 | -define('lang_Extract','extract here'); |
|
55 | -define('lang_File_info','file info'); |
|
56 | -define('lang_Edit_image','edit image'); |
|
57 | -define('lang_Duplicate','Duplicate'); |
|
2 | +define('lang_Select', 'Избери'); |
|
3 | +define('lang_Erase', 'Изтрий'); |
|
4 | +define('lang_Open', 'Отвори'); |
|
5 | +define('lang_Confirm_del', 'Сигурни ли сте, че искате да изтриете този файл?'); |
|
6 | +define('lang_All', 'Всичко'); |
|
7 | +define('lang_Files', 'Файлове'); |
|
8 | +define('lang_Images', 'Изображения'); |
|
9 | +define('lang_Archives', 'Архиви'); |
|
10 | +define('lang_Error_Upload', 'Каченият файл надминава максимално разрешената големина.'); |
|
11 | +define('lang_Error_extension', 'Това файлово разширение не е позволено.'); |
|
12 | +define('lang_Upload_file', 'Качете файл'); |
|
13 | +define('lang_Filters', 'Папка'); |
|
14 | +define('lang_Videos', 'Видео'); |
|
15 | +define('lang_Music', 'Музика'); |
|
16 | +define('lang_New_Folder', 'Нова папка'); |
|
17 | +define('lang_Folder_Created', 'Папката е правилно създадена'); |
|
18 | +define('lang_Existing_Folder', 'Съществуваща папка'); |
|
19 | +define('lang_Confirm_Folder_del', 'Сигурни ли сте, че искате да изтриете папката и всичко, което се съдържа с нея?'); |
|
20 | +define('lang_Return_Files_List', 'Връщане към списъка с файлове'); |
|
21 | +define('lang_Preview', 'Преглед'); |
|
22 | +define('lang_Download', 'Свали'); |
|
23 | +define('lang_Insert_Folder_Name', 'Въведете име на папката:'); |
|
24 | +define('lang_Root', 'root'); |
|
25 | +define('lang_Rename', 'Преименуване'); |
|
26 | +define('lang_Back', 'обратно'); |
|
27 | +define('lang_View', 'View'); |
|
28 | +define('lang_View_list', 'List view'); |
|
29 | +define('lang_View_columns_list', 'Columns list view'); |
|
30 | +define('lang_View_boxes', 'Box view'); |
|
31 | +define('lang_Toolbar', 'Toolbar'); |
|
32 | +define('lang_Actions', 'Actions'); |
|
33 | +define('lang_Rename_existing_file', 'The file is already existing'); |
|
34 | +define('lang_Rename_existing_folder', 'The folder is already existing'); |
|
35 | +define('lang_Empty_name', 'The name is empty'); |
|
36 | +define('lang_Text_filter', 'text filter'); |
|
37 | +define('lang_Swipe_help', 'Swipe the name of file/folder to show options'); |
|
38 | +define('lang_Upload_base', 'Base upload'); |
|
39 | +define('lang_Upload_java', 'JAVA upload (big size files)'); |
|
40 | +define('lang_Upload_java_help', "If the Java Applet don't load 1. make sure you have Java installed otherwise <a href='http://java.com/en/download/'>[download link]</a> 2. make sure nothing is blocked from firewall"); |
|
41 | +define('lang_Upload_base_help', "Drag & Drop file/s inside above area or click in it (for modern browsers) otherwise select the file and click on button. When the upload end, click on upper return button."); |
|
42 | +define('lang_Type_dir', 'dir'); |
|
43 | +define('lang_Type', 'Type'); |
|
44 | +define('lang_Dimension', 'Dimension'); |
|
45 | +define('lang_Size', 'Size'); |
|
46 | +define('lang_Date', 'Date'); |
|
47 | +define('lang_Filename', 'Name'); |
|
48 | +define('lang_Operations', 'Operations'); |
|
49 | +define('lang_Date_type', 'y-m-d'); |
|
50 | +define('lang_OK', 'OK'); |
|
51 | +define('lang_Cancel', 'Cancel'); |
|
52 | +define('lang_Sorting', 'sorting'); |
|
53 | +define('lang_Show_url', 'show URL'); |
|
54 | +define('lang_Extract', 'extract here'); |
|
55 | +define('lang_File_info', 'file info'); |
|
56 | +define('lang_Edit_image', 'edit image'); |
|
57 | +define('lang_Duplicate', 'Duplicate'); |
|
58 | 58 | define('lang_Folders', 'Folders'); |
59 | -define('lang_Copy','Copy'); |
|
60 | -define('lang_Cut','Cut'); |
|
61 | -define('lang_Paste','Paste'); |
|
59 | +define('lang_Copy', 'Copy'); |
|
60 | +define('lang_Cut', 'Cut'); |
|
61 | +define('lang_Paste', 'Paste'); |
|
62 | 62 | define('lang_CB', 'CB'); // clipboard |
63 | -define('lang_Paste_Here','Paste to this directory'); |
|
64 | -define('lang_Paste_Confirm','Are you sure you want to paste to this directory? This will overwrite existing files/folders if encountered any.'); |
|
65 | -define('lang_Paste_Failed','Failed to paste file(s)'); |
|
66 | -define('lang_Clear_Clipboard','Clear clipboard'); |
|
67 | -define('lang_Clear_Clipboard_Confirm','Are you sure you want to clear the clipboard?'); |
|
68 | -define('lang_Files_ON_Clipboard','There are files on the clipboard.'); |
|
69 | -define('lang_Copy_Cut_Size_Limit','The selected files/folders are too big to %s. Limit: %d MB/operation'); // %s = cut or copy |
|
70 | -define('lang_Copy_Cut_Count_Limit','You selected too many files/folders to %s. Limit: %d files/operation'); // %s = cut or copy |
|
71 | -define('lang_Copy_Cut_Not_Allowed','You are not allowed to %s files.'); // %s(1) = cut or copy, %s(2) = files or folders |
|
63 | +define('lang_Paste_Here', 'Paste to this directory'); |
|
64 | +define('lang_Paste_Confirm', 'Are you sure you want to paste to this directory? This will overwrite existing files/folders if encountered any.'); |
|
65 | +define('lang_Paste_Failed', 'Failed to paste file(s)'); |
|
66 | +define('lang_Clear_Clipboard', 'Clear clipboard'); |
|
67 | +define('lang_Clear_Clipboard_Confirm', 'Are you sure you want to clear the clipboard?'); |
|
68 | +define('lang_Files_ON_Clipboard', 'There are files on the clipboard.'); |
|
69 | +define('lang_Copy_Cut_Size_Limit', 'The selected files/folders are too big to %s. Limit: %d MB/operation'); // %s = cut or copy |
|
70 | +define('lang_Copy_Cut_Count_Limit', 'You selected too many files/folders to %s. Limit: %d files/operation'); // %s = cut or copy |
|
71 | +define('lang_Copy_Cut_Not_Allowed', 'You are not allowed to %s files.'); // %s(1) = cut or copy, %s(2) = files or folders |
|
72 | 72 | define('lang_Aviary_No_Save', 'Could not save image'); |
73 | 73 | define('lang_Zip_No_Extract', 'Could not extract. File might be corrupt.'); |
74 | 74 | define('lang_Zip_Invalid', 'This extension is not supported. Valid: zip, gz, tar.'); |
@@ -1,74 +1,74 @@ |
||
1 | 1 | <?php |
2 | -define('lang_Select','Velg'); |
|
3 | -define('lang_Erase','Slett'); |
|
4 | -define('lang_Open','Åpne'); |
|
5 | -define('lang_Confirm_del','Er du sikker på at du vil slette denne filen?'); |
|
6 | -define('lang_All','Alle'); |
|
7 | -define('lang_Files','Filer'); |
|
8 | -define('lang_Images','Bilder'); |
|
9 | -define('lang_Archives','Arkiv'); |
|
10 | -define('lang_Error_Upload','Den opplastede filen overskrider maksimal tillatt størrelse.'); |
|
11 | -define('lang_Error_extension','Filtypen er ikke tillatt.'); |
|
12 | -define('lang_Upload_file','Last opp fil'); |
|
13 | -define('lang_Filters','Filter'); |
|
14 | -define('lang_Videos','Videoer'); |
|
15 | -define('lang_Music','Musikk'); |
|
16 | -define('lang_New_Folder','Ny mappe'); |
|
17 | -define('lang_Folder_Created','Mappe opprettet'); |
|
18 | -define('lang_Existing_Folder','Eksisterende mappe'); |
|
19 | -define('lang_Confirm_Folder_del','Er du sikker på at du vil slette mappen og alt innholdet?'); |
|
20 | -define('lang_Return_Files_List','Tilbake til filoversikten'); |
|
21 | -define('lang_Preview','Forhåndsvisning'); |
|
22 | -define('lang_Download','Last ned'); |
|
23 | -define('lang_Insert_Folder_Name','Gi mappen et navn:'); |
|
24 | -define('lang_Root','Rot'); |
|
25 | -define('lang_Rename','Gi nytt navn'); |
|
26 | -define('lang_Back','Tilbake'); |
|
27 | -define('lang_View','Visning'); |
|
28 | -define('lang_View_list','Listevisning'); |
|
29 | -define('lang_View_columns_list','Side ved side'); |
|
30 | -define('lang_View_boxes','Boksvisning'); |
|
31 | -define('lang_Toolbar','Verktøylinje'); |
|
32 | -define('lang_Actions','Gjøremål'); |
|
33 | -define('lang_Rename_existing_file','Filen er allerede opprettet'); |
|
34 | -define('lang_Rename_existing_folder','Mappen er allerede opprettet'); |
|
35 | -define('lang_Empty_name','Tomt navn'); |
|
36 | -define('lang_Text_filter','Tekst-filter'); |
|
37 | -define('lang_Swipe_help','Sveip filnavnet/mappenavnet for å vise alternativer'); |
|
38 | -define('lang_Upload_base','Vanlig opplasting'); |
|
39 | -define('lang_Upload_java','Java-opplasting (store filer)'); |
|
40 | -define('lang_Upload_java_help',"Hvis java-appleten ikke lastes: 1. Sjekk om Java er installert, hvis ikke <a href='http://java.com/en/download/'>last ned Java</a> 2. Sjekk brannmur-innstillingene."); |
|
41 | -define('lang_Upload_base_help',"Dra og slipp filen(e) i området over eller klikk (virker for moderne nettlesere). Ved bruk av gammel nettleser: Velg filen og klikk på knappen. Når opplastingen er ferdig, klikk på tilbake-knappen øverst."); |
|
42 | -define('lang_Type_dir','Mappe'); |
|
43 | -define('lang_Type','Type'); |
|
44 | -define('lang_Dimension','Dimensjoner'); |
|
45 | -define('lang_Size','Størrelse'); |
|
46 | -define('lang_Date','Dato'); |
|
47 | -define('lang_Filename','Filnavn'); |
|
48 | -define('lang_Operations','Handlinger'); |
|
49 | -define('lang_Date_type','d.m.y'); |
|
50 | -define('lang_OK','OK'); |
|
51 | -define('lang_Cancel','Avbryt'); |
|
52 | -define('lang_Sorting','Sortering'); |
|
53 | -define('lang_Show_url','Vis URL'); |
|
54 | -define('lang_Extract','Pakk ut her'); |
|
55 | -define('lang_File_info','Fil-info'); |
|
56 | -define('lang_Edit_image','Rediger bilde'); |
|
57 | -define('lang_Duplicate','Duplikat'); |
|
2 | +define('lang_Select', 'Velg'); |
|
3 | +define('lang_Erase', 'Slett'); |
|
4 | +define('lang_Open', 'Åpne'); |
|
5 | +define('lang_Confirm_del', 'Er du sikker på at du vil slette denne filen?'); |
|
6 | +define('lang_All', 'Alle'); |
|
7 | +define('lang_Files', 'Filer'); |
|
8 | +define('lang_Images', 'Bilder'); |
|
9 | +define('lang_Archives', 'Arkiv'); |
|
10 | +define('lang_Error_Upload', 'Den opplastede filen overskrider maksimal tillatt størrelse.'); |
|
11 | +define('lang_Error_extension', 'Filtypen er ikke tillatt.'); |
|
12 | +define('lang_Upload_file', 'Last opp fil'); |
|
13 | +define('lang_Filters', 'Filter'); |
|
14 | +define('lang_Videos', 'Videoer'); |
|
15 | +define('lang_Music', 'Musikk'); |
|
16 | +define('lang_New_Folder', 'Ny mappe'); |
|
17 | +define('lang_Folder_Created', 'Mappe opprettet'); |
|
18 | +define('lang_Existing_Folder', 'Eksisterende mappe'); |
|
19 | +define('lang_Confirm_Folder_del', 'Er du sikker på at du vil slette mappen og alt innholdet?'); |
|
20 | +define('lang_Return_Files_List', 'Tilbake til filoversikten'); |
|
21 | +define('lang_Preview', 'Forhåndsvisning'); |
|
22 | +define('lang_Download', 'Last ned'); |
|
23 | +define('lang_Insert_Folder_Name', 'Gi mappen et navn:'); |
|
24 | +define('lang_Root', 'Rot'); |
|
25 | +define('lang_Rename', 'Gi nytt navn'); |
|
26 | +define('lang_Back', 'Tilbake'); |
|
27 | +define('lang_View', 'Visning'); |
|
28 | +define('lang_View_list', 'Listevisning'); |
|
29 | +define('lang_View_columns_list', 'Side ved side'); |
|
30 | +define('lang_View_boxes', 'Boksvisning'); |
|
31 | +define('lang_Toolbar', 'Verktøylinje'); |
|
32 | +define('lang_Actions', 'Gjøremål'); |
|
33 | +define('lang_Rename_existing_file', 'Filen er allerede opprettet'); |
|
34 | +define('lang_Rename_existing_folder', 'Mappen er allerede opprettet'); |
|
35 | +define('lang_Empty_name', 'Tomt navn'); |
|
36 | +define('lang_Text_filter', 'Tekst-filter'); |
|
37 | +define('lang_Swipe_help', 'Sveip filnavnet/mappenavnet for å vise alternativer'); |
|
38 | +define('lang_Upload_base', 'Vanlig opplasting'); |
|
39 | +define('lang_Upload_java', 'Java-opplasting (store filer)'); |
|
40 | +define('lang_Upload_java_help', "Hvis java-appleten ikke lastes: 1. Sjekk om Java er installert, hvis ikke <a href='http://java.com/en/download/'>last ned Java</a> 2. Sjekk brannmur-innstillingene."); |
|
41 | +define('lang_Upload_base_help', "Dra og slipp filen(e) i området over eller klikk (virker for moderne nettlesere). Ved bruk av gammel nettleser: Velg filen og klikk på knappen. Når opplastingen er ferdig, klikk på tilbake-knappen øverst."); |
|
42 | +define('lang_Type_dir', 'Mappe'); |
|
43 | +define('lang_Type', 'Type'); |
|
44 | +define('lang_Dimension', 'Dimensjoner'); |
|
45 | +define('lang_Size', 'Størrelse'); |
|
46 | +define('lang_Date', 'Dato'); |
|
47 | +define('lang_Filename', 'Filnavn'); |
|
48 | +define('lang_Operations', 'Handlinger'); |
|
49 | +define('lang_Date_type', 'd.m.y'); |
|
50 | +define('lang_OK', 'OK'); |
|
51 | +define('lang_Cancel', 'Avbryt'); |
|
52 | +define('lang_Sorting', 'Sortering'); |
|
53 | +define('lang_Show_url', 'Vis URL'); |
|
54 | +define('lang_Extract', 'Pakk ut her'); |
|
55 | +define('lang_File_info', 'Fil-info'); |
|
56 | +define('lang_Edit_image', 'Rediger bilde'); |
|
57 | +define('lang_Duplicate', 'Duplikat'); |
|
58 | 58 | define('lang_Folders', 'Mapper'); |
59 | -define('lang_Copy','Kopier'); |
|
60 | -define('lang_Cut','Klipp ut'); |
|
61 | -define('lang_Paste','Lim inn'); |
|
59 | +define('lang_Copy', 'Kopier'); |
|
60 | +define('lang_Cut', 'Klipp ut'); |
|
61 | +define('lang_Paste', 'Lim inn'); |
|
62 | 62 | define('lang_CB', 'Utklippstavle'); // clipboard |
63 | -define('lang_Paste_Here','Lim inn i denne mappen'); |
|
64 | -define('lang_Paste_Confirm','Er du sikker på at du vil lime inn i denne mappen? Dette vil overskrive eventuelle eksisterende filer eller mapper.'); |
|
65 | -define('lang_Paste_Failed','Lim inn feilet'); |
|
66 | -define('lang_Clear_Clipboard','Tøm utklippstavlen'); |
|
67 | -define('lang_Clear_Clipboard_Confirm','Er du sikker på at du vil tømme utklippstavlen?'); |
|
68 | -define('lang_Files_ON_Clipboard','Der er filer på utklippstavlen.'); |
|
69 | -define('lang_Copy_Cut_Size_Limit','De valgte filene/mappene er for store for %s. Grense: %d MB/operasjon'); // %s = cut or copy |
|
70 | -define('lang_Copy_Cut_Count_Limit','Du valgte for mange filer/mapper for %s. Grense: %d filer/operasjon'); // %s = cut or copy |
|
71 | -define('lang_Copy_Cut_Not_Allowed','Du har ikke lov til å %s filer.'); // %s(1) = cut or copy, %s(2) = files or folders |
|
63 | +define('lang_Paste_Here', 'Lim inn i denne mappen'); |
|
64 | +define('lang_Paste_Confirm', 'Er du sikker på at du vil lime inn i denne mappen? Dette vil overskrive eventuelle eksisterende filer eller mapper.'); |
|
65 | +define('lang_Paste_Failed', 'Lim inn feilet'); |
|
66 | +define('lang_Clear_Clipboard', 'Tøm utklippstavlen'); |
|
67 | +define('lang_Clear_Clipboard_Confirm', 'Er du sikker på at du vil tømme utklippstavlen?'); |
|
68 | +define('lang_Files_ON_Clipboard', 'Der er filer på utklippstavlen.'); |
|
69 | +define('lang_Copy_Cut_Size_Limit', 'De valgte filene/mappene er for store for %s. Grense: %d MB/operasjon'); // %s = cut or copy |
|
70 | +define('lang_Copy_Cut_Count_Limit', 'Du valgte for mange filer/mapper for %s. Grense: %d filer/operasjon'); // %s = cut or copy |
|
71 | +define('lang_Copy_Cut_Not_Allowed', 'Du har ikke lov til å %s filer.'); // %s(1) = cut or copy, %s(2) = files or folders |
|
72 | 72 | define('lang_Aviary_No_Save', 'Kunne ikke lagre bildet'); |
73 | 73 | define('lang_Zip_No_Extract', 'Kunne ikke pakke ut. Filen er muligens ødelagt.'); |
74 | 74 | define('lang_Zip_Invalid', 'Dette filetternavnet er ikke støttet. Valide filer: zip, gz, tar.'); |
@@ -54,403 +54,403 @@ discard block |
||
54 | 54 | |
55 | 55 | class JUpload { |
56 | 56 | |
57 | - var $appletparams; |
|
58 | - var $classparams; |
|
59 | - var $files; |
|
60 | - |
|
61 | - public function JUpload($appletparams = array(), $classparams = array()) { |
|
62 | - if (gettype($classparams) !== 'array') |
|
63 | - $this->abort('Invalid type of parameter classparams: Expecting an array'); |
|
64 | - if (gettype($appletparams) !== 'array') |
|
65 | - $this->abort('Invalid type of parameter appletparams: Expecting an array'); |
|
66 | - |
|
67 | - // set some defaults for the applet params |
|
68 | - if (!isset($appletparams['afterUploadURL'])) |
|
69 | - $appletparams['afterUploadURL'] = $_SERVER['PHP_SELF'] . '?afterupload=1'; |
|
70 | - if (!isset($appletparams['name'])) |
|
71 | - $appletparams['name'] = 'JUpload'; |
|
72 | - if (!isset($appletparams['archive'])) |
|
73 | - $appletparams['archive'] = 'wjhk.jupload.jar'; |
|
74 | - if (!isset($appletparams['code'])) |
|
75 | - $appletparams['code'] = 'wjhk.jupload2.JUploadApplet'; |
|
76 | - if (!isset($appletparams['debugLevel'])) |
|
77 | - $appletparams['debugLevel'] = 0; |
|
78 | - if (!isset($appletparams['httpUploadParameterType'])) |
|
79 | - $appletparams['httpUploadParameterType'] = 'array'; |
|
80 | - if (!isset($appletparams['showLogWindow'])) |
|
81 | - $appletparams['showLogWindow'] = ($appletparams['debugLevel'] > 0) ? 'true' : 'false'; |
|
82 | - if (!isset($appletparams['width'])) |
|
83 | - $appletparams['width'] = 640; |
|
84 | - if (!isset($appletparams['height'])) |
|
85 | - $appletparams['height'] = ($appletparams['showLogWindow'] === 'true') ? 500 : 300; |
|
86 | - if (!isset($appletparams['mayscript'])) |
|
87 | - $appletparams['mayscript'] = 'true'; |
|
88 | - if (!isset($appletparams['scriptable'])) |
|
89 | - $appletparams['scriptable'] = 'false'; |
|
90 | - //if (!isset($appletparams['stringUploadSuccess'])) |
|
91 | - $appletparams['stringUploadSuccess'] = 'SUCCESS'; |
|
92 | - //if (!isset($appletparams['stringUploadError'])) |
|
93 | - $appletparams['stringUploadError'] = 'ERROR: (.*)'; |
|
94 | - $maxpost = $this->tobytes(ini_get('post_max_size')); |
|
95 | - $maxmem = $this->tobytes(ini_get('memory_limit')); |
|
96 | - $maxfs = $this->tobytes(ini_get('upload_max_filesize')); |
|
97 | - $obd = ini_get('open_basedir'); |
|
98 | - if (!isset($appletparams['maxChunkSize'])) { |
|
99 | - $maxchunk = ($maxpost < $maxmem) ? $maxpost : $maxmem; |
|
100 | - $maxchunk = ($maxchunk < $maxfs) ? $maxchunk : $maxfs; |
|
101 | - $maxchunk /= 4; |
|
102 | - $optchunk = (500000 > $maxchunk) ? $maxchunk : 500000; |
|
103 | - $appletparams['maxChunkSize'] = $optchunk; |
|
104 | - } |
|
105 | - $appletparams['maxChunkSize'] = $this->tobytes($appletparams['maxChunkSize']); |
|
106 | - if (!isset($appletparams['maxFileSize'])) |
|
107 | - $appletparams['maxFileSize'] = $maxfs; |
|
108 | - $appletparams['maxFileSize'] = $this->tobytes($appletparams['maxFileSize']); |
|
109 | - if (isset($classparams['errormail'])) { |
|
110 | - $appletparams['urlToSendErrorTo'] = $_SERVER["PHP_SELF"] . '?errormail'; |
|
111 | - } |
|
112 | - |
|
113 | - // Same for class parameters |
|
114 | - if (!isset($classparams['demo_mode'])) |
|
115 | - $classparams['demo_mode'] = false; |
|
116 | - if ($classparams['demo_mode']) { |
|
117 | - $classparams['create_destdir'] = false; |
|
118 | - $classparams['allow_subdirs'] = true; |
|
119 | - $classparams['allow_zerosized'] = true; |
|
120 | - $classparams['duplicate'] = 'overwrite'; |
|
121 | - } |
|
122 | - if (!isset($classparams['debug_php'])) // set true to log some messages in PHP log |
|
123 | - $classparams['debug_php'] = false; |
|
124 | - if (!isset($this->classparams['allowed_mime_types'])) // array of allowed MIME type |
|
125 | - $classparams['allowed_mime_types'] = 'all'; |
|
126 | - if (!isset($this->classparams['allowed_file_extensions'])) // array of allowed file extensions |
|
127 | - $classparams['allowed_file_extensions'] = 'all'; |
|
128 | - if (!isset($classparams['verbose_errors'])) // shouldn't display server info on a production site! |
|
129 | - $classparams['verbose_errors'] = true; |
|
130 | - if (!isset($classparams['session_regenerate'])) |
|
131 | - $classparams['session_regenerate'] = false; |
|
132 | - if (!isset($classparams['create_destdir'])) |
|
133 | - $classparams['create_destdir'] = true; |
|
134 | - if (!isset($classparams['allow_subdirs'])) |
|
135 | - $classparams['allow_subdirs'] = false; |
|
136 | - if (!isset($classparams['spaces_in_subdirs'])) |
|
137 | - $classparams['spaces_in_subdirs'] = false; |
|
138 | - if (!isset($classparams['allow_zerosized'])) |
|
139 | - $classparams['allow_zerosized'] = false; |
|
140 | - if (!isset($classparams['duplicate'])) |
|
141 | - $classparams['duplicate'] = 'rename'; |
|
142 | - if (!isset($classparams['dirperm'])) |
|
143 | - $classparams['dirperm'] = 0755; |
|
144 | - if (!isset($classparams['fileperm'])) |
|
145 | - $classparams['fileperm'] = 0644; |
|
146 | - if (!isset($classparams['destdir'])) { |
|
147 | - if ($obd != '') |
|
148 | - $classparams['destdir'] = $obd; |
|
149 | - else |
|
150 | - $classparams['destdir'] = '/var/tmp/jupload_test'; |
|
151 | - }else{ |
|
152 | - $classparams['destdir']=str_replace('~',' ',$classparams['destdir']); |
|
153 | - } |
|
154 | - if ($classparams['create_destdir']) { |
|
155 | - $_umask = umask(0); // override the system mask |
|
156 | - @mkdir($classparams['destdir'], $classparams['dirperm']); |
|
157 | - umask($_umask); |
|
158 | - } |
|
159 | - if (!is_dir($classparams['destdir']) && is_writable($classparams['destdir'])) |
|
160 | - $this->abort('Destination dir not accessible'); |
|
161 | - if (!isset($classparams['tmp_prefix'])) |
|
162 | - $classparams['tmp_prefix'] = 'jutmp.'; |
|
163 | - if (!isset($classparams['var_prefix'])) |
|
164 | - $classparams['var_prefix'] = 'juvar.'; |
|
165 | - if (!isset($classparams['jscript_wrapper'])) |
|
166 | - $classparams['jscript_wrapper'] = 'JUploadSetProperty'; |
|
167 | - if (!isset($classparams['tag_jscript'])) |
|
168 | - $classparams['tag_jscript'] = '<!--JUPLOAD_JSCRIPT-->'; |
|
169 | - if (!isset($classparams['tag_applet'])) |
|
170 | - $classparams['tag_applet'] = '<!--JUPLOAD_APPLET-->'; |
|
171 | - if (!isset($classparams['tag_flist'])) |
|
172 | - $classparams['tag_flist'] = '<!--JUPLOAD_FILES-->'; |
|
173 | - if (!isset($classparams['http_flist_start'])) |
|
174 | - $classparams['http_flist_start'] = |
|
175 | - "<table border='1'><TR><TH>Filename</TH><TH>file size</TH><TH>Relative path</TH><TH>Full name</TH><TH>md5sum</TH><TH>Specific parameters</TH></TR>"; |
|
176 | - if (!isset($classparams['http_flist_end'])) |
|
177 | - $classparams['http_flist_end'] = "</table>\n"; |
|
178 | - if (!isset($classparams['http_flist_file_before'])) |
|
179 | - $classparams['http_flist_file_before'] = "<tr><td>"; |
|
180 | - if (!isset($classparams['http_flist_file_between'])) |
|
181 | - $classparams['http_flist_file_between'] = "</td><td>"; |
|
182 | - if (!isset($classparams['http_flist_file_after'])) |
|
183 | - $classparams['http_flist_file_after'] = "</td></tr>\n"; |
|
184 | - |
|
185 | - $this->appletparams = $appletparams; |
|
186 | - $this->classparams = $classparams; |
|
187 | - $this->page_start(); |
|
188 | - } |
|
189 | - |
|
190 | - /** |
|
191 | - * Return an array of uploaded files * The array contains: name, size, tmp_name, error, |
|
192 | - * relativePath, md5sum, mimetype, fullName, path |
|
193 | - */ |
|
194 | - public function uploadedfiles() { |
|
195 | - return $this->files; |
|
196 | - } |
|
197 | - |
|
198 | - /** |
|
199 | - * Log a message on the current output, as a HTML comment. |
|
200 | - */ |
|
201 | - protected function logDebug($function, $msg, $htmlComment=true) { |
|
202 | - $output = "[DEBUG] [$function] $msg"; |
|
203 | - if ($htmlComment) { |
|
204 | - echo("<!-- $output -->\r\n"); |
|
205 | - } else { |
|
206 | - echo("$output\r\n"); |
|
207 | - } |
|
208 | - } |
|
209 | - |
|
210 | - /** |
|
211 | - * Log a message to the PHP log. |
|
212 | - * Declared "protected" so it may be Extended if you require customised logging (e.g. particular log file location). |
|
213 | - */ |
|
214 | - protected function logPHPDebug($function, $msg) { |
|
215 | - if ($this->classparams['debug_php'] === true) { |
|
216 | - $output = "[DEBUG] [$function] ".$this->arrayexpand($msg); |
|
217 | - error_log($output); |
|
218 | - } |
|
219 | - } |
|
220 | - |
|
221 | - private function arrayexpand($array) { |
|
222 | - $output = ''; |
|
223 | - if (is_array($array)) { |
|
224 | - foreach ($array as $key => $value) { |
|
225 | - $output .= "\n ".$key.' => '.$this->arrayexpand($value); |
|
226 | - } |
|
227 | - } else { |
|
228 | - $output .= $array; |
|
229 | - } |
|
230 | - return $output; |
|
231 | - } |
|
232 | - |
|
233 | - |
|
234 | - /** |
|
235 | - * Convert a value ending in 'G','M' or 'K' to bytes |
|
236 | - * |
|
237 | - */ |
|
238 | - private function tobytes($val) { |
|
239 | - $val = trim($val); |
|
240 | - $last = fix_strtolower($val{strlen($val)-1}); |
|
241 | - switch($last) { |
|
242 | - case 'g': |
|
243 | - $val *= 1024; |
|
244 | - case 'm': |
|
245 | - $val *= 1024; |
|
246 | - case 'k': |
|
247 | - $val *= 1024; |
|
248 | - } |
|
249 | - return $val; |
|
250 | - } |
|
251 | - |
|
252 | - /** |
|
253 | - * Build a string, containing a javascript wrapper function |
|
254 | - * for setting applet properties via JavaScript. This is necessary, |
|
255 | - * because we use the "modern" method of including the applet (using |
|
256 | - * <object> resp. <embed> tags) in order to trigger automatic JRE downloading. |
|
257 | - * Therefore, in Netscape-like browsers, the applet is accessible via |
|
258 | - * the document.embeds[] array while in others, it is accessible via the |
|
259 | - * document.applets[] array. |
|
260 | - * |
|
261 | - * @return A string, containing the necessary wrapper function (named JUploadSetProperty) |
|
262 | - */ |
|
263 | - private function str_jsinit() { |
|
264 | - $N = "\n"; |
|
265 | - $name = $this->appletparams['name']; |
|
266 | - $ret = '<script type="text/javascript">'.$N; |
|
267 | - $ret .= '<!--'.$N; |
|
268 | - $ret .= 'function '.$this->classparams['jscript_wrapper'].'(name, value) {'.$N; |
|
269 | - $ret .= ' document.applets["'.$name.'"] == null || document.applets["'.$name.'"].setProperty(name,value);'.$N; |
|
270 | - $ret .= ' document.embeds["'.$name.'"] == null || document.embeds["'.$name.'"].setProperty(name,value);'.$N; |
|
271 | - $ret .= '}'.$N; |
|
272 | - $ret .= '//-->'.$N; |
|
273 | - $ret .= '</script>'; |
|
274 | - return $ret; |
|
275 | - } |
|
276 | - |
|
277 | - /** |
|
278 | - * Build a string, containing the applet tag with all parameters. |
|
279 | - * |
|
280 | - * @return A string, containing the applet tag |
|
281 | - */ |
|
282 | - private function str_applet() { |
|
283 | - $N = "\n"; |
|
284 | - $params = $this->appletparams; |
|
285 | - // return the actual applet tag |
|
286 | - $ret = '<object classid = "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"'.$N; |
|
287 | - $ret .= ' codebase = "http://java.sun.com/update/1.5.0/jinstall-1_5-windows-i586.cab#Version=5,0,0,3"'.$N; |
|
288 | - $ret .= ' width = "'.$params['width'].'"'.$N; |
|
289 | - $ret .= ' height = "'.$params['height'].'"'.$N; |
|
290 | - $ret .= ' name = "'.$params['name'].'">'.$N; |
|
291 | - foreach ($params as $key => $val) { |
|
292 | - if ($key !== 'width' && $key !== 'height') |
|
293 | - $ret .= ' <param name = "'.$key.'" value = "'.$val.'" />'.$N; |
|
294 | - } |
|
295 | - $ret .= ' <comment>'.$N; |
|
296 | - $ret .= ' <embed'.$N; |
|
297 | - $ret .= ' type = "application/x-java-applet;version=1.5"'.$N; |
|
298 | - foreach ($params as $key => $val) |
|
299 | - $ret .= ' '.$key.' = "'.$val.'"'.$N; |
|
300 | - $ret .= ' pluginspage = "http://java.sun.com/products/plugin/index.html#download">'.$N; |
|
301 | - $ret .= ' <noembed>'.$N; |
|
302 | - $ret .= ' Java 1.5 or higher plugin required.'.$N; |
|
303 | - $ret .= ' </noembed>'.$N; |
|
304 | - $ret .= ' </embed>'.$N; |
|
305 | - $ret .= ' </comment>'.$N; |
|
306 | - $ret .= '</object>'; |
|
307 | - return $ret; |
|
308 | - } |
|
309 | - |
|
310 | - private function abort($msg = '') { |
|
311 | - $this->cleanup(); |
|
312 | - if ($msg != '') |
|
313 | - die(str_replace('(.*)',$msg,$this->appletparams['stringUploadError'])."\n"); |
|
314 | - exit; |
|
315 | - } |
|
316 | - |
|
317 | - private function warning($msg = '') { |
|
318 | - $this->cleanup(); |
|
319 | - if ($msg != '') |
|
320 | - echo('WARNING: '.$msg."\n"); |
|
321 | - echo $this->appletparams['stringUploadSuccess']."\n"; |
|
322 | - exit; |
|
323 | - } |
|
324 | - |
|
325 | - private function cleanup() { |
|
326 | - // remove all uploaded files of *this* request |
|
327 | - if (isset($_FILES)) { |
|
328 | - foreach ($_FILES as $key => $val) |
|
329 | - @unlink($val['tmp_name']); |
|
330 | - } |
|
331 | - // remove accumulated file, if any. |
|
332 | - @unlink($this->classparams['destdir'].'/'.$this->classparams['tmp_prefix'].session_id()); |
|
333 | - @unlink($this->classparams['destdir'].'/'.$this->classparams['tmp_prefix'].'tmp'.session_id()); |
|
334 | - // reset session var |
|
335 | - $_SESSION['RF'][$this->classparams['var_prefix'].'size'] = 0; |
|
336 | - return; |
|
337 | - } |
|
338 | - |
|
339 | - private function mkdirp($path) { |
|
340 | - // create subdir (hierary) below destdir; |
|
341 | - $dirs = explode('/', $path); |
|
342 | - $path = $this->classparams['destdir']; |
|
343 | - foreach ($dirs as $dir) { |
|
344 | - $path .= '/'.$dir; |
|
345 | - if (!file_exists($path)) { // @ does NOT always supress the error! |
|
346 | - $_umask = umask(0); // override the system mask |
|
347 | - @mkdir($path, $this->classparams['dirperm']); |
|
348 | - umask($_umask); |
|
349 | - } |
|
350 | - } |
|
351 | - if (!is_dir($path) && is_writable($path)) |
|
352 | - $this->abort('Destination dir not accessible'); |
|
353 | - } |
|
354 | - |
|
355 | - /** |
|
356 | - * This method: |
|
357 | - * - Replaces some potentially dangerous characters by '_' (in the given name an relative path) |
|
358 | - * - Checks if a files of the same name already exists. |
|
359 | - * - If no: no problem. |
|
360 | - * - If yes, and the duplicate class param is set to rename, the file is renamed. |
|
361 | - * - If yes, and the duplicate class param is set to overwrite, the file is not renamed. The existing one will be erased. |
|
362 | - * - If yes, and the duplicate class param is set to reject, an error is thrown. |
|
363 | - */ |
|
364 | - private function dstfinal(&$name, &$subdir) { |
|
365 | - $name = preg_replace('![`$\\\\/|]!', '_', $name); |
|
366 | - if ($this->classparams['allow_subdirs'] && ($subdir != '')) { |
|
367 | - $subdir = trim(preg_replace('!\\\\!','/',$subdir),'/'); |
|
368 | - $subdir = preg_replace('![`$|]!', '_', $subdir); |
|
369 | - if (!$this->classparams['spaces_in_subdirs']) { |
|
370 | - $subdir = str_replace(' ','_',$subdir); |
|
371 | - } |
|
372 | - // recursively create subdir |
|
373 | - if (!$this->classparams['demo_mode']) |
|
374 | - $this->mkdirp($subdir); |
|
375 | - // append a slash |
|
376 | - $subdir .= '/'; |
|
377 | - } else { |
|
378 | - $subdir = ''; |
|
379 | - } |
|
380 | - $ret = $this->classparams['destdir'].'/'.$subdir.$name; |
|
381 | - if (file_exists($ret)) { |
|
382 | - if ($this->classparams['duplicate'] === 'overwrite') { |
|
383 | - return $ret; |
|
384 | - } |
|
385 | - if ($this->classparams['duplicate'] === 'reject') { |
|
386 | - $this->abort('A file with the same name already exists'); |
|
387 | - } |
|
388 | - if ($this->classparams['duplicate'] === 'warning') { |
|
389 | - $this->warning("File $name already exists - rejected"); |
|
390 | - } |
|
391 | - if ($this->classparams['duplicate'] === 'rename') { |
|
392 | - $cnt = 1; |
|
393 | - $dir = $this->classparams['destdir'].'/'.$subdir; |
|
394 | - $ext = strrchr($name, '.'); |
|
395 | - if ($ext) { |
|
396 | - $nameWithoutExtension = substr($name, 0, strlen($name) - strlen($ext)); |
|
397 | - } else { |
|
398 | - $ext = ''; |
|
399 | - $nameWithoutExtension = $name; |
|
400 | - } |
|
401 | - |
|
402 | - $rtry = $dir.$nameWithoutExtension.'_'.$cnt.$ext; |
|
403 | - while (file_exists($rtry)) { |
|
404 | - $cnt++; |
|
405 | - $rtry = $dir.$nameWithoutExtension.'._'.$cnt.$ext; |
|
406 | - } |
|
407 | - //We store the result name in the byReference name parameter. |
|
408 | - $name = $nameWithoutExtension.'_'.$cnt.$ext; |
|
409 | - $ret = $rtry; |
|
410 | - } |
|
411 | - } |
|
412 | - return $ret; |
|
413 | - } |
|
414 | - |
|
415 | - /** |
|
416 | - * Example function to process the files uploaded. This one simply displays the files' data. |
|
417 | - * |
|
418 | - */ |
|
419 | - public function defaultAfterUploadManagement() { |
|
420 | - $flist = '[defaultAfterUploadManagement] Nb uploaded files is: ' . sizeof($this->files); |
|
421 | - $flist = $this->classparams['http_flist_start']; |
|
422 | - foreach ($this->files as $f) { |
|
423 | - //$f is an array, that contains all info about the uploaded file. |
|
424 | - $this->logDebug('defaultAfterUploadManagement', " Reading file ${f['name']}"); |
|
425 | - $flist .= $this->classparams['http_flist_file_before']; |
|
426 | - $flist .= $f['name']; |
|
427 | - $flist .= $this->classparams['http_flist_file_between']; |
|
428 | - $flist .= $f['size']; |
|
429 | - $flist .= $this->classparams['http_flist_file_between']; |
|
430 | - $flist .= $f['relativePath']; |
|
431 | - $flist .= $this->classparams['http_flist_file_between']; |
|
432 | - $flist .= $f['fullName']; |
|
433 | - $flist .= $this->classparams['http_flist_file_between']; |
|
434 | - $flist .= $f['md5sum']; |
|
435 | - $addBR = false; |
|
436 | - foreach ($f as $key=>$value) { |
|
437 | - //If it's a specific key, let's display it: |
|
438 | - if ($key !== 'name' && $key !== 'size' && $key !== 'relativePath' && $key !== 'fullName' && $key !== 'md5sum') { |
|
439 | - if ($addBR) { |
|
440 | - $flist .= "<br>"; |
|
441 | - } else { |
|
442 | - // First line. We must add a new 'official' list separator. |
|
443 | - $flist .= $this->classparams['http_flist_file_between']; |
|
444 | - $addBR = true; |
|
445 | - } |
|
446 | - $flist .= "$key => $value"; |
|
447 | - } |
|
448 | - } |
|
449 | - $flist .= $this->classparams['http_flist_file_after']; |
|
450 | - } |
|
451 | - $flist .= $this->classparams['http_flist_end']; |
|
452 | - |
|
453 | - return $flist; |
|
57 | + var $appletparams; |
|
58 | + var $classparams; |
|
59 | + var $files; |
|
60 | + |
|
61 | + public function JUpload($appletparams = array(), $classparams = array()) { |
|
62 | + if (gettype($classparams) !== 'array') |
|
63 | + $this->abort('Invalid type of parameter classparams: Expecting an array'); |
|
64 | + if (gettype($appletparams) !== 'array') |
|
65 | + $this->abort('Invalid type of parameter appletparams: Expecting an array'); |
|
66 | + |
|
67 | + // set some defaults for the applet params |
|
68 | + if (!isset($appletparams['afterUploadURL'])) |
|
69 | + $appletparams['afterUploadURL'] = $_SERVER['PHP_SELF'] . '?afterupload=1'; |
|
70 | + if (!isset($appletparams['name'])) |
|
71 | + $appletparams['name'] = 'JUpload'; |
|
72 | + if (!isset($appletparams['archive'])) |
|
73 | + $appletparams['archive'] = 'wjhk.jupload.jar'; |
|
74 | + if (!isset($appletparams['code'])) |
|
75 | + $appletparams['code'] = 'wjhk.jupload2.JUploadApplet'; |
|
76 | + if (!isset($appletparams['debugLevel'])) |
|
77 | + $appletparams['debugLevel'] = 0; |
|
78 | + if (!isset($appletparams['httpUploadParameterType'])) |
|
79 | + $appletparams['httpUploadParameterType'] = 'array'; |
|
80 | + if (!isset($appletparams['showLogWindow'])) |
|
81 | + $appletparams['showLogWindow'] = ($appletparams['debugLevel'] > 0) ? 'true' : 'false'; |
|
82 | + if (!isset($appletparams['width'])) |
|
83 | + $appletparams['width'] = 640; |
|
84 | + if (!isset($appletparams['height'])) |
|
85 | + $appletparams['height'] = ($appletparams['showLogWindow'] === 'true') ? 500 : 300; |
|
86 | + if (!isset($appletparams['mayscript'])) |
|
87 | + $appletparams['mayscript'] = 'true'; |
|
88 | + if (!isset($appletparams['scriptable'])) |
|
89 | + $appletparams['scriptable'] = 'false'; |
|
90 | + //if (!isset($appletparams['stringUploadSuccess'])) |
|
91 | + $appletparams['stringUploadSuccess'] = 'SUCCESS'; |
|
92 | + //if (!isset($appletparams['stringUploadError'])) |
|
93 | + $appletparams['stringUploadError'] = 'ERROR: (.*)'; |
|
94 | + $maxpost = $this->tobytes(ini_get('post_max_size')); |
|
95 | + $maxmem = $this->tobytes(ini_get('memory_limit')); |
|
96 | + $maxfs = $this->tobytes(ini_get('upload_max_filesize')); |
|
97 | + $obd = ini_get('open_basedir'); |
|
98 | + if (!isset($appletparams['maxChunkSize'])) { |
|
99 | + $maxchunk = ($maxpost < $maxmem) ? $maxpost : $maxmem; |
|
100 | + $maxchunk = ($maxchunk < $maxfs) ? $maxchunk : $maxfs; |
|
101 | + $maxchunk /= 4; |
|
102 | + $optchunk = (500000 > $maxchunk) ? $maxchunk : 500000; |
|
103 | + $appletparams['maxChunkSize'] = $optchunk; |
|
104 | + } |
|
105 | + $appletparams['maxChunkSize'] = $this->tobytes($appletparams['maxChunkSize']); |
|
106 | + if (!isset($appletparams['maxFileSize'])) |
|
107 | + $appletparams['maxFileSize'] = $maxfs; |
|
108 | + $appletparams['maxFileSize'] = $this->tobytes($appletparams['maxFileSize']); |
|
109 | + if (isset($classparams['errormail'])) { |
|
110 | + $appletparams['urlToSendErrorTo'] = $_SERVER["PHP_SELF"] . '?errormail'; |
|
111 | + } |
|
112 | + |
|
113 | + // Same for class parameters |
|
114 | + if (!isset($classparams['demo_mode'])) |
|
115 | + $classparams['demo_mode'] = false; |
|
116 | + if ($classparams['demo_mode']) { |
|
117 | + $classparams['create_destdir'] = false; |
|
118 | + $classparams['allow_subdirs'] = true; |
|
119 | + $classparams['allow_zerosized'] = true; |
|
120 | + $classparams['duplicate'] = 'overwrite'; |
|
121 | + } |
|
122 | + if (!isset($classparams['debug_php'])) // set true to log some messages in PHP log |
|
123 | + $classparams['debug_php'] = false; |
|
124 | + if (!isset($this->classparams['allowed_mime_types'])) // array of allowed MIME type |
|
125 | + $classparams['allowed_mime_types'] = 'all'; |
|
126 | + if (!isset($this->classparams['allowed_file_extensions'])) // array of allowed file extensions |
|
127 | + $classparams['allowed_file_extensions'] = 'all'; |
|
128 | + if (!isset($classparams['verbose_errors'])) // shouldn't display server info on a production site! |
|
129 | + $classparams['verbose_errors'] = true; |
|
130 | + if (!isset($classparams['session_regenerate'])) |
|
131 | + $classparams['session_regenerate'] = false; |
|
132 | + if (!isset($classparams['create_destdir'])) |
|
133 | + $classparams['create_destdir'] = true; |
|
134 | + if (!isset($classparams['allow_subdirs'])) |
|
135 | + $classparams['allow_subdirs'] = false; |
|
136 | + if (!isset($classparams['spaces_in_subdirs'])) |
|
137 | + $classparams['spaces_in_subdirs'] = false; |
|
138 | + if (!isset($classparams['allow_zerosized'])) |
|
139 | + $classparams['allow_zerosized'] = false; |
|
140 | + if (!isset($classparams['duplicate'])) |
|
141 | + $classparams['duplicate'] = 'rename'; |
|
142 | + if (!isset($classparams['dirperm'])) |
|
143 | + $classparams['dirperm'] = 0755; |
|
144 | + if (!isset($classparams['fileperm'])) |
|
145 | + $classparams['fileperm'] = 0644; |
|
146 | + if (!isset($classparams['destdir'])) { |
|
147 | + if ($obd != '') |
|
148 | + $classparams['destdir'] = $obd; |
|
149 | + else |
|
150 | + $classparams['destdir'] = '/var/tmp/jupload_test'; |
|
151 | + }else{ |
|
152 | + $classparams['destdir']=str_replace('~',' ',$classparams['destdir']); |
|
153 | + } |
|
154 | + if ($classparams['create_destdir']) { |
|
155 | + $_umask = umask(0); // override the system mask |
|
156 | + @mkdir($classparams['destdir'], $classparams['dirperm']); |
|
157 | + umask($_umask); |
|
158 | + } |
|
159 | + if (!is_dir($classparams['destdir']) && is_writable($classparams['destdir'])) |
|
160 | + $this->abort('Destination dir not accessible'); |
|
161 | + if (!isset($classparams['tmp_prefix'])) |
|
162 | + $classparams['tmp_prefix'] = 'jutmp.'; |
|
163 | + if (!isset($classparams['var_prefix'])) |
|
164 | + $classparams['var_prefix'] = 'juvar.'; |
|
165 | + if (!isset($classparams['jscript_wrapper'])) |
|
166 | + $classparams['jscript_wrapper'] = 'JUploadSetProperty'; |
|
167 | + if (!isset($classparams['tag_jscript'])) |
|
168 | + $classparams['tag_jscript'] = '<!--JUPLOAD_JSCRIPT-->'; |
|
169 | + if (!isset($classparams['tag_applet'])) |
|
170 | + $classparams['tag_applet'] = '<!--JUPLOAD_APPLET-->'; |
|
171 | + if (!isset($classparams['tag_flist'])) |
|
172 | + $classparams['tag_flist'] = '<!--JUPLOAD_FILES-->'; |
|
173 | + if (!isset($classparams['http_flist_start'])) |
|
174 | + $classparams['http_flist_start'] = |
|
175 | + "<table border='1'><TR><TH>Filename</TH><TH>file size</TH><TH>Relative path</TH><TH>Full name</TH><TH>md5sum</TH><TH>Specific parameters</TH></TR>"; |
|
176 | + if (!isset($classparams['http_flist_end'])) |
|
177 | + $classparams['http_flist_end'] = "</table>\n"; |
|
178 | + if (!isset($classparams['http_flist_file_before'])) |
|
179 | + $classparams['http_flist_file_before'] = "<tr><td>"; |
|
180 | + if (!isset($classparams['http_flist_file_between'])) |
|
181 | + $classparams['http_flist_file_between'] = "</td><td>"; |
|
182 | + if (!isset($classparams['http_flist_file_after'])) |
|
183 | + $classparams['http_flist_file_after'] = "</td></tr>\n"; |
|
184 | + |
|
185 | + $this->appletparams = $appletparams; |
|
186 | + $this->classparams = $classparams; |
|
187 | + $this->page_start(); |
|
188 | + } |
|
189 | + |
|
190 | + /** |
|
191 | + * Return an array of uploaded files * The array contains: name, size, tmp_name, error, |
|
192 | + * relativePath, md5sum, mimetype, fullName, path |
|
193 | + */ |
|
194 | + public function uploadedfiles() { |
|
195 | + return $this->files; |
|
196 | + } |
|
197 | + |
|
198 | + /** |
|
199 | + * Log a message on the current output, as a HTML comment. |
|
200 | + */ |
|
201 | + protected function logDebug($function, $msg, $htmlComment=true) { |
|
202 | + $output = "[DEBUG] [$function] $msg"; |
|
203 | + if ($htmlComment) { |
|
204 | + echo("<!-- $output -->\r\n"); |
|
205 | + } else { |
|
206 | + echo("$output\r\n"); |
|
207 | + } |
|
208 | + } |
|
209 | + |
|
210 | + /** |
|
211 | + * Log a message to the PHP log. |
|
212 | + * Declared "protected" so it may be Extended if you require customised logging (e.g. particular log file location). |
|
213 | + */ |
|
214 | + protected function logPHPDebug($function, $msg) { |
|
215 | + if ($this->classparams['debug_php'] === true) { |
|
216 | + $output = "[DEBUG] [$function] ".$this->arrayexpand($msg); |
|
217 | + error_log($output); |
|
218 | + } |
|
219 | + } |
|
220 | + |
|
221 | + private function arrayexpand($array) { |
|
222 | + $output = ''; |
|
223 | + if (is_array($array)) { |
|
224 | + foreach ($array as $key => $value) { |
|
225 | + $output .= "\n ".$key.' => '.$this->arrayexpand($value); |
|
226 | + } |
|
227 | + } else { |
|
228 | + $output .= $array; |
|
229 | + } |
|
230 | + return $output; |
|
231 | + } |
|
232 | + |
|
233 | + |
|
234 | + /** |
|
235 | + * Convert a value ending in 'G','M' or 'K' to bytes |
|
236 | + * |
|
237 | + */ |
|
238 | + private function tobytes($val) { |
|
239 | + $val = trim($val); |
|
240 | + $last = fix_strtolower($val{strlen($val)-1}); |
|
241 | + switch($last) { |
|
242 | + case 'g': |
|
243 | + $val *= 1024; |
|
244 | + case 'm': |
|
245 | + $val *= 1024; |
|
246 | + case 'k': |
|
247 | + $val *= 1024; |
|
248 | + } |
|
249 | + return $val; |
|
250 | + } |
|
251 | + |
|
252 | + /** |
|
253 | + * Build a string, containing a javascript wrapper function |
|
254 | + * for setting applet properties via JavaScript. This is necessary, |
|
255 | + * because we use the "modern" method of including the applet (using |
|
256 | + * <object> resp. <embed> tags) in order to trigger automatic JRE downloading. |
|
257 | + * Therefore, in Netscape-like browsers, the applet is accessible via |
|
258 | + * the document.embeds[] array while in others, it is accessible via the |
|
259 | + * document.applets[] array. |
|
260 | + * |
|
261 | + * @return A string, containing the necessary wrapper function (named JUploadSetProperty) |
|
262 | + */ |
|
263 | + private function str_jsinit() { |
|
264 | + $N = "\n"; |
|
265 | + $name = $this->appletparams['name']; |
|
266 | + $ret = '<script type="text/javascript">'.$N; |
|
267 | + $ret .= '<!--'.$N; |
|
268 | + $ret .= 'function '.$this->classparams['jscript_wrapper'].'(name, value) {'.$N; |
|
269 | + $ret .= ' document.applets["'.$name.'"] == null || document.applets["'.$name.'"].setProperty(name,value);'.$N; |
|
270 | + $ret .= ' document.embeds["'.$name.'"] == null || document.embeds["'.$name.'"].setProperty(name,value);'.$N; |
|
271 | + $ret .= '}'.$N; |
|
272 | + $ret .= '//-->'.$N; |
|
273 | + $ret .= '</script>'; |
|
274 | + return $ret; |
|
275 | + } |
|
276 | + |
|
277 | + /** |
|
278 | + * Build a string, containing the applet tag with all parameters. |
|
279 | + * |
|
280 | + * @return A string, containing the applet tag |
|
281 | + */ |
|
282 | + private function str_applet() { |
|
283 | + $N = "\n"; |
|
284 | + $params = $this->appletparams; |
|
285 | + // return the actual applet tag |
|
286 | + $ret = '<object classid = "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"'.$N; |
|
287 | + $ret .= ' codebase = "http://java.sun.com/update/1.5.0/jinstall-1_5-windows-i586.cab#Version=5,0,0,3"'.$N; |
|
288 | + $ret .= ' width = "'.$params['width'].'"'.$N; |
|
289 | + $ret .= ' height = "'.$params['height'].'"'.$N; |
|
290 | + $ret .= ' name = "'.$params['name'].'">'.$N; |
|
291 | + foreach ($params as $key => $val) { |
|
292 | + if ($key !== 'width' && $key !== 'height') |
|
293 | + $ret .= ' <param name = "'.$key.'" value = "'.$val.'" />'.$N; |
|
294 | + } |
|
295 | + $ret .= ' <comment>'.$N; |
|
296 | + $ret .= ' <embed'.$N; |
|
297 | + $ret .= ' type = "application/x-java-applet;version=1.5"'.$N; |
|
298 | + foreach ($params as $key => $val) |
|
299 | + $ret .= ' '.$key.' = "'.$val.'"'.$N; |
|
300 | + $ret .= ' pluginspage = "http://java.sun.com/products/plugin/index.html#download">'.$N; |
|
301 | + $ret .= ' <noembed>'.$N; |
|
302 | + $ret .= ' Java 1.5 or higher plugin required.'.$N; |
|
303 | + $ret .= ' </noembed>'.$N; |
|
304 | + $ret .= ' </embed>'.$N; |
|
305 | + $ret .= ' </comment>'.$N; |
|
306 | + $ret .= '</object>'; |
|
307 | + return $ret; |
|
308 | + } |
|
309 | + |
|
310 | + private function abort($msg = '') { |
|
311 | + $this->cleanup(); |
|
312 | + if ($msg != '') |
|
313 | + die(str_replace('(.*)',$msg,$this->appletparams['stringUploadError'])."\n"); |
|
314 | + exit; |
|
315 | + } |
|
316 | + |
|
317 | + private function warning($msg = '') { |
|
318 | + $this->cleanup(); |
|
319 | + if ($msg != '') |
|
320 | + echo('WARNING: '.$msg."\n"); |
|
321 | + echo $this->appletparams['stringUploadSuccess']."\n"; |
|
322 | + exit; |
|
323 | + } |
|
324 | + |
|
325 | + private function cleanup() { |
|
326 | + // remove all uploaded files of *this* request |
|
327 | + if (isset($_FILES)) { |
|
328 | + foreach ($_FILES as $key => $val) |
|
329 | + @unlink($val['tmp_name']); |
|
330 | + } |
|
331 | + // remove accumulated file, if any. |
|
332 | + @unlink($this->classparams['destdir'].'/'.$this->classparams['tmp_prefix'].session_id()); |
|
333 | + @unlink($this->classparams['destdir'].'/'.$this->classparams['tmp_prefix'].'tmp'.session_id()); |
|
334 | + // reset session var |
|
335 | + $_SESSION['RF'][$this->classparams['var_prefix'].'size'] = 0; |
|
336 | + return; |
|
337 | + } |
|
338 | + |
|
339 | + private function mkdirp($path) { |
|
340 | + // create subdir (hierary) below destdir; |
|
341 | + $dirs = explode('/', $path); |
|
342 | + $path = $this->classparams['destdir']; |
|
343 | + foreach ($dirs as $dir) { |
|
344 | + $path .= '/'.$dir; |
|
345 | + if (!file_exists($path)) { // @ does NOT always supress the error! |
|
346 | + $_umask = umask(0); // override the system mask |
|
347 | + @mkdir($path, $this->classparams['dirperm']); |
|
348 | + umask($_umask); |
|
349 | + } |
|
350 | + } |
|
351 | + if (!is_dir($path) && is_writable($path)) |
|
352 | + $this->abort('Destination dir not accessible'); |
|
353 | + } |
|
354 | + |
|
355 | + /** |
|
356 | + * This method: |
|
357 | + * - Replaces some potentially dangerous characters by '_' (in the given name an relative path) |
|
358 | + * - Checks if a files of the same name already exists. |
|
359 | + * - If no: no problem. |
|
360 | + * - If yes, and the duplicate class param is set to rename, the file is renamed. |
|
361 | + * - If yes, and the duplicate class param is set to overwrite, the file is not renamed. The existing one will be erased. |
|
362 | + * - If yes, and the duplicate class param is set to reject, an error is thrown. |
|
363 | + */ |
|
364 | + private function dstfinal(&$name, &$subdir) { |
|
365 | + $name = preg_replace('![`$\\\\/|]!', '_', $name); |
|
366 | + if ($this->classparams['allow_subdirs'] && ($subdir != '')) { |
|
367 | + $subdir = trim(preg_replace('!\\\\!','/',$subdir),'/'); |
|
368 | + $subdir = preg_replace('![`$|]!', '_', $subdir); |
|
369 | + if (!$this->classparams['spaces_in_subdirs']) { |
|
370 | + $subdir = str_replace(' ','_',$subdir); |
|
371 | + } |
|
372 | + // recursively create subdir |
|
373 | + if (!$this->classparams['demo_mode']) |
|
374 | + $this->mkdirp($subdir); |
|
375 | + // append a slash |
|
376 | + $subdir .= '/'; |
|
377 | + } else { |
|
378 | + $subdir = ''; |
|
379 | + } |
|
380 | + $ret = $this->classparams['destdir'].'/'.$subdir.$name; |
|
381 | + if (file_exists($ret)) { |
|
382 | + if ($this->classparams['duplicate'] === 'overwrite') { |
|
383 | + return $ret; |
|
384 | + } |
|
385 | + if ($this->classparams['duplicate'] === 'reject') { |
|
386 | + $this->abort('A file with the same name already exists'); |
|
387 | + } |
|
388 | + if ($this->classparams['duplicate'] === 'warning') { |
|
389 | + $this->warning("File $name already exists - rejected"); |
|
390 | + } |
|
391 | + if ($this->classparams['duplicate'] === 'rename') { |
|
392 | + $cnt = 1; |
|
393 | + $dir = $this->classparams['destdir'].'/'.$subdir; |
|
394 | + $ext = strrchr($name, '.'); |
|
395 | + if ($ext) { |
|
396 | + $nameWithoutExtension = substr($name, 0, strlen($name) - strlen($ext)); |
|
397 | + } else { |
|
398 | + $ext = ''; |
|
399 | + $nameWithoutExtension = $name; |
|
400 | + } |
|
401 | + |
|
402 | + $rtry = $dir.$nameWithoutExtension.'_'.$cnt.$ext; |
|
403 | + while (file_exists($rtry)) { |
|
404 | + $cnt++; |
|
405 | + $rtry = $dir.$nameWithoutExtension.'._'.$cnt.$ext; |
|
406 | + } |
|
407 | + //We store the result name in the byReference name parameter. |
|
408 | + $name = $nameWithoutExtension.'_'.$cnt.$ext; |
|
409 | + $ret = $rtry; |
|
410 | + } |
|
411 | + } |
|
412 | + return $ret; |
|
413 | + } |
|
414 | + |
|
415 | + /** |
|
416 | + * Example function to process the files uploaded. This one simply displays the files' data. |
|
417 | + * |
|
418 | + */ |
|
419 | + public function defaultAfterUploadManagement() { |
|
420 | + $flist = '[defaultAfterUploadManagement] Nb uploaded files is: ' . sizeof($this->files); |
|
421 | + $flist = $this->classparams['http_flist_start']; |
|
422 | + foreach ($this->files as $f) { |
|
423 | + //$f is an array, that contains all info about the uploaded file. |
|
424 | + $this->logDebug('defaultAfterUploadManagement', " Reading file ${f['name']}"); |
|
425 | + $flist .= $this->classparams['http_flist_file_before']; |
|
426 | + $flist .= $f['name']; |
|
427 | + $flist .= $this->classparams['http_flist_file_between']; |
|
428 | + $flist .= $f['size']; |
|
429 | + $flist .= $this->classparams['http_flist_file_between']; |
|
430 | + $flist .= $f['relativePath']; |
|
431 | + $flist .= $this->classparams['http_flist_file_between']; |
|
432 | + $flist .= $f['fullName']; |
|
433 | + $flist .= $this->classparams['http_flist_file_between']; |
|
434 | + $flist .= $f['md5sum']; |
|
435 | + $addBR = false; |
|
436 | + foreach ($f as $key=>$value) { |
|
437 | + //If it's a specific key, let's display it: |
|
438 | + if ($key !== 'name' && $key !== 'size' && $key !== 'relativePath' && $key !== 'fullName' && $key !== 'md5sum') { |
|
439 | + if ($addBR) { |
|
440 | + $flist .= "<br>"; |
|
441 | + } else { |
|
442 | + // First line. We must add a new 'official' list separator. |
|
443 | + $flist .= $this->classparams['http_flist_file_between']; |
|
444 | + $addBR = true; |
|
445 | + } |
|
446 | + $flist .= "$key => $value"; |
|
447 | + } |
|
448 | + } |
|
449 | + $flist .= $this->classparams['http_flist_file_after']; |
|
450 | + } |
|
451 | + $flist .= $this->classparams['http_flist_end']; |
|
452 | + |
|
453 | + return $flist; |
|
454 | 454 | } |
455 | 455 | |
456 | 456 | /** |
@@ -459,9 +459,9 @@ discard block |
||
459 | 459 | * See the tag_jscript and tag_applet class parameters. |
460 | 460 | */ |
461 | 461 | private function generateAppletTag($str) { |
462 | - $this->logDebug('generateAppletTag', 'Entering function'); |
|
463 | - $str = preg_replace('/'.$this->classparams['tag_jscript'].'/', $this->str_jsinit(), $str); |
|
464 | - return preg_replace('/'.$this->classparams['tag_applet'].'/', $this->str_applet(), $str); |
|
462 | + $this->logDebug('generateAppletTag', 'Entering function'); |
|
463 | + $str = preg_replace('/'.$this->classparams['tag_jscript'].'/', $this->str_jsinit(), $str); |
|
464 | + return preg_replace('/'.$this->classparams['tag_applet'].'/', $this->str_applet(), $str); |
|
465 | 465 | } |
466 | 466 | |
467 | 467 | /** |
@@ -471,8 +471,8 @@ discard block |
||
471 | 471 | * This *must* be public, because it is called from PHP's output buffering |
472 | 472 | */ |
473 | 473 | public function interceptBeforeUpload($str) { |
474 | - $this->logDebug('interceptBeforeUpload', 'Entering function'); |
|
475 | - return $this->generateAppletTag($str); |
|
474 | + $this->logDebug('interceptBeforeUpload', 'Entering function'); |
|
475 | + return $this->generateAppletTag($str); |
|
476 | 476 | } |
477 | 477 | |
478 | 478 | /** |
@@ -481,36 +481,36 @@ discard block |
||
481 | 481 | * This *must* be public, because it is called from PHP's output buffering. |
482 | 482 | */ |
483 | 483 | public function interceptAfterUpload($str) { |
484 | - $this->logDebug('interceptAfterUpload', 'Entering function'); |
|
485 | - $this->logPHPDebug('interceptAfterUpload', $this->files); |
|
486 | - |
|
487 | - if (count($this->files) > 0) { |
|
488 | - if (isset($this->classparams['callbackAfterUploadManagement'])) { |
|
489 | - $this->logDebug('interceptAfterUpload', 'Before call of ' .$this->classparams['callbackAfterUploadManagement']); |
|
490 | - $strForFListContent = call_user_func($this->classparams['callbackAfterUploadManagement'], $this, $this->files); |
|
491 | - } else { |
|
492 | - $strForFListContent = $this->defaultAfterUploadManagement(); |
|
493 | - } |
|
494 | - $str = preg_replace('/'.$this->classparams['tag_flist'].'/', $strForFListContent, $str); |
|
495 | - } |
|
496 | - return $this->generateAppletTag($str); |
|
484 | + $this->logDebug('interceptAfterUpload', 'Entering function'); |
|
485 | + $this->logPHPDebug('interceptAfterUpload', $this->files); |
|
486 | + |
|
487 | + if (count($this->files) > 0) { |
|
488 | + if (isset($this->classparams['callbackAfterUploadManagement'])) { |
|
489 | + $this->logDebug('interceptAfterUpload', 'Before call of ' .$this->classparams['callbackAfterUploadManagement']); |
|
490 | + $strForFListContent = call_user_func($this->classparams['callbackAfterUploadManagement'], $this, $this->files); |
|
491 | + } else { |
|
492 | + $strForFListContent = $this->defaultAfterUploadManagement(); |
|
493 | + } |
|
494 | + $str = preg_replace('/'.$this->classparams['tag_flist'].'/', $strForFListContent, $str); |
|
495 | + } |
|
496 | + return $this->generateAppletTag($str); |
|
497 | 497 | } |
498 | 498 | |
499 | 499 | /** |
500 | 500 | * This method manages the receiving of the debug log, when an error occurs. |
501 | 501 | */ |
502 | 502 | private function receive_debug_log() { |
503 | - // handle error report |
|
504 | - if (isset($_POST['description']) && isset($_POST['log'])) { |
|
505 | - $msg = $_POST['log']; |
|
506 | - mail($this->classparams['errormail'], $_POST['description'], $msg); |
|
507 | - } else { |
|
508 | - if (isset($_SERVER['SERVER_ADMIN'])) |
|
509 | - mail($_SERVER['SERVER_ADMIN'], 'Empty jupload error log', |
|
503 | + // handle error report |
|
504 | + if (isset($_POST['description']) && isset($_POST['log'])) { |
|
505 | + $msg = $_POST['log']; |
|
506 | + mail($this->classparams['errormail'], $_POST['description'], $msg); |
|
507 | + } else { |
|
508 | + if (isset($_SERVER['SERVER_ADMIN'])) |
|
509 | + mail($_SERVER['SERVER_ADMIN'], 'Empty jupload error log', |
|
510 | 510 | 'An empty log has just been posted.'); |
511 | - $this->logPHPDebug('receive_debug_log', 'Empty error log received'); |
|
512 | - } |
|
513 | - exit; |
|
511 | + $this->logPHPDebug('receive_debug_log', 'Empty error log received'); |
|
512 | + } |
|
513 | + exit; |
|
514 | 514 | } |
515 | 515 | |
516 | 516 | /** |
@@ -522,180 +522,180 @@ discard block |
||
522 | 522 | * Or you can Extend the class and redeclare defaultAfterUploadManagement() to your needs. |
523 | 523 | */ |
524 | 524 | private function receive_uploaded_files() { |
525 | - $this->logDebug('receive_uploaded_files', 'Entering POST management'); |
|
526 | - |
|
527 | - if (session_id() == '') { |
|
528 | - session_start(); |
|
529 | - } |
|
530 | - // we check for the session *after* handling possible error log |
|
531 | - // because an error could have happened because the session-id is missing. |
|
532 | - if (!isset($_SESSION['RF'][$this->classparams['var_prefix'].'size'])) { |
|
533 | - $this->abort('Invalid session (in afterupload, POST, check of size)'); |
|
534 | - } |
|
535 | - if (!isset($_SESSION['RF'][$this->classparams['var_prefix'].'files'])) { |
|
536 | - $this->abort('Invalid session (in afterupload, POST, check of files)'); |
|
537 | - } |
|
538 | - $this->files = $_SESSION['RF'][$this->classparams['var_prefix'].'files']; |
|
539 | - if (!is_array($this->files)) { |
|
540 | - $this->abort('Invalid session (in afterupload, POST, is_array(files))'); |
|
541 | - } |
|
542 | - if ($this->appletparams['sendMD5Sum'] === 'true' && !isset($_POST['md5sum'])) { |
|
543 | - $this->abort('Required POST variable md5sum is missing'); |
|
544 | - } |
|
545 | - $cnt = 0; |
|
546 | - foreach ($_FILES as $key => $value) { |
|
547 | - //Let's read the $_FILES data |
|
548 | - if (isset($files_data)) { |
|
549 | - unset($files_data); |
|
550 | - } |
|
551 | - $jupart = (isset($_POST['jupart'])) ? (int)$_POST['jupart'] : 0; |
|
552 | - $jufinal = (isset($_POST['jufinal'])) ? (int)$_POST['jufinal'] : 1; |
|
553 | - $relpaths = (isset($_POST['relpathinfo'])) ? $_POST['relpathinfo'] : null; |
|
554 | - $md5sums = (isset($_POST['md5sum'])) ? $_POST['md5sum'] : null; |
|
555 | - $mimetypes = (isset($_POST['mimetype'])) ? $_POST['mimetype'] : null; |
|
556 | - //$relpaths = (isset($_POST["relpathinfo$cnt"])) ? $_POST["relpathinfo$cnt"] : null; |
|
557 | - //$md5sums = (isset($_POST["md5sum$cnt"])) ? $_POST["md5sum$cnt"] : null; |
|
558 | - |
|
559 | - if (gettype($relpaths) === 'string') { |
|
560 | - $relpaths = array($relpaths); |
|
561 | - } |
|
562 | - if (gettype($md5sums) === 'string') { |
|
563 | - $md5sums = array($md5sums); |
|
564 | - } |
|
565 | - if ($this->appletparams['sendMD5Sum'] === 'true' && !is_array($md5sums)) { |
|
566 | - $this->abort('Expecting an array of MD5 checksums'); |
|
567 | - } |
|
568 | - if (!is_array($relpaths)) { |
|
569 | - $this->abort('Expecting an array of relative paths'); |
|
570 | - } |
|
571 | - if (!is_array($mimetypes)) { |
|
572 | - $this->abort('Expecting an array of MIME types'); |
|
573 | - } |
|
574 | - // Check the MIME type (note: this is easily forged!) |
|
575 | - if (isset($this->classparams['allowed_mime_types']) && is_array($this->classparams['allowed_mime_types'])) { |
|
576 | - if (!in_array($mimetypes[$cnt], $this->classparams['allowed_mime_types'])) { |
|
577 | - $this->abort('MIME type '.$mimetypes[$cnt].' not allowed'); |
|
578 | - } |
|
579 | - } |
|
580 | - if (isset($this->classparams['allowed_file_extensions']) && is_array($this->classparams['allowed_file_extensions'])) { |
|
581 | - $fileExtension = substr(strrchr($value['name'][$cnt], "."), 1); |
|
582 | - if (!in_array($fileExtension, $this->classparams['allowed_file_extensions'])) { |
|
583 | - $this->abort('File extension '.$fileExtension.' not allowed'); |
|
584 | - } |
|
585 | - } |
|
586 | - |
|
587 | - $dstdir = $this->classparams['destdir']; |
|
588 | - $dstname = $dstdir.'/'.$this->classparams['tmp_prefix'].session_id(); |
|
589 | - $tmpname = $dstdir.'/'.$this->classparams['tmp_prefix'].'tmp'.session_id(); |
|
590 | - |
|
591 | - // Controls are now done. Let's store the current uploaded files properties in an array, for future use. |
|
592 | - $files_data['name'] = $value['name'][$cnt]; |
|
593 | - $files_data['size'] = 'not calculated yet'; |
|
594 | - $files_data['tmp_name'] = $value['tmp_name'][$cnt]; |
|
595 | - $files_data['error'] = $value['error'][$cnt]; |
|
596 | - $files_data['relativePath'] = $relpaths[$cnt]; |
|
597 | - $files_data['md5sum'] = $md5sums[$cnt]; |
|
598 | - $files_data['mimetype'] = $mimetypes[$cnt]; |
|
599 | - |
|
600 | - if (!move_uploaded_file($files_data['tmp_name'], $tmpname)) { |
|
601 | - if ($classparams['verbose_errors']) { |
|
602 | - $this->abort("Unable to move uploaded file (from ${files_data['tmp_name']} to $tmpname)"); |
|
603 | - } else { |
|
604 | - trigger_error("Unable to move uploaded file (from ${files_data['tmp_name']} to $tmpname)",E_USER_WARNING); |
|
605 | - $this->abort("Unable to move uploaded file"); |
|
606 | - } |
|
525 | + $this->logDebug('receive_uploaded_files', 'Entering POST management'); |
|
526 | + |
|
527 | + if (session_id() == '') { |
|
528 | + session_start(); |
|
529 | + } |
|
530 | + // we check for the session *after* handling possible error log |
|
531 | + // because an error could have happened because the session-id is missing. |
|
532 | + if (!isset($_SESSION['RF'][$this->classparams['var_prefix'].'size'])) { |
|
533 | + $this->abort('Invalid session (in afterupload, POST, check of size)'); |
|
534 | + } |
|
535 | + if (!isset($_SESSION['RF'][$this->classparams['var_prefix'].'files'])) { |
|
536 | + $this->abort('Invalid session (in afterupload, POST, check of files)'); |
|
537 | + } |
|
538 | + $this->files = $_SESSION['RF'][$this->classparams['var_prefix'].'files']; |
|
539 | + if (!is_array($this->files)) { |
|
540 | + $this->abort('Invalid session (in afterupload, POST, is_array(files))'); |
|
541 | + } |
|
542 | + if ($this->appletparams['sendMD5Sum'] === 'true' && !isset($_POST['md5sum'])) { |
|
543 | + $this->abort('Required POST variable md5sum is missing'); |
|
544 | + } |
|
545 | + $cnt = 0; |
|
546 | + foreach ($_FILES as $key => $value) { |
|
547 | + //Let's read the $_FILES data |
|
548 | + if (isset($files_data)) { |
|
549 | + unset($files_data); |
|
550 | + } |
|
551 | + $jupart = (isset($_POST['jupart'])) ? (int)$_POST['jupart'] : 0; |
|
552 | + $jufinal = (isset($_POST['jufinal'])) ? (int)$_POST['jufinal'] : 1; |
|
553 | + $relpaths = (isset($_POST['relpathinfo'])) ? $_POST['relpathinfo'] : null; |
|
554 | + $md5sums = (isset($_POST['md5sum'])) ? $_POST['md5sum'] : null; |
|
555 | + $mimetypes = (isset($_POST['mimetype'])) ? $_POST['mimetype'] : null; |
|
556 | + //$relpaths = (isset($_POST["relpathinfo$cnt"])) ? $_POST["relpathinfo$cnt"] : null; |
|
557 | + //$md5sums = (isset($_POST["md5sum$cnt"])) ? $_POST["md5sum$cnt"] : null; |
|
558 | + |
|
559 | + if (gettype($relpaths) === 'string') { |
|
560 | + $relpaths = array($relpaths); |
|
561 | + } |
|
562 | + if (gettype($md5sums) === 'string') { |
|
563 | + $md5sums = array($md5sums); |
|
564 | + } |
|
565 | + if ($this->appletparams['sendMD5Sum'] === 'true' && !is_array($md5sums)) { |
|
566 | + $this->abort('Expecting an array of MD5 checksums'); |
|
567 | + } |
|
568 | + if (!is_array($relpaths)) { |
|
569 | + $this->abort('Expecting an array of relative paths'); |
|
570 | + } |
|
571 | + if (!is_array($mimetypes)) { |
|
572 | + $this->abort('Expecting an array of MIME types'); |
|
573 | + } |
|
574 | + // Check the MIME type (note: this is easily forged!) |
|
575 | + if (isset($this->classparams['allowed_mime_types']) && is_array($this->classparams['allowed_mime_types'])) { |
|
576 | + if (!in_array($mimetypes[$cnt], $this->classparams['allowed_mime_types'])) { |
|
577 | + $this->abort('MIME type '.$mimetypes[$cnt].' not allowed'); |
|
578 | + } |
|
579 | + } |
|
580 | + if (isset($this->classparams['allowed_file_extensions']) && is_array($this->classparams['allowed_file_extensions'])) { |
|
581 | + $fileExtension = substr(strrchr($value['name'][$cnt], "."), 1); |
|
582 | + if (!in_array($fileExtension, $this->classparams['allowed_file_extensions'])) { |
|
583 | + $this->abort('File extension '.$fileExtension.' not allowed'); |
|
584 | + } |
|
585 | + } |
|
586 | + |
|
587 | + $dstdir = $this->classparams['destdir']; |
|
588 | + $dstname = $dstdir.'/'.$this->classparams['tmp_prefix'].session_id(); |
|
589 | + $tmpname = $dstdir.'/'.$this->classparams['tmp_prefix'].'tmp'.session_id(); |
|
590 | + |
|
591 | + // Controls are now done. Let's store the current uploaded files properties in an array, for future use. |
|
592 | + $files_data['name'] = $value['name'][$cnt]; |
|
593 | + $files_data['size'] = 'not calculated yet'; |
|
594 | + $files_data['tmp_name'] = $value['tmp_name'][$cnt]; |
|
595 | + $files_data['error'] = $value['error'][$cnt]; |
|
596 | + $files_data['relativePath'] = $relpaths[$cnt]; |
|
597 | + $files_data['md5sum'] = $md5sums[$cnt]; |
|
598 | + $files_data['mimetype'] = $mimetypes[$cnt]; |
|
599 | + |
|
600 | + if (!move_uploaded_file($files_data['tmp_name'], $tmpname)) { |
|
601 | + if ($classparams['verbose_errors']) { |
|
602 | + $this->abort("Unable to move uploaded file (from ${files_data['tmp_name']} to $tmpname)"); |
|
603 | + } else { |
|
604 | + trigger_error("Unable to move uploaded file (from ${files_data['tmp_name']} to $tmpname)",E_USER_WARNING); |
|
605 | + $this->abort("Unable to move uploaded file"); |
|
606 | + } |
|
607 | 607 | } |
608 | 608 | |
609 | 609 | // In demo mode, no file storing is done. We just delete the newly uploaded file. |
610 | 610 | if ($this->classparams['demo_mode']) { |
611 | - if ($jufinal || (!$jupart)) { |
|
612 | - if ($jupart) { |
|
613 | - $files_data['size'] = ($jupart-1) * $this->appletparams['maxChunkSize'] + filesize($tmpname); |
|
614 | - } else { |
|
615 | - $files_data['size'] = filesize($tmpname); |
|
616 | - } |
|
617 | - $files_data['fullName'] = 'Demo mode<BR>No file storing'; |
|
618 | - array_push($this->files, $files_data); |
|
619 | - } |
|
620 | - unlink($tmpname); |
|
621 | - $cnt++; |
|
622 | - continue; |
|
611 | + if ($jufinal || (!$jupart)) { |
|
612 | + if ($jupart) { |
|
613 | + $files_data['size'] = ($jupart-1) * $this->appletparams['maxChunkSize'] + filesize($tmpname); |
|
614 | + } else { |
|
615 | + $files_data['size'] = filesize($tmpname); |
|
616 | + } |
|
617 | + $files_data['fullName'] = 'Demo mode<BR>No file storing'; |
|
618 | + array_push($this->files, $files_data); |
|
619 | + } |
|
620 | + unlink($tmpname); |
|
621 | + $cnt++; |
|
622 | + continue; |
|
623 | 623 | } |
624 | 624 | //If we get here, the upload is a real one (no demo) |
625 | 625 | if ($jupart) { |
626 | - // got a chunk of a multi-part upload |
|
627 | - $len = filesize($tmpname); |
|
628 | - $_SESSION['RF'][$this->classparams['var_prefix'].'size'] += $len; |
|
629 | - if ($len > 0) { |
|
630 | - $src = fopen($tmpname, 'rb'); |
|
631 | - $dst = fopen($dstname, ($jupart == 1) ? 'wb' : 'ab'); |
|
632 | - while ($len > 0) { |
|
633 | - $rlen = ($len > 8192) ? 8192 : $len; |
|
634 | - $buf = fread($src, $rlen); |
|
635 | - if (!$buf) { |
|
636 | - fclose($src); |
|
637 | - fclose($dst); |
|
638 | - unlink($dstname); |
|
639 | - $this->abort('read IO error'); |
|
640 | - } |
|
641 | - if (!fwrite($dst, $buf, $rlen)) { |
|
642 | - fclose($src); |
|
643 | - fclose($dst); |
|
644 | - unlink($dstname); |
|
645 | - $this->abort('write IO error'); |
|
646 | - } |
|
647 | - $len -= $rlen; |
|
648 | - } |
|
649 | - fclose($src); |
|
650 | - fclose($dst); |
|
651 | - unlink($tmpname); |
|
652 | - } |
|
653 | - if ($jufinal) { |
|
654 | - // This is the last chunk. Check total lenght and |
|
655 | - // rename it to it's final name. |
|
656 | - $dlen = filesize($dstname); |
|
657 | - if ($dlen != $_SESSION['RF'][$this->classparams['var_prefix'].'size']) |
|
658 | - $this->abort('file size mismatch'); |
|
659 | - if ($this->appletparams['sendMD5Sum'] === 'true' ) { |
|
660 | - if ($md5sums[$cnt] != md5_file($dstname)) |
|
661 | - $this->abort('MD5 checksum mismatch'); |
|
662 | - } |
|
663 | - // remove zero sized files |
|
664 | - if (($dlen > 0) || $this->classparams['allow_zerosized']) { |
|
665 | - $dstfinal = $this->dstfinal($files_data['name'],$files_data['relativePath']); |
|
666 | - if (!rename($dstname, $dstfinal)) |
|
667 | - $this->abort('rename IO error'); |
|
668 | - $_umask = umask(0); // override the system mask |
|
669 | - if (!chmod($dstfinal, $this->classparams['fileperm'])) |
|
670 | - $this->abort('chmod IO error'); |
|
671 | - umask($_umask); |
|
672 | - $files_data['size'] = filesize($dstfinal); |
|
673 | - $files_data['fullName'] = $dstfinal; |
|
674 | - $files_data['path'] = fix_dirname($dstfinal); |
|
675 | - array_push($this->files, $files_data); |
|
676 | - } else { |
|
677 | - unlink($dstname); |
|
678 | - } |
|
679 | - // reset session var |
|
680 | - $_SESSION['RF'][$this->classparams['var_prefix'].'size'] = 0; |
|
681 | - } |
|
626 | + // got a chunk of a multi-part upload |
|
627 | + $len = filesize($tmpname); |
|
628 | + $_SESSION['RF'][$this->classparams['var_prefix'].'size'] += $len; |
|
629 | + if ($len > 0) { |
|
630 | + $src = fopen($tmpname, 'rb'); |
|
631 | + $dst = fopen($dstname, ($jupart == 1) ? 'wb' : 'ab'); |
|
632 | + while ($len > 0) { |
|
633 | + $rlen = ($len > 8192) ? 8192 : $len; |
|
634 | + $buf = fread($src, $rlen); |
|
635 | + if (!$buf) { |
|
636 | + fclose($src); |
|
637 | + fclose($dst); |
|
638 | + unlink($dstname); |
|
639 | + $this->abort('read IO error'); |
|
640 | + } |
|
641 | + if (!fwrite($dst, $buf, $rlen)) { |
|
642 | + fclose($src); |
|
643 | + fclose($dst); |
|
644 | + unlink($dstname); |
|
645 | + $this->abort('write IO error'); |
|
646 | + } |
|
647 | + $len -= $rlen; |
|
648 | + } |
|
649 | + fclose($src); |
|
650 | + fclose($dst); |
|
651 | + unlink($tmpname); |
|
652 | + } |
|
653 | + if ($jufinal) { |
|
654 | + // This is the last chunk. Check total lenght and |
|
655 | + // rename it to it's final name. |
|
656 | + $dlen = filesize($dstname); |
|
657 | + if ($dlen != $_SESSION['RF'][$this->classparams['var_prefix'].'size']) |
|
658 | + $this->abort('file size mismatch'); |
|
659 | + if ($this->appletparams['sendMD5Sum'] === 'true' ) { |
|
660 | + if ($md5sums[$cnt] != md5_file($dstname)) |
|
661 | + $this->abort('MD5 checksum mismatch'); |
|
662 | + } |
|
663 | + // remove zero sized files |
|
664 | + if (($dlen > 0) || $this->classparams['allow_zerosized']) { |
|
665 | + $dstfinal = $this->dstfinal($files_data['name'],$files_data['relativePath']); |
|
666 | + if (!rename($dstname, $dstfinal)) |
|
667 | + $this->abort('rename IO error'); |
|
668 | + $_umask = umask(0); // override the system mask |
|
669 | + if (!chmod($dstfinal, $this->classparams['fileperm'])) |
|
670 | + $this->abort('chmod IO error'); |
|
671 | + umask($_umask); |
|
672 | + $files_data['size'] = filesize($dstfinal); |
|
673 | + $files_data['fullName'] = $dstfinal; |
|
674 | + $files_data['path'] = fix_dirname($dstfinal); |
|
675 | + array_push($this->files, $files_data); |
|
676 | + } else { |
|
677 | + unlink($dstname); |
|
678 | + } |
|
679 | + // reset session var |
|
680 | + $_SESSION['RF'][$this->classparams['var_prefix'].'size'] = 0; |
|
681 | + } |
|
682 | 682 | } else { |
683 | - // Got a single file upload. Trivial. |
|
684 | - if ($this->appletparams['sendMD5Sum'] === 'true' ) { |
|
685 | - if ($md5sums[$cnt] != md5_file($tmpname)) |
|
686 | - $this->abort('MD5 checksum mismatch'); |
|
687 | - } |
|
688 | - $dstfinal = $this->dstfinal($files_data['name'],$files_data['relativePath']); |
|
689 | - if (!rename($tmpname, $dstfinal)) |
|
690 | - $this->abort('rename IO error'); |
|
691 | - $_umask = umask(0); // override the system mask |
|
692 | - if (!chmod($dstfinal, $this->classparams['fileperm'])) |
|
693 | - $this->abort('chmod IO error'); |
|
694 | - umask($_umask); |
|
695 | - $files_data['size'] = filesize($dstfinal); |
|
696 | - $files_data['fullName'] = $dstfinal; |
|
697 | - $files_data['path'] = fix_dirname($dstfinal); |
|
698 | - array_push($this->files, $files_data); |
|
683 | + // Got a single file upload. Trivial. |
|
684 | + if ($this->appletparams['sendMD5Sum'] === 'true' ) { |
|
685 | + if ($md5sums[$cnt] != md5_file($tmpname)) |
|
686 | + $this->abort('MD5 checksum mismatch'); |
|
687 | + } |
|
688 | + $dstfinal = $this->dstfinal($files_data['name'],$files_data['relativePath']); |
|
689 | + if (!rename($tmpname, $dstfinal)) |
|
690 | + $this->abort('rename IO error'); |
|
691 | + $_umask = umask(0); // override the system mask |
|
692 | + if (!chmod($dstfinal, $this->classparams['fileperm'])) |
|
693 | + $this->abort('chmod IO error'); |
|
694 | + umask($_umask); |
|
695 | + $files_data['size'] = filesize($dstfinal); |
|
696 | + $files_data['fullName'] = $dstfinal; |
|
697 | + $files_data['path'] = fix_dirname($dstfinal); |
|
698 | + array_push($this->files, $files_data); |
|
699 | 699 | } |
700 | 700 | $cnt++; |
701 | 701 | } |
@@ -711,56 +711,56 @@ discard block |
||
711 | 711 | * |
712 | 712 | */ |
713 | 713 | private function page_start() { |
714 | - $this->logDebug('page_start', 'Entering function'); |
|
715 | - |
|
716 | - // If the applet checks for the serverProtocol, it issues a HEAD request |
|
717 | - // -> Simply return an empty doc. |
|
718 | - if ($_SERVER['REQUEST_METHOD'] === 'HEAD') { |
|
719 | - // Nothing to do |
|
720 | - |
|
721 | - } else if ($_SERVER['REQUEST_METHOD'] === 'GET') { |
|
722 | - // A GET request means: return upload page |
|
723 | - $this->logDebug('page_start', 'Entering GET management'); |
|
724 | - |
|
725 | - if (session_id() == '') { |
|
726 | - session_start(); |
|
727 | - } |
|
728 | - if (isset($_GET['afterupload'])) { |
|
729 | - $this->logDebug('page_start', 'afterupload is set'); |
|
730 | - if (!isset($_SESSION['RF'][$this->classparams['var_prefix'].'files'])) { |
|
731 | - $this->abort('Invalid session (in afterupload, GET, check of $_SESSION["RF"]): files array is not set'); |
|
732 | - } |
|
733 | - $this->files = $_SESSION['RF'][$this->classparams['var_prefix'].'files']; |
|
734 | - if (!is_array($this->files)) { |
|
735 | - $this->abort('Invalid session (in afterupload, GET, check of is_array(files)): files is not an array'); |
|
736 | - } |
|
737 | - // clear session data ready for new upload |
|
738 | - $_SESSION['RF'][$this->classparams['var_prefix'].'files'] = array(); |
|
739 | - |
|
740 | - // start intercepting the content of the calling page, to display the upload result. |
|
741 | - ob_start(array(& $this, 'interceptAfterUpload')); |
|
742 | - |
|
743 | - } else { |
|
744 | - $this->logDebug('page_start', 'afterupload is not set'); |
|
745 | - if ($this->classparams['session_regenerate']) { |
|
746 | - session_regenerate_id(true); |
|
747 | - } |
|
748 | - $this->files = array(); |
|
749 | - $_SESSION['RF'][$this->classparams['var_prefix'].'size'] = 0; |
|
750 | - $_SESSION['RF'][$this->classparams['var_prefix'].'files'] = $this->files; |
|
751 | - // start intercepting the content of the calling page, to display the applet tag. |
|
752 | - ob_start(array(& $this, 'interceptBeforeUpload')); |
|
753 | - } |
|
754 | - |
|
755 | - } else if ($_SERVER['REQUEST_METHOD'] === 'POST') { |
|
756 | - // If we got a POST request, this is the real work. |
|
757 | - if (isset($_GET['errormail'])) { |
|
758 | - //Hum, an error occurs on server side. Let's manage the debug log, that we just received. |
|
759 | - $this->receive_debug_log(); |
|
760 | - } else { |
|
761 | - $this->receive_uploaded_files(); |
|
762 | - } |
|
763 | - } |
|
714 | + $this->logDebug('page_start', 'Entering function'); |
|
715 | + |
|
716 | + // If the applet checks for the serverProtocol, it issues a HEAD request |
|
717 | + // -> Simply return an empty doc. |
|
718 | + if ($_SERVER['REQUEST_METHOD'] === 'HEAD') { |
|
719 | + // Nothing to do |
|
720 | + |
|
721 | + } else if ($_SERVER['REQUEST_METHOD'] === 'GET') { |
|
722 | + // A GET request means: return upload page |
|
723 | + $this->logDebug('page_start', 'Entering GET management'); |
|
724 | + |
|
725 | + if (session_id() == '') { |
|
726 | + session_start(); |
|
727 | + } |
|
728 | + if (isset($_GET['afterupload'])) { |
|
729 | + $this->logDebug('page_start', 'afterupload is set'); |
|
730 | + if (!isset($_SESSION['RF'][$this->classparams['var_prefix'].'files'])) { |
|
731 | + $this->abort('Invalid session (in afterupload, GET, check of $_SESSION["RF"]): files array is not set'); |
|
732 | + } |
|
733 | + $this->files = $_SESSION['RF'][$this->classparams['var_prefix'].'files']; |
|
734 | + if (!is_array($this->files)) { |
|
735 | + $this->abort('Invalid session (in afterupload, GET, check of is_array(files)): files is not an array'); |
|
736 | + } |
|
737 | + // clear session data ready for new upload |
|
738 | + $_SESSION['RF'][$this->classparams['var_prefix'].'files'] = array(); |
|
739 | + |
|
740 | + // start intercepting the content of the calling page, to display the upload result. |
|
741 | + ob_start(array(& $this, 'interceptAfterUpload')); |
|
742 | + |
|
743 | + } else { |
|
744 | + $this->logDebug('page_start', 'afterupload is not set'); |
|
745 | + if ($this->classparams['session_regenerate']) { |
|
746 | + session_regenerate_id(true); |
|
747 | + } |
|
748 | + $this->files = array(); |
|
749 | + $_SESSION['RF'][$this->classparams['var_prefix'].'size'] = 0; |
|
750 | + $_SESSION['RF'][$this->classparams['var_prefix'].'files'] = $this->files; |
|
751 | + // start intercepting the content of the calling page, to display the applet tag. |
|
752 | + ob_start(array(& $this, 'interceptBeforeUpload')); |
|
753 | + } |
|
754 | + |
|
755 | + } else if ($_SERVER['REQUEST_METHOD'] === 'POST') { |
|
756 | + // If we got a POST request, this is the real work. |
|
757 | + if (isset($_GET['errormail'])) { |
|
758 | + //Hum, an error occurs on server side. Let's manage the debug log, that we just received. |
|
759 | + $this->receive_debug_log(); |
|
760 | + } else { |
|
761 | + $this->receive_uploaded_files(); |
|
762 | + } |
|
763 | + } |
|
764 | 764 | } |
765 | 765 | } |
766 | 766 |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | |
67 | 67 | // set some defaults for the applet params |
68 | 68 | if (!isset($appletparams['afterUploadURL'])) |
69 | - $appletparams['afterUploadURL'] = $_SERVER['PHP_SELF'] . '?afterupload=1'; |
|
69 | + $appletparams['afterUploadURL'] = $_SERVER['PHP_SELF'].'?afterupload=1'; |
|
70 | 70 | if (!isset($appletparams['name'])) |
71 | 71 | $appletparams['name'] = 'JUpload'; |
72 | 72 | if (!isset($appletparams['archive'])) |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | $appletparams['maxFileSize'] = $maxfs; |
108 | 108 | $appletparams['maxFileSize'] = $this->tobytes($appletparams['maxFileSize']); |
109 | 109 | if (isset($classparams['errormail'])) { |
110 | - $appletparams['urlToSendErrorTo'] = $_SERVER["PHP_SELF"] . '?errormail'; |
|
110 | + $appletparams['urlToSendErrorTo'] = $_SERVER["PHP_SELF"].'?errormail'; |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | // Same for class parameters |
@@ -148,11 +148,11 @@ discard block |
||
148 | 148 | $classparams['destdir'] = $obd; |
149 | 149 | else |
150 | 150 | $classparams['destdir'] = '/var/tmp/jupload_test'; |
151 | - }else{ |
|
152 | - $classparams['destdir']=str_replace('~',' ',$classparams['destdir']); |
|
151 | + } else { |
|
152 | + $classparams['destdir'] = str_replace('~', ' ', $classparams['destdir']); |
|
153 | 153 | } |
154 | 154 | if ($classparams['create_destdir']) { |
155 | - $_umask = umask(0); // override the system mask |
|
155 | + $_umask = umask(0); // override the system mask |
|
156 | 156 | @mkdir($classparams['destdir'], $classparams['dirperm']); |
157 | 157 | umask($_umask); |
158 | 158 | } |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | /** |
199 | 199 | * Log a message on the current output, as a HTML comment. |
200 | 200 | */ |
201 | - protected function logDebug($function, $msg, $htmlComment=true) { |
|
201 | + protected function logDebug($function, $msg, $htmlComment = true) { |
|
202 | 202 | $output = "[DEBUG] [$function] $msg"; |
203 | 203 | if ($htmlComment) { |
204 | 204 | echo("<!-- $output -->\r\n"); |
@@ -237,8 +237,8 @@ discard block |
||
237 | 237 | */ |
238 | 238 | private function tobytes($val) { |
239 | 239 | $val = trim($val); |
240 | - $last = fix_strtolower($val{strlen($val)-1}); |
|
241 | - switch($last) { |
|
240 | + $last = fix_strtolower($val{strlen($val) - 1}); |
|
241 | + switch ($last) { |
|
242 | 242 | case 'g': |
243 | 243 | $val *= 1024; |
244 | 244 | case 'm': |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | private function abort($msg = '') { |
311 | 311 | $this->cleanup(); |
312 | 312 | if ($msg != '') |
313 | - die(str_replace('(.*)',$msg,$this->appletparams['stringUploadError'])."\n"); |
|
313 | + die(str_replace('(.*)', $msg, $this->appletparams['stringUploadError'])."\n"); |
|
314 | 314 | exit; |
315 | 315 | } |
316 | 316 | |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | foreach ($dirs as $dir) { |
344 | 344 | $path .= '/'.$dir; |
345 | 345 | if (!file_exists($path)) { // @ does NOT always supress the error! |
346 | - $_umask = umask(0); // override the system mask |
|
346 | + $_umask = umask(0); // override the system mask |
|
347 | 347 | @mkdir($path, $this->classparams['dirperm']); |
348 | 348 | umask($_umask); |
349 | 349 | } |
@@ -364,10 +364,10 @@ discard block |
||
364 | 364 | private function dstfinal(&$name, &$subdir) { |
365 | 365 | $name = preg_replace('![`$\\\\/|]!', '_', $name); |
366 | 366 | if ($this->classparams['allow_subdirs'] && ($subdir != '')) { |
367 | - $subdir = trim(preg_replace('!\\\\!','/',$subdir),'/'); |
|
367 | + $subdir = trim(preg_replace('!\\\\!', '/', $subdir), '/'); |
|
368 | 368 | $subdir = preg_replace('![`$|]!', '_', $subdir); |
369 | 369 | if (!$this->classparams['spaces_in_subdirs']) { |
370 | - $subdir = str_replace(' ','_',$subdir); |
|
370 | + $subdir = str_replace(' ', '_', $subdir); |
|
371 | 371 | } |
372 | 372 | // recursively create subdir |
373 | 373 | if (!$this->classparams['demo_mode']) |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | * |
418 | 418 | */ |
419 | 419 | public function defaultAfterUploadManagement() { |
420 | - $flist = '[defaultAfterUploadManagement] Nb uploaded files is: ' . sizeof($this->files); |
|
420 | + $flist = '[defaultAfterUploadManagement] Nb uploaded files is: '.sizeof($this->files); |
|
421 | 421 | $flist = $this->classparams['http_flist_start']; |
422 | 422 | foreach ($this->files as $f) { |
423 | 423 | //$f is an array, that contains all info about the uploaded file. |
@@ -486,7 +486,7 @@ discard block |
||
486 | 486 | |
487 | 487 | if (count($this->files) > 0) { |
488 | 488 | if (isset($this->classparams['callbackAfterUploadManagement'])) { |
489 | - $this->logDebug('interceptAfterUpload', 'Before call of ' .$this->classparams['callbackAfterUploadManagement']); |
|
489 | + $this->logDebug('interceptAfterUpload', 'Before call of '.$this->classparams['callbackAfterUploadManagement']); |
|
490 | 490 | $strForFListContent = call_user_func($this->classparams['callbackAfterUploadManagement'], $this, $this->files); |
491 | 491 | } else { |
492 | 492 | $strForFListContent = $this->defaultAfterUploadManagement(); |
@@ -539,7 +539,7 @@ discard block |
||
539 | 539 | if (!is_array($this->files)) { |
540 | 540 | $this->abort('Invalid session (in afterupload, POST, is_array(files))'); |
541 | 541 | } |
542 | - if ($this->appletparams['sendMD5Sum'] === 'true' && !isset($_POST['md5sum'])) { |
|
542 | + if ($this->appletparams['sendMD5Sum'] === 'true' && !isset($_POST['md5sum'])) { |
|
543 | 543 | $this->abort('Required POST variable md5sum is missing'); |
544 | 544 | } |
545 | 545 | $cnt = 0; |
@@ -548,11 +548,11 @@ discard block |
||
548 | 548 | if (isset($files_data)) { |
549 | 549 | unset($files_data); |
550 | 550 | } |
551 | - $jupart = (isset($_POST['jupart'])) ? (int)$_POST['jupart'] : 0; |
|
552 | - $jufinal = (isset($_POST['jufinal'])) ? (int)$_POST['jufinal'] : 1; |
|
553 | - $relpaths = (isset($_POST['relpathinfo'])) ? $_POST['relpathinfo'] : null; |
|
554 | - $md5sums = (isset($_POST['md5sum'])) ? $_POST['md5sum'] : null; |
|
555 | - $mimetypes = (isset($_POST['mimetype'])) ? $_POST['mimetype'] : null; |
|
551 | + $jupart = (isset($_POST['jupart'])) ? (int)$_POST['jupart'] : 0; |
|
552 | + $jufinal = (isset($_POST['jufinal'])) ? (int)$_POST['jufinal'] : 1; |
|
553 | + $relpaths = (isset($_POST['relpathinfo'])) ? $_POST['relpathinfo'] : null; |
|
554 | + $md5sums = (isset($_POST['md5sum'])) ? $_POST['md5sum'] : null; |
|
555 | + $mimetypes = (isset($_POST['mimetype'])) ? $_POST['mimetype'] : null; |
|
556 | 556 | //$relpaths = (isset($_POST["relpathinfo$cnt"])) ? $_POST["relpathinfo$cnt"] : null; |
557 | 557 | //$md5sums = (isset($_POST["md5sum$cnt"])) ? $_POST["md5sum$cnt"] : null; |
558 | 558 | |
@@ -562,7 +562,7 @@ discard block |
||
562 | 562 | if (gettype($md5sums) === 'string') { |
563 | 563 | $md5sums = array($md5sums); |
564 | 564 | } |
565 | - if ($this->appletparams['sendMD5Sum'] === 'true' && !is_array($md5sums)) { |
|
565 | + if ($this->appletparams['sendMD5Sum'] === 'true' && !is_array($md5sums)) { |
|
566 | 566 | $this->abort('Expecting an array of MD5 checksums'); |
567 | 567 | } |
568 | 568 | if (!is_array($relpaths)) { |
@@ -595,13 +595,13 @@ discard block |
||
595 | 595 | $files_data['error'] = $value['error'][$cnt]; |
596 | 596 | $files_data['relativePath'] = $relpaths[$cnt]; |
597 | 597 | $files_data['md5sum'] = $md5sums[$cnt]; |
598 | - $files_data['mimetype'] = $mimetypes[$cnt]; |
|
598 | + $files_data['mimetype'] = $mimetypes[$cnt]; |
|
599 | 599 | |
600 | 600 | if (!move_uploaded_file($files_data['tmp_name'], $tmpname)) { |
601 | 601 | if ($classparams['verbose_errors']) { |
602 | 602 | $this->abort("Unable to move uploaded file (from ${files_data['tmp_name']} to $tmpname)"); |
603 | 603 | } else { |
604 | - trigger_error("Unable to move uploaded file (from ${files_data['tmp_name']} to $tmpname)",E_USER_WARNING); |
|
604 | + trigger_error("Unable to move uploaded file (from ${files_data['tmp_name']} to $tmpname)", E_USER_WARNING); |
|
605 | 605 | $this->abort("Unable to move uploaded file"); |
606 | 606 | } |
607 | 607 | } |
@@ -610,11 +610,11 @@ discard block |
||
610 | 610 | if ($this->classparams['demo_mode']) { |
611 | 611 | if ($jufinal || (!$jupart)) { |
612 | 612 | if ($jupart) { |
613 | - $files_data['size'] = ($jupart-1) * $this->appletparams['maxChunkSize'] + filesize($tmpname); |
|
613 | + $files_data['size'] = ($jupart - 1) * $this->appletparams['maxChunkSize'] + filesize($tmpname); |
|
614 | 614 | } else { |
615 | 615 | $files_data['size'] = filesize($tmpname); |
616 | 616 | } |
617 | - $files_data['fullName'] = 'Demo mode<BR>No file storing'; |
|
617 | + $files_data['fullName'] = 'Demo mode<BR>No file storing'; |
|
618 | 618 | array_push($this->files, $files_data); |
619 | 619 | } |
620 | 620 | unlink($tmpname); |
@@ -656,22 +656,22 @@ discard block |
||
656 | 656 | $dlen = filesize($dstname); |
657 | 657 | if ($dlen != $_SESSION['RF'][$this->classparams['var_prefix'].'size']) |
658 | 658 | $this->abort('file size mismatch'); |
659 | - if ($this->appletparams['sendMD5Sum'] === 'true' ) { |
|
659 | + if ($this->appletparams['sendMD5Sum'] === 'true') { |
|
660 | 660 | if ($md5sums[$cnt] != md5_file($dstname)) |
661 | 661 | $this->abort('MD5 checksum mismatch'); |
662 | 662 | } |
663 | 663 | // remove zero sized files |
664 | 664 | if (($dlen > 0) || $this->classparams['allow_zerosized']) { |
665 | - $dstfinal = $this->dstfinal($files_data['name'],$files_data['relativePath']); |
|
665 | + $dstfinal = $this->dstfinal($files_data['name'], $files_data['relativePath']); |
|
666 | 666 | if (!rename($dstname, $dstfinal)) |
667 | 667 | $this->abort('rename IO error'); |
668 | - $_umask = umask(0); // override the system mask |
|
668 | + $_umask = umask(0); // override the system mask |
|
669 | 669 | if (!chmod($dstfinal, $this->classparams['fileperm'])) |
670 | 670 | $this->abort('chmod IO error'); |
671 | 671 | umask($_umask); |
672 | - $files_data['size'] = filesize($dstfinal); |
|
673 | - $files_data['fullName'] = $dstfinal; |
|
674 | - $files_data['path'] = fix_dirname($dstfinal); |
|
672 | + $files_data['size'] = filesize($dstfinal); |
|
673 | + $files_data['fullName'] = $dstfinal; |
|
674 | + $files_data['path'] = fix_dirname($dstfinal); |
|
675 | 675 | array_push($this->files, $files_data); |
676 | 676 | } else { |
677 | 677 | unlink($dstname); |
@@ -681,20 +681,20 @@ discard block |
||
681 | 681 | } |
682 | 682 | } else { |
683 | 683 | // Got a single file upload. Trivial. |
684 | - if ($this->appletparams['sendMD5Sum'] === 'true' ) { |
|
684 | + if ($this->appletparams['sendMD5Sum'] === 'true') { |
|
685 | 685 | if ($md5sums[$cnt] != md5_file($tmpname)) |
686 | 686 | $this->abort('MD5 checksum mismatch'); |
687 | 687 | } |
688 | - $dstfinal = $this->dstfinal($files_data['name'],$files_data['relativePath']); |
|
688 | + $dstfinal = $this->dstfinal($files_data['name'], $files_data['relativePath']); |
|
689 | 689 | if (!rename($tmpname, $dstfinal)) |
690 | 690 | $this->abort('rename IO error'); |
691 | - $_umask = umask(0); // override the system mask |
|
691 | + $_umask = umask(0); // override the system mask |
|
692 | 692 | if (!chmod($dstfinal, $this->classparams['fileperm'])) |
693 | 693 | $this->abort('chmod IO error'); |
694 | 694 | umask($_umask); |
695 | - $files_data['size'] = filesize($dstfinal); |
|
696 | - $files_data['fullName'] = $dstfinal; |
|
697 | - $files_data['path'] = fix_dirname($dstfinal); |
|
695 | + $files_data['size'] = filesize($dstfinal); |
|
696 | + $files_data['fullName'] = $dstfinal; |
|
697 | + $files_data['path'] = fix_dirname($dstfinal); |
|
698 | 698 | array_push($this->files, $files_data); |
699 | 699 | } |
700 | 700 | $cnt++; |
@@ -59,34 +59,47 @@ discard block |
||
59 | 59 | var $files; |
60 | 60 | |
61 | 61 | public function JUpload($appletparams = array(), $classparams = array()) { |
62 | - if (gettype($classparams) !== 'array') |
|
63 | - $this->abort('Invalid type of parameter classparams: Expecting an array'); |
|
64 | - if (gettype($appletparams) !== 'array') |
|
65 | - $this->abort('Invalid type of parameter appletparams: Expecting an array'); |
|
62 | + if (gettype($classparams) !== 'array') { |
|
63 | + $this->abort('Invalid type of parameter classparams: Expecting an array'); |
|
64 | + } |
|
65 | + if (gettype($appletparams) !== 'array') { |
|
66 | + $this->abort('Invalid type of parameter appletparams: Expecting an array'); |
|
67 | + } |
|
66 | 68 | |
67 | 69 | // set some defaults for the applet params |
68 | - if (!isset($appletparams['afterUploadURL'])) |
|
69 | - $appletparams['afterUploadURL'] = $_SERVER['PHP_SELF'] . '?afterupload=1'; |
|
70 | - if (!isset($appletparams['name'])) |
|
71 | - $appletparams['name'] = 'JUpload'; |
|
72 | - if (!isset($appletparams['archive'])) |
|
73 | - $appletparams['archive'] = 'wjhk.jupload.jar'; |
|
74 | - if (!isset($appletparams['code'])) |
|
75 | - $appletparams['code'] = 'wjhk.jupload2.JUploadApplet'; |
|
76 | - if (!isset($appletparams['debugLevel'])) |
|
77 | - $appletparams['debugLevel'] = 0; |
|
78 | - if (!isset($appletparams['httpUploadParameterType'])) |
|
79 | - $appletparams['httpUploadParameterType'] = 'array'; |
|
80 | - if (!isset($appletparams['showLogWindow'])) |
|
81 | - $appletparams['showLogWindow'] = ($appletparams['debugLevel'] > 0) ? 'true' : 'false'; |
|
82 | - if (!isset($appletparams['width'])) |
|
83 | - $appletparams['width'] = 640; |
|
84 | - if (!isset($appletparams['height'])) |
|
85 | - $appletparams['height'] = ($appletparams['showLogWindow'] === 'true') ? 500 : 300; |
|
86 | - if (!isset($appletparams['mayscript'])) |
|
87 | - $appletparams['mayscript'] = 'true'; |
|
88 | - if (!isset($appletparams['scriptable'])) |
|
89 | - $appletparams['scriptable'] = 'false'; |
|
70 | + if (!isset($appletparams['afterUploadURL'])) { |
|
71 | + $appletparams['afterUploadURL'] = $_SERVER['PHP_SELF'] . '?afterupload=1'; |
|
72 | + } |
|
73 | + if (!isset($appletparams['name'])) { |
|
74 | + $appletparams['name'] = 'JUpload'; |
|
75 | + } |
|
76 | + if (!isset($appletparams['archive'])) { |
|
77 | + $appletparams['archive'] = 'wjhk.jupload.jar'; |
|
78 | + } |
|
79 | + if (!isset($appletparams['code'])) { |
|
80 | + $appletparams['code'] = 'wjhk.jupload2.JUploadApplet'; |
|
81 | + } |
|
82 | + if (!isset($appletparams['debugLevel'])) { |
|
83 | + $appletparams['debugLevel'] = 0; |
|
84 | + } |
|
85 | + if (!isset($appletparams['httpUploadParameterType'])) { |
|
86 | + $appletparams['httpUploadParameterType'] = 'array'; |
|
87 | + } |
|
88 | + if (!isset($appletparams['showLogWindow'])) { |
|
89 | + $appletparams['showLogWindow'] = ($appletparams['debugLevel'] > 0) ? 'true' : 'false'; |
|
90 | + } |
|
91 | + if (!isset($appletparams['width'])) { |
|
92 | + $appletparams['width'] = 640; |
|
93 | + } |
|
94 | + if (!isset($appletparams['height'])) { |
|
95 | + $appletparams['height'] = ($appletparams['showLogWindow'] === 'true') ? 500 : 300; |
|
96 | + } |
|
97 | + if (!isset($appletparams['mayscript'])) { |
|
98 | + $appletparams['mayscript'] = 'true'; |
|
99 | + } |
|
100 | + if (!isset($appletparams['scriptable'])) { |
|
101 | + $appletparams['scriptable'] = 'false'; |
|
102 | + } |
|
90 | 103 | //if (!isset($appletparams['stringUploadSuccess'])) |
91 | 104 | $appletparams['stringUploadSuccess'] = 'SUCCESS'; |
92 | 105 | //if (!isset($appletparams['stringUploadError'])) |
@@ -103,52 +116,71 @@ discard block |
||
103 | 116 | $appletparams['maxChunkSize'] = $optchunk; |
104 | 117 | } |
105 | 118 | $appletparams['maxChunkSize'] = $this->tobytes($appletparams['maxChunkSize']); |
106 | - if (!isset($appletparams['maxFileSize'])) |
|
107 | - $appletparams['maxFileSize'] = $maxfs; |
|
119 | + if (!isset($appletparams['maxFileSize'])) { |
|
120 | + $appletparams['maxFileSize'] = $maxfs; |
|
121 | + } |
|
108 | 122 | $appletparams['maxFileSize'] = $this->tobytes($appletparams['maxFileSize']); |
109 | 123 | if (isset($classparams['errormail'])) { |
110 | 124 | $appletparams['urlToSendErrorTo'] = $_SERVER["PHP_SELF"] . '?errormail'; |
111 | 125 | } |
112 | 126 | |
113 | 127 | // Same for class parameters |
114 | - if (!isset($classparams['demo_mode'])) |
|
115 | - $classparams['demo_mode'] = false; |
|
128 | + if (!isset($classparams['demo_mode'])) { |
|
129 | + $classparams['demo_mode'] = false; |
|
130 | + } |
|
116 | 131 | if ($classparams['demo_mode']) { |
117 | 132 | $classparams['create_destdir'] = false; |
118 | 133 | $classparams['allow_subdirs'] = true; |
119 | 134 | $classparams['allow_zerosized'] = true; |
120 | 135 | $classparams['duplicate'] = 'overwrite'; |
121 | 136 | } |
122 | - if (!isset($classparams['debug_php'])) // set true to log some messages in PHP log |
|
137 | + if (!isset($classparams['debug_php'])) { |
|
138 | + // set true to log some messages in PHP log |
|
123 | 139 | $classparams['debug_php'] = false; |
124 | - if (!isset($this->classparams['allowed_mime_types'])) // array of allowed MIME type |
|
140 | + } |
|
141 | + if (!isset($this->classparams['allowed_mime_types'])) { |
|
142 | + // array of allowed MIME type |
|
125 | 143 | $classparams['allowed_mime_types'] = 'all'; |
126 | - if (!isset($this->classparams['allowed_file_extensions'])) // array of allowed file extensions |
|
144 | + } |
|
145 | + if (!isset($this->classparams['allowed_file_extensions'])) { |
|
146 | + // array of allowed file extensions |
|
127 | 147 | $classparams['allowed_file_extensions'] = 'all'; |
128 | - if (!isset($classparams['verbose_errors'])) // shouldn't display server info on a production site! |
|
148 | + } |
|
149 | + if (!isset($classparams['verbose_errors'])) { |
|
150 | + // shouldn't display server info on a production site! |
|
129 | 151 | $classparams['verbose_errors'] = true; |
130 | - if (!isset($classparams['session_regenerate'])) |
|
131 | - $classparams['session_regenerate'] = false; |
|
132 | - if (!isset($classparams['create_destdir'])) |
|
133 | - $classparams['create_destdir'] = true; |
|
134 | - if (!isset($classparams['allow_subdirs'])) |
|
135 | - $classparams['allow_subdirs'] = false; |
|
136 | - if (!isset($classparams['spaces_in_subdirs'])) |
|
137 | - $classparams['spaces_in_subdirs'] = false; |
|
138 | - if (!isset($classparams['allow_zerosized'])) |
|
139 | - $classparams['allow_zerosized'] = false; |
|
140 | - if (!isset($classparams['duplicate'])) |
|
141 | - $classparams['duplicate'] = 'rename'; |
|
142 | - if (!isset($classparams['dirperm'])) |
|
143 | - $classparams['dirperm'] = 0755; |
|
144 | - if (!isset($classparams['fileperm'])) |
|
145 | - $classparams['fileperm'] = 0644; |
|
152 | + } |
|
153 | + if (!isset($classparams['session_regenerate'])) { |
|
154 | + $classparams['session_regenerate'] = false; |
|
155 | + } |
|
156 | + if (!isset($classparams['create_destdir'])) { |
|
157 | + $classparams['create_destdir'] = true; |
|
158 | + } |
|
159 | + if (!isset($classparams['allow_subdirs'])) { |
|
160 | + $classparams['allow_subdirs'] = false; |
|
161 | + } |
|
162 | + if (!isset($classparams['spaces_in_subdirs'])) { |
|
163 | + $classparams['spaces_in_subdirs'] = false; |
|
164 | + } |
|
165 | + if (!isset($classparams['allow_zerosized'])) { |
|
166 | + $classparams['allow_zerosized'] = false; |
|
167 | + } |
|
168 | + if (!isset($classparams['duplicate'])) { |
|
169 | + $classparams['duplicate'] = 'rename'; |
|
170 | + } |
|
171 | + if (!isset($classparams['dirperm'])) { |
|
172 | + $classparams['dirperm'] = 0755; |
|
173 | + } |
|
174 | + if (!isset($classparams['fileperm'])) { |
|
175 | + $classparams['fileperm'] = 0644; |
|
176 | + } |
|
146 | 177 | if (!isset($classparams['destdir'])) { |
147 | - if ($obd != '') |
|
148 | - $classparams['destdir'] = $obd; |
|
149 | - else |
|
150 | - $classparams['destdir'] = '/var/tmp/jupload_test'; |
|
151 | - }else{ |
|
178 | + if ($obd != '') { |
|
179 | + $classparams['destdir'] = $obd; |
|
180 | + } else { |
|
181 | + $classparams['destdir'] = '/var/tmp/jupload_test'; |
|
182 | + } |
|
183 | + } else{ |
|
152 | 184 | $classparams['destdir']=str_replace('~',' ',$classparams['destdir']); |
153 | 185 | } |
154 | 186 | if ($classparams['create_destdir']) { |
@@ -156,31 +188,43 @@ discard block |
||
156 | 188 | @mkdir($classparams['destdir'], $classparams['dirperm']); |
157 | 189 | umask($_umask); |
158 | 190 | } |
159 | - if (!is_dir($classparams['destdir']) && is_writable($classparams['destdir'])) |
|
160 | - $this->abort('Destination dir not accessible'); |
|
161 | - if (!isset($classparams['tmp_prefix'])) |
|
162 | - $classparams['tmp_prefix'] = 'jutmp.'; |
|
163 | - if (!isset($classparams['var_prefix'])) |
|
164 | - $classparams['var_prefix'] = 'juvar.'; |
|
165 | - if (!isset($classparams['jscript_wrapper'])) |
|
166 | - $classparams['jscript_wrapper'] = 'JUploadSetProperty'; |
|
167 | - if (!isset($classparams['tag_jscript'])) |
|
168 | - $classparams['tag_jscript'] = '<!--JUPLOAD_JSCRIPT-->'; |
|
169 | - if (!isset($classparams['tag_applet'])) |
|
170 | - $classparams['tag_applet'] = '<!--JUPLOAD_APPLET-->'; |
|
171 | - if (!isset($classparams['tag_flist'])) |
|
172 | - $classparams['tag_flist'] = '<!--JUPLOAD_FILES-->'; |
|
173 | - if (!isset($classparams['http_flist_start'])) |
|
174 | - $classparams['http_flist_start'] = |
|
191 | + if (!is_dir($classparams['destdir']) && is_writable($classparams['destdir'])) { |
|
192 | + $this->abort('Destination dir not accessible'); |
|
193 | + } |
|
194 | + if (!isset($classparams['tmp_prefix'])) { |
|
195 | + $classparams['tmp_prefix'] = 'jutmp.'; |
|
196 | + } |
|
197 | + if (!isset($classparams['var_prefix'])) { |
|
198 | + $classparams['var_prefix'] = 'juvar.'; |
|
199 | + } |
|
200 | + if (!isset($classparams['jscript_wrapper'])) { |
|
201 | + $classparams['jscript_wrapper'] = 'JUploadSetProperty'; |
|
202 | + } |
|
203 | + if (!isset($classparams['tag_jscript'])) { |
|
204 | + $classparams['tag_jscript'] = '<!--JUPLOAD_JSCRIPT-->'; |
|
205 | + } |
|
206 | + if (!isset($classparams['tag_applet'])) { |
|
207 | + $classparams['tag_applet'] = '<!--JUPLOAD_APPLET-->'; |
|
208 | + } |
|
209 | + if (!isset($classparams['tag_flist'])) { |
|
210 | + $classparams['tag_flist'] = '<!--JUPLOAD_FILES-->'; |
|
211 | + } |
|
212 | + if (!isset($classparams['http_flist_start'])) { |
|
213 | + $classparams['http_flist_start'] = |
|
175 | 214 | "<table border='1'><TR><TH>Filename</TH><TH>file size</TH><TH>Relative path</TH><TH>Full name</TH><TH>md5sum</TH><TH>Specific parameters</TH></TR>"; |
176 | - if (!isset($classparams['http_flist_end'])) |
|
177 | - $classparams['http_flist_end'] = "</table>\n"; |
|
178 | - if (!isset($classparams['http_flist_file_before'])) |
|
179 | - $classparams['http_flist_file_before'] = "<tr><td>"; |
|
180 | - if (!isset($classparams['http_flist_file_between'])) |
|
181 | - $classparams['http_flist_file_between'] = "</td><td>"; |
|
182 | - if (!isset($classparams['http_flist_file_after'])) |
|
183 | - $classparams['http_flist_file_after'] = "</td></tr>\n"; |
|
215 | + } |
|
216 | + if (!isset($classparams['http_flist_end'])) { |
|
217 | + $classparams['http_flist_end'] = "</table>\n"; |
|
218 | + } |
|
219 | + if (!isset($classparams['http_flist_file_before'])) { |
|
220 | + $classparams['http_flist_file_before'] = "<tr><td>"; |
|
221 | + } |
|
222 | + if (!isset($classparams['http_flist_file_between'])) { |
|
223 | + $classparams['http_flist_file_between'] = "</td><td>"; |
|
224 | + } |
|
225 | + if (!isset($classparams['http_flist_file_after'])) { |
|
226 | + $classparams['http_flist_file_after'] = "</td></tr>\n"; |
|
227 | + } |
|
184 | 228 | |
185 | 229 | $this->appletparams = $appletparams; |
186 | 230 | $this->classparams = $classparams; |
@@ -289,14 +333,16 @@ discard block |
||
289 | 333 | $ret .= ' height = "'.$params['height'].'"'.$N; |
290 | 334 | $ret .= ' name = "'.$params['name'].'">'.$N; |
291 | 335 | foreach ($params as $key => $val) { |
292 | - if ($key !== 'width' && $key !== 'height') |
|
293 | - $ret .= ' <param name = "'.$key.'" value = "'.$val.'" />'.$N; |
|
336 | + if ($key !== 'width' && $key !== 'height') { |
|
337 | + $ret .= ' <param name = "'.$key.'" value = "'.$val.'" />'.$N; |
|
338 | + } |
|
294 | 339 | } |
295 | 340 | $ret .= ' <comment>'.$N; |
296 | 341 | $ret .= ' <embed'.$N; |
297 | 342 | $ret .= ' type = "application/x-java-applet;version=1.5"'.$N; |
298 | - foreach ($params as $key => $val) |
|
299 | - $ret .= ' '.$key.' = "'.$val.'"'.$N; |
|
343 | + foreach ($params as $key => $val) { |
|
344 | + $ret .= ' '.$key.' = "'.$val.'"'.$N; |
|
345 | + } |
|
300 | 346 | $ret .= ' pluginspage = "http://java.sun.com/products/plugin/index.html#download">'.$N; |
301 | 347 | $ret .= ' <noembed>'.$N; |
302 | 348 | $ret .= ' Java 1.5 or higher plugin required.'.$N; |
@@ -309,15 +355,17 @@ discard block |
||
309 | 355 | |
310 | 356 | private function abort($msg = '') { |
311 | 357 | $this->cleanup(); |
312 | - if ($msg != '') |
|
313 | - die(str_replace('(.*)',$msg,$this->appletparams['stringUploadError'])."\n"); |
|
358 | + if ($msg != '') { |
|
359 | + die(str_replace('(.*)',$msg,$this->appletparams['stringUploadError'])."\n"); |
|
360 | + } |
|
314 | 361 | exit; |
315 | 362 | } |
316 | 363 | |
317 | 364 | private function warning($msg = '') { |
318 | 365 | $this->cleanup(); |
319 | - if ($msg != '') |
|
320 | - echo('WARNING: '.$msg."\n"); |
|
366 | + if ($msg != '') { |
|
367 | + echo('WARNING: '.$msg."\n"); |
|
368 | + } |
|
321 | 369 | echo $this->appletparams['stringUploadSuccess']."\n"; |
322 | 370 | exit; |
323 | 371 | } |
@@ -325,8 +373,9 @@ discard block |
||
325 | 373 | private function cleanup() { |
326 | 374 | // remove all uploaded files of *this* request |
327 | 375 | if (isset($_FILES)) { |
328 | - foreach ($_FILES as $key => $val) |
|
329 | - @unlink($val['tmp_name']); |
|
376 | + foreach ($_FILES as $key => $val) { |
|
377 | + @unlink($val['tmp_name']); |
|
378 | + } |
|
330 | 379 | } |
331 | 380 | // remove accumulated file, if any. |
332 | 381 | @unlink($this->classparams['destdir'].'/'.$this->classparams['tmp_prefix'].session_id()); |
@@ -348,8 +397,9 @@ discard block |
||
348 | 397 | umask($_umask); |
349 | 398 | } |
350 | 399 | } |
351 | - if (!is_dir($path) && is_writable($path)) |
|
352 | - $this->abort('Destination dir not accessible'); |
|
400 | + if (!is_dir($path) && is_writable($path)) { |
|
401 | + $this->abort('Destination dir not accessible'); |
|
402 | + } |
|
353 | 403 | } |
354 | 404 | |
355 | 405 | /** |
@@ -370,8 +420,9 @@ discard block |
||
370 | 420 | $subdir = str_replace(' ','_',$subdir); |
371 | 421 | } |
372 | 422 | // recursively create subdir |
373 | - if (!$this->classparams['demo_mode']) |
|
374 | - $this->mkdirp($subdir); |
|
423 | + if (!$this->classparams['demo_mode']) { |
|
424 | + $this->mkdirp($subdir); |
|
425 | + } |
|
375 | 426 | // append a slash |
376 | 427 | $subdir .= '/'; |
377 | 428 | } else { |
@@ -505,9 +556,10 @@ discard block |
||
505 | 556 | $msg = $_POST['log']; |
506 | 557 | mail($this->classparams['errormail'], $_POST['description'], $msg); |
507 | 558 | } else { |
508 | - if (isset($_SERVER['SERVER_ADMIN'])) |
|
509 | - mail($_SERVER['SERVER_ADMIN'], 'Empty jupload error log', |
|
559 | + if (isset($_SERVER['SERVER_ADMIN'])) { |
|
560 | + mail($_SERVER['SERVER_ADMIN'], 'Empty jupload error log', |
|
510 | 561 | 'An empty log has just been posted.'); |
562 | + } |
|
511 | 563 | $this->logPHPDebug('receive_debug_log', 'Empty error log received'); |
512 | 564 | } |
513 | 565 | exit; |
@@ -654,20 +706,24 @@ discard block |
||
654 | 706 | // This is the last chunk. Check total lenght and |
655 | 707 | // rename it to it's final name. |
656 | 708 | $dlen = filesize($dstname); |
657 | - if ($dlen != $_SESSION['RF'][$this->classparams['var_prefix'].'size']) |
|
658 | - $this->abort('file size mismatch'); |
|
709 | + if ($dlen != $_SESSION['RF'][$this->classparams['var_prefix'].'size']) { |
|
710 | + $this->abort('file size mismatch'); |
|
711 | + } |
|
659 | 712 | if ($this->appletparams['sendMD5Sum'] === 'true' ) { |
660 | - if ($md5sums[$cnt] != md5_file($dstname)) |
|
661 | - $this->abort('MD5 checksum mismatch'); |
|
713 | + if ($md5sums[$cnt] != md5_file($dstname)) { |
|
714 | + $this->abort('MD5 checksum mismatch'); |
|
715 | + } |
|
662 | 716 | } |
663 | 717 | // remove zero sized files |
664 | 718 | if (($dlen > 0) || $this->classparams['allow_zerosized']) { |
665 | 719 | $dstfinal = $this->dstfinal($files_data['name'],$files_data['relativePath']); |
666 | - if (!rename($dstname, $dstfinal)) |
|
667 | - $this->abort('rename IO error'); |
|
720 | + if (!rename($dstname, $dstfinal)) { |
|
721 | + $this->abort('rename IO error'); |
|
722 | + } |
|
668 | 723 | $_umask = umask(0); // override the system mask |
669 | - if (!chmod($dstfinal, $this->classparams['fileperm'])) |
|
670 | - $this->abort('chmod IO error'); |
|
724 | + if (!chmod($dstfinal, $this->classparams['fileperm'])) { |
|
725 | + $this->abort('chmod IO error'); |
|
726 | + } |
|
671 | 727 | umask($_umask); |
672 | 728 | $files_data['size'] = filesize($dstfinal); |
673 | 729 | $files_data['fullName'] = $dstfinal; |
@@ -682,15 +738,18 @@ discard block |
||
682 | 738 | } else { |
683 | 739 | // Got a single file upload. Trivial. |
684 | 740 | if ($this->appletparams['sendMD5Sum'] === 'true' ) { |
685 | - if ($md5sums[$cnt] != md5_file($tmpname)) |
|
686 | - $this->abort('MD5 checksum mismatch'); |
|
741 | + if ($md5sums[$cnt] != md5_file($tmpname)) { |
|
742 | + $this->abort('MD5 checksum mismatch'); |
|
743 | + } |
|
687 | 744 | } |
688 | 745 | $dstfinal = $this->dstfinal($files_data['name'],$files_data['relativePath']); |
689 | - if (!rename($tmpname, $dstfinal)) |
|
690 | - $this->abort('rename IO error'); |
|
746 | + if (!rename($tmpname, $dstfinal)) { |
|
747 | + $this->abort('rename IO error'); |
|
748 | + } |
|
691 | 749 | $_umask = umask(0); // override the system mask |
692 | - if (!chmod($dstfinal, $this->classparams['fileperm'])) |
|
693 | - $this->abort('chmod IO error'); |
|
750 | + if (!chmod($dstfinal, $this->classparams['fileperm'])) { |
|
751 | + $this->abort('chmod IO error'); |
|
752 | + } |
|
694 | 753 | umask($_umask); |
695 | 754 | $files_data['size'] = filesize($dstfinal); |
696 | 755 | $files_data['fullName'] = $dstfinal; |
@@ -5,7 +5,7 @@ |
||
5 | 5 | <style> |
6 | 6 | body{padding:0px; margin:0px;} |
7 | 7 | </style> |
8 | - <meta http-equiv="refresh" content="3;url=index.php?path=<?php echo strip_tags(preg_replace( "/[^a-zA-Z0-9\.\[\]_| -]/", '',$_GET['path'])); ?>"> |
|
8 | + <meta http-equiv="refresh" content="3;url=index.php?path=<?php echo strip_tags(preg_replace("/[^a-zA-Z0-9\.\[\]_| -]/", '', $_GET['path'])); ?>"> |
|
9 | 9 | </head> |
10 | 10 | <body> |
11 | 11 | <center><br/><br/> |
@@ -17,8 +17,8 @@ discard block |
||
17 | 17 | if($path==$current_path) $cycle=false; |
18 | 18 | |
19 | 19 | if(file_exists($path."config.php")){ |
20 | - require_once($path."config.php"); |
|
21 | - $cycle=false; |
|
20 | + require_once($path."config.php"); |
|
21 | + $cycle=false; |
|
22 | 22 | } |
23 | 23 | $path=fix_dirname($path)."/"; |
24 | 24 | } |
@@ -44,11 +44,11 @@ discard block |
||
44 | 44 | * @param $file The array wich contains info about all uploaded files. |
45 | 45 | */ |
46 | 46 | function handle_uploaded_files($juploadPhpSupportClass, $files) { |
47 | - return |
|
48 | - "<P>We are in the 'handle_uploaded_files' callback function, in the index.php script. To avoid double coding, we " |
|
49 | - . "just call the default behavior of the JUpload PHP class. Just replace this by your code...</P>" |
|
50 | - . $juploadPhpSupportClass->defaultAfterUploadManagement(); |
|
51 | - ; |
|
47 | + return |
|
48 | + "<P>We are in the 'handle_uploaded_files' callback function, in the index.php script. To avoid double coding, we " |
|
49 | + . "just call the default behavior of the JUpload PHP class. Just replace this by your code...</P>" |
|
50 | + . $juploadPhpSupportClass->defaultAfterUploadManagement(); |
|
51 | + ; |
|
52 | 52 | |
53 | 53 | } |
54 | 54 | //////////////////////////////////////////////////////////////////////////////////////////////////////// |
@@ -65,17 +65,17 @@ discard block |
||
65 | 65 | // see all details http://jupload.sourceforge.net/howto-customization.html |
66 | 66 | // |
67 | 67 | $appletParameters = array( |
68 | - //Default value is ... maximum size for a file on the current FS. 2G is problably too much already. |
|
68 | + //Default value is ... maximum size for a file on the current FS. 2G is problably too much already. |
|
69 | 69 | 'maxFileSize' => $JAVAMaxSizeUpload.'G', |
70 | 70 | // |
71 | 71 | //In the sourceforge project structure, the applet jar file is one folder below. Default |
72 | 72 | //configuration is ok, if wjhk.jupload.jar is in the same folder as the script containing this call. |
73 | 73 | 'archive' => 'wjhk.jupload.jar', |
74 | - 'showLogWindow' => 'false', |
|
75 | - 'width' => '100%', |
|
76 | - 'height' =>'358px', |
|
77 | - 'name' => 'No limit Uploader', |
|
78 | - 'allowedFileExtensions' => implode('/',$ext), |
|
74 | + 'showLogWindow' => 'false', |
|
75 | + 'width' => '100%', |
|
76 | + 'height' =>'358px', |
|
77 | + 'name' => 'No limit Uploader', |
|
78 | + 'allowedFileExtensions' => implode('/',$ext), |
|
79 | 79 | //To manage, other jar files, like the ftp jar files if postURL is an FTP URL: |
80 | 80 | //'archive' => 'wjhk.jupload.jar,jakarta-commons-oro.jar,jakarta-commons-net.jar', |
81 | 81 | // |
@@ -94,13 +94,13 @@ discard block |
||
94 | 94 | // for htaccess protected folders |
95 | 95 | if((isset($_SERVER['PHP_AUTH_USER']) && $_SERVER['PHP_AUTH_USER'] != '') && $_SERVER['PHP_AUTH_USER'] != '' && $_SERVER['PHP_AUTH_USER'] != '') |
96 | 96 | { |
97 | - $appletParameters['specificHeaders'] = 'Authorization: Basic '.base64_encode($_SERVER['PHP_AUTH_USER'].":".$_SERVER['PHP_AUTH_PW']); |
|
97 | + $appletParameters['specificHeaders'] = 'Authorization: Basic '.base64_encode($_SERVER['PHP_AUTH_USER'].":".$_SERVER['PHP_AUTH_PW']); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | // |
101 | 101 | //Then: the jupload PHP class parameters |
102 | 102 | $classParameters = array( |
103 | - //Files won't be stored on the server. Useful for first tests of the applet behavior ... and sourceforge demo site ! |
|
103 | + //Files won't be stored on the server. Useful for first tests of the applet behavior ... and sourceforge demo site ! |
|
104 | 104 | 'demo_mode' => false, |
105 | 105 | // |
106 | 106 | //Allow creation of subdirectories, when uploading several folders/files (drag and drop a folder on the applet to use it). |
@@ -1,33 +1,33 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | include '../config/config.php'; |
4 | -if(!$java_upload) die('forbidden'); |
|
5 | -if($_SESSION['RF']["verify"] !== "RESPONSIVEfilemanager") die('forbidden'); |
|
4 | +if (!$java_upload) die('forbidden'); |
|
5 | +if ($_SESSION['RF']["verify"] !== "RESPONSIVEfilemanager") die('forbidden'); |
|
6 | 6 | |
7 | 7 | //Let's load the 'interesting' stuff ... ;-) |
8 | 8 | include 'jupload.php'; |
9 | 9 | include '../include/utils.php'; |
10 | 10 | |
11 | -$path=$current_path.$_GET['path']; |
|
12 | -$cycle=true; |
|
13 | -$max_cycles=50; |
|
14 | -$i=0; |
|
15 | -while($cycle && $i<$max_cycles){ |
|
11 | +$path = $current_path.$_GET['path']; |
|
12 | +$cycle = true; |
|
13 | +$max_cycles = 50; |
|
14 | +$i = 0; |
|
15 | +while ($cycle && $i < $max_cycles) { |
|
16 | 16 | $i++; |
17 | - if($path==$current_path) $cycle=false; |
|
17 | + if ($path == $current_path) $cycle = false; |
|
18 | 18 | |
19 | - if(file_exists($path."config.php")){ |
|
19 | + if (file_exists($path."config.php")) { |
|
20 | 20 | require_once($path."config.php"); |
21 | - $cycle=false; |
|
21 | + $cycle = false; |
|
22 | 22 | } |
23 | - $path=fix_dirname($path)."/"; |
|
23 | + $path = fix_dirname($path)."/"; |
|
24 | 24 | } |
25 | 25 | |
26 | -$path="../".$current_path.$_GET['path']; |
|
26 | +$path = "../".$current_path.$_GET['path']; |
|
27 | 27 | |
28 | -if(strpos($_GET['path'],'../')!==FALSE || strpos($_GET['path'],'./')!==FALSE || strpos($_GET['path'],'/')===0) die ('path error'); |
|
28 | +if (strpos($_GET['path'], '../') !== FALSE || strpos($_GET['path'], './') !== FALSE || strpos($_GET['path'], '/') === 0) die ('path error'); |
|
29 | 29 | |
30 | -$path=str_replace(' ','~',$path); |
|
30 | +$path = str_replace(' ', '~', $path); |
|
31 | 31 | //////////////////////////////////////////////////////////////////////////////////////////////////////// |
32 | 32 | /////////////// The user callback function, that can be called after upload //////////////////////// |
33 | 33 | //////////////////////////////////////////////////////////////////////////////////////////////////////// |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | 'width' => '100%', |
76 | 76 | 'height' =>'358px', |
77 | 77 | 'name' => 'No limit Uploader', |
78 | - 'allowedFileExtensions' => implode('/',$ext), |
|
78 | + 'allowedFileExtensions' => implode('/', $ext), |
|
79 | 79 | //To manage, other jar files, like the ftp jar files if postURL is an FTP URL: |
80 | 80 | //'archive' => 'wjhk.jupload.jar,jakarta-commons-oro.jar,jakarta-commons-net.jar', |
81 | 81 | // |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | ); |
93 | 93 | |
94 | 94 | // for htaccess protected folders |
95 | -if((isset($_SERVER['PHP_AUTH_USER']) && $_SERVER['PHP_AUTH_USER'] != '') && $_SERVER['PHP_AUTH_USER'] != '' && $_SERVER['PHP_AUTH_USER'] != '') |
|
95 | +if ((isset($_SERVER['PHP_AUTH_USER']) && $_SERVER['PHP_AUTH_USER'] != '') && $_SERVER['PHP_AUTH_USER'] != '' && $_SERVER['PHP_AUTH_USER'] != '') |
|
96 | 96 | { |
97 | 97 | $appletParameters['specificHeaders'] = 'Authorization: Basic '.base64_encode($_SERVER['PHP_AUTH_USER'].":".$_SERVER['PHP_AUTH_PW']); |
98 | 98 | } |
@@ -1,8 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | include '../config/config.php'; |
4 | -if(!$java_upload) die('forbidden'); |
|
5 | -if($_SESSION['RF']["verify"] !== "RESPONSIVEfilemanager") die('forbidden'); |
|
4 | +if(!$java_upload) { |
|
5 | + die('forbidden'); |
|
6 | +} |
|
7 | +if($_SESSION['RF']["verify"] !== "RESPONSIVEfilemanager") { |
|
8 | + die('forbidden'); |
|
9 | +} |
|
6 | 10 | |
7 | 11 | //Let's load the 'interesting' stuff ... ;-) |
8 | 12 | include 'jupload.php'; |
@@ -14,7 +18,9 @@ discard block |
||
14 | 18 | $i=0; |
15 | 19 | while($cycle && $i<$max_cycles){ |
16 | 20 | $i++; |
17 | - if($path==$current_path) $cycle=false; |
|
21 | + if($path==$current_path) { |
|
22 | + $cycle=false; |
|
23 | + } |
|
18 | 24 | |
19 | 25 | if(file_exists($path."config.php")){ |
20 | 26 | require_once($path."config.php"); |
@@ -25,7 +31,9 @@ discard block |
||
25 | 31 | |
26 | 32 | $path="../".$current_path.$_GET['path']; |
27 | 33 | |
28 | -if(strpos($_GET['path'],'../')!==FALSE || strpos($_GET['path'],'./')!==FALSE || strpos($_GET['path'],'/')===0) die ('path error'); |
|
34 | +if(strpos($_GET['path'],'../')!==FALSE || strpos($_GET['path'],'./')!==FALSE || strpos($_GET['path'],'/')===0) { |
|
35 | + die ('path error'); |
|
36 | +} |
|
29 | 37 | |
30 | 38 | $path=str_replace(' ','~',$path); |
31 | 39 | //////////////////////////////////////////////////////////////////////////////////////////////////////// |