Browse CVS Repository
Diff of /xoonips/AL/commonal.cc
Parent Directory
| Revision Log
| Revision Graph
| Patch
| 2 |
* |
* |
| 3 |
* $Revision$ |
* $Revision$ |
| 4 |
* $Log$ |
* $Log$ |
| 5 |
|
* Revision 1.61 2005/02/09 07:23:50 aga |
| 6 |
|
* ・URL to My Personal Archive をDB・ALから消した. |
| 7 |
|
* |
| 8 |
* Revision 1.60 2005/02/09 02:14:15 aga |
* Revision 1.60 2005/02/09 02:14:15 aga |
| 9 |
* ・initializeDB()にdbtype引数を追加(SQLite用). |
* ・initializeDB()にdbtype引数を追加(SQLite用). |
| 10 |
* |
* |
| 174 |
* institute -> division |
* institute -> division |
| 175 |
* organizaion -> company_name |
* organizaion -> company_name |
| 176 |
* |
* |
| 177 |
* Revision 1.20 2004/12/01 04:37:04 youi |
* Revis1.20 2004/12/01 04:37:04 youi |
| 178 |
* freeResult: unsigned int* を int* へ修正. |
* freeResult: unsigned int* を int* へ修正. |
| 179 |
* コメント部に関数の説明を追記. |
* コメント部に関数の説明を追記. |
| 180 |
* |
* |
| 1223 |
string sql; |
string sql; |
| 1224 |
account_t* dst = new account_t[ uidsLen ]; |
account_t* dst = new account_t[ uidsLen ]; |
| 1225 |
|
|
| 1226 |
sql += "SELECT u1.uid, u1.name, u1.uname, u1.email, u1.url, u1.user_avatar, u1.user_regdate, u1.user_icq, u1.user_from, u1.user_sig, u1.user_viewemail, u1.actkey, u1.user_aim, u1.user_yim, u1.user_msnm, u1.pass, u1.posts, u1.attachsig, u1.rank, u1.level, u1.theme, u1.timezone_offset, u1.last_login, u1.umode, u1.uorder, u1.notify_method, u1.notify_mode, u1.user_occ, u1.bio, u1.user_intrest, u1.user_mailok, u2.activate, u2.address, u2.division, u2.tel, u2.company_name, u2.country, u2.zipcode, u2.fax, u2.base_url, u2.notice_mail, u2.notice_mail_since, u2.private_index_id "; |
sql += "SELECT u1.uid, u1.name, u1.uname, u1.email, u1.url, u1.user_avatar, u1.user_regdate, u1.user_icq, u1.user_from, u1.user_sig, u1.user_viewemail, u1.actkey, u1.user_aim, u1.user_yim, u1.user_msnm, u1.pass, u1.posts, u1.attachsig, u1.rank, u1.level, u1.theme, u1.timezone_offset, u1.last_login, u1.umode, u1.uorder, u1.notify_method, u1.notify_mode, u1.user_occ, u1.bio, u1.user_intrest, u1.user_mailok, u2.activate, u2.address, u2.division, u2.tel, u2.company_name, u2.country, u2.zipcode, u2.fax, u2.notice_mail, u2.notice_mail_since, u2.private_index_id "; |
| 1227 |
sql += "FROM " + dbprefix + "_users AS u1, " + dbprefix + "_xnpaccount_users AS u2 "; |
sql += "FROM " + dbprefix + "_users AS u1, " + dbprefix + "_xnpaccount_users AS u2 "; |
| 1228 |
sql += "WHERE u1.uid = u2.uid "; |
sql += "WHERE u1.uid = u2.uid "; |
| 1229 |
if( uidsLen > 0 ){ |
if( uidsLen > 0 ){ |
| 1290 |
dst[ i ].setCountry( getResultCol( hstmt, 37 ).c_str() ); |
dst[ i ].setCountry( getResultCol( hstmt, 37 ).c_str() ); |
| 1291 |
dst[ i ].setZipcode( getResultCol( hstmt, 38 ).c_str() ); |
dst[ i ].setZipcode( getResultCol( hstmt, 38 ).c_str() ); |
| 1292 |
dst[ i ].setFax( getResultCol( hstmt, 39 ).c_str() ); |
dst[ i ].setFax( getResultCol( hstmt, 39 ).c_str() ); |
| 1293 |
dst[ i ].setBaseURL( getResultCol( hstmt, 40 ).c_str() ); |
dst[ i ].setNoticeMail( atoi( getResultCol( hstmt, 40 ).c_str() )); |
| 1294 |
dst[ i ].setNoticeMail( atoi( getResultCol( hstmt, 41 ).c_str() )); |
dst[ i ].setNoticeMailSince( atoi( getResultCol( hstmt, 41 ).c_str() )); |
| 1295 |
dst[ i ].setNoticeMailSince( atoi( getResultCol( hstmt, 42 ).c_str() )); |
dst[ i ].setPrivateIndexID( atoi( getResultCol( hstmt, 42 ).c_str() )); |
|
dst[ i ].setPrivateIndexID( atoi( getResultCol( hstmt, 43 ).c_str() )); |
|
| 1296 |
#ifdef USE_SYSLOG |
#ifdef USE_SYSLOG |
| 1297 |
syslog( LOG_DEBUG, "set to account_t %d", i ); |
syslog( LOG_DEBUG, "set to account_t %d", i ); |
| 1298 |
#endif |
#endif |
| 1480 |
SQLCHAR country[XNP_ACCOUNT_COUNTRY_LEN+1]; |
SQLCHAR country[XNP_ACCOUNT_COUNTRY_LEN+1]; |
| 1481 |
SQLCHAR zipcode[XNP_ACCOUNT_ZIPCODE_LEN+1]; |
SQLCHAR zipcode[XNP_ACCOUNT_ZIPCODE_LEN+1]; |
| 1482 |
SQLCHAR fax[XNP_ACCOUNT_FAX_LEN+1]; |
SQLCHAR fax[XNP_ACCOUNT_FAX_LEN+1]; |
| 1483 |
SQLCHAR base_url[XNP_ACCOUNT_BASE_URL_LEN+1]; |
SQLLEN cbAddress = SQL_NTS, cbDivision = SQL_NTS, cbTel = SQL_NTS, cbCompany_name = SQL_NTS, cbCountry = SQL_NTS, cbZipcode = SQL_NTS, cbFax = SQL_NTS; |
|
SQLLEN cbAddress = SQL_NTS, cbDivision = SQL_NTS, cbTel = SQL_NTS, cbCompany_name = SQL_NTS, cbCountry = SQL_NTS, cbZipcode = SQL_NTS, cbFax = SQL_NTS, cbBase_url = SQL_NTS; |
|
| 1484 |
SQLLEN cbUid = 0, cbActivate = 0, cbNotice_mail = 0, cbNotice_mail_since = 0; |
SQLLEN cbUid = 0, cbActivate = 0, cbNotice_mail = 0, cbNotice_mail_since = 0; |
| 1485 |
SQLUINTEGER notice_mail; |
SQLUINTEGER notice_mail; |
| 1486 |
SQLUINTEGER notice_mail_since; |
SQLUINTEGER notice_mail_since; |
| 1487 |
if( ret == RES_OK && ( sqlcode = SQLAllocHandle( SQL_HANDLE_STMT, hdbc, &hstmt ) ) == SQL_SUCCESS ) { |
if( ret == RES_OK && ( sqlcode = SQLAllocHandle( SQL_HANDLE_STMT, hdbc, &hstmt ) ) == SQL_SUCCESS ) { |
| 1488 |
string sql; |
string sql; |
| 1489 |
sql = "INSERT INTO " + dbprefix + "_xnpaccount_users (uid, activate, address, division, tel, company_name, country, zipcode, fax, base_url, notice_mail, notice_mail_since) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )"; |
sql = "INSERT INTO " + dbprefix + "_xnpaccount_users (uid, activate, address, division, tel, company_name, country, zipcode, fax, notice_mail, notice_mail_since) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )"; |
| 1490 |
sqlcode = SQLPrepare(hstmt, (SQLCHAR*)sql.c_str(), SQL_NTS); |
sqlcode = SQLPrepare(hstmt, (SQLCHAR*)sql.c_str(), SQL_NTS); |
| 1491 |
if( sqlcode == SQL_SUCCESS || sqlcode == SQL_SUCCESS_WITH_INFO ){ |
if( sqlcode == SQL_SUCCESS || sqlcode == SQL_SUCCESS_WITH_INFO ){ |
| 1492 |
SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_SSHORT, SQL_INTEGER, 0, 0, uid, 0, &cbUid); |
SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_SSHORT, SQL_INTEGER, 0, 0, uid, 0, &cbUid); |
| 1498 |
SQLBindParameter(hstmt, 7, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_LONGVARCHAR, XNP_ACCOUNT_COUNTRY_LEN, 0, country, 0, &cbCountry); |
SQLBindParameter(hstmt, 7, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_LONGVARCHAR, XNP_ACCOUNT_COUNTRY_LEN, 0, country, 0, &cbCountry); |
| 1499 |
SQLBindParameter(hstmt, 8, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_LONGVARCHAR, XNP_ACCOUNT_ZIPCODE_LEN, 0, zipcode, 0, &cbZipcode); |
SQLBindParameter(hstmt, 8, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_LONGVARCHAR, XNP_ACCOUNT_ZIPCODE_LEN, 0, zipcode, 0, &cbZipcode); |
| 1500 |
SQLBindParameter(hstmt, 9, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_LONGVARCHAR, XNP_ACCOUNT_FAX_LEN, 0, fax, 0, &cbFax); |
SQLBindParameter(hstmt, 9, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_LONGVARCHAR, XNP_ACCOUNT_FAX_LEN, 0, fax, 0, &cbFax); |
| 1501 |
SQLBindParameter(hstmt, 10, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_LONGVARCHAR, XNP_ACCOUNT_BASE_URL_LEN, 0, base_url, 0, &cbBase_url); |
SQLBindParameter(hstmt, 10, SQL_PARAM_INPUT, SQL_C_SSHORT, SQL_INTEGER, 0, 0, ¬ice_mail, 0, &cbNotice_mail); |
| 1502 |
SQLBindParameter(hstmt, 11, SQL_PARAM_INPUT, SQL_C_SSHORT, SQL_INTEGER, 0, 0, ¬ice_mail, 0, &cbNotice_mail); |
SQLBindParameter(hstmt, 11, SQL_PARAM_INPUT, SQL_C_SSHORT, SQL_INTEGER, 0, 0, ¬ice_mail_since, 0, &cbNotice_mail_since); |
|
SQLBindParameter(hstmt, 12, SQL_PARAM_INPUT, SQL_C_SSHORT, SQL_INTEGER, 0, 0, ¬ice_mail_since, 0, &cbNotice_mail_since); |
|
| 1503 |
|
|
| 1504 |
activate = account -> getActivate() ? 1 : 0; |
activate = account -> getActivate() ? 1 : 0; |
| 1505 |
strncpy2( (char*)address, account -> getAddress(), XNP_ACCOUNT_ADDRESS_LEN ); |
strncpy2( (char*)address, account -> getAddress(), XNP_ACCOUNT_ADDRESS_LEN ); |
| 1509 |
strncpy2( (char*)country, account -> getCountry(), XNP_ACCOUNT_COUNTRY_LEN ); |
strncpy2( (char*)country, account -> getCountry(), XNP_ACCOUNT_COUNTRY_LEN ); |
| 1510 |
strncpy2( (char*)zipcode, account -> getZipcode(), XNP_ACCOUNT_ZIPCODE_LEN ); |
strncpy2( (char*)zipcode, account -> getZipcode(), XNP_ACCOUNT_ZIPCODE_LEN ); |
| 1511 |
strncpy2( (char*)fax, account -> getFax(), XNP_ACCOUNT_FAX_LEN ); |
strncpy2( (char*)fax, account -> getFax(), XNP_ACCOUNT_FAX_LEN ); |
|
strncpy2( (char*)base_url, account -> getBaseURL(), XNP_ACCOUNT_BASE_URL_LEN ); |
|
| 1512 |
notice_mail = account -> getNoticeMail( ); |
notice_mail = account -> getNoticeMail( ); |
| 1513 |
notice_mail_since = account -> getNoticeMailSince( ); |
notice_mail_since = account -> getNoticeMailSince( ); |
| 1514 |
|
|
| 1642 |
SQLCHAR country[XNP_ACCOUNT_COUNTRY_LEN+1]; |
SQLCHAR country[XNP_ACCOUNT_COUNTRY_LEN+1]; |
| 1643 |
SQLCHAR zipcode[XNP_ACCOUNT_ZIPCODE_LEN+1]; |
SQLCHAR zipcode[XNP_ACCOUNT_ZIPCODE_LEN+1]; |
| 1644 |
SQLCHAR fax[XNP_ACCOUNT_FAX_LEN+1]; |
SQLCHAR fax[XNP_ACCOUNT_FAX_LEN+1]; |
| 1645 |
SQLCHAR base_url[XNP_ACCOUNT_BASE_URL_LEN+1]; |
SQLLEN cbActivate = 0, cbAddress = SQL_NTS, cbDivision = SQL_NTS, cbTel = SQL_NTS, cbCompany_name = SQL_NTS, cbCountry = SQL_NTS, cbZipcode = SQL_NTS, cbFax = SQL_NTS; |
|
SQLLEN cbActivate = 0, cbAddress = SQL_NTS, cbDivision = SQL_NTS, cbTel = SQL_NTS, cbCompany_name = SQL_NTS, cbCountry = SQL_NTS, cbZipcode = SQL_NTS, cbFax = SQL_NTS, cbBase_url = SQL_NTS; |
|
| 1646 |
SQLUINTEGER notice_mail, notice_mail_since; |
SQLUINTEGER notice_mail, notice_mail_since; |
| 1647 |
SQLLEN cbNotice_mail = 0, cbNotice_mail_since = 0; |
SQLLEN cbNotice_mail = 0, cbNotice_mail_since = 0; |
| 1648 |
|
|
| 1794 |
sql += "country=?, "; |
sql += "country=?, "; |
| 1795 |
sql += "zipcode=?, "; |
sql += "zipcode=?, "; |
| 1796 |
sql += "fax=?, "; |
sql += "fax=?, "; |
|
sql += "base_url=?, "; |
|
| 1797 |
sql += "notice_mail=?, "; |
sql += "notice_mail=?, "; |
| 1798 |
sql += "notice_mail_since=? "; |
sql += "notice_mail_since=? "; |
| 1799 |
sql += "WHERE uid=?"; |
sql += "WHERE uid=?"; |
| 1808 |
SQLBindParameter(hstmt, 6, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_LONGVARCHAR, XNP_ACCOUNT_COUNTRY_LEN, 0, country, 0, &cbCountry); |
SQLBindParameter(hstmt, 6, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_LONGVARCHAR, XNP_ACCOUNT_COUNTRY_LEN, 0, country, 0, &cbCountry); |
| 1809 |
SQLBindParameter(hstmt, 7, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_LONGVARCHAR, XNP_ACCOUNT_ZIPCODE_LEN, 0, zipcode, 0, &cbZipcode); |
SQLBindParameter(hstmt, 7, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_LONGVARCHAR, XNP_ACCOUNT_ZIPCODE_LEN, 0, zipcode, 0, &cbZipcode); |
| 1810 |
SQLBindParameter(hstmt, 8, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_LONGVARCHAR, XNP_ACCOUNT_FAX_LEN, 0, fax, 0, &cbFax); |
SQLBindParameter(hstmt, 8, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_LONGVARCHAR, XNP_ACCOUNT_FAX_LEN, 0, fax, 0, &cbFax); |
| 1811 |
SQLBindParameter(hstmt, 9, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_LONGVARCHAR, XNP_ACCOUNT_BASE_URL_LEN, 0, base_url, 0, &cbBase_url); |
SQLBindParameter(hstmt, 9, SQL_PARAM_INPUT, SQL_C_SSHORT, SQL_INTEGER, 0, 0, ¬ice_mail, 0, &cbNotice_mail); |
| 1812 |
SQLBindParameter(hstmt, 10, SQL_PARAM_INPUT, SQL_C_SSHORT, SQL_INTEGER, 0, 0, ¬ice_mail, 0, &cbNotice_mail); |
SQLBindParameter(hstmt, 10, SQL_PARAM_INPUT, SQL_C_SSHORT, SQL_INTEGER, 0, 0, ¬ice_mail_since, 0, &cbNotice_mail_since); |
| 1813 |
SQLBindParameter(hstmt, 11, SQL_PARAM_INPUT, SQL_C_SSHORT, SQL_INTEGER, 0, 0, ¬ice_mail_since, 0, &cbNotice_mail_since); |
SQLBindParameter(hstmt, 11, SQL_PARAM_INPUT, SQL_C_SLONG, SQL_INTEGER, 0, 0, &uid, 0, &cbUid ); |
|
SQLBindParameter(hstmt, 12, SQL_PARAM_INPUT, SQL_C_SLONG, SQL_INTEGER, 0, 0, &uid, 0, &cbUid ); |
|
| 1814 |
|
|
| 1815 |
activate = account -> getActivate() ? 1 : 0; |
activate = account -> getActivate() ? 1 : 0; |
| 1816 |
strncpy2( (char*)address, account -> getAddress( ) , XNP_ACCOUNT_ADDRESS_LEN ); |
strncpy2( (char*)address, account -> getAddress( ) , XNP_ACCOUNT_ADDRESS_LEN ); |
| 1820 |
strncpy2( (char*)country, account -> getCountry(), XNP_ACCOUNT_COUNTRY_LEN ); |
strncpy2( (char*)country, account -> getCountry(), XNP_ACCOUNT_COUNTRY_LEN ); |
| 1821 |
strncpy2( (char*)zipcode, account -> getZipcode(), XNP_ACCOUNT_ZIPCODE_LEN ); |
strncpy2( (char*)zipcode, account -> getZipcode(), XNP_ACCOUNT_ZIPCODE_LEN ); |
| 1822 |
strncpy2( (char*)fax, account -> getFax(), XNP_ACCOUNT_FAX_LEN ); |
strncpy2( (char*)fax, account -> getFax(), XNP_ACCOUNT_FAX_LEN ); |
|
strncpy2( (char*)base_url, account -> getBaseURL(), XNP_ACCOUNT_BASE_URL_LEN ); |
|
| 1823 |
notice_mail = account -> getNoticeMail( ); |
notice_mail = account -> getNoticeMail( ); |
| 1824 |
notice_mail_since = account -> getNoticeMailSince( ); |
notice_mail_since = account -> getNoticeMailSince( ); |
| 1825 |
uid = account -> getUID( ); |
uid = account -> getUID( ); |
| 6659 |
extern "C" {int zip_main(int, char**);} |
extern "C" {int zip_main(int, char**);} |
| 6660 |
result_t zipCreate( char* zippath, char** files, int filesLen ) |
result_t zipCreate( char* zippath, char** files, int filesLen ) |
| 6661 |
{ |
{ |
| 6662 |
char** argv = new char*[filesLen+3]; |
/* char** argv = new char*[filesLen+3]; |
| 6663 |
argv[ 0 ] = NULL; |
argv[ 0 ] = NULL; |
| 6664 |
argv[ 1 ] = "-o"; |
argv[ 1 ] = "-o"; |
| 6665 |
argv[ 2 ] = zippath; |
argv[ 2 ] = zippath; |
| 6672 |
} |
} |
| 6673 |
delete[] argv; |
delete[] argv; |
| 6674 |
return RES_ERROR; |
return RES_ERROR; |
| 6675 |
} |
*/} |
|
|
Legend:
| Removed from v.1.60 |
|
| changed lines |
| |
Added in v.1.61 |
|
|
| |