gennaro 0.3.5 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0feaf7039090decd2eadb3f002828c3cbf18bba0
|
4
|
+
data.tar.gz: 669b21a4f09f66b76cf87811302e56bb8de8e4f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af718ba64a9c71d6dd1ca0a10edb3af50ff13d8065f9f31763aed544aa3a04a0c20ace92828e0e7d767a86b62eb2a6713600087cf42b70085a1658188397beb2
|
7
|
+
data.tar.gz: f42fe4fa5ce91a9c5c08471592260d17f727ab7d8fb88a67cd9139e3f217f017f1a770b029e9c2e45e43a48a7c8c11771f422f75e35e152af4da544fb60b26d2
|
data/lib/gennaro/version.rb
CHANGED
@@ -79,7 +79,7 @@ class ${ClassName}
|
|
79
79
|
level = User.empty? ? User.founder : User.user
|
80
80
|
user = User.signup params[:username], params[:email], params[:password], level
|
81
81
|
if user.errors.any?
|
82
|
-
@error = user.errors.first
|
82
|
+
@error = user.errors.first.first
|
83
83
|
else
|
84
84
|
@success = 'Sign up successful.'
|
85
85
|
end
|
@@ -118,7 +118,7 @@ class ${ClassName}
|
|
118
118
|
post '/user/change_level/?' do
|
119
119
|
if not logged_in?
|
120
120
|
@error = 'You need to log in.'
|
121
|
-
elsif not current_user.
|
121
|
+
elsif not current_user.high_staff?
|
122
122
|
@error = 'Go home, this is not a place for you.'
|
123
123
|
elsif fields? :username, :go
|
124
124
|
@user = User.get params[:username]
|
@@ -126,8 +126,7 @@ class ${ClassName}
|
|
126
126
|
elsif not fields? :username, :level
|
127
127
|
@error = 'To change a user level, you need to send his username and level.'
|
128
128
|
else
|
129
|
-
user
|
130
|
-
|
129
|
+
user = User.get params[:username]
|
131
130
|
level = case params[:level]
|
132
131
|
when 'banned' then User.banned
|
133
132
|
when 'founder' then User.founder
|
@@ -63,9 +63,15 @@ class User
|
|
63
63
|
false
|
64
64
|
end
|
65
65
|
|
66
|
+
def high_staff?
|
67
|
+
founder? || admin?
|
68
|
+
end
|
69
|
+
alias_method :high_staffer?, :high_staff?
|
70
|
+
|
66
71
|
def staff?
|
67
72
|
founder? || admin? || smod? || mod?
|
68
73
|
end
|
74
|
+
alias_method :staffer?, :staff?
|
69
75
|
|
70
76
|
def logged?(session)
|
71
77
|
self.session == session
|