View | Details | Raw Unified | Return to bug 32888 | Differences between
and this patch

Collapse All | Expand All

(-)univention-management-console-web-server (-23 / +35 lines)
 Lines 633-665    Link Here 
633
633
634
		options = []
634
		options = []
635
		body = {}
635
		body = {}
636
		for iid, ifield in args.iteritems():
637
			if isinstance(ifield, cherrypy._cpreqbody.Part):
638
				# field is a FieldStorage object
639
				store = ifield
640
				tmpfile = _upload_manager.add(req.id, store)
641
636
642
				# check if filesize is allowed
637
		def _check_field_storage(iid, ifield):
643
				st = os.stat(tmpfile)
638
			# field is a FieldStorage object
644
				max_size = int(configRegistry.get('umc/server/upload/max', 64)) * 1024
639
			store = ifield
645
				if st.st_size > max_size:
640
			tmpfile = _upload_manager.add(req.id, store)
646
					self._log('warn', 'file of size %d could not be uploaded' % (st.st_size))
647
					raise cherrypy.HTTPError(httplib.BAD_REQUEST, 'The size of the uploaded file is too large')
648
641
649
				# check if enough free space is available
642
			# check if filesize is allowed
650
				min_size = int(configRegistry.get('umc/server/upload/min_free_space', 51200))  # kilobyte
643
			st = os.stat(tmpfile)
651
				s = os.statvfs(tmpfile)
644
			max_size = int(configRegistry.get('umc/server/upload/max', 64)) * 1024
652
				free_disk_space = s.f_bavail * s.f_frsize / 1024  # kilobyte
645
			if st.st_size > max_size:
653
				if free_disk_space < min_size:
646
				self._log('warn', 'file of size %d could not be uploaded' % (st.st_size))
654
					self._log('error', 'there is not enough free space to upload files')
647
				raise cherrypy.HTTPError(httplib.BAD_REQUEST, 'The size of the uploaded file is too large')
655
					raise cherrypy.HTTPError(httplib.BAD_REQUEST, 'There is not enough free space on disk')
656
648
657
				filename = store.filename
649
			# check if enough free space is available
658
				# some security
650
			min_size = int(configRegistry.get('umc/server/upload/min_free_space', 51200))  # kilobyte
659
				for c in ('<>/'):
651
			s = os.statvfs(tmpfile)
660
					filename = filename.replace(c, '_')
652
			free_disk_space = s.f_bavail * s.f_frsize / 1024  # kilobyte
653
			if free_disk_space < min_size:
654
				self._log('error', 'there is not enough free space to upload files')
655
				raise cherrypy.HTTPError(httplib.BAD_REQUEST, 'There is not enough free space on disk')
661
656
662
				options.append({'filename': filename, 'name': store.name, 'tmpfile': tmpfile})
657
			filename = store.filename
658
			# some security
659
			for c in ('<>/'):
660
				filename = filename.replace(c, '_')
661
662
			options.append({'filename': filename, 'name': store.name, 'tmpfile': tmpfile})
663
664
665
		for iid, ifield in args.iteritems():
666
			if isinstance(ifield, cherrypy._cpreqbody.Part):
667
				_check_field_storage(iid, ifield)
668
			elif isinstance(ifield, list):
669
				for jfield in ifield:
670
					if isinstance(jfield, cherrypy._cpreqbody.Part):
671
						_check_field_storage(iid, jfield)
672
					else:
673
						# we cannot handle any other type
674
						CORE.warn('Unknown type of multipart/form entry: %s=%s' % (iid, ifield))
663
			elif isinstance(ifield, basestring):
675
			elif isinstance(ifield, basestring):
664
				# field is a string :)
676
				# field is a string :)
665
				body[iid] = ifield
677
				body[iid] = ifield
(-)umc/de.po (-41 / +44 lines)
 Lines 7-13    Link Here 
7
msgstr ""
7
msgstr ""
8
"Project-Id-Version: univention-management-console-frontend\n"
8
"Project-Id-Version: univention-management-console-frontend\n"
9
"Report-Msgid-Bugs-To: packages@univention.de\n"
9
"Report-Msgid-Bugs-To: packages@univention.de\n"
10
"POT-Creation-Date: 2015-03-31 17:55+0200\n"
10
"POT-Creation-Date: 2015-04-15 14:34+0200\n"
11
"PO-Revision-Date: 2013-09-12 11:31+0200\n"
11
"PO-Revision-Date: 2013-09-12 11:31+0200\n"
12
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
"Language-Team: LANGUAGE <LL@li.org>\n"
13
"Language-Team: LANGUAGE <LL@li.org>\n"
 Lines 17-23    Link Here 
17
"Content-Transfer-Encoding: 8bit\n"
17
"Content-Transfer-Encoding: 8bit\n"
18
18
19
#: umc/tools.js:1577
19
#: umc/tools.js:1577
20
#, python-brace-format
21
msgid "\"${moduleName}\" module"
20
msgid "\"${moduleName}\" module"
22
msgstr "Modul \"${moduleName}\""
21
msgstr "Modul \"${moduleName}\""
23
22
 Lines 26-32    Link Here 
26
msgid "%(label)s (retype)"
25
msgid "%(label)s (retype)"
27
msgstr "%(label)s (Wiederholung)"
26
msgstr "%(label)s (Wiederholung)"
28
27
29
#: umc/widgets/Grid.js:786
28
#: umc/widgets/Grid.js:812
30
#, python-format
29
#, python-format
31
msgid "%d entries of %d selected"
30
msgid "%d entries of %d selected"
32
msgstr "%d Einträge von %d ausgewählt"
31
msgstr "%d Einträge von %d ausgewählt"
 Lines 45-51    Link Here 
45
msgid "%s: %s"
44
msgid "%s: %s"
46
msgstr "%s: %s"
45
msgstr "%s: %s"
47
46
48
#: umc/widgets/Grid.js:791
47
#: umc/widgets/Grid.js:817
49
#, python-format
48
#, python-format
50
msgid "1 entry of %d selected"
49
msgid "1 entry of %d selected"
51
msgstr "1 Eintrag von %d ausgewählt"
50
msgstr "1 Eintrag von %d ausgewählt"
 Lines 143-150    Link Here 
143
"installation on this system.</p>"
142
"installation on this system.</p>"
144
msgstr ""
143
msgstr ""
145
"<p>Die Lizenz wurde erfolgreich aktualisiert.</p><p>Sie können nun mit dem "
144
"<p>Die Lizenz wurde erfolgreich aktualisiert.</p><p>Sie können nun mit dem "
146
"Einsatz von UMC fortfahren, alle Anwendungen des Univention App Centers stehen "
145
"Einsatz von UMC fortfahren, alle Anwendungen des Univention App Centers "
147
"dem System nun zur Installation zur Verfügung.</p>"
146
"stehen dem System nun zur Installation zur Verfügung.</p>"
148
147
149
#: umc/app/FinishedPage.js:44
148
#: umc/app/FinishedPage.js:44
150
msgid ""
149
msgid ""
 Lines 164-171    Link Here 
164
msgstr ""
163
msgstr ""
165
"<p>Sie können nun eine gültige E-Mail-Adresse angeben, um das UCS-System für "
164
"<p>Sie können nun eine gültige E-Mail-Adresse angeben, um das UCS-System für "
166
"die Verwendung des App Centers freizuschalten. Im nächsten Schritt können "
165
"die Verwendung des App Centers freizuschalten. Im nächsten Schritt können "
167
"Sie die Lizenzdatei hochladen, die an Ihre E-Mail-Adresse gesendet wird.</"
166
"Sie die Lizenzdatei hochladen, die an Ihre E-Mail-Adresse gesendet wird.</p>"
168
"p>"
169
167
170
#: umc/app/HelpPage.js:48
168
#: umc/app/HelpPage.js:48
171
msgid ""
169
msgid ""
 Lines 195-206    Link Here 
195
msgid "About UMC"
193
msgid "About UMC"
196
msgstr "Über UMC"
194
msgstr "Über UMC"
197
195
196
#: umc/widgets/UnixAccessRights.js:96
198
#: umc/widgets/UnixAccessRightsExtended.js:96
197
#: umc/widgets/UnixAccessRightsExtended.js:96
199
#: umc/widgets/UnixAccessRights.js:96
200
msgid "Access"
198
msgid "Access"
201
msgstr "Zugriff"
199
msgstr "Zugriff"
202
200
203
#: umc/app/ActivationPage.js:40 umc/app/ActivationDialog.js:55
201
#: umc/app/ActivationDialog.js:55 umc/app/ActivationPage.js:40
204
msgid "Activation of Univention Corporate Server"
202
msgid "Activation of Univention Corporate Server"
205
msgstr "Aktivierung von Univention Corporate Server"
203
msgstr "Aktivierung von Univention Corporate Server"
206
204
 Lines 264-275    Link Here 
264
msgid "Back to overview"
262
msgid "Back to overview"
265
msgstr "Zurück zur Übersicht"
263
msgstr "Zurück zur Übersicht"
266
264
267
#: umc/tools.js:231 umc/app.js:1710 umc/widgets/MultiObjectSelect.js:137
265
#: umc/tools.js:231 umc/app.js:1710 umc/dialog.js:352
268
#: umc/widgets/Wizard.js:163 umc/dialog.js:352
266
#: umc/widgets/MultiObjectSelect.js:137 umc/widgets/Wizard.js:163
269
msgid "Cancel"
267
msgid "Cancel"
270
msgstr "Abbrechen"
268
msgstr "Abbrechen"
271
269
272
#: umc/widgets/Uploader.js:110
270
#: umc/widgets/Uploader.js:113
273
msgid "Clear data"
271
msgid "Clear data"
274
msgstr "Daten leeren"
272
msgstr "Daten leeren"
275
273
 Lines 338-350    Link Here 
338
msgid "Fetching information from the server failed!"
336
msgid "Fetching information from the server failed!"
339
msgstr "Das Holen von Informationen vom Server schlug fehl!"
337
msgstr "Das Holen von Informationen vom Server schlug fehl!"
340
338
341
#: umc/widgets/Uploader.js:158
342
#, python-format
343
msgid "File cannot be uploaded, its maximum size may be %.1f MB."
344
msgstr ""
345
"Die Datei kann nicht hochgeladen werden, ihre Maximalgröße darf %.1f MB "
346
"nicht überschreiten."
347
348
#: umc/widgets/Wizard.js:159
339
#: umc/widgets/Wizard.js:159
349
msgid "Finish"
340
msgid "Finish"
350
msgstr "Fertigstellen"
341
msgstr "Fertigstellen"
 Lines 353-360    Link Here 
353
msgid "Further Information"
344
msgid "Further Information"
354
msgstr "Weiterführende Informationen"
345
msgstr "Weiterführende Informationen"
355
346
347
#: umc/widgets/UnixAccessRights.js:76
356
#: umc/widgets/UnixAccessRightsExtended.js:76
348
#: umc/widgets/UnixAccessRightsExtended.js:76
357
#: umc/widgets/UnixAccessRights.js:76
358
msgid "Group"
349
msgid "Group"
359
msgstr "Gruppe"
350
msgstr "Gruppe"
360
351
 Lines 485-491    Link Here 
485
msgid "Next"
476
msgid "Next"
486
msgstr "Weiter"
477
msgstr "Weiter"
487
478
488
#: umc/widgets/Grid.js:788
479
#: umc/widgets/Grid.js:814
489
msgid "No entries could be found"
480
msgid "No entries could be found"
490
msgstr "Es konnten keine Einträge gefunden werden"
481
msgstr "Es konnten keine Einträge gefunden werden"
491
482
 Lines 493-503    Link Here 
493
msgid "No message"
484
msgid "No message"
494
msgstr "Keine Nachricht"
485
msgstr "Keine Nachricht"
495
486
496
#: umc/widgets/Grid.js:765
487
#: umc/widgets/Grid.js:791
497
msgid "No object selected"
488
msgid "No object selected"
498
msgstr "Kein Objekt ausgewählt"
489
msgstr "Kein Objekt ausgewählt"
499
490
500
#: umc/widgets/MultiUploader.js:203
491
#: umc/widgets/MultiUploader.js:206
501
msgid "No upload in progress"
492
msgid "No upload in progress"
502
msgstr "Keine laufende Dateiübertragung"
493
msgstr "Keine laufende Dateiübertragung"
503
494
 Lines 505-513    Link Here 
505
msgid "No valid e-mail address."
496
msgid "No valid e-mail address."
506
msgstr "Keine gültige E-Mail-Adresse."
497
msgstr "Keine gültige E-Mail-Adresse."
507
498
499
#: umc/dialog.js:164 umc/dialog.js:193 umc/dialog.js:217
508
#: umc/dialog/NotificationContainer.js:54
500
#: umc/dialog/NotificationContainer.js:54
509
#: umc/dialog/NotificationContainer.js:204 umc/dialog.js:164 umc/dialog.js:193
501
#: umc/dialog/NotificationContainer.js:204
510
#: umc/dialog.js:217
511
msgid "Notification"
502
msgid "Notification"
512
msgstr "Benachrichtigung"
503
msgstr "Benachrichtigung"
513
504
 Lines 519-531    Link Here 
519
msgid "Open module"
510
msgid "Open module"
520
msgstr "Modul öffnen"
511
msgstr "Modul öffnen"
521
512
513
#: umc/widgets/UnixAccessRights.js:77
522
#: umc/widgets/UnixAccessRightsExtended.js:77
514
#: umc/widgets/UnixAccessRightsExtended.js:77
523
#: umc/widgets/UnixAccessRights.js:77
524
msgid "Others"
515
msgid "Others"
525
msgstr "Andere"
516
msgstr "Andere"
526
517
518
#: umc/widgets/UnixAccessRights.js:75
527
#: umc/widgets/UnixAccessRightsExtended.js:75
519
#: umc/widgets/UnixAccessRightsExtended.js:75
528
#: umc/widgets/UnixAccessRights.js:75
529
msgid "Owner"
520
msgid "Owner"
530
msgstr "Besitzer"
521
msgstr "Besitzer"
531
522
 Lines 539-546    Link Here 
539
"Bitte nehmen Sie sich einen Augenblick Zeit, um die folgenden Informationen "
530
"Bitte nehmen Sie sich einen Augenblick Zeit, um die folgenden Informationen "
540
"bereitzustellen:"
531
"bereitzustellen:"
541
532
533
#: umc/widgets/UnixAccessRights.js:88
542
#: umc/widgets/UnixAccessRightsExtended.js:88
534
#: umc/widgets/UnixAccessRightsExtended.js:88
543
#: umc/widgets/UnixAccessRights.js:88
544
msgid "Read"
535
msgid "Read"
545
msgstr "Lesen"
536
msgstr "Lesen"
546
537
 Lines 548-554    Link Here 
548
msgid "Reload"
539
msgid "Reload"
549
msgstr "Neu laden"
540
msgstr "Neu laden"
550
541
551
#: umc/widgets/MultiUploader.js:123 umc/widgets/MultiObjectSelect.js:287
542
#: umc/widgets/MultiObjectSelect.js:287 umc/widgets/MultiUploader.js:126
552
msgid "Remove"
543
msgid "Remove"
553
msgstr "Entfernen"
544
msgstr "Entfernen"
554
545
 Lines 625-631    Link Here 
625
"probiert."
616
"probiert."
626
617
627
#: umc/tools.js:313
618
#: umc/tools.js:313
628
#, python-brace-format
629
msgid ""
619
msgid ""
630
"So far, the connection to the server could not be established after {time} "
620
"So far, the connection to the server could not be established after {time} "
631
"seconds. This can be a normal behavior. In any case, the process will "
621
"seconds. This can be a normal behavior. In any case, the process will "
 Lines 670-675    Link Here 
670
"Die Aktivierung des UCS-Systems schlug fehl. Bitte wiederholen Sie den "
660
"Die Aktivierung des UCS-Systems schlug fehl. Bitte wiederholen Sie den "
671
"Aktivierungsvorgang über das Benutzermenü oben rechts."
661
"Aktivierungsvorgang über das Benutzermenü oben rechts."
672
662
663
#: umc/widgets/Uploader.js:169
664
#, python-format
665
msgid ""
666
"The following Files cannot be uploaded because they exceed the maximum file "
667
"size: %s The maximum size of a file is %.1f MB."
668
msgstr ""
669
"Die folgenden Dateien können nicht hochgeladen werden, da sie die maximale "
670
"Dateigröße überschreiten: %s Die maximale Größe einer Datei ist %.1f MB."
671
673
#: umc/app/StartupDialog.js:132 umc/app/ActivationDialog.js:147
672
#: umc/app/StartupDialog.js:132 umc/app/ActivationDialog.js:147
674
msgid ""
673
msgid ""
675
"The import of the license failed. Check the integrity of the original file "
674
"The import of the license failed. Check the integrity of the original file "
 Lines 686-692    Link Here 
686
msgid "The password has expired and must be changed."
685
msgid "The password has expired and must be changed."
687
msgstr "Das Passwort ist abgelaufen und muss geändert werden."
686
msgstr "Das Passwort ist abgelaufen und muss geändert werden."
688
687
689
#: umc/dialog/LoginDialog.js:226 umc/widgets/PasswordInputBox.js:122
688
#: umc/widgets/PasswordInputBox.js:122 umc/dialog/LoginDialog.js:226
690
msgid "The passwords do not match, please retype again."
689
msgid "The passwords do not match, please retype again."
691
msgstr "Die Passwörter stimmen nicht überein. Bitte versuchen Sie es erneut."
690
msgstr "Die Passwörter stimmen nicht überein. Bitte versuchen Sie es erneut."
692
691
 Lines 747-754    Link Here 
747
msgid "Updating session data..."
746
msgid "Updating session data..."
748
msgstr "Aktualisieren der Sitzungsdaten..."
747
msgstr "Aktualisieren der Sitzungsdaten..."
749
748
750
#: umc/widgets/InfoUploader.js:43 umc/widgets/MultiUploader.js:104
749
#: umc/widgets/Uploader.js:112 umc/widgets/InfoUploader.js:43
751
#: umc/widgets/Uploader.js:109
750
#: umc/widgets/MultiUploader.js:107
752
msgid "Upload"
751
msgid "Upload"
753
msgstr "Hochladen"
752
msgstr "Hochladen"
754
753
 Lines 760-775    Link Here 
760
msgid "Upload new image"
759
msgid "Upload new image"
761
msgstr "Neues Bild hochladen"
760
msgstr "Neues Bild hochladen"
762
761
763
#: umc/widgets/Uploader.js:260
762
#: umc/widgets/Uploader.js:277
764
msgid "Uploading..."
763
msgid "Uploading..."
765
msgstr "Datenübertragung..."
764
msgstr "Datenübertragung..."
766
765
767
#: umc/widgets/MultiUploader.js:223
766
#: umc/widgets/MultiUploader.js:226
768
#, python-format
767
#, python-format
769
msgid "Uploading... %d of %d files remaining."
768
msgid "Uploading... %d of %d files remaining."
770
msgstr "Dateiübertragung... %d von %d Dateien verbleiben"
769
msgstr "Dateiübertragung... %d von %d Dateien verbleiben"
771
770
772
#: umc/widgets/MultiUploader.js:220
771
#: umc/widgets/MultiUploader.js:223
773
msgid "Uploads finished"
772
msgid "Uploads finished"
774
msgstr "Dateiübertragung beendet"
773
msgstr "Dateiübertragung beendet"
775
774
 Lines 813-820    Link Here 
813
msgid "Welcome to Univention Management Console"
812
msgid "Welcome to Univention Management Console"
814
msgstr "Willkommen bei Univention Management Console"
813
msgstr "Willkommen bei Univention Management Console"
815
814
815
#: umc/widgets/UnixAccessRights.js:92
816
#: umc/widgets/UnixAccessRightsExtended.js:92
816
#: umc/widgets/UnixAccessRightsExtended.js:92
817
#: umc/widgets/UnixAccessRights.js:92
818
msgid "Write"
817
msgid "Write"
819
msgstr "Schreiben"
818
msgstr "Schreiben"
820
819
 Lines 862-868    Link Here 
862
msgid "expected result"
861
msgid "expected result"
863
msgstr "erwartetes Ergebnis"
862
msgstr "erwartetes Ergebnis"
864
863
865
#: umc/widgets/Grid.js:565
864
#: umc/widgets/Grid.js:591
866
msgid "more"
865
msgid "more"
867
msgstr "mehr"
866
msgstr "mehr"
868
867
 Lines 870-876    Link Here 
870
msgid "steps to reproduce the failure"
869
msgid "steps to reproduce the failure"
871
msgstr "Schritte, um den Fehler zu reproduzieren"
870
msgstr "Schritte, um den Fehler zu reproduzieren"
872
871
873
#: umc/app/WelcomePage.js:78 umc/app.js:901
872
#: umc/app.js:901 umc/app/WelcomePage.js:78
874
msgid "umcFeedbackUrl"
873
msgid "umcFeedbackUrl"
875
msgstr "https://www.univention.de/produkt-feedback/"
874
msgstr "https://www.univention.de/produkt-feedback/"
876
875
 Lines 879-885    Link Here 
879
msgstr "http://www.univention.de"
878
msgstr "http://www.univention.de"
880
879
881
#: umc/widgets/ProgressBar.js:176
880
#: umc/widgets/ProgressBar.js:176
882
#, python-brace-format
883
msgid "{number} errors occurred: "
881
msgid "{number} errors occurred: "
884
msgstr "{number} Fehler sind aufgetreten: "
882
msgstr "{number} Fehler sind aufgetreten: "
885
883
 Lines 905-910    Link Here 
905
#~ msgid "Favorites"
903
#~ msgid "Favorites"
906
#~ msgstr "Favoriten"
904
#~ msgstr "Favoriten"
907
905
906
#~ msgid "File cannot be uploaded, its maximum size may be %.1f MB."
907
#~ msgstr ""
908
#~ "Die Datei kann nicht hochgeladen werden, ihre Maximalgröße darf %.1f MB "
909
#~ "nicht überschreiten."
910
908
#~ msgid "Loaded module %s"
911
#~ msgid "Loaded module %s"
909
#~ msgstr "Modul %s wurde geladen"
912
#~ msgstr "Modul %s wurde geladen"
910
913
(-)umc/widgets/Uploader.js (-25 / +42 lines)
 Lines 87-92    Link Here 
87
		//		A size limit for the uploaded file.
87
		//		A size limit for the uploaded file.
88
		maxSize: 524288,
88
		maxSize: 524288,
89
89
90
		//toggle mutliple files selectable
91
		multiFile: false,
92
90
		// make sure that no sizeClass is being set
93
		// make sure that no sizeClass is being set
91
		sizeClass: null,
94
		sizeClass: null,
92
95
 Lines 124-129    Link Here 
124
			this._uploader = new dojox.form.Uploader({
127
			this._uploader = new dojox.form.Uploader({
125
				url: '/umcp/upload' + (this.command ? '/' + this.command : ''),
128
				url: '/umcp/upload' + (this.command ? '/' + this.command : ''),
126
				label: this.buttonLabel,
129
				label: this.buttonLabel,
130
				multiple: this.multiFile,
131
				uploadOnSelect: false,
127
				getForm: function() {
132
				getForm: function() {
128
					// make sure that the Uploader does not find any of our encapsulating forms
133
					// make sure that the Uploader does not find any of our encapsulating forms
129
					return null;
134
					return null;
 Lines 150-188    Link Here 
150
			this.inherited(arguments);
155
			this.inherited(arguments);
151
156
152
			// as soon as the user has selected a file, start the upload
157
			// as soon as the user has selected a file, start the upload
153
			this._uploader.on('change', lang.hitch(this, function(data) {
158
154
				var allOk = array.every(data, function(ifile) {
159
			this._uploader.on('change', lang.hitch(this, function(_data) {
155
					return ifile.size <= this.maxSize;
160
				var _fileTooBig = [];
161
				var allOk = true;
162
				array.forEach(_data, function(ifile) {
163
					if (! (ifile.size <= this.maxSize)){
164
						_fileTooBig.push(ifile.name);
165
						allOk = false;
166
					}
156
				}, this);
167
				}, this);
157
				if (!allOk) {
168
				if (!allOk) {
158
					dialog.alert(_('File cannot be uploaded, its maximum size may be %.1f MB.', this.maxSize / 1048576.0));
169
					dialog.alert(_('The following Files cannot be uploaded because they exceed the maximum file size: %s The maximum size of a file is %.1f MB.',('<ul><li>' + _fileTooBig.join('</li><li>') + '</li></ul>' ), this.maxSize / 1048576.0));
159
					this._uploader.reset();
170
					this._uploader.reset();
160
				}
171
				}else {
161
				else {
172
					var data = _data;
162
					when(this.canUpload(data[0]), lang.hitch(this, function(doUpload) {
173
					if (data.length == 1){
174
						data = data[0];
175
						this.data = data;
176
					}
177
					when(this.canUpload(data), lang.hitch(this, function(doUpload) {
163
						if (!doUpload) {
178
						if (!doUpload) {
164
							// upload canceled
179
						 	// upload canceled
165
							this._uploader.reset();
180
							this._uploader.reset();
166
							return;
181
							return;
167
						}
182
						}else{
168
183
							// perform the upload
169
						// perform the upload
184
							var params = {};
170
						var params = {};
185
							if (this.dynamicOptions) {
171
						if (this.dynamicOptions) {
186
								if (typeof this.dynamicOptions == "function") {
172
							if (typeof this.dynamicOptions == "function") {
187
									lang.mixin(params, this.dynamicOptions(params));
173
								lang.mixin(params, this.dynamicOptions(params));
188
								}
189
								else if (typeof this.dynamicOptions == "object") {
190
									lang.mixin(params, this.dynamicOptions);
191
								}
174
							}
192
							}
175
							else if (typeof this.dynamicOptions == "object") {
193
							// mixin the iframe information
176
								lang.mixin(params, this.dynamicOptions);
194
							lang.mixin(params, {
177
							}
195
								iframe: (this._uploader.uploadType === 'iframe') ? true : false
196
							});
197
							
198
							this._uploader.upload(params);
199
							this._updateLabel();
200
							this.onUploadStarted(data);
178
						}
201
						}
179
						// mixin the iframe information
180
						lang.mixin(params, {
181
							iframe: (this._uploader.uploadType === 'iframe') ? true : false
182
						});
183
						this._uploader.upload(params);
184
						this._updateLabel();
185
						this.onUploadStarted(data[0]);
186
					}));
202
					}));
187
				}
203
				}
188
			}));
204
			}));
 Lines 193-198    Link Here 
193
			// notification as soon as the file has been uploaded
209
			// notification as soon as the file has been uploaded
194
			this._uploader.on('complete', lang.hitch(this, function(data) {
210
			this._uploader.on('complete', lang.hitch(this, function(data) {
195
				if (data && data.result instanceof Array) {
211
				if (data && data.result instanceof Array) {
212
					console.debug('Upload Finished, Data:', data);
196
					this.set('data', data.result[0]);
213
					this.set('data', data.result[0]);
197
					this.onUploaded(this.data);
214
					this.onUploaded(this.data);
198
				}
215
				}
(-)umc/widgets/MultiUploader.js (-4 / +16 lines)
 Lines 88-93    Link Here 
88
		// internal reference to the current Uploader widget
88
		// internal reference to the current Uploader widget
89
		_uploader: null,
89
		_uploader: null,
90
90
91
		// allow selecting of Multiple Files
92
		multiFile: false,
93
91
		// internal reference to the progress bar
94
		// internal reference to the progress bar
92
		_progressBar: null,
95
		_progressBar: null,
93
96
 Lines 232-237    Link Here 
232
				command: this.command,
235
				command: this.command,
233
				dynamicOptions: this.dynamicOptions,
236
				dynamicOptions: this.dynamicOptions,
234
				maxSize: this.maxSize,
237
				maxSize: this.maxSize,
238
				multiFile: this.multiFile,
235
				canUpload: this.canUpload,
239
				canUpload: this.canUpload,
236
				style: 'float: left;'
240
				style: 'float: left;'
237
			});
241
			});
 Lines 286-297    Link Here 
286
						// add files to internal list of files
290
						// add files to internal list of files
287
						this._files.standby(false);
291
						this._files.standby(false);
288
						var vals = this.get('value');
292
						var vals = this.get('value');
289
						array.forEach(this._uploadingFiles, function(ifile) {
293
290
							//console.log('### adding:', ifile.name);
294
						if (this.multiFile && ( this._uploadingFiles[0] instanceof Array ) ){
295
							array.forEach(this._uploadingFiles[0], function(ifile){
296
								if (file.success) { 
297
									vals.unshift(ifile.name);
298
								}
299
							});
300
						}else{
291
							if (file.success) {
301
							if (file.success) {
292
								vals.unshift(ifile.name);
302
								vals.unshift(this._uploadingFiles[0].name);
293
							}
303
							}
294
						});
304
						}
305
295
						this.set('value', vals);
306
						this.set('value', vals);
296
307
297
						// clear the list of uploading files
308
						// clear the list of uploading files
 Lines 310-315    Link Here 
310
			}));
321
			}));
311
		},
322
		},
312
323
324
313
		canUpload: function(fileInfo) {
325
		canUpload: function(fileInfo) {
314
			// summary:
326
			// summary:
315
			//		Before uploading a file, this function is called to make sure
327
			//		Before uploading a file, this function is called to make sure

Return to bug 32888