poll_uid

Versions
4.6
poll_uid()

Determine an adjusted user id, to allow for basic tracking of anonymous users (IP-based).

▾ 2 functions call poll_uid()

poll_load in modules/poll.module
Implementation of hook_load().
poll_vote in modules/poll.module
Callback for processing a vote

Code

modules/poll.module, line 225

<?php
function poll_uid() {
  global $user;
  if ($user->uid) {
     // Pad the UID with underscores to allow a simple strstr() search
    $id = '_'. $user->uid .'_';
  }
  else {
    $id = $_SERVER['REMOTE_ADDR'];
  }
  return $id;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.