#login on
alias login {
var %x = 0
[color:green]; allow for 3 attempts[/color]
while (%x < 3) {
inc %x
if ($md5($input(Input password:,p,input request)) == %mypassword) {
[color:green]; user has entered his password [/color]
echo -a Password accepted!
guser IDENTIFIED $nick 3
[color:green]; stop processing or he will be asked again! [/color]
halt
}
elseif (%x != 3) {
[color:green]; user provided a wrong password [/color]
echo -a You provided the wrong password. Please try again!
}
else {
[color:green]; Sorry, only 3 attempts allowed [/color]
echo -a You have tried to identify 3 times and failed. Goodbye.
}
}
}
#login end