Browse Source

Fixes broken Shibboleth authentication.

master
paweldomas 10 years ago
parent
commit
0848283f6d
3 changed files with 100 additions and 29 deletions
  1. 1
    1
      index.html
  2. 92
    28
      libs/app.bundle.js
  3. 7
    0
      modules/xmpp/moderator.js

+ 1
- 1
index.html View File

19
     <script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib -->
19
     <script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib -->
20
     <script src="libs/toastr.js?v=1"></script><!-- notifications lib -->
20
     <script src="libs/toastr.js?v=1"></script><!-- notifications lib -->
21
     <script src="interface_config.js?v=5"></script>
21
     <script src="interface_config.js?v=5"></script>
22
-    <script src="libs/app.bundle.js?v=36"></script>
22
+    <script src="libs/app.bundle.js?v=37"></script>
23
     <script src="analytics.js?v=1"></script><!-- google analytics plugin -->
23
     <script src="analytics.js?v=1"></script><!-- google analytics plugin -->
24
     <link rel="stylesheet" href="css/font.css?v=6"/>
24
     <link rel="stylesheet" href="css/font.css?v=6"/>
25
     <link rel="stylesheet" href="css/toastr.css?v=1">
25
     <link rel="stylesheet" href="css/toastr.css?v=1">

+ 92
- 28
libs/app.bundle.js View File

15489
                 // Not authorized to create new room
15489
                 // Not authorized to create new room
15490
                 if ($(error).find('>error>not-authorized').length) {
15490
                 if ($(error).find('>error>not-authorized').length) {
15491
                     console.warn("Unauthorized to start the conference", error);
15491
                     console.warn("Unauthorized to start the conference", error);
15492
+                    var toDomain
15493
+                        = Strophe.getDomainFromJid(error.getAttribute('to'));
15494
+                    if (toDomain !== config.hosts.anonymousdomain) {
15495
+                        // FIXME: "is external" should come either from
15496
+                        // the focus or config.js
15497
+                        externalAuthEnabled = true;
15498
+                    }
15492
                     eventEmitter.emit(
15499
                     eventEmitter.emit(
15493
                         XMPPEvents.AUTHENTICATION_REQUIRED,
15500
                         XMPPEvents.AUTHENTICATION_REQUIRED,
15494
                         function () {
15501
                         function () {
17404
 module.exports = XMPP;
17411
 module.exports = XMPP;
17405
 
17412
 
17406
 },{"../../service/RTC/StreamEventTypes":92,"../../service/UI/UIEvents":93,"../../service/xmpp/XMPPEvents":98,"./SDP":50,"./moderator":54,"./recording":55,"./strophe.emuc":56,"./strophe.jingle":57,"./strophe.logger":58,"./strophe.moderate":59,"./strophe.rayo":60,"./strophe.util":61,"events":1,"pako":64}],63:[function(require,module,exports){
17413
 },{"../../service/RTC/StreamEventTypes":92,"../../service/UI/UIEvents":93,"../../service/xmpp/XMPPEvents":98,"./SDP":50,"./moderator":54,"./recording":55,"./strophe.emuc":56,"./strophe.jingle":57,"./strophe.logger":58,"./strophe.moderate":59,"./strophe.rayo":60,"./strophe.util":61,"events":1,"pako":64}],63:[function(require,module,exports){
17407
-// i18next, v1.7.7
17408
-// Copyright (c)2014 Jan Mühlemann (jamuhl).
17414
+// i18next, v1.8.0
17415
+// Copyright (c)2015 Jan Mühlemann (jamuhl).
17409
 // Distributed under MIT license
17416
 // Distributed under MIT license
17410
 // http://i18next.com
17417
 // http://i18next.com
17411
-(function() {
17418
+(function(root) {
17412
 
17419
 
17413
     // add indexOf to non ECMA-262 standard compliant browsers
17420
     // add indexOf to non ECMA-262 standard compliant browsers
17414
     if (!Array.prototype.indexOf) {
17421
     if (!Array.prototype.indexOf) {
17482
         }
17489
         }
17483
     }
17490
     }
17484
 
17491
 
17485
-    var root = this
17486
-      , $ = root.jQuery || root.Zepto
17492
+    var $ = root.jQuery || root.Zepto
17487
       , i18n = {}
17493
       , i18n = {}
17488
       , resStore = {}
17494
       , resStore = {}
17489
       , currentLng
17495
       , currentLng
17498
     // If we're not in CommonJS, add `i18n` to the
17504
     // If we're not in CommonJS, add `i18n` to the
17499
     // global object or to jquery.
17505
     // global object or to jquery.
17500
     if (typeof module !== 'undefined' && module.exports) {
17506
     if (typeof module !== 'undefined' && module.exports) {
17501
-        if (!$) {
17502
-          try {
17503
-            $ = require('jquery');
17504
-          } catch(e) {
17505
-            // just ignore
17506
-          }
17507
-        }
17508
-        if ($) {
17509
-            $.i18n = $.i18n || i18n;
17510
-        }
17511
         module.exports = i18n;
17507
         module.exports = i18n;
17512
     } else {
17508
     } else {
17513
         if ($) {
17509
         if ($) {
17553
                 var todo = lngs.length;
17549
                 var todo = lngs.length;
17554
     
17550
     
17555
                 f.each(lngs, function(key, lng) {
17551
                 f.each(lngs, function(key, lng) {
17556
-                    var local = window.localStorage.getItem('res_' + lng);
17552
+                    var local = f.localStorage.getItem('res_' + lng);
17557
     
17553
     
17558
                     if (local) {
17554
                     if (local) {
17559
                         local = JSON.parse(local);
17555
                         local = JSON.parse(local);
18273
                         f.log('failed to set value for key "' + key + '" to localStorage.');
18269
                         f.log('failed to set value for key "' + key + '" to localStorage.');
18274
                     }
18270
                     }
18275
                 }
18271
                 }
18272
+            },
18273
+            getItem: function(key, value) {
18274
+                if (window.localStorage) {
18275
+                    try {
18276
+                        return window.localStorage.getItem(key, value);
18277
+                    } catch (e) {
18278
+                        f.log('failed to get value for key "' + key + '" from localStorage.');
18279
+                        return undefined;
18280
+                    }
18281
+                }
18276
             }
18282
             }
18277
         }
18283
         }
18278
     };
18284
     };
18406
         } else {
18412
         } else {
18407
             f.extend(resStore[lng][ns], resources);
18413
             f.extend(resStore[lng][ns], resources);
18408
         }
18414
         }
18415
+        if (o.useLocalStorage) {
18416
+            sync._storeLocal(resStore);
18417
+        }
18409
     }
18418
     }
18410
     
18419
     
18411
     function hasResourceBundle(lng, ns) {
18420
     function hasResourceBundle(lng, ns) {
18426
         return hasValues;
18435
         return hasValues;
18427
     }
18436
     }
18428
     
18437
     
18438
+    function getResourceBundle(lng, ns) {
18439
+        if (typeof ns !== 'string') {
18440
+            ns = o.ns.defaultNs;
18441
+        }
18442
+    
18443
+        resStore[lng] = resStore[lng] || {};
18444
+        return f.extend({}, resStore[lng][ns]);
18445
+    }
18446
+    
18429
     function removeResourceBundle(lng, ns) {
18447
     function removeResourceBundle(lng, ns) {
18430
         if (typeof ns !== 'string') {
18448
         if (typeof ns !== 'string') {
18431
             ns = o.ns.defaultNs;
18449
             ns = o.ns.defaultNs;
18433
     
18451
     
18434
         resStore[lng] = resStore[lng] || {};
18452
         resStore[lng] = resStore[lng] || {};
18435
         resStore[lng][ns] = {};
18453
         resStore[lng][ns] = {};
18454
+        if (o.useLocalStorage) {
18455
+            sync._storeLocal(resStore);
18456
+        }
18436
     }
18457
     }
18437
     
18458
     
18438
     function addResource(lng, ns, key, value) {
18459
     function addResource(lng, ns, key, value) {
18462
             }
18483
             }
18463
             x++;
18484
             x++;
18464
         }
18485
         }
18486
+        if (o.useLocalStorage) {
18487
+            sync._storeLocal(resStore);
18488
+        }
18465
     }
18489
     }
18466
     
18490
     
18467
     function addResources(lng, ns, resources) {
18491
     function addResources(lng, ns, resources) {
18803
     
18827
     
18804
         if (potentialKeys === undefined || potentialKeys === null || potentialKeys === '') return '';
18828
         if (potentialKeys === undefined || potentialKeys === null || potentialKeys === '') return '';
18805
     
18829
     
18830
+        if (typeof potentialKeys === 'number') {
18831
+            potentialKeys = String(potentialKeys);
18832
+        }
18833
+    
18806
         if (typeof potentialKeys === 'string') {
18834
         if (typeof potentialKeys === 'string') {
18807
             potentialKeys = [potentialKeys];
18835
             potentialKeys = [potentialKeys];
18808
         }
18836
         }
18839
             }
18867
             }
18840
         }
18868
         }
18841
     
18869
     
18842
-        var postProcessor = options.postProcess || o.postProcess;
18843
-        if (found !== undefined && postProcessor) {
18844
-            if (postProcessors[postProcessor]) {
18845
-                found = postProcessors[postProcessor](found, key, options);
18846
-            }
18870
+        var postProcessorsToApply;
18871
+        if (typeof o.postProcess === 'string' && o.postProcess !== '') {
18872
+            postProcessorsToApply = [o.postProcess];
18873
+        } else if (typeof o.postProcess === 'array' || typeof o.postProcess === 'object') {
18874
+            postProcessorsToApply = o.postProcess;
18875
+        } else {
18876
+            postProcessorsToApply = [];
18877
+        }
18878
+    
18879
+        if (typeof options.postProcess === 'string' && options.postProcess !== '') {
18880
+            postProcessorsToApply = postProcessorsToApply.concat([options.postProcess]);
18881
+        } else if (typeof options.postProcess === 'array' || typeof options.postProcess === 'object') {
18882
+            postProcessorsToApply = postProcessorsToApply.concat(options.postProcess);
18883
+        }
18884
+    
18885
+        if (found !== undefined && postProcessorsToApply.length) {
18886
+            postProcessorsToApply.forEach(function(postProcessor) {
18887
+                if (postProcessors[postProcessor]) {
18888
+                    found = postProcessors[postProcessor](found, key, options);
18889
+                }
18890
+            });
18847
         }
18891
         }
18848
     
18892
     
18849
         // process notFound if function exists
18893
         // process notFound if function exists
18860
             notFound = applyReplacement(notFound, options);
18904
             notFound = applyReplacement(notFound, options);
18861
             notFound = applyReuse(notFound, options);
18905
             notFound = applyReuse(notFound, options);
18862
     
18906
     
18863
-            if (postProcessor && postProcessors[postProcessor]) {
18907
+            if (postProcessorsToApply.length) {
18864
                 var val = _getDefaultValue(key, options);
18908
                 var val = _getDefaultValue(key, options);
18865
-                found = postProcessors[postProcessor](val, key, options);
18909
+                postProcessorsToApply.forEach(function(postProcessor) {
18910
+                    if (postProcessors[postProcessor]) {
18911
+                        found = postProcessors[postProcessor](val, key, options);
18912
+                    }
18913
+                });
18866
             }
18914
             }
18867
         }
18915
         }
18868
     
18916
     
18920
         if (needsPlural(options, lngs[0])) {
18968
         if (needsPlural(options, lngs[0])) {
18921
             optionWithoutCount = f.extend({ lngs: [lngs[0]]}, options);
18969
             optionWithoutCount = f.extend({ lngs: [lngs[0]]}, options);
18922
             delete optionWithoutCount.count;
18970
             delete optionWithoutCount.count;
18971
+            optionWithoutCount._origLng = optionWithoutCount._origLng || optionWithoutCount.lng || lngs[0];
18923
             delete optionWithoutCount.lng;
18972
             delete optionWithoutCount.lng;
18924
             optionWithoutCount.defaultValue = o.pluralNotFound;
18973
             optionWithoutCount.defaultValue = o.pluralNotFound;
18925
     
18974
     
18949
                 var clone = lngs.slice();
18998
                 var clone = lngs.slice();
18950
                 clone.shift();
18999
                 clone.shift();
18951
                 options = f.extend(options, { lngs: clone });
19000
                 options = f.extend(options, { lngs: clone });
19001
+                options._origLng = optionWithoutCount._origLng;
18952
                 delete options.lng;
19002
                 delete options.lng;
18953
                 // retry with fallbacks
19003
                 // retry with fallbacks
18954
                 translated = translate(ns + o.nsseparator + key, options);
19004
                 translated = translate(ns + o.nsseparator + key, options);
18955
                 if (translated != o.pluralNotFound) return translated;
19005
                 if (translated != o.pluralNotFound) return translated;
18956
             } else {
19006
             } else {
18957
-                return translated;
19007
+                optionWithoutCount.lng = optionWithoutCount._origLng;
19008
+                delete optionWithoutCount._origLng;
19009
+                translated = translate(ns + o.nsseparator + key, optionWithoutCount);
19010
+                
19011
+                return applyReplacement(translated, {
19012
+                    count: options.count,
19013
+                    interpolationPrefix: options.interpolationPrefix,
19014
+                    interpolationSuffix: options.interpolationSuffix
19015
+                });
18958
             }
19016
             }
18959
         }
19017
         }
18960
     
19018
     
19075
     
19133
     
19076
         // get from localStorage
19134
         // get from localStorage
19077
         if (o.detectLngFromLocalStorage && typeof window !== 'undefined' && window.localStorage) {
19135
         if (o.detectLngFromLocalStorage && typeof window !== 'undefined' && window.localStorage) {
19078
-            userLngChoices.push(window.localStorage.getItem('i18next_lng'));
19136
+            userLngChoices.push(f.localStorage.getItem('i18next_lng'));
19079
         }
19137
         }
19080
     
19138
     
19081
         // get from navigator
19139
         // get from navigator
19508
     i18n.preload = preload;
19566
     i18n.preload = preload;
19509
     i18n.addResourceBundle = addResourceBundle;
19567
     i18n.addResourceBundle = addResourceBundle;
19510
     i18n.hasResourceBundle = hasResourceBundle;
19568
     i18n.hasResourceBundle = hasResourceBundle;
19569
+    i18n.getResourceBundle = getResourceBundle;
19511
     i18n.addResource = addResource;
19570
     i18n.addResource = addResource;
19512
     i18n.addResources = addResources;
19571
     i18n.addResources = addResources;
19513
     i18n.removeResourceBundle = removeResourceBundle;
19572
     i18n.removeResourceBundle = removeResourceBundle;
19523
     i18n.functions = f;
19582
     i18n.functions = f;
19524
     i18n.lng = lng;
19583
     i18n.lng = lng;
19525
     i18n.addPostProcessor = addPostProcessor;
19584
     i18n.addPostProcessor = addPostProcessor;
19585
+    i18n.applyReplacement = f.applyReplacement;
19526
     i18n.options = o;
19586
     i18n.options = o;
19527
 
19587
 
19528
-})();
19529
-},{"jquery":"jquery"}],64:[function(require,module,exports){
19588
+})(typeof exports === 'undefined' ? window : exports);
19589
+},{}],64:[function(require,module,exports){
19530
 // Top level file is just a mixin of submodules & constants
19590
 // Top level file is just a mixin of submodules & constants
19531
 'use strict';
19591
 'use strict';
19532
 
19592
 
26725
         return str;
26785
         return str;
26726
       }
26786
       }
26727
     },
26787
     },
26788
+    { //a=end-of-candidates (keep after the candidates line for readability)
26789
+      name: 'endOfCandidates',
26790
+      reg: /^(end-of-candidates)/
26791
+    },
26728
     { //a=remote-candidates:1 203.0.113.1 54400 2 203.0.113.1 54401 ...
26792
     { //a=remote-candidates:1 203.0.113.1 54400 2 203.0.113.1 54401 ...
26729
       name: 'remoteCandidates',
26793
       name: 'remoteCandidates',
26730
       reg: /^remote-candidates:(.*)/,
26794
       reg: /^remote-candidates:(.*)/,
26781
       obj.format = "%s";
26845
       obj.format = "%s";
26782
     }
26846
     }
26783
   });
26847
   });
26784
-}); 
26848
+});
26785
 
26849
 
26786
 },{}],85:[function(require,module,exports){
26850
 },{}],85:[function(require,module,exports){
26787
 var parser = require('./parser');
26851
 var parser = require('./parser');

+ 7
- 0
modules/xmpp/moderator.js View File

298
                 // Not authorized to create new room
298
                 // Not authorized to create new room
299
                 if ($(error).find('>error>not-authorized').length) {
299
                 if ($(error).find('>error>not-authorized').length) {
300
                     console.warn("Unauthorized to start the conference", error);
300
                     console.warn("Unauthorized to start the conference", error);
301
+                    var toDomain
302
+                        = Strophe.getDomainFromJid(error.getAttribute('to'));
303
+                    if (toDomain !== config.hosts.anonymousdomain) {
304
+                        // FIXME: "is external" should come either from
305
+                        // the focus or config.js
306
+                        externalAuthEnabled = true;
307
+                    }
301
                     eventEmitter.emit(
308
                     eventEmitter.emit(
302
                         XMPPEvents.AUTHENTICATION_REQUIRED,
309
                         XMPPEvents.AUTHENTICATION_REQUIRED,
303
                         function () {
310
                         function () {

Loading…
Cancel
Save