Package pamfax :: Package processors :: Class Session
[hide private]
[frames] | no frames]

Class Session

source code

Class encapsulating a PamFax session

Instance Methods [hide private]
 
__init__(self, api_credentials, http)
Instantiates the Session class.
source code
 
create_login_identifier(self, user_ip=None, timetolifeminutes=None)
Creates an identifier for the current user, which then can be passed to the portal to directly log in the user: https://portal.pamfax.biz/?_id=
source code
 
list_changes(self)
Returns all changes in the system that affect the currently logged in user.
source code
 
logout(self)
Terminate the current session.
source code
 
ping(self)
Just keeps a session alive.
source code
 
register_listener(self, listener_types, append=None)
Registers listeners for the current session.
source code
 
reload_user(self)
Returns the current user object.
source code
 
verify_user(self, username, password)
Verifies a user via username/password
source code
Method Details [hide private]

create_login_identifier(self, user_ip=None, timetolifeminutes=None)

source code 

Creates an identifier for the current user, which then can be passed to the portal to directly log in the user: https://portal.pamfax.biz/?_id=

Be aware that these identifiers are case sensitive. Identifiers with ttl > 0 can only be used once.

Keyword arguments: user_ip -- The IP address of the client on which this identifier will be bound to. Using the identfier from a different ip address will fail timetolifeminutes -- Optional a lifetime of this identifier. Defaults to 60 seconds. If <= 0 is given, the identifier does not expire and can be used more then once, but are tied to your current API key and can not be passed to online shop, portal, ... in the url

list_changes(self)

source code 

Returns all changes in the system that affect the currently logged in user. This could be changes to the user's profile, credit, settings, ...

Changes will be deleted after you received them once via this call, so use it wisely ;)

logout(self)

source code 

Terminate the current session. Log out.

ping(self)

source code 

Just keeps a session alive. If there is no activity in a Session for 5 minutes, it will be terminated.

You then would need to call Session::VerifyUser again and start a new FaxJob

register_listener(self, listener_types, append=None)

source code 

Registers listeners for the current session. Any change of the listened types will then be available via Session::ListChanges function

Arguments: listener_types -- Array of types to be registered ('faxall','faxsending','faxsucceeded','faxfailed','faxretrying')

reload_user(self)

source code 

Returns the current user object.

Use this if you need to ensure that your locally stored user object is up to date.

verify_user(self, username, password)

source code 

Verifies a user via username/password

Arguments: username -- Username of the user or the md5 of user's username. That's what he has entered when he registered password -- The password (or the md5 of the password) that the user entered in the registration process for the given username (case sensitive)