| 22 |
* |
* |
| 23 |
* $Revision$ |
* $Revision$ |
| 24 |
* $Log$ |
* $Log$ |
| 25 |
|
* Revision 1.96 2005/06/29 00:10:18 aga4096 |
| 26 |
|
* ・login name -> additional info に修正. |
| 27 |
|
* |
| 28 |
* Revision 1.95 2005/06/24 02:07:34 tani |
* Revision 1.95 2005/06/24 02:07:34 tani |
| 29 |
* insertItemDirectを定義(Import用) |
* insertItemDirectを定義(Import用) |
| 30 |
* getPrivateItemIDに,BINDERを無視する条件を追加(個人バインダー対応) |
* getPrivateItemIDに,BINDERを無視する条件を追加(個人バインダー対応) |
| 7625 |
|
|
| 7626 |
if( ( sqlcode = SQLAllocHandle( SQL_HANDLE_STMT, hdbc, &hstmt ) ) == SQL_SUCCESS ) { |
if( ( sqlcode = SQLAllocHandle( SQL_HANDLE_STMT, hdbc, &hstmt ) ) == SQL_SUCCESS ) { |
| 7627 |
string sql = "insert into " + dbprefix + "_xoonips_event_log " |
string sql = "insert into " + dbprefix + "_xoonips_event_log " |
| 7628 |
" ( event_type_id, timestamp, exec_uid, index_id, item_id, file_id, uid, gid, remote_host, search_keyword, login_name ) " |
" ( event_type_id, timestamp, exec_uid, index_id, item_id, file_id, uid, gid, remote_host, search_keyword, additional_info ) " |
| 7629 |
" values ( " |
" values ( " |
| 7630 |
+ unsignedIntToString(ev->getEventTypeID()) + "," + |
+ unsignedIntToString(ev->getEventTypeID()) + "," + |
| 7631 |
( ev->isValidTimestamp() ? unsignedIntToString(ev->getTimestamp ()) : "NULL" ) + "," + |
( ev->isValidTimestamp() ? unsignedIntToString(ev->getTimestamp ()) : "NULL" ) + "," + |
| 7638 |
" ?,?,? )"; |
" ?,?,? )"; |
| 7639 |
sqlcode = SQLPrepare(hstmt, (SQLCHAR*)sql.c_str(), SQL_NTS); |
sqlcode = SQLPrepare(hstmt, (SQLCHAR*)sql.c_str(), SQL_NTS); |
| 7640 |
if ( sqlcode == SQL_SUCCESS ){ |
if ( sqlcode == SQL_SUCCESS ){ |
| 7641 |
SQLLEN cbRemoteHost = SQL_NTS, cbSearchKeyword = SQL_NTS, cbLoginName = SQL_NTS; |
SQLLEN cbRemoteHost = SQL_NTS, cbSearchKeyword = SQL_NTS, cbAdditionalInfo = SQL_NTS; |
| 7642 |
if ( !ev->isValidRemoteHost () ) cbRemoteHost = SQL_NULL_DATA; |
if ( !ev->isValidRemoteHost () ) cbRemoteHost = SQL_NULL_DATA; |
| 7643 |
if ( !ev->isValidSearchKeyword() ) cbSearchKeyword = SQL_NULL_DATA; |
if ( !ev->isValidSearchKeyword () ) cbSearchKeyword = SQL_NULL_DATA; |
| 7644 |
if ( !ev->isValidLoginName () ) cbLoginName = SQL_NULL_DATA; |
if ( !ev->isValidAdditionalInfo() ) cbAdditionalInfo= SQL_NULL_DATA; |
| 7645 |
SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, strlen(ev->getRemoteHost ()), 0, (SQLCHAR *)ev->getRemoteHost (), 0, &cbRemoteHost ); |
SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, strlen(ev->getRemoteHost ()), 0, (SQLCHAR *)ev->getRemoteHost (), 0, &cbRemoteHost ); |
| 7646 |
SQLBindParameter(hstmt, 2, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, strlen(ev->getSearchKeyword()), 0, (SQLCHAR *)ev->getSearchKeyword(), 0, &cbSearchKeyword ); |
SQLBindParameter(hstmt, 2, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, strlen(ev->getSearchKeyword ()), 0, (SQLCHAR *)ev->getSearchKeyword (), 0, &cbSearchKeyword ); |
| 7647 |
SQLBindParameter(hstmt, 3, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, strlen(ev->getLoginName ()), 0, (SQLCHAR *)ev->getLoginName (), 0, &cbLoginName ); |
SQLBindParameter(hstmt, 3, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, strlen(ev->getAdditionalInfo()), 0, (SQLCHAR *)ev->getAdditionalInfo(), 0, &cbAdditionalInfo); |
| 7648 |
|
|
| 7649 |
sqlcode = SQLExecute( hstmt ); |
sqlcode = SQLExecute( hstmt ); |
| 7650 |
if( sqlcode == SQL_SUCCESS ){ |
if( sqlcode == SQL_SUCCESS ){ |
| 7704 |
|
|
| 7705 |
// get |
// get |
| 7706 |
sql = "select event_id, event_type_id, timestamp, exec_uid, index_id, item_id, " |
sql = "select event_id, event_type_id, timestamp, exec_uid, index_id, item_id, " |
| 7707 |
" file_id, uid, gid, remote_host, search_keyword, login_name from " + dbprefix + "_xoonips_event_log " + condition; |
" file_id, uid, gid, remote_host, search_keyword, additional_info from " + dbprefix + "_xoonips_event_log " + condition; |
| 7708 |
if( ( sqlcode = SQLAllocHandle( SQL_HANDLE_STMT, hdbc, &hstmt ) ) == SQL_SUCCESS ) { |
if( ( sqlcode = SQLAllocHandle( SQL_HANDLE_STMT, hdbc, &hstmt ) ) == SQL_SUCCESS ) { |
| 7709 |
if( ( sqlcode = SQLExecDirect( hstmt, (SQLCHAR*)sql.c_str(), sql.length() ) ) == SQL_SUCCESS ){ |
if( ( sqlcode = SQLExecDirect( hstmt, (SQLCHAR*)sql.c_str(), sql.length() ) ) == SQL_SUCCESS ){ |
| 7710 |
eventid_t eventID = 0; SQLLEN cbEventID = 0; |
eventid_t eventID = 0; SQLLEN cbEventID = 0; |
| 7740 |
p->setGID ( (groupid_t )gid ); |
p->setGID ( (groupid_t )gid ); |
| 7741 |
p->setRemoteHost ( getResultCol( hstmt, 10 ).c_str() ); |
p->setRemoteHost ( getResultCol( hstmt, 10 ).c_str() ); |
| 7742 |
p->setSearchKeyword ( getResultCol( hstmt, 11, SQL_C_BINARY ).c_str() ); |
p->setSearchKeyword ( getResultCol( hstmt, 11, SQL_C_BINARY ).c_str() ); |
| 7743 |
p->setLoginName ( getResultCol( hstmt, 12 ).c_str() ); |
p->setAdditionalInfo( getResultCol( hstmt, 12, SQL_C_BINARY ).c_str() ); |
| 7744 |
} |
} |
| 7745 |
ret = RES_OK; |
ret = RES_OK; |
| 7746 |
}else{ |
}else{ |