Pulling CiviCRM data into a custom Drupal module based on checksum/hash link I have a CiviCRM contribution page that allows an individual to renew a membership on behalf of an organization. When we email them from CiviMail with a checksum link to the page, it will prefill their information in the form automatically and have the membership renewal associate correctly to the organization.

How can I pull the organizational information into a custom Drupal module (e.g. a block that displays in the sidebar, for example)? I would like to have a text block that displays some information about the org and potentially names of people who are related to the org by relationships in CiviCRM. I won't have a problem doing that with Views and/or the CiviCRM API in a custom Drupal module, but I'm not sure how to get the org's ID in this scenario, to know which info to display.
I am assuming you want to show the organization information of logged in contact.
So I would do following:


Get the contact id of logged in contact (or anonymous user who used a checksum link, via the cid field in the URL, as @petednz noted).
Get the current employer id 
then retrieve address of current employer