t('Persistent Login debug')); return $blocks; case 'view': $block = array('subject' => t('Persistent Login'), 'content' => _persistent_login_debug()); return $block; } } function _persistent_login_debug() { $output = ('
Security Hole! Debugging only. '. 'Turn this off!
'); global $user; $now = time(); $output .= ('

Time: '.format_date($now)." ($now)
" . 'Uid: '.$user->uid.'

'); $output .= '

Cookies
'; foreach ($_COOKIE as $name => $value) { $output .= "$name = $value
"; } list($uid, $series, $token) = explode(':', $_COOKIE[PERSISTENT_LOGIN_COOKIE]); $res = db_query('SELECT * FROM {persistent_login} pl ' . 'WHERE pl.uid=%d', $uid); $rows = array(); while ($r = db_fetch_array($res)) { $row = array(); $row[] = $r['uid']; $row[] = $r['series']; $row[] = $r['token']; $row[] = date('m/d H:i', $r['expires']); $rows[] = $row; } $output .= '

Stored data:
'; $output .= theme('table', array('uid', 'series', 'token', 'expires'), $rows); $vars = array('check', 'login', 'reauth', 'default_user', 'welcomed'); foreach ($vars as $var) { $output .= ("persistent_login_$var: ". serialize($_SESSION['persistent_login_'.$var])."
"); } return $output; }