1 |
dashley |
35 |
<?php
|
2 |
|
|
//$Header: /hl/cvsroots/gpl01/gpl01/webprojs/fboprime/sw/phplib/sessx.inc,v 1.4 2006/11/05 21:05:37 dashley Exp $
|
3 |
|
|
//--------------------------------------------------------------------------------------------------------------
|
4 |
|
|
//sessx.inc--FboPrime Session and Authentication Management Functions and Constants Not Needed by Day View
|
5 |
|
|
// Scheduler
|
6 |
|
|
//Copyright (C) 2006 David T. Ashley
|
7 |
|
|
//
|
8 |
|
|
//This program is free software; you can redistribute it and/or
|
9 |
|
|
//modify it under the terms of the GNU General Public License
|
10 |
|
|
//as published by the Free Software Foundation; either version 2
|
11 |
|
|
//of the License, or (at your option) any later version.
|
12 |
|
|
//
|
13 |
|
|
//This program is distributed in the hope that it will be useful,
|
14 |
|
|
//but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
|
|
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16 |
|
|
//GNU General Public License for more details.
|
17 |
|
|
//
|
18 |
|
|
//You should have received a copy of the GNU General Public License
|
19 |
|
|
//along with this program; if not, write to the Free Software
|
20 |
|
|
//Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
21 |
|
|
//********************************************************************************
|
22 |
|
|
//Implement session and authentication functions.
|
23 |
|
|
//--------------------------------------------------------------------------------------------------------------
|
24 |
|
|
require_once("sess.inc");
|
25 |
|
|
//
|
26 |
|
|
//--------------------------------------------------------------------------------------------------------------
|
27 |
|
|
//Stores the current resource field of the session. The current resource field is remembered
|
28 |
|
|
//as part of the session state in case the resource is ever ambiguous and we need a default.
|
29 |
|
|
//
|
30 |
|
|
function SESS_curresource_set($sid_in, $curresource_in)
|
31 |
|
|
{
|
32 |
|
|
global $GLOBAL_dbhandle;
|
33 |
|
|
|
34 |
|
|
//Form a query to reflect assigning the new current resource to the session record.
|
35 |
|
|
//
|
36 |
|
|
$query_string = "UPDATE sess SET curresource=\"" . (string)$curresource_in . "\" WHERE sid=\"" . $sid_in . "\"";
|
37 |
|
|
|
38 |
|
|
//Run the query. We don't much care whether it fails or succeeds (nothing to be done, anyway).
|
39 |
|
|
mysql_query($query_string, $GLOBAL_dbhandle);
|
40 |
|
|
}
|
41 |
|
|
//
|
42 |
|
|
//--------------------------------------------------------------------------------------------------------------
|
43 |
|
|
//Stores the current user field of the session. The current user field is remembered
|
44 |
|
|
//as part of the session state in case the user is ever ambiguous and we need a default.
|
45 |
|
|
//
|
46 |
|
|
function SESS_curuser_set($sid_in, $curuser_in)
|
47 |
|
|
{
|
48 |
|
|
global $GLOBAL_dbhandle;
|
49 |
|
|
|
50 |
|
|
//Form a query to reflect assigning the new current user to the session record.
|
51 |
|
|
//
|
52 |
|
|
$query_string = "UPDATE sess SET curuser=\"" . (string)$curuser_in . "\" WHERE sid=\"" . $sid_in . "\"";
|
53 |
|
|
|
54 |
|
|
//Run the query. We don't much care whether it fails or succeeds (nothing to be done, anyway).
|
55 |
|
|
mysql_query($query_string, $GLOBAL_dbhandle);
|
56 |
|
|
}
|
57 |
|
|
//
|
58 |
|
|
//--------------------------------------------------------------------------------------------------------------
|
59 |
|
|
//Stores the userlistactive field of the session. The userlistactive field is remembered
|
60 |
|
|
//as part of the session state so we know which of the two user lists to come back to.
|
61 |
|
|
//
|
62 |
|
|
function SESS_userlistactive_set($sid_in, $userlistactive_in)
|
63 |
|
|
{
|
64 |
|
|
global $GLOBAL_dbhandle;
|
65 |
|
|
|
66 |
|
|
//Form a query to reflect assigning the new userlistactive field to the session record.
|
67 |
|
|
//
|
68 |
|
|
$query_string = "UPDATE sess SET userlistactive=\"" . (string)$userlistactive_in . "\" WHERE sid=\"" . $sid_in . "\"";
|
69 |
|
|
|
70 |
|
|
//Run the query. We don't much care whether it fails or succeeds (nothing to be done, anyway).
|
71 |
|
|
mysql_query($query_string, $GLOBAL_dbhandle);
|
72 |
|
|
}
|
73 |
|
|
//
|
74 |
|
|
//--------------------------------------------------------------------------------------------------------------
|
75 |
|
|
//End of $RCSfile: sessx.inc,v $.
|
76 |
|
|
//--------------------------------------------------------------------------------------------------------------
|
77 |
|
|
?>
|