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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6a1d8206ba33434d2c194eded5bebd255802ea02
4
- data.tar.gz: 0000be057664ade929e8f7e25397093e3d7f6911
3
+ metadata.gz: 5f541cd6e130743a5228509f69b4893924a27212
4
+ data.tar.gz: faf4291c97a5d182b32c36963c1ec43620ba9a33
5
5
  SHA512:
6
- metadata.gz: 43d785497ce5c329e0eb92f96d9b12f0054745175809b4b4ad1f2e19d5b5094bf5aef898cfbc4598538c9ecf456ce862e8c381f469ef8d91a9a9ff3df4c7ff46
7
- data.tar.gz: 9dd8714fa88b2a83b94779353b3a8d9b135ac230a48b59946570b7a23258952b9348841bbb4c3815c868f846363b2c46d5a6313e9a303149c08b4f7e5c2c0d55
6
+ metadata.gz: d730423112e177b8d91558269ac271c3f548f07255b7613f5686420fad532736629f36ccb58e182bcbee6cdcfeb8e3f3a760abac4875063262166e77ac3e6b39
7
+ data.tar.gz: 7dad55facca5ad8e637abdf8c40b02e0cb4f49a44418a8413a1db33a99ebba96452b9066977f1498c24f4163a55a4be3710f3a15f80640a22095d888c7a8db62
@@ -10,6 +10,6 @@
10
10
 
11
11
  class Gennaro
12
12
  def self.version
13
- '0.3.4.2'
13
+ '0.3.5'
14
14
  end
15
15
  end
@@ -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
- level = case # I guess using #send could be dangerous
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gennaro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4.2
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Giovanni Capuano