Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
c66a0021
Commit
c66a0021
authored
19 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Added "email forgotten password" feature.
Set email_passwords=false to disable.
parent
a000d6d0
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
exec/login.js
+53
-4
53 additions, 4 deletions
exec/login.js
with
53 additions
and
4 deletions
exec/login.js
+
53
−
4
View file @
c66a0021
...
...
@@ -6,6 +6,8 @@
load
(
"
sbbsdefs.js
"
);
var
email_passwords
=
true
;
// The following 2 lines are only required for "Re-login" capability
bbs
.
logout
();
system
.
node_list
[
bbs
.
node_num
-
1
].
status
=
NODE_LOGON
;
...
...
@@ -18,13 +20,13 @@ for(var c=0; c<10; c++) {
bbs
.
nodesync
();
// Display login prompt
console
.
print
(
"
\r\n\
1n
\
1h
\
1cEnter User Name
"
);
console
.
print
(
"
\r\n\
1n
\
1h
\
1cEnter
\
1w
User Name
"
);
if
(
!
(
bbs
.
node_settings
&
NM_NO_NUM
))
console
.
print
(
"
or Number
"
);
console
.
print
(
"
\
1c
or
\
1w
Number
"
);
if
(
!
(
system
.
settings
&
SYS_CLOSED
))
console
.
print
(
"
or '
\
1yNew
\
1c'
"
);
console
.
print
(
"
\
1c
or '
\
1yNew
\
1c'
"
);
if
(
guest
)
console
.
print
(
"
or '
\
1yGuest
\
1c'
"
);
console
.
print
(
"
\
1c
or '
\
1yGuest
\
1c'
"
);
console
.
print
(
"
\r\n
NN:
\
b
\
b
\
bLogin:
\
1w
"
);
// Get login string
...
...
@@ -47,6 +49,53 @@ for(var c=0; c<10; c++) {
bbs
.
logon
();
exit
();
}
if
(
email_passwords
)
{
var
usernum
=
system
.
matchuser
(
str
);
if
(
usernum
)
{
var
u
=
new
User
(
usernum
);
if
(
!
(
u
.
settings
&
(
USER_DELETED
|
USER_INACTIVE
))
&&
netaddr_type
(
u
.
netmail
)
==
NET_INTERNET
&&
!
console
.
noyes
(
"
Did you forget your password
"
))
{
console
.
print
(
"
\
1n
\
1c
\
1hPlease confirm your Internet e-mail address:
\
1y
"
);
var
email_addr
=
console
.
getstr
(
50
);
if
(
email_addr
.
toLowerCase
()
==
u
.
netmail
.
toLowerCase
())
{
var
msgbase
=
new
MsgBase
(
"
mail
"
);
if
(
msgbase
.
open
()
==
false
)
alert
(
log
(
LOG_ERR
,
"
!ERROR
"
+
msgbase
.
last_error
));
else
{
var
hdr
=
{
to
:
u
.
alias
,
to_net_addr
:
u
.
netmail
,
to_net_type
:
NET_INTERNET
,
from
:
system
.
operator
,
from_ext
:
"
1
"
,
subject
:
system
.
name
+
"
user account information
"
};
var
msgtxt
=
"
Your user account information was requested on
"
+
system
.
timestr
()
+
"
\r\n
"
;
msgtxt
+=
"
by
"
+
client
.
host_name
+
"
[
"
+
client
.
ip_address
+
"
] via
"
+
client
.
protocol
+
"
(TCP port
"
+
client
.
port
+
"
):
\r\n\r\n
"
;
msgtxt
+=
"
Account Number:
"
+
u
.
number
+
"
\r\n
"
;
msgtxt
+=
"
Created:
"
+
system
.
timestr
(
u
.
stats
.
firston_date
)
+
"
\r\n
"
;
msgtxt
+=
"
Last on:
"
+
system
.
timestr
(
u
.
stats
.
laston_date
)
+
"
\r\n
"
;
msgtxt
+=
"
Connect:
"
+
u
.
host_name
+
"
[
"
+
u
.
ip_address
+
"
]
"
+
"
via
"
+
u
.
connection
+
"
\r\n
"
;
msgtxt
+=
"
Password:
"
+
u
.
security
.
password
+
"
\r\n
"
;
if
(
msgbase
.
save_msg
(
hdr
,
msgtxt
))
console
.
print
(
"
\r\n\
1n
\
1h
\
1yAccount information e-mailed to:
\
1w
"
+
u
.
netmail
+
"
\r\n
"
);
else
alert
(
log
(
LOG_ERR
,
"
!ERROR
"
+
msgbase
.
last_error
+
"
saving bulkmail message
"
));
msgbase
.
close
();
}
continue
;
}
alert
(
log
(
LOG_WARNING
,
"
Incorrect e-mail address:
"
+
email_addr
));
}
}
}
// Password failure counts as 2 attempts
c
++
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment