gennaro 0.3.4.2 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gennaro/version.rb +1 -1
- data/templates/authentication/app/controllers/users.rb +8 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f541cd6e130743a5228509f69b4893924a27212
|
4
|
+
data.tar.gz: faf4291c97a5d182b32c36963c1ec43620ba9a33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d730423112e177b8d91558269ac271c3f548f07255b7613f5686420fad532736629f36ccb58e182bcbee6cdcfeb8e3f3a760abac4875063262166e77ac3e6b39
|
7
|
+
data.tar.gz: 7dad55facca5ad8e637abdf8c40b02e0cb4f49a44418a8413a1db33a99ebba96452b9066977f1498c24f4163a55a4be3710f3a15f80640a22095d888c7a8db62
|
data/lib/gennaro/version.rb
CHANGED
@@ -126,7 +126,9 @@ 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
|
-
|
129
|
+
user = User.get params[:username]
|
130
|
+
|
131
|
+
level = case params[:level]
|
130
132
|
when 'banned' then User.banned
|
131
133
|
when 'founder' then User.founder
|
132
134
|
when 'admin' then User.admin
|
@@ -135,8 +137,13 @@ class ${ClassName}
|
|
135
137
|
when 'user' then User.user
|
136
138
|
else nil
|
137
139
|
end
|
140
|
+
|
138
141
|
if level.nil?
|
139
142
|
@error = 'User level not recognized.'
|
143
|
+
elsif not user
|
144
|
+
@error = 'User not recognized.'
|
145
|
+
elsif level == User.founder || user.founder?
|
146
|
+
@error = 'Foundership is untouchable.'
|
140
147
|
else
|
141
148
|
user = User.change_level params[:username], level
|
142
149
|
if user
|