Sha256: 670ba3287a2844fa385348a36a780d97a13f2e3c48dcbe376fc2e312edf7b5a5
Contents?: true
Size: 822 Bytes
Versions: 3
Compression:
Stored size: 822 Bytes
Contents
#!/usr/bin/env ruby # encoding: utf-8 # Html::Util::Server -- ydim -- 12.01.2006 -- hwyss@ywesee.com require 'openssl' require 'sbsm/drbserver' require 'ydim/html/util/session' require 'ydim/html/util/validator' require 'ydim/client' module YDIM module Html module Util class Server < SBSM::DRbServer SESSION = Html::Util::Session VALIDATOR = Html::Util::Validator def initialize(server) @server = server @private_key = OpenSSL::PKey::DSA.new(File.read(Html.config.root_key)) @system = YDIM::Client.new(Html.config) super(@system) end def login(email, pass_hash) (email == Html.config.email) && (pass_hash == Html.config.md5_pass) end def method_missing(meth, *args) @system.login(@server, @private_key) begin @system.send(meth, *args) ensure @system.logout end end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
ydim-html-1.0.3 | lib/ydim/html/util/server.rb |
ydim-html-1.0.2 | lib/ydim/html/util/server.rb |
ydim-html-1.0.1 | lib/ydim/html/util/server.rb |