Develop and Download Open Source Software

Browse CVS Repository

Diff of /xoonips/AL/commonal.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.95 by tani, Fri Jun 24 02:07:34 2005 UTC revision 1.96 by aga4096, Wed Jun 29 00:10:18 2005 UTC
# Line 22  Line 22 
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を無視する条件を追加(個人バインダー対応)
# Line 7622  result_t insertEvent(sessionid_t sid, ev Line 7625  result_t insertEvent(sessionid_t sid, ev
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" ) + "," +
# Line 7635  result_t insertEvent(sessionid_t sid, ev Line 7638  result_t insertEvent(sessionid_t sid, ev
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 ){
# Line 7701  result_t getEvents(sessionid_t sid, even Line 7704  result_t getEvents(sessionid_t sid, even
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;
# Line 7737  result_t getEvents(sessionid_t sid, even Line 7740  result_t getEvents(sessionid_t sid, even
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{

Legend:
Removed from v.1.95  
changed lines
  Added in v.1.96

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26