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
13e8c94f
Commit
13e8c94f
authored
14 years ago
by
mcmlxxix
Browse files
Options
Downloads
Patches
Plain Diff
moved SEVAL to admin module, moved IDENT from admin module
parent
fb9ab563
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
exec/load/ircbot_commands.js
+39
-8
39 additions, 8 deletions
exec/load/ircbot_commands.js
with
39 additions
and
8 deletions
exec/load/ircbot_commands.js
+
39
−
8
View file @
13e8c94f
...
...
@@ -145,15 +145,46 @@ Bot_Commands["HELP"].command = function (target,onick,ouh,srv,lvl,cmd) {
}
Bot_Commands
[
"
?
"
]
=
Bot_Commands
[
"
HELP
"
];
Bot_Commands
[
"
SEVAL
"
]
=
new
Bot_Command
(
99
,
true
,
true
);
Bot_Commands
[
"
SEVAL
"
].
command
=
function
(
target
,
onick
,
ouh
,
srv
,
lvl
,
cmd
)
{
cmd
.
shift
();
var
query
=
cmd
.
join
(
"
"
);
try
{
srv
.
o
(
target
,
eval
(
query
));
}
catch
(
e
)
{
srv
.
o
(
target
,
"
ERROR:
"
+
e
);
Bot_Commands
[
"
IDENT
"
]
=
new
Bot_Command
(
0
,
true
,
false
);
Bot_Commands
[
"
IDENT
"
].
usage
=
"
/MSG %s IDENT <nick> <pass>
"
;
Bot_Commands
[
"
IDENT
"
].
help
=
"
Identifies a user by alias and password. Use via private message only.
"
;
Bot_Commands
[
"
IDENT
"
].
command
=
function
(
target
,
onick
,
ouh
,
srv
,
lvl
,
cmd
)
{
var
usr
=
new
User
(
system
.
matchuser
(
onick
));
if
(
cmd
[
2
])
{
/* Username passed */
usr
=
new
User
(
system
.
matchuser
(
cmd
[
1
]));
cmd
[
1
]
=
cmd
[
2
];
}
if
(
!
usr
.
number
)
{
srv
.
o
(
target
,
"
No such user.
"
);
return
;
}
if
((
target
[
0
]
==
"
#
"
)
||
(
target
[
0
]
==
"
&
"
))
{
if
(
lvl
>=
50
)
{
srv
.
o
(
target
,
"
Fool! You've just broadcasted your password to
"
+
"
a public channel! Because of this, I've reset your
"
+
"
password. Pick a new password, then /MSG
"
+
srv
.
nick
+
"
"
+
"
PASS <newpass>
"
);
usr
.
security
.
password
=
""
;
}
else
{
srv
.
o
(
target
,
"
Is broadcasting a password to a public channel
"
+
"
really a smart idea?
"
);
}
return
;
}
if
(
usr
.
security
.
password
==
""
)
{
srv
.
o
(
target
,
"
Your password is blank. Please set one with /MSG
"
+
srv
.
nick
+
"
PASS <newpass>, and then use IDENT.
"
);
return
;
}
if
(
cmd
[
1
].
toUpperCase
()
==
usr
.
security
.
password
)
{
srv
.
o
(
target
,
"
You are now recognized as user '
"
+
usr
.
alias
+
"
'
"
);
srv
.
users
[
onick
.
toUpperCase
()].
ident
=
usr
.
number
;
login_user
(
usr
);
return
;
}
srv
.
o
(
target
,
"
Incorrect password.
"
);
return
;
}
...
...
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