vidibus-pureftpd 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -167,45 +167,44 @@ dscacheutil -q user
167
167
  dscacheutil -q group
168
168
  ```
169
169
 
170
+ #### Debugging
170
171
 
171
- Not needed for testing, but to start the server, type:
172
+ To start the server, e.g. for debugging the users you've created, type `sudo /usr/local/sbin/pure-ftpd &`
172
173
 
173
- ```
174
- sudo /usr/local/sbin/pure-ftpd &
175
- ```
174
+ You should now be able to connect via ftp by entering `ftp localhost`. To shut it down, call `sudo pkill pure-ftpd`
176
175
 
177
- You should now be able to connect via ftp:
176
+ In order to check which users have been created, call `pure-pw list`.
178
177
 
179
- ```
180
- ftp localhost
181
- ```
178
+ If you really want to use Pure-FTPd as FTP server on OSX, you should consider installing [PureFTPd Manager](http://jeanmatthieu.free.fr/pureftpd/).
182
179
 
183
- Shut it down with:
184
180
 
185
- ```
186
- sudo pkill pure-ftpd
187
- ```
181
+ #### Troubleshooting
188
182
 
189
- If you really want to use Pure-FTPd as FTP server on OSX, you should consider installing [PureFTPd Manager](http://jeanmatthieu.free.fr/pureftpd/).
183
+ When using this gem in a web application, it may happen that the execution of the `pure-ftp` command fails. A reason for that may be that your webserver is not able access the command.
184
+
185
+ I solved this issue by adding a symlink:
190
186
 
187
+ ```
188
+ sudo ln -s /usr/local/bin/pure-pw /usr/bin/pure-pw
189
+ ```
191
190
 
192
191
  ## TODO
193
192
 
194
193
  Implement all user options offered by Pure-FTPd:
195
194
 
196
195
  ```
197
- -t <download bandwidth>
198
- -T <upload bandwidth>
199
- -n <max number of files>
200
- -N <max Mbytes>
201
- -q <upload ratio>
202
- -Q <download ratio>
203
- -r <allow client host>
204
- -R <deny client host>
205
- -i <allow local host>
206
- -I <deny local host>
207
- -y <max number of concurrent sessions>
208
- -z <hhmm>-<hhmm>
196
+ -t <download bandwidth>
197
+ -T <upload bandwidth>
198
+ -n <max number of files>
199
+ -N <max Mbytes>
200
+ -q <upload ratio>
201
+ -Q <download ratio>
202
+ -r <allow client host>
203
+ -R <deny client host>
204
+ -i <allow local host>
205
+ -I <deny local host>
206
+ -y <max number of concurrent sessions>
207
+ -z <hhmm>-<hhmm>
209
208
  ```
210
209
 
211
210
 
@@ -6,6 +6,8 @@ de:
6
6
  attributes:
7
7
  login:
8
8
  taken: 'ist bereits vergeben'
9
+ password:
10
+ reenter: 'bitte nochmals eingeben'
9
11
  directory:
10
12
  not_existent: 'gibt es nicht'
11
13
  not_a_directory: 'muss ein Verzeichnis sein'
@@ -6,6 +6,8 @@ en:
6
6
  attributes:
7
7
  login:
8
8
  taken: 'has already been taken'
9
+ password:
10
+ reenter: 'please re-enter'
9
11
  directory:
10
12
  not_existent: 'does not exist'
11
13
  not_a_directory: 'must be a directory'
@@ -28,7 +28,7 @@ module Vidibus
28
28
 
29
29
  validates :password, :directory, :presence => true
30
30
  validates :login, :format => { :with => /^[a-z_0-9\-]+$/ }
31
- validate :unique_login?, :if => :login_changed?
31
+ validate :valid_login?, :if => :login_changed?
32
32
  validate :valid_directory?, :if => :directory_changed?
33
33
 
34
34
  def initialize(values = {})
@@ -73,6 +73,7 @@ module Vidibus
73
73
  def reload
74
74
  if persisted? && login_was && (user = User.find_by_login(login_was))
75
75
  self.attributes = user.attributes
76
+ @changed_attributes.clear
76
77
  self
77
78
  else
78
79
  raise DocumentNotFound
@@ -118,11 +119,20 @@ module Vidibus
118
119
  attributes.merge(Vidibus::Pureftpd.settings)
119
120
  end
120
121
 
121
- def unique_login?
122
+ def valid_login?
122
123
  return unless login.present?
123
124
  if User.find_by_login(login)
124
125
  self.errors.add(:login, :taken)
125
126
  end
127
+ unless password_changed?
128
+ # Double check that password has not been changed
129
+ if existing = User.find_by_login(login_was)
130
+ if password == existing.password
131
+ self.password = nil
132
+ self.errors.add(:password, :reenter)
133
+ end
134
+ end
135
+ end
126
136
  end
127
137
 
128
138
  def valid_directory?
@@ -1,5 +1,5 @@
1
1
  module Vidibus
2
2
  module Pureftpd
3
- VERSION = '1.0.2'
3
+ VERSION = '1.0.3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vidibus-pureftpd
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-22 00:00:00.000000000 Z
12
+ date: 2012-09-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: posix-spawn
@@ -184,7 +184,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
184
184
  version: '0'
185
185
  segments:
186
186
  - 0
187
- hash: 2950673401498761053
187
+ hash: -2523392839063022724
188
188
  required_rubygems_version: !ruby/object:Gem::Requirement
189
189
  none: false
190
190
  requirements: