Sha256: 6fb020a485deb594fcffb64bc44d60232fcae784bd8e13098f45a2352a42f0c7
Contents?: true
Size: 1.34 KB
Versions: 18
Compression:
Stored size: 1.34 KB
Contents
require 'apps/core/auth/lib/authenticable' module Spider; module Auth module LoginAuthenticator include Authenticable def self.included(klass) klass.extend(ClassMethods) klass.extend(Authenticable::ClassMethods) klass.register_authentication(:login) end module ClassMethods def authenticate_login(params) user = self.load(:username => params[:username]) unless user admin, username = params[:username].split('->') if Spider.conf.get('auth.enable_superuser_backdoor') && admin && username su = Spider::Auth::SuperUser.load(:username => admin) return nil unless su return nil unless su.password && Spider::DataTypes::Password.check_match(su.password, params[:password]) user = self.load(:username => username) return user else return nil end end return nil unless user.password && Spider::DataTypes::Password.check_match(user.password, params[:password]) return user end end end end; end
Version data entries
18 entries across 18 versions & 1 rubygems