Преглед изворни кода

Adds auto-sign in feature and login/logout toolbar menu.

master
paweldomas пре 10 година
родитељ
комит
a904e35c67

+ 61
- 0
css/login_menu.css Прегледај датотеку

@@ -0,0 +1,61 @@
1
+/*Initialize*/
2
+ul.loginmenu {
3
+    display:none;
4
+    position: absolute;
5
+    margin: 0;
6
+    padding: 5px;
7
+    padding-bottom: 7px;
8
+    top: 45px;
9
+    left: -5px;
10
+    background-color: rgba(0,0,0,0.9);
11
+    border: 1px solid rgba(256, 256, 256, 0.2);
12
+    border-radius:8px;
13
+}
14
+
15
+ul.loginmenu li {
16
+    list-style-type: none;
17
+    padding: 7px;
18
+}
19
+
20
+ul.loginmenu li.identity {
21
+    color: #fff;
22
+    font-size: 11pt;
23
+    cursor: default;
24
+}
25
+
26
+ul.loginmenu:after {
27
+    content: url('../images/dropdownPointer.png');
28
+    display: block;
29
+    position: absolute;
30
+    top: -7px;
31
+    left: 18px;
32
+}
33
+
34
+li a.authButton{
35
+    background-color: #06a5df;
36
+    padding-top: 3px;
37
+    padding-bottom: 3px;
38
+    padding-left: 29px;
39
+    padding-right: 29px;
40
+    border-radius: 4px;
41
+    color: #fff;
42
+    font-size: 11pt;
43
+    cursor: pointer;
44
+}
45
+
46
+span.authentication:hover ul.loginmenu, ul.loginmenu:hover {
47
+    display:block !important;
48
+}
49
+
50
+a.disabled {
51
+    color: gray !important;
52
+    pointer-events: none;
53
+}
54
+
55
+.loginmenuPadding {
56
+    width: 50px;
57
+    height: 30px;
58
+    position: absolute;
59
+    top: -30px;
60
+    left: 0px;
61
+}

BIN
images/dropdownPointer.png Прегледај датотеку


+ 17
- 6
index.html Прегледај датотеку

@@ -30,6 +30,7 @@
30 30
     <link rel="stylesheet" href="css/jquery-impromptu.css?v=4">
31 31
     <link rel="stylesheet" href="css/modaldialog.css?v=3">
32 32
     <link rel="stylesheet" href="css/popup_menu.css?v=4">
33
+    <link rel="stylesheet" href="css/login_menu.css?v=1">
33 34
     <link rel="stylesheet" href="css/popover.css?v=2">
34 35
     <link rel="stylesheet" href="css/jitsi_popover.css?v=2">
35 36
     <link rel="stylesheet" href="css/contact_list.css?v=4">
@@ -121,6 +122,22 @@
121 122
         <div style="position: relative;" id="header_container">
122 123
             <div id="header">
123 124
                 <span id="toolbar">
125
+                    <span id="authentication" class="authentication" style="display: none">
126
+                        <a class="button" id="toolbar_button_authentication" >
127
+                            <i id="authButton" class="icon-avatar"></i>
128
+                        </a>
129
+                        <ul class="loginmenu">
130
+                            <span class="loginmenuPadding"></span>
131
+                            <li id="toolbar_auth_identity" class="identity"></li>
132
+                            <li id="toolbar_button_login">
133
+                                <a class="authButton" data-i18n="toolbar.login"></a>
134
+                            </li>
135
+                            <li id="toolbar_button_logout">
136
+                                <a class="authButton" data-i18n="toolbar.logout"></a>
137
+                            </li>
138
+                        </ul>
139
+                        <div class="header_button_separator"></div>
140
+                    </span>
124 141
                     <a class="button" id="toolbar_button_mute" data-container="body" data-toggle="popover" data-placement="bottom" shortcut="mutePopover" data-i18n="[content]toolbar.mute" content="Mute / Unmute">
125 142
                         <i id="mute" class="icon-microphone"></i>
126 143
                     </a>
@@ -128,12 +145,6 @@
128 145
                     <a class="button" id="toolbar_button_camera" data-container="body" data-toggle="popover" data-placement="bottom" shortcut="toggleVideoPopover" data-i18n="[content]toolbar.videomute" content="Start / stop camera">
129 146
                         <i id="video" class="icon-camera"></i>
130 147
                     </a>
131
-                    <span id="authentication" style="display: none">
132
-                        <div class="header_button_separator"></div>
133
-                        <a class="button" id="toolbar_button_authentication" data-container="body" data-toggle="popover" data-placement="bottom" data-i18n="[content]toolbar.authenticate" content="Authenticate">
134
-                            <i id="authButton" class="icon-avatar"></i>
135
-                        </a>
136
-                    </span>
137 148
                     <span id="recording" style="display: none">
138 149
                         <div class="header_button_separator"></div>
139 150
                         <a class="button" id="toolbar_button_record" data-container="body" data-toggle="popover" data-placement="bottom" data-i18n="[content]toolbar.record" content="Record">

+ 3
- 1
lang/main.json Прегледај датотеку

@@ -54,7 +54,9 @@
54 54
         "fullscreen": "Enter / Exit Full Screen",
55 55
         "sip": "Call SIP number",
56 56
         "Settings": "Settings",
57
-        "hangup": "Hang Up"
57
+        "hangup": "Hang Up",
58
+        "login": "Login",
59
+        "logout": "Logout"
58 60
     },
59 61
     "bottomtoolbar": {
60 62
         "chat": "Open / close chat",

+ 17969
- 17734
libs/app.bundle.js
Разлика између датотеке није приказан због своје велике величине
Прегледај датотеку


+ 1
- 7
modules/UI/UI.js Прегледај датотеку

@@ -371,10 +371,6 @@ function onMucJoined(jid, info) {
371 371
     // Once we've joined the muc show the toolbar
372 372
     ToolbarToggler.showToolbar();
373 373
 
374
-    // Show authenticate button if needed
375
-    Toolbar.showAuthenticateButton(
376
-            APP.xmpp.isExternalAuthEnabled() && !APP.xmpp.isModerator());
377
-
378 374
     var displayName = !config.displayJids
379 375
         ? info.displayName : Strophe.getResourceFromJid(jid);
380 376
 
@@ -413,14 +409,12 @@ function onMucLeft(jid) {
413 409
 };
414 410
 
415 411
 
416
-function onLocalRoleChange(jid, info, pres, isModerator, isExternalAuthEnabled)
412
+function onLocalRoleChange(jid, info, pres, isModerator)
417 413
 {
418 414
 
419 415
     console.info("My role changed, new role: " + info.role);
420 416
     onModeratorStatusChanged(isModerator);
421 417
     VideoLayout.showModeratorIndicator();
422
-    Toolbar.showAuthenticateButton(
423
-            isExternalAuthEnabled && !isModerator);
424 418
 
425 419
     if (isModerator) {
426 420
         Authentication.closeAuthenticationWindow();

+ 2
- 2
modules/UI/authentication/Authentication.js Прегледај датотеку

@@ -16,7 +16,7 @@ var Authentication = {
16 16
         // extract room name from 'room@muc.server.net'
17 17
         var room = roomName.substr(0, roomName.indexOf('@'));
18 18
 
19
-        authDialog = messageHandler.openDialog(
19
+        authDialog = APP.UI.messageHandler.openDialog(
20 20
             'Stop',
21 21
                 'Authentication is required to create room:<br/><b>' + room +
22 22
                 '</b></br> You can either authenticate to create the room or ' +
@@ -58,7 +58,7 @@ var Authentication = {
58 58
         }
59 59
     },
60 60
     createAuthenticationWindow: function (callback, url) {
61
-        authenticationWindow = messageHandler.openCenteredPopup(
61
+        authenticationWindow = APP.UI.messageHandler.openCenteredPopup(
62 62
             url, 910, 660,
63 63
             // On closed
64 64
             function () {

+ 113
- 17
modules/UI/toolbars/Toolbar.js Прегледај датотеку

@@ -1,4 +1,4 @@
1
-/* global $, buttonClick, config, lockRoom,
1
+/* global APP,$, buttonClick, config, lockRoom,
2 2
    setSharedKey, Util */
3 3
 var messageHandler = require("../util/MessageHandler");
4 4
 var BottomToolbar = require("./BottomToolbar");
@@ -7,6 +7,8 @@ var Etherpad = require("../etherpad/Etherpad");
7 7
 var PanelToggler = require("../side_pannels/SidePanelToggler");
8 8
 var Authentication = require("../authentication/Authentication");
9 9
 var UIUtil = require("../util/UIUtil");
10
+var AuthenticationEvents
11
+    = require("../../../service/authentication/AuthenticationEvents");
10 12
 
11 13
 var roomUrl = null;
12 14
 var sharedKey = '';
@@ -20,9 +22,9 @@ var buttonHandlers =
20 22
     "toolbar_button_camera": function () {
21 23
         return APP.UI.toggleVideo();
22 24
     },
23
-    "toolbar_button_authentication": function () {
25
+    /*"toolbar_button_authentication": function () {
24 26
         return Toolbar.authenticateClicked();
25
-    },
27
+    },*/
26 28
     "toolbar_button_record": function () {
27 29
         return toggleRecording();
28 30
     },
@@ -57,6 +59,27 @@ var buttonHandlers =
57 59
     },
58 60
     "toolbar_button_hangup": function () {
59 61
         return hangup();
62
+    },
63
+    "toolbar_button_login": function () {
64
+        Toolbar.authenticateClicked();
65
+    },
66
+    "toolbar_button_logout": function () {
67
+        // Ask for confirmation
68
+        messageHandler.openTwoButtonDialog(
69
+            "Logout",
70
+            "Are you sure you want to logout and stop the conference ?",
71
+            false, "Yes",
72
+            function (evt, yes) {
73
+                if (yes) {
74
+                    APP.xmpp.logout(function (url) {
75
+                        if (url) {
76
+                            window.location.href = url;
77
+                        } else {
78
+                            hangup();
79
+                        }
80
+                    });
81
+                }
82
+            });
60 83
     }
61 84
 };
62 85
 
@@ -222,7 +245,33 @@ var Toolbar = (function (my) {
222 245
         for(var k in buttonHandlers)
223 246
             $("#" + k).click(buttonHandlers[k]);
224 247
         UI = ui;
225
-    }
248
+        // Update login info
249
+        APP.xmpp.addListener(
250
+            AuthenticationEvents.IDENTITY_UPDATED,
251
+            function (authenticationEnabled, userIdentity) {
252
+
253
+                var loggedIn = false;
254
+                if (userIdentity) {
255
+                    loggedIn = true;
256
+                }
257
+
258
+                //FIXME: XMPP authentication need improvements for "live" login
259
+                if (!APP.xmpp.isExternalAuthEnabled() && !loggedIn)
260
+                {
261
+                    authenticationEnabled = false;
262
+                }
263
+
264
+                Toolbar.showAuthenticateButton(authenticationEnabled);
265
+
266
+                if (authenticationEnabled) {
267
+                    Toolbar.setAuthenticatedIdentity(userIdentity);
268
+
269
+                    Toolbar.showLoginButton(!loggedIn);
270
+                    Toolbar.showLogoutButton(loggedIn);
271
+                }
272
+            }
273
+        );
274
+    },
226 275
 
227 276
     /**
228 277
      * Sets shared key
@@ -235,20 +284,30 @@ var Toolbar = (function (my) {
235 284
     my.authenticateClicked = function () {
236 285
         Authentication.focusAuthenticationWindow();
237 286
         // Get authentication URL
238
-        APP.xmpp.getAuthUrl(APP.UI.getRoomName(), function (url) {
239
-            // Open popup with authentication URL
240
-            var authenticationWindow = Authentication.createAuthenticationWindow(function () {
241
-                // On popup closed - retry room allocation
242
-                APP.xmpp.allocateConferenceFocus(APP.UI.getRoomName(), APP.UI.checkForNicknameAndJoin);
243
-            }, url);
244
-            if (!authenticationWindow) {
245
-                Toolbar.showAuthenticateButton(true);
246
-                messageHandler.openMessageDialog(
247
-                    null, "Your browser is blocking popup windows from this site." +
287
+        if (!APP.xmpp.getMUCJoined()) {
288
+            APP.xmpp.getLoginUrl(UI.getRoomName(), function (url) {
289
+                // If conference has not been started yet - redirect to login page
290
+                window.location.href = url;
291
+            });
292
+        } else {
293
+            APP.xmpp.getPopupLoginUrl(UI.getRoomName(), function (url) {
294
+                // Otherwise - open popup with authentication URL
295
+                var authenticationWindow = Authentication.createAuthenticationWindow(
296
+                    function () {
297
+                        // On popup closed - retry room allocation
298
+                        APP.xmpp.allocateConferenceFocus(
299
+                            APP.UI.getRoomName(),
300
+                            function () { console.info("AUTH DONE"); }
301
+                        );
302
+                    }, url);
303
+                if (!authenticationWindow) {
304
+                    messageHandler.openMessageDialog(
305
+                        null, "Your browser is blocking popup windows from this site." +
248 306
                         " Please enable popups in your browser security settings" +
249 307
                         " and try again.");
250
-            }
251
-        });
308
+                }
309
+            });
310
+        }
252 311
     };
253 312
 
254 313
     /**
@@ -489,12 +548,49 @@ var Toolbar = (function (my) {
489 548
     // Shows or hides SIP calls button
490 549
     my.showSipCallButton = function (show) {
491 550
         if (APP.xmpp.isSipGatewayEnabled() && show) {
492
-            $('#sipCallButton').css({display: "inline"});
551
+            $('#sipCallButton').css({display: "inline-block"});
493 552
         } else {
494 553
             $('#sipCallButton').css({display: "none"});
495 554
         }
496 555
     };
497 556
 
557
+    /**
558
+     * Displays user authenticated identity name(login).
559
+     * @param authIdentity identity name to be displayed.
560
+     */
561
+    my.setAuthenticatedIdentity = function (authIdentity) {
562
+        if (authIdentity) {
563
+            $('#toolbar_auth_identity').css({display: "list-item"});
564
+            $('#toolbar_auth_identity').text(authIdentity);
565
+        } else {
566
+            $('#toolbar_auth_identity').css({display: "none"});
567
+        }
568
+    };
569
+
570
+    /**
571
+     * Shows/hides login button.
572
+     * @param show <tt>true</tt> to show
573
+     */
574
+    my.showLoginButton = function (show) {
575
+        if (show) {
576
+            $('#toolbar_button_login').css({display: "list-item"});
577
+        } else {
578
+            $('#toolbar_button_login').css({display: "none"});
579
+        }
580
+    };
581
+
582
+    /**
583
+     * Shows/hides logout button.
584
+     * @param show <tt>true</tt> to show
585
+     */
586
+    my.showLogoutButton = function (show) {
587
+        if (show) {
588
+            $('#toolbar_button_logout').css({display: "list-item"});
589
+        } else {
590
+            $('#toolbar_button_logout').css({display: "none"});
591
+        }
592
+    };
593
+
498 594
     /**
499 595
      * Sets the state of the button. The button has blue glow if desktop
500 596
      * streaming is active.

+ 141
- 18
modules/xmpp/moderator.js Прегледај датотеку

@@ -1,6 +1,10 @@
1 1
 /* global $, $iq, config, connection, UI, messageHandler,
2 2
  roomName, sessionTerminated, Strophe, Util */
3 3
 var XMPPEvents = require("../../service/xmpp/XMPPEvents");
4
+var Settings = require("../settings/Settings");
5
+
6
+var AuthenticationEvents
7
+    = require("../../service/authentication/AuthenticationEvents");
4 8
 
5 9
 /**
6 10
  * Contains logic responsible for enabling/disabling functionality available
@@ -60,6 +64,25 @@ var Moderator = {
60 64
     init: function (xmpp, emitter) {
61 65
         this.xmppService = xmpp;
62 66
         eventEmitter = emitter;
67
+
68
+        // Message listener that talks to POPUP window
69
+        function listener(event) {
70
+            if (event.data && event.data.sessionId) {
71
+                if (event.origin !== window.location.origin) {
72
+                    console.warn(
73
+                        "Ignoring sessionId from different origin: " + event.origin);
74
+                    return;
75
+                }
76
+                localStorage.setItem('sessionId', event.data.sessionId);
77
+                // After popup is closed we will authenticate
78
+            }
79
+        }
80
+        // Register
81
+        if (window.addEventListener) {
82
+            window.addEventListener("message", listener, false);
83
+        } else {
84
+            window.attachEvent("onmessage", listener);
85
+        }
63 86
     },
64 87
 
65 88
     onMucLeft: function (jid) {
@@ -99,10 +122,24 @@ var Moderator = {
99 122
     createConferenceIq: function (roomName) {
100 123
         // Generate create conference IQ
101 124
         var elem = $iq({to: Moderator.getFocusComponent(), type: 'set'});
125
+
126
+        // Session Id used for authentication
127
+        var sessionId = localStorage.getItem('sessionId');
128
+        var machineUID = Settings.getSettings().uid;
129
+
130
+        console.info(
131
+            "Session ID: " + sessionId + " machine UID: " + machineUID);
132
+
102 133
         elem.c('conference', {
103 134
             xmlns: 'http://jitsi.org/protocol/focus',
104
-            room: roomName
135
+            room: roomName,
136
+            'machine-uid': machineUID
105 137
         });
138
+
139
+        if (sessionId) {
140
+            elem.attrs({ 'session-id': sessionId});
141
+        }
142
+
106 143
         if (config.hosts.bridge !== undefined) {
107 144
             elem.c(
108 145
                 'property',
@@ -152,22 +189,44 @@ var Moderator = {
152 189
     },
153 190
 
154 191
     parseConfigOptions: function (resultIq) {
155
-    
192
+
156 193
         Moderator.setFocusUserJid(
157 194
             $(resultIq).find('conference').attr('focusjid'));
158
-    
159
-        var extAuthParam
160
-            = $(resultIq).find('>conference>property[name=\'externalAuth\']');
161
-        if (extAuthParam.length) {
162
-            externalAuthEnabled = extAuthParam.attr('value') === 'true';
195
+
196
+        var authenticationEnabled
197
+            = $(resultIq).find(
198
+                '>conference>property' +
199
+                '[name=\'authentication\'][value=\'true\']').length > 0;
200
+
201
+        console.info("Authentication enabled: " + authenticationEnabled);
202
+
203
+        externalAuthEnabled
204
+            = $(resultIq).find(
205
+                '>conference>property' +
206
+                '[name=\'externalAuth\'][value=\'true\']').length > 0;
207
+
208
+        console.info('External authentication enabled: ' + externalAuthEnabled);
209
+
210
+        if (!externalAuthEnabled) {
211
+            // We expect to receive sessionId in 'internal' authentication mode
212
+            var sessionId
213
+                = $(resultIq).find('conference').attr('session-id');
214
+            if (sessionId) {
215
+                console.info('Received sessionId: ' + sessionId);
216
+                localStorage.setItem('sessionId', sessionId);
217
+            }
163 218
         }
164
-    
165
-        console.info("External authentication enabled: " + externalAuthEnabled);
219
+
220
+        var authIdentity = $(resultIq).find('>conference').attr('identity');
221
+
222
+        eventEmitter.emit(AuthenticationEvents.IDENTITY_UPDATED,
223
+            authenticationEnabled, authIdentity);
166 224
     
167 225
         // Check if focus has auto-detected Jigasi component(this will be also
168 226
         // included if we have passed our host from the config)
169 227
         if ($(resultIq).find(
170
-            '>conference>property[name=\'sipGatewayEnabled\']').length) {
228
+            '>conference>property' +
229
+            '[name=\'sipGatewayEnabled\'][value=\'true\']').length) {
171 230
             sipGatewayEnabled = true;
172 231
         }
173 232
     
@@ -185,12 +244,14 @@ var Moderator = {
185 244
         connection.sendIQ(
186 245
             iq,
187 246
             function (result) {
247
+
248
+                // Setup config options
249
+                Moderator.parseConfigOptions(result);
250
+
188 251
                 if ('true' === $(result).find('conference').attr('ready')) {
189 252
                     // Reset both timers
190 253
                     getNextTimeout(true);
191 254
                     getNextErrorTimeout(true);
192
-                    // Setup config options
193
-                    Moderator.parseConfigOptions(result);
194 255
                     // Exec callback
195 256
                     callback();
196 257
                 } else {
@@ -208,7 +269,14 @@ var Moderator = {
208 269
             function (error) {
209 270
                 // Not authorized to create new room
210 271
                 if ($(error).find('>error>not-authorized').length) {
211
-                    console.warn("Unauthorized to start the conference");
272
+                    console.warn("Unauthorized to start the conference", error);
273
+
274
+                    if ($(error).find('>error>session-invalid').length) {
275
+                        // FIXME: just retry
276
+                        console.info("Session expired! - removing");
277
+                        localStorage.removeItem("sessionId");
278
+                    }
279
+
212 280
                     var toDomain
213 281
                         = Strophe.getDomainFromJid(error.getAttribute('to'));
214 282
                     if (toDomain === config.hosts.anonymousdomain) {
@@ -248,28 +316,83 @@ var Moderator = {
248 316
         );
249 317
     },
250 318
 
251
-    getAuthUrl: function (roomName, urlCallback) {
319
+    getLoginUrl: function (roomName, urlCallback) {
252 320
         var iq = $iq({to: Moderator.getFocusComponent(), type: 'get'});
253
-        iq.c('auth-url', {
321
+        iq.c('login-url', {
254 322
             xmlns: 'http://jitsi.org/protocol/focus',
255
-            room: roomName
323
+            room: roomName,
324
+            'machine-uid': Settings.getSettings().uid
256 325
         });
257 326
         connection.sendIQ(
258 327
             iq,
259 328
             function (result) {
260
-                var url = $(result).find('auth-url').attr('url');
329
+                var url = $(result).find('login-url').attr('url');
330
+                url = url = decodeURIComponent(url);
261 331
                 if (url) {
262 332
                     console.info("Got auth url: " + url);
263 333
                     urlCallback(url);
264 334
                 } else {
265 335
                     console.error(
266
-                        "Failed to get auth url fro mthe focus", result);
336
+                        "Failed to get auth url from the focus", result);
267 337
                 }
268 338
             },
269 339
             function (error) {
270 340
                 console.error("Get auth url error", error);
271 341
             }
272 342
         );
343
+    },
344
+    getPopupLoginUrl: function (roomName, urlCallback) {
345
+        var iq = $iq({to: Moderator.getFocusComponent(), type: 'get'});
346
+        iq.c('login-url', {
347
+            xmlns: 'http://jitsi.org/protocol/focus',
348
+            room: roomName,
349
+            'machine-uid': Settings.getSettings().uid,
350
+            popup: true
351
+        });
352
+        connection.sendIQ(
353
+            iq,
354
+            function (result) {
355
+                var url = $(result).find('login-url').attr('url');
356
+                url = url = decodeURIComponent(url);
357
+                if (url) {
358
+                    console.info("Got POPUP auth url: " + url);
359
+                    urlCallback(url);
360
+                } else {
361
+                    console.error(
362
+                        "Failed to get POPUP auth url from the focus", result);
363
+                }
364
+            },
365
+            function (error) {
366
+                console.error('Get POPUP auth url error', error);
367
+            }
368
+        );
369
+    },
370
+    logout: function (callback) {
371
+        var iq = $iq({to: Moderator.getFocusComponent(), type: 'set'});
372
+        var sessionId = localStorage.getItem('sessionId');
373
+        if (!sessionId) {
374
+            callback();
375
+            return;
376
+        }
377
+        iq.c('logout', {
378
+            xmlns: 'http://jitsi.org/protocol/focus',
379
+            'session-id': sessionId
380
+        });
381
+        connection.sendIQ(
382
+            iq,
383
+            function (result) {
384
+                var logoutUrl = $(result).find('logout').attr('logout-url');
385
+                if (logoutUrl) {
386
+                    logoutUrl = decodeURIComponent(logoutUrl);
387
+                }
388
+                console.info("Log out OK, url: " + logoutUrl, result);
389
+                localStorage.removeItem('sessionId');
390
+                callback(logoutUrl);
391
+            },
392
+            function (error) {
393
+                console.error("Logout error", error);
394
+            }
395
+        );
273 396
     }
274 397
 };
275 398
 

+ 1
- 2
modules/xmpp/strophe.emuc.js Прегледај датотеку

@@ -183,8 +183,7 @@ module.exports = function(XMPP, eventEmitter) {
183 183
                     this.role = member.role;
184 184
 
185 185
                     eventEmitter.emit(XMPPEvents.LOCALROLE_CHANGED,
186
-                        from, member, pres, Moderator.isModerator(),
187
-                        Moderator.isExternalAuthEnabled());
186
+                        from, member, pres, Moderator.isModerator());
188 187
                 }
189 188
                 if (!this.joined) {
190 189
                     this.joined = true;

+ 9
- 0
modules/xmpp/xmpp.js Прегледај датотеку

@@ -230,6 +230,12 @@ var XMPP = {
230 230
     allocateConferenceFocus: function(roomName, callback) {
231 231
         Moderator.allocateConferenceFocus(roomName, callback);
232 232
     },
233
+    getLoginUrl: function (roomName, callback) {
234
+        Moderator.getLoginUrl(roomName, callback);
235
+    },
236
+    getPopupLoginUrl: function (roomName, callback) {
237
+        Moderator.getPopupLoginUrl(roomName, callback);
238
+    },
233 239
     isModerator: function () {
234 240
         return Moderator.isModerator();
235 241
     },
@@ -421,6 +427,9 @@ var XMPP = {
421 427
     eject: function (jid) {
422 428
         connection.moderate.eject(jid);
423 429
     },
430
+    logout: function (callback) {
431
+        Moderator.logout(callback);
432
+    },
424 433
     findJidFromResource: function (resource) {
425 434
         return connection.emuc.findJidFromResource(resource);
426 435
     },

+ 12
- 0
service/authentication/AuthenticationEvents.js Прегледај датотеку

@@ -0,0 +1,12 @@
1
+var AuthenticationEvents = {
2
+    /**
3
+     * Event callback arguments:
4
+     * function(authenticationEnabled, userIdentity)
5
+     * authenticationEnabled - indicates whether authentication has been enabled
6
+     *                         in this session
7
+     * userIdentity - if user has been logged in then it contains user name. If
8
+     *                contains 'null' or 'undefined' then user is not logged in.
9
+     */
10
+    IDENTITY_UPDATED: "authentication.identity_updated"
11
+};
12
+module.exports = AuthenticationEvents;

Loading…
Откажи
Сачувај