Module: Admin::Control

Defined in:
lib/erasmus/admin.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(obj) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/erasmus/admin.rb', line 9

def self.extended(obj)
  obj.instance_eval {
    @flags['stop'] = lambda { |user, host, arguments, source|
      begin
        su user
        @server.quit
      rescue Erasmus::AuthenticationError
        notice_user(user, "I'm sorry, but I can't allow you to do that.")
      rescue Exception => e
        raise
      end
    }
  }
end

Instance Method Details

#su(user) ⇒ Object



3
4
5
6
7
8
# File 'lib/erasmus/admin.rb', line 3

def su(user)
  # check if owner and idented
  if !(user == @server.owner and @server.acc(user) == "3")
      raise Erasmus::AuthenticationError
  end
end