Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
b2b2b2bb
Commit
b2b2b2bb
authored
Mar 22, 2015
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable automatic anonymous login.
parent
9dae305c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
16 deletions
+30
-16
converse.js
converse.js
+11
-4
dev.html
dev.html
+2
-0
src/templates/login_panel.html
src/templates/login_panel.html
+17
-12
No files found.
converse.js
View file @
b2b2b2bb
...
...
@@ -244,6 +244,7 @@
allow_registration
:
true
,
animate
:
true
,
auto_list_rooms
:
false
,
auto_login
:
false
,
// Currently only used in connection with anonymous login
auto_reconnect
:
false
,
auto_subscribe
:
false
,
bosh_service_url
:
undefined
,
// The BOSH connection manager URL.
...
...
@@ -292,6 +293,13 @@
// BBB
if
(
this
.
prebind
===
true
)
{
this
.
authentication
=
PREBIND
;
}
if
(
this
.
authentication
===
ANONYMOUS
)
{
if
(
!
this
.
jid
)
{
throw
(
"
Config Error: you need to provide the server's domain via the
"
+
"
'jid' option when using anonymous authentication.
"
);
}
}
if
(
settings
.
visible_toolbar_buttons
)
{
_
.
extend
(
this
.
visible_toolbar_buttons
,
...
...
@@ -5160,6 +5168,7 @@
'
MANUAL
'
:
MANUAL
,
'
ANONYMOUS
'
:
ANONYMOUS
,
'
PREBIND
'
:
PREBIND
,
'
auto_login
'
:
converse
.
auto_login
,
'
authentication
'
:
converse
.
authentication
,
'
label_username
'
:
__
(
'
XMPP Username:
'
),
'
label_password
'
:
__
(
'
Password:
'
),
...
...
@@ -5183,10 +5192,6 @@
if
(
ev
&&
ev
.
preventDefault
)
{
ev
.
preventDefault
();
}
var
$form
=
$
(
ev
.
target
);
if
(
converse
.
authentication
===
ANONYMOUS
)
{
if
(
!
converse
.
jid
)
{
throw
(
"
Config Error: you need to provide the server's domain via the
"
+
"
'jid' option when using anonymous authentication.
"
);
}
this
.
connect
(
$form
,
converse
.
jid
,
null
);
return
;
}
...
...
@@ -5379,6 +5384,8 @@
if
(
rid
&&
sid
&&
jid
)
{
this
.
session
.
save
({
rid
:
rid
});
// The RID needs to be increased with each request.
this
.
connection
.
attach
(
jid
,
sid
,
rid
,
this
.
onConnect
);
}
else
if
(
this
.
authentication
===
ANONYMOUS
&&
this
.
auto_login
)
{
this
.
connection
.
connect
(
this
.
jid
,
null
,
this
.
onConnect
);
}
}
}
else
if
(
this
.
authentication
==
"
prebind
"
)
{
...
...
dev.html
View file @
b2b2b2bb
...
...
@@ -52,7 +52,9 @@
<script>
require
([
'
converse
'
],
function
(
converse
)
{
converse
.
initialize
({
auto_login
:
true
,
allow_registration
:
false
,
allow_logout
:
false
,
authentication
:
"
anonymous
"
,
jid
:
"
opkode.im
"
,
bosh_service_url
:
'
https://conversejs.org/http-bind/
'
,
// Please use this connection manager only for testing purposes
...
...
src/templates/login_panel.html
View file @
b2b2b2bb
<form
id=
"converse-login"
method=
"post"
>
{[ if (authentication == MANUAL) { ]}
<label>
{{label_username}}
</label>
<input
type=
"email"
name=
"jid"
placeholder=
"user@server"
>
<label>
{{label_password}}
</label>
<input
type=
"password"
name=
"password"
placeholder=
"password"
>
<input
class=
"submit"
type=
"submit"
value=
"{{label_login}}"
>
<span
class=
"conn-feedback"
></span>
{[ if (auto_login) { ]}
<span
class=
"spinner login-submit"
/>
{[ } ]}
{[ if (authentication == ANONYMOUS) { ]}
<input
type=
"submit"
class=
"submit login-anon"
value=
"{{label_anon_login}}"
/>
{[ } ]}
{[ if (authentication == PREBIND) { ]}
<p>
Disconnected.
</p>
{[ if (!auto_login) { ]}
{[ if (authentication == MANUAL) { ]}
<label>
{{label_username}}
</label>
<input
type=
"email"
name=
"jid"
placeholder=
"user@server"
>
<label>
{{label_password}}
</label>
<input
type=
"password"
name=
"password"
placeholder=
"password"
>
<input
class=
"submit"
type=
"submit"
value=
"{{label_login}}"
>
<span
class=
"conn-feedback"
></span>
{[ } ]}
{[ if (authentication == ANONYMOUS) { ]}
<input
type=
"submit"
class=
"submit login-anon"
value=
"{{label_anon_login}}"
/>
{[ } ]}
{[ if (authentication == PREBIND) { ]}
<p>
Disconnected.
</p>
{[ } ]}
{[ } ]}
</form>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment