Browse CVS Repository
Annotation of /xoonips/AL/event.cc
Parent Directory
| Revision Log
| Revision Graph
Revision 1.3 -
( hide annotations)
( download)
( as text)
Wed Oct 5 08:12:15 2005 UTC
(18 years, 6 months ago)
by orrisroot
Branch: MAIN
CVS Tags: REL20060213, REL20051226, XOONIPS_RC1, MergePnt_20051116, REL20060323, MergePnt_20051220
Branch point for: XOONIPS_STABLE_2, XOONIPS_STABLE
Changes since 1.2: +2 -1 lines
File MIME type: text/x-c++src
time.h へッダファイルのインクルードを追加
| 1 |
aga4096 |
1.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 |
orrisroot |
1.3 |
* $Revision: 1.2 $ |
| 26 |
aga4096 |
1.1 |
*/ |
| 27 |
|
|
|
| 28 |
orrisroot |
1.3 |
#include <time.h> |
| 29 |
aga4096 |
1.1 |
#include <string.h> |
| 30 |
|
|
|
| 31 |
|
|
#include "common.h" |
| 32 |
|
|
#include "event.h" |
| 33 |
|
|
|
| 34 |
|
|
const int event::validFields[][10] = |
| 35 |
|
|
{ |
| 36 |
aga4096 |
1.2 |
// timestamp, exec_uid, remote_host, index_id, file_id, uid, gid, search_keyword, additional_info |
| 37 |
aga4096 |
1.1 |
{ 0,0,0,0,0,0,0,0,0,0}, //(dummy) |
| 38 |
|
|
{ 1,1,1,0,0,0,0,0,0,1}, //LOGIN_FAILURE |
| 39 |
|
|
{ 1,1,1,0,0,0,0,0,0,0}, //LOGIN_SUCCESS |
| 40 |
|
|
{ 1,1,1,0,0,0,0,0,0,0}, //LOGOUT |
| 41 |
|
|
{ 1,1,1,0,1,0,0,0,0,0}, //INSERT_ITEM |
| 42 |
|
|
{ 1,1,1,0,1,0,0,0,0,0}, //UPDATE_ITEM |
| 43 |
|
|
{ 1,1,1,0,1,0,0,0,0,0}, //DELETE_ITEM |
| 44 |
|
|
{ 1,1,1,0,1,0,0,0,0,0}, //VIEW_ITEM |
| 45 |
|
|
{ 1,1,1,0,1,1,0,0,0,0}, //DOWNLOAD_FILE |
| 46 |
|
|
{ 1,1,1,1,1,0,0,0,0,0}, //REQUEST_CERTIFY_ITEM |
| 47 |
|
|
{ 1,1,1,1,0,0,0,0,0,0}, //INSERT_INDEX |
| 48 |
|
|
{ 1,1,1,1,0,0,0,0,0,0}, //UPDATE_INDEX |
| 49 |
|
|
{ 1,1,1,1,0,0,0,0,0,0}, //DELETE_INDEX |
| 50 |
|
|
{ 1,1,1,1,1,0,0,0,0,0}, //CERTIFY_ITEM |
| 51 |
|
|
{ 1,1,1,1,1,0,0,0,0,0}, //REJECT_ITEM |
| 52 |
aga4096 |
1.2 |
{ 1,0,1,0,0,0,1,0,0,0}, //REQUEST_INSERT_ACCOUNT |
| 53 |
aga4096 |
1.1 |
{ 1,1,1,0,0,0,1,0,0,0}, //CERTIFY_ACCOUNT |
| 54 |
|
|
{ 1,1,1,0,0,0,0,1,0,0}, //INSERT_GROUP |
| 55 |
|
|
{ 1,1,1,0,0,0,0,1,0,0}, //UPDATE_GROUP |
| 56 |
|
|
{ 1,1,1,0,0,0,0,1,0,0}, //DELETE_GROUP |
| 57 |
|
|
{ 1,1,1,0,0,0,1,1,0,0}, //INSERT_GROUP_MEMBER |
| 58 |
|
|
{ 1,1,1,0,0,0,1,1,0,0}, //DELETE_GROUP_MEMBER |
| 59 |
|
|
{ 1,1,1,0,0,0,0,0,0,0}, //VIEW_TOP_PAGE |
| 60 |
|
|
{ 1,1,1,0,0,0,0,0,1,0}, //QUICK_SEARCH |
| 61 |
|
|
{ 1,1,1,0,0,0,0,0,1,0} //ADVANCED_SEARCH |
| 62 |
|
|
}; |
| 63 |
|
|
|
| 64 |
|
|
event::event() |
| 65 |
|
|
{ |
| 66 |
|
|
eventID = 0; |
| 67 |
|
|
eventTypeID = ETID_INVALID_ETID; |
| 68 |
|
|
timestamp = 0; |
| 69 |
|
|
execUID = 0; |
| 70 |
|
|
indexID = 0; |
| 71 |
|
|
itemID = 0; |
| 72 |
|
|
fileID = 0; |
| 73 |
|
|
uid = 0; |
| 74 |
|
|
gid = 0; |
| 75 |
|
|
remoteHost = 0; setValue( &this -> remoteHost , "" ); |
| 76 |
|
|
searchKeyword = 0; setValue( &this -> searchKeyword , "" ); |
| 77 |
aga4096 |
1.2 |
additionalInfo= 0; setValue( &this -> additionalInfo, "" ); |
| 78 |
aga4096 |
1.1 |
} |
| 79 |
|
|
|
| 80 |
|
|
event::~event(){ |
| 81 |
|
|
if ( remoteHost != 0 ) delete[] remoteHost ; |
| 82 |
|
|
if ( searchKeyword != 0 ) delete[] searchKeyword ; |
| 83 |
aga4096 |
1.2 |
if ( additionalInfo!= 0 ) delete[] additionalInfo; |
| 84 |
aga4096 |
1.1 |
|
| 85 |
|
|
} |
| 86 |
|
|
|
| 87 |
|
|
eventid_t event::getEventID () const { return eventID ; } |
| 88 |
|
|
eventtypeid_t event::getEventTypeID () const { return eventTypeID ; } |
| 89 |
|
|
time_t event::getTimestamp () const { return timestamp ; } |
| 90 |
|
|
userid_t event::getExecUID () const { return execUID ; } |
| 91 |
|
|
indexid_t event::getIndexID () const { return indexID ; } |
| 92 |
|
|
itemid_t event::getItemID () const { return itemID ; } |
| 93 |
|
|
fileid_t event::getFileID () const { return fileID ; } |
| 94 |
|
|
userid_t event::getUID () const { return uid ; } |
| 95 |
|
|
groupid_t event::getGID () const { return gid ; } |
| 96 |
|
|
const char* event::getRemoteHost () const { return remoteHost ; } |
| 97 |
|
|
const char* event::getSearchKeyword () const { return searchKeyword ; } |
| 98 |
aga4096 |
1.2 |
const char* event::getAdditionalInfo() const { return additionalInfo; } |
| 99 |
aga4096 |
1.1 |
|
| 100 |
aga4096 |
1.2 |
void event::setEventID ( eventid_t x ) { if ( ETID_INVALID_ETID < x && x <= ETID_MAX ) eventID = x; } |
| 101 |
|
|
void event::setEventTypeID ( eventtypeid_t x ) { eventTypeID = x; } |
| 102 |
|
|
void event::setTimestamp ( time_t x ) { timestamp = x; } |
| 103 |
|
|
void event::setExecUID ( userid_t x ) { execUID = x; } |
| 104 |
|
|
void event::setIndexID ( indexid_t x ) { indexID = x; } |
| 105 |
|
|
void event::setItemID ( itemid_t x ) { itemID = x; } |
| 106 |
|
|
void event::setFileID ( fileid_t x ) { fileID = x; } |
| 107 |
|
|
void event::setUID ( userid_t x ) { uid = x; } |
| 108 |
|
|
void event::setGID ( groupid_t x ) { gid = x; } |
| 109 |
|
|
void event::setRemoteHost ( const char* x ) { setValue( &this -> remoteHost , x ); } |
| 110 |
|
|
void event::setSearchKeyword ( const char* x ) { setValue( &this -> searchKeyword , x ); } |
| 111 |
|
|
void event::setAdditionalInfo( const char* x ) { setValue( &this -> additionalInfo, x ); } |
| 112 |
|
|
|
| 113 |
|
|
bool event::isValidTimestamp () const { return (bool)validFields[eventTypeID][0]; } |
| 114 |
|
|
bool event::isValidExecUID () const { return (bool)validFields[eventTypeID][1]; } |
| 115 |
|
|
bool event::isValidIndexID () const { return (bool)validFields[eventTypeID][3]; } |
| 116 |
|
|
bool event::isValidItemID () const { return (bool)validFields[eventTypeID][4]; } |
| 117 |
|
|
bool event::isValidFileID () const { return (bool)validFields[eventTypeID][5]; } |
| 118 |
|
|
bool event::isValidUID () const { return (bool)validFields[eventTypeID][6]; } |
| 119 |
|
|
bool event::isValidGID () const { return (bool)validFields[eventTypeID][7]; } |
| 120 |
|
|
bool event::isValidRemoteHost () const { return (bool)validFields[eventTypeID][2]; } |
| 121 |
|
|
bool event::isValidSearchKeyword () const { return (bool)validFields[eventTypeID][8]; } |
| 122 |
|
|
bool event::isValidAdditionalInfo() const { return (bool)validFields[eventTypeID][9]; } |
| 123 |
aga4096 |
1.1 |
|
| |