| 1 |
/* |
| 2 |
* -------------------------------------------------------------------------- |
| 3 |
* XooNiPs Xoops modules for Neuroinformatics Platforms |
| 4 |
* Copyright (C) 2005 RIKEN, Japan. All rights reserved. |
| 5 |
* http://sourceforge.jp/projects/xoonips/ |
| 6 |
* -------------------------------------------------------------------------- |
| 7 |
* This program is free software; you can redistribute it and/or |
| 8 |
* modify it under the terms of the GNU General Public License |
| 9 |
* as published by the Free Software Foundation; either version 2 |
| 10 |
* of the License, or (at your option) any later version. |
| 11 |
* |
| 12 |
* This program is distributed in the hope that it will be useful, |
| 13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
* GNU General Public License for more details. |
| 16 |
* |
| 17 |
* You should have received a copy of the GNU General Public License |
| 18 |
* along with this program; if not, write to the Free Software |
| 19 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 20 |
* -------------------------------------------------------------------------- |
| 21 |
* |
| 22 |
* |
| 23 |
* 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 24 |
* |
| 25 |
* $Revision: 1.8 $ |
| 26 |
* $Log: session.h,v $ |
| 27 |
* Revision 1.8 2005/01/19 10:06:37 aga |
| 28 |
* 鐃緒申session::SID_GUEST=0鐃緒申鐃緒申鐃緒申. |
| 29 |
* |
| 30 |
* Revision 1.7 2005/01/15 05:33:41 youi |
| 31 |
* account.h鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申. |
| 32 |
* |
| 33 |
* Revision 1.6 2005/01/06 07:24:07 youi |
| 34 |
* getUserID鐃緒申getUID鐃緒申鐃緒申setUserID鐃緒申setUID鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申. |
| 35 |
* |
| 36 |
* Revision 1.5 2004/11/30 05:46:32 aga |
| 37 |
* 鐃緒申session鐃緒申鐃緒申remoteHost鐃緒申鐃緒申鐃緒申. |
| 38 |
* |
| 39 |
* Revision 1.4 2004/11/26 06:24:53 aga |
| 40 |
* 鐃緒申session鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申userid_t鐃緒申鐃緒申鐃緒申. |
| 41 |
* |
| 42 |
* Revision 1.3 2004/11/25 09:00:41 youi |
| 43 |
* get鐃緒申鐃緒申鐃緒申鐃緒申const鐃緒申鐃緒申. |
| 44 |
* sessionid_t鐃緒申typedef鐃緒申鐃緒申. |
| 45 |
* |
| 46 |
* Revision 1.2 2004/11/25 04:12:03 youi |
| 47 |
* typedef鐃緒申鐃緒申鐃緒申. |
| 48 |
* |
| 49 |
* Revision 1.1 2004/11/24 06:53:07 youi |
| 50 |
* initial version |
| 51 |
* |
| 52 |
* |
| 53 |
*/ |
| 54 |
|
| 55 |
#if !defined( SESSION_H ) |
| 56 |
#define SESSION_H |
| 57 |
|
| 58 |
#include <time.h> |
| 59 |
#include "account.h" |
| 60 |
#include "common.h" |
| 61 |
|
| 62 |
typedef unsigned long sessionid_t; |
| 63 |
class session{ |
| 64 |
private: |
| 65 |
unsigned long sessionID; //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申ID |
| 66 |
time_t date; //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 67 |
userid_t userID; // xoops_users鐃緒申uid |
| 68 |
|
| 69 |
void sessionid( time_t date ); |
| 70 |
public: |
| 71 |
// reserved sessionID |
| 72 |
static const sessionid_t SID_GUEST = 0; |
| 73 |
|
| 74 |
session(); |
| 75 |
session( time_t date ); |
| 76 |
~session(); |
| 77 |
|
| 78 |
sessionid_t getSessionID() const; |
| 79 |
time_t getDate() const; |
| 80 |
userid_t getUID() const; |
| 81 |
|
| 82 |
void setDate( time_t date ); |
| 83 |
void setSessionID( sessionid_t ); |
| 84 |
void setUID( userid_t ); |
| 85 |
}; |
| 86 |
|
| 87 |
typedef session session_t; |
| 88 |
#endif |