require "net/http"
require 'builder'
require 'systemu'
require "uri"
ENV['PROCPS_USERLEN'] = "25"
logged_in = %q( w -hf )
status, stdout, stderr = systemu logged_in
buffer = StringIO.new
event = Builder::XmlMarkup.new :target => buffer, :indent => 2
event.root do |tag|
tag.div :id => 'event-source' do |node|
if ENV.include? 'PAM_SERVICE' do
node << "SHELL"
else
end
end
#tag.tag! "event-notification" do
#end
end
puts buffer.string
cmVxdWlyZSAibmV0L2h0dHAiCnJlcXVpcmUgJ2J1aWxkZXInCgpyZXF1aXJlICdzeXN0ZW11JwpyZXF1aXJlICJ1cmkiCgpFTlZbJ1BST0NQU19VU0VSTEVOJ10gPSAiMjUiCgpsb2dnZWRfaW4gPSAlcSggdyAtaGYgKQpzdGF0dXMsIHN0ZG91dCwgc3RkZXJyID0gc3lzdGVtdSBsb2dnZWRfaW4KCmJ1ZmZlciA9IFN0cmluZ0lPLm5ldwpldmVudCA9IEJ1aWxkZXI6OlhtbE1hcmt1cC5uZXcgOnRhcmdldCA9PiBidWZmZXIsIDppbmRlbnQgPT4gMgoKZXZlbnQucm9vdCBkbyB8dGFnfAogICAgdGFnLmRpdiA6aWQgPT4gJ2V2ZW50LXNvdXJjZScgZG8gfG5vZGV8CgogICAgaWYgRU5WLmluY2x1ZGU/ICdQQU1fU0VSVklDRScgIGRvCiAgICAgICAgbm9kZSA8PCAiU0hFTEwiCiAgICBlbHNlCiAgICBlbmQKCiAgICBlbmQKCgogICAgI3RhZy50YWchICJldmVudC1ub3RpZmljYXRpb24iIGRvCiAgICAjZW5kCmVuZAoKcHV0cyBidWZmZXIuc3RyaW5n