[RCU] How to know that a user is connected to Roundcube from a Rails app ?

Sol Badguy kazenocoe at yahoo.fr
Fri May 8 16:22:33 CEST 2009


I am making an SSO-like system based on the Roundcube connection and would like to check from a Ruby on Rails App that the user is logged in Roundcube. I have tried to make a HTTP GET request from my Rails app and checking for the existance of the login form on the index.php page.

Here's my rails code 

        require 'net/http'      
        url = URI.parse('http://www.mysite.com/dir1/index.php')
        req = Net::HTTP::Get.new(url.path)
        res = Net::HTTP.start(url.host, url.port) {|http|

        reg = /<div id="login-form">/
        logged = reg.match(res.body) ? false : true

even though a user is connected in Roundcube my get keep returning the login page.
Where am I mistaken ? Or does anyone have a better way of doing this ?

Thank you for your help.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.roundcube.net/pipermail/users/attachments/20090508/4757b0e5/attachment-0001.html>
-------------- next part --------------
List info: http://lists.roundcube.net/users/

More information about the users mailing list