This repository was archived by the owner on Sep 23, 2021. It is now read-only.
File tree 4 files changed +9
-3
lines changed
4 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -45,8 +45,9 @@ authentication server. But I hope by using MCMyAuth you save some time.
45
45
46
46
2. This program handles just the basics and provides password
47
47
secured login for your users. You can not set skins or cloaks
48
- and there is no password recovery system (admin can only delete
49
- user from the file to let him register again)
48
+ over the web interface and there is no password recovery system
49
+ (admin can only delete user from the file to let him register again
50
+ and only admin can add skins (into the public/skin dir) for players)
50
51
51
52
----
52
53
Requirements: sinatra gem
Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ def msg(str)
69
69
return msg 'You have to set a nickname!' if name ==''
70
70
return msg 'User already exists!' if $userpws[ name ] != nil
71
71
return msg 'You have to set a password!' if pwd ==''
72
+ return msg 'Passwords do not match!' if pwd != params [ :pwdrep ]
72
73
73
74
$userpws[ name ] = md5 pwd
74
75
save_users
@@ -80,6 +81,7 @@ def msg(str)
80
81
name = params [ :name ]
81
82
pwd = params [ :pwd ]
82
83
return msg 'Wrong nickname or password!' if $userpws[ name ] . nil? || md5 ( pwd ) != $userpws[ name ]
84
+ return msg 'Passwords do not match!' if params [ :newpwd ] != params [ :pwdrep ]
83
85
84
86
$userpws[ name ] = md5 params [ :newpwd ]
85
87
save_users
Original file line number Diff line number Diff line change 1
- rvmsudo ruby main.rb -p80
1
+ #! /bin/sh
2
+ sudo ruby main.rb -p80
Original file line number Diff line number Diff line change 6
6
< label for ="name "> Nickname:</ label > < input type ="text " name ="name " maxlength ="20 " />
7
7
< br />
8
8
< label for ="pwd "> Password:</ label > < input type ="password " name ="pwd " maxlength ="20 " />
9
+ < label for ="pwdrep "> Repeat:</ label > < input type ="password " name ="pwdrep " maxlength ="20 " />
9
10
< label > </ label > < input type ="submit " value ="Register " />
10
11
</ form >
11
12
</ div >
17
18
< br />
18
19
< label for ="pwd "> Old password:</ label > < input type ="password " name ="pwd " maxlength ="20 " />
19
20
< label for ="newpwd "> New password:</ label > < input type ="password " name ="newpwd " maxlength ="20 " />
21
+ < label for ="pwdrep "> Repeat:</ label > < input type ="password " name ="pwdrep " maxlength ="20 " />
20
22
< label > </ label > < input type ="submit " value ="Change password " />
21
23
</ form >
22
24
</ div >
You can’t perform that action at this time.
0 commit comments