Mercurial > defr > drupal > core
comparison includes/session.inc @ 9:acef7ccb09b5 6.4
Drupal 6.4
author | Franck Deroche <webmaster@defr.org> |
---|---|
date | Tue, 23 Dec 2008 14:32:08 +0100 |
parents | c1f4ac30525a |
children | 589fb7c02327 |
comparison
equal
deleted
inserted
replaced
8:85cbd6048071 | 9:acef7ccb09b5 |
---|---|
1 <?php | 1 <?php |
2 // $Id: session.inc,v 1.44.2.1 2008/02/07 11:58:40 goba Exp $ | 2 // $Id: session.inc,v 1.44.2.2 2008/08/12 10:29:03 dries Exp $ |
3 | 3 |
4 /** | 4 /** |
5 * @file | 5 * @file |
6 * User session handling functions. | 6 * User session handling functions. |
7 */ | 7 */ |
105 | 105 |
106 db_query("UPDATE {sessions} SET sid = '%s' WHERE sid = '%s'", session_id(), $old_session_id); | 106 db_query("UPDATE {sessions} SET sid = '%s' WHERE sid = '%s'", session_id(), $old_session_id); |
107 } | 107 } |
108 | 108 |
109 /** | 109 /** |
110 * Counts how many users have sessions. Can count either anonymous sessions, authenticated sessions, or both. | 110 * Counts how many users have sessions. Can count either anonymous sessions or authenticated sessions. |
111 * | 111 * |
112 * @param int $timestamp | 112 * @param int $timestamp |
113 * A Unix timestamp representing a point of time in the past. | 113 * A Unix timestamp representing a point of time in the past. |
114 * The default is 0, which counts all existing sessions. | 114 * The default is 0, which counts all existing sessions. |
115 * @param int $anonymous | 115 * @param boolean $anonymous |
116 * TRUE counts only anonymous users. | 116 * TRUE counts only anonymous users. |
117 * FALSE counts only authenticated users. | 117 * FALSE counts only authenticated users. |
118 * Any other value will return the count of both authenticated and anonymous users. | |
119 * @return int | 118 * @return int |
120 * The number of users with sessions. | 119 * The number of users with sessions. |
121 */ | 120 */ |
122 function sess_count($timestamp = 0, $anonymous = true) { | 121 function sess_count($timestamp = 0, $anonymous = true) { |
123 $query = $anonymous ? ' AND uid = 0' : ' AND uid > 0'; | 122 $query = $anonymous ? ' AND uid = 0' : ' AND uid > 0'; |