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,7 +19,7 @@
19 19
     <script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib -->
20 20
     <script src="libs/toastr.js?v=1"></script><!-- notifications lib -->
21 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 23
     <script src="analytics.js?v=1"></script><!-- google analytics plugin -->
24 24
     <link rel="stylesheet" href="css/font.css?v=6"/>
25 25
     <link rel="stylesheet" href="css/toastr.css?v=1">

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

@@ -15489,6 +15489,13 @@ var Moderator = {
15489 15489
                 // Not authorized to create new room
15490 15490
                 if ($(error).find('>error>not-authorized').length) {
15491 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 15499
                     eventEmitter.emit(
15493 15500
                         XMPPEvents.AUTHENTICATION_REQUIRED,
15494 15501
                         function () {
@@ -17404,11 +17411,11 @@ var XMPP = {
17404 17411
 module.exports = XMPP;
17405 17412
 
17406 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 17416
 // Distributed under MIT license
17410 17417
 // http://i18next.com
17411
-(function() {
17418
+(function(root) {
17412 17419
 
17413 17420
     // add indexOf to non ECMA-262 standard compliant browsers
17414 17421
     if (!Array.prototype.indexOf) {
@@ -17482,8 +17489,7 @@ module.exports = XMPP;
17482 17489
         }
17483 17490
     }
17484 17491
 
17485
-    var root = this
17486
-      , $ = root.jQuery || root.Zepto
17492
+    var $ = root.jQuery || root.Zepto
17487 17493
       , i18n = {}
17488 17494
       , resStore = {}
17489 17495
       , currentLng
@@ -17498,16 +17504,6 @@ module.exports = XMPP;
17498 17504
     // If we're not in CommonJS, add `i18n` to the
17499 17505
     // global object or to jquery.
17500 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 17507
         module.exports = i18n;
17512 17508
     } else {
17513 17509
         if ($) {
@@ -17553,7 +17549,7 @@ module.exports = XMPP;
17553 17549
                 var todo = lngs.length;
17554 17550
     
17555 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 17554
                     if (local) {
17559 17555
                         local = JSON.parse(local);
@@ -18273,6 +18269,16 @@ module.exports = XMPP;
18273 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,6 +18412,9 @@ module.exports = XMPP;
18406 18412
         } else {
18407 18413
             f.extend(resStore[lng][ns], resources);
18408 18414
         }
18415
+        if (o.useLocalStorage) {
18416
+            sync._storeLocal(resStore);
18417
+        }
18409 18418
     }
18410 18419
     
18411 18420
     function hasResourceBundle(lng, ns) {
@@ -18426,6 +18435,15 @@ module.exports = XMPP;
18426 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 18447
     function removeResourceBundle(lng, ns) {
18430 18448
         if (typeof ns !== 'string') {
18431 18449
             ns = o.ns.defaultNs;
@@ -18433,6 +18451,9 @@ module.exports = XMPP;
18433 18451
     
18434 18452
         resStore[lng] = resStore[lng] || {};
18435 18453
         resStore[lng][ns] = {};
18454
+        if (o.useLocalStorage) {
18455
+            sync._storeLocal(resStore);
18456
+        }
18436 18457
     }
18437 18458
     
18438 18459
     function addResource(lng, ns, key, value) {
@@ -18462,6 +18483,9 @@ module.exports = XMPP;
18462 18483
             }
18463 18484
             x++;
18464 18485
         }
18486
+        if (o.useLocalStorage) {
18487
+            sync._storeLocal(resStore);
18488
+        }
18465 18489
     }
18466 18490
     
18467 18491
     function addResources(lng, ns, resources) {
@@ -18803,6 +18827,10 @@ module.exports = XMPP;
18803 18827
     
18804 18828
         if (potentialKeys === undefined || potentialKeys === null || potentialKeys === '') return '';
18805 18829
     
18830
+        if (typeof potentialKeys === 'number') {
18831
+            potentialKeys = String(potentialKeys);
18832
+        }
18833
+    
18806 18834
         if (typeof potentialKeys === 'string') {
18807 18835
             potentialKeys = [potentialKeys];
18808 18836
         }
@@ -18839,11 +18867,27 @@ module.exports = XMPP;
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 18893
         // process notFound if function exists
@@ -18860,9 +18904,13 @@ module.exports = XMPP;
18860 18904
             notFound = applyReplacement(notFound, options);
18861 18905
             notFound = applyReuse(notFound, options);
18862 18906
     
18863
-            if (postProcessor && postProcessors[postProcessor]) {
18907
+            if (postProcessorsToApply.length) {
18864 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,6 +18968,7 @@ module.exports = XMPP;
18920 18968
         if (needsPlural(options, lngs[0])) {
18921 18969
             optionWithoutCount = f.extend({ lngs: [lngs[0]]}, options);
18922 18970
             delete optionWithoutCount.count;
18971
+            optionWithoutCount._origLng = optionWithoutCount._origLng || optionWithoutCount.lng || lngs[0];
18923 18972
             delete optionWithoutCount.lng;
18924 18973
             optionWithoutCount.defaultValue = o.pluralNotFound;
18925 18974
     
@@ -18949,12 +18998,21 @@ module.exports = XMPP;
18949 18998
                 var clone = lngs.slice();
18950 18999
                 clone.shift();
18951 19000
                 options = f.extend(options, { lngs: clone });
19001
+                options._origLng = optionWithoutCount._origLng;
18952 19002
                 delete options.lng;
18953 19003
                 // retry with fallbacks
18954 19004
                 translated = translate(ns + o.nsseparator + key, options);
18955 19005
                 if (translated != o.pluralNotFound) return translated;
18956 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,7 +19133,7 @@ module.exports = XMPP;
19075 19133
     
19076 19134
         // get from localStorage
19077 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 19139
         // get from navigator
@@ -19508,6 +19566,7 @@ module.exports = XMPP;
19508 19566
     i18n.preload = preload;
19509 19567
     i18n.addResourceBundle = addResourceBundle;
19510 19568
     i18n.hasResourceBundle = hasResourceBundle;
19569
+    i18n.getResourceBundle = getResourceBundle;
19511 19570
     i18n.addResource = addResource;
19512 19571
     i18n.addResources = addResources;
19513 19572
     i18n.removeResourceBundle = removeResourceBundle;
@@ -19523,10 +19582,11 @@ module.exports = XMPP;
19523 19582
     i18n.functions = f;
19524 19583
     i18n.lng = lng;
19525 19584
     i18n.addPostProcessor = addPostProcessor;
19585
+    i18n.applyReplacement = f.applyReplacement;
19526 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 19590
 // Top level file is just a mixin of submodules & constants
19531 19591
 'use strict';
19532 19592
 
@@ -26725,6 +26785,10 @@ var grammar = module.exports = {
26725 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 26792
     { //a=remote-candidates:1 203.0.113.1 54400 2 203.0.113.1 54401 ...
26729 26793
       name: 'remoteCandidates',
26730 26794
       reg: /^remote-candidates:(.*)/,
@@ -26781,7 +26845,7 @@ Object.keys(grammar).forEach(function (key) {
26781 26845
       obj.format = "%s";
26782 26846
     }
26783 26847
   });
26784
-}); 
26848
+});
26785 26849
 
26786 26850
 },{}],85:[function(require,module,exports){
26787 26851
 var parser = require('./parser');

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

@@ -298,6 +298,13 @@ var Moderator = {
298 298
                 // Not authorized to create new room
299 299
                 if ($(error).find('>error>not-authorized').length) {
300 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 308
                     eventEmitter.emit(
302 309
                         XMPPEvents.AUTHENTICATION_REQUIRED,
303 310
                         function () {

Loading…
Cancel
Save