Skip to content
icaton edited this page Jul 1, 2011 · 13 revisions

We have already shown you how to log into the server and how you check if you are logged in and connected. Now we will add a bit more to that.

You can log out of the server in a similar manner to logging in. The SugarCRM logout function can be found here. As you can see, the format is very similar to the log in function. You can make a simple call like such:

session.logout()

Which will log you out of the server. You can check this by doing the opposite of information printed from the logout function.

if session.id = 0
print "Login Successful!

The picture shows you the output you should see after logging out of the server in the manner shown above.

Now if you are interested in general information about your server, you can call the get_server_info() function, which you can find here.

As you can see it's pretty simple and you can check this information using the following example.

server_info = session.get_server_info()

Which will return with three values. It will give you the current GMT time on the server in Y-m-d H:i:s format, it will give you the sugarCRM edition you are using (Enterprise, Professional or Community) and it will give you the version you are using. The output will look something like this: Get server info

Clone this wiki locally