require "json" #This class handels various operations with the Openall-installation. It uses HTTP and JSON. class Openall_time_applet::Connection def initialize(args) @args = args @http = Knj::Http2.new( :host => @args[:host], :port => @args[:port], :follow_redirects => false, :ssl => @args[:ssl], :debug => false ) self.login end def login #For some weird reason OpenAll seems to only accept multipart-post-requests?? @http.post_multipart("index.php?c=Auth&m=validateLogin", {"username" => @args[:username], "password" => @args[:password]}) #Verify login by reading dashboard HTML. res = @http.get("index.php?c=Dashboard") if !res.body.match(/