| 2 |
* |
* |
| 3 |
* $Revision$ |
* $Revision$ |
| 4 |
* $Log$ |
* $Log$ |
| 5 |
|
* Revision 1.64 2005/02/15 02:35:47 youi |
| 6 |
|
* SQLINTEGERからSQLLENへ型変更. |
| 7 |
|
* |
| 8 |
* Revision 1.63 2005/02/10 02:33:16 aga |
* Revision 1.63 2005/02/10 02:33:16 aga |
| 9 |
* ・zipCreateをコメントアウトしていたのを戻した. |
* ・zipCreateをコメントアウトしていたのを戻した. |
| 10 |
* |
* |
| 550 |
string getResultCol( SQLHANDLE hstmt, int col ) |
string getResultCol( SQLHANDLE hstmt, int col ) |
| 551 |
{ |
{ |
| 552 |
string s; |
string s; |
| 553 |
SQLRETURN sqlcode; |
SQLRETURN sqlcode; |
| 554 |
SQLCHAR BinaryPtr[5000]; |
SQLCHAR BinaryPtr[5000]; |
| 555 |
SQLINTEGER BinaryLenOrInd, NumBytes; |
SQLLEN BinaryLenOrInd; |
| 556 |
|
SQLINTEGER NumBytes; |
| 557 |
|
|
| 558 |
while ( ( sqlcode = SQLGetData(hstmt, col, SQL_C_CHAR, BinaryPtr, sizeof(BinaryPtr), |
while ( ( sqlcode = SQLGetData(hstmt, col, SQL_C_CHAR, BinaryPtr, sizeof(BinaryPtr), |
| 559 |
&BinaryLenOrInd)) != SQL_NO_DATA) { |
&BinaryLenOrInd)) != SQL_NO_DATA) { |
| 988 |
sql += " WHERE uid=" + string( unsignedIntToString( uid ) ); |
sql += " WHERE uid=" + string( unsignedIntToString( uid ) ); |
| 989 |
if( ( sqlcode = SQLAllocHandle( SQL_HANDLE_STMT, hdbc, &hstmt ) ) == SQL_SUCCESS ) { |
if( ( sqlcode = SQLAllocHandle( SQL_HANDLE_STMT, hdbc, &hstmt ) ) == SQL_SUCCESS ) { |
| 990 |
if( ( sqlcode = SQLExecDirect( hstmt, (SQLCHAR*)sql.c_str(), sql.length() ) ) == SQL_SUCCESS ){ |
if( ( sqlcode = SQLExecDirect( hstmt, (SQLCHAR*)sql.c_str(), sql.length() ) ) == SQL_SUCCESS ){ |
| 991 |
SQLINTEGER count = 0; |
SQLLEN count = 0; |
| 992 |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
| 993 |
ret = RES_OK; |
ret = RES_OK; |
| 994 |
}else{ |
}else{ |
| 1108 |
sql += "WHERE uid = " + string( unsignedIntToString( uid ) ); |
sql += "WHERE uid = " + string( unsignedIntToString( uid ) ); |
| 1109 |
if( ( sqlcode = SQLAllocHandle( SQL_HANDLE_STMT, hdbc, &hstmt ) ) == SQL_SUCCESS ) { |
if( ( sqlcode = SQLAllocHandle( SQL_HANDLE_STMT, hdbc, &hstmt ) ) == SQL_SUCCESS ) { |
| 1110 |
if( ( sqlcode = SQLExecDirect( hstmt, (SQLCHAR*)sql.c_str(), sql.length() ) ) == SQL_SUCCESS ){ |
if( ( sqlcode = SQLExecDirect( hstmt, (SQLCHAR*)sql.c_str(), sql.length() ) ) == SQL_SUCCESS ){ |
| 1111 |
SQLINTEGER count = 0; |
SQLLEN count = 0; |
| 1112 |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
| 1113 |
ret1 = RES_OK; |
ret1 = RES_OK; |
| 1114 |
}else{ |
}else{ |
| 1139 |
sql += "WHERE uid = " + string( unsignedIntToString( uid ) ); |
sql += "WHERE uid = " + string( unsignedIntToString( uid ) ); |
| 1140 |
if( ( sqlcode = SQLAllocHandle( SQL_HANDLE_STMT, hdbc, &hstmt ) ) == SQL_SUCCESS ) { |
if( ( sqlcode = SQLAllocHandle( SQL_HANDLE_STMT, hdbc, &hstmt ) ) == SQL_SUCCESS ) { |
| 1141 |
if( ( sqlcode = SQLExecDirect( hstmt, (SQLCHAR*)sql.c_str(), sql.length() ) ) == SQL_SUCCESS ){ |
if( ( sqlcode = SQLExecDirect( hstmt, (SQLCHAR*)sql.c_str(), sql.length() ) ) == SQL_SUCCESS ){ |
| 1142 |
SQLINTEGER count = 0; |
SQLLEN count = 0; |
| 1143 |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
| 1144 |
ret2 = RES_OK; |
ret2 = RES_OK; |
| 1145 |
}else{ |
}else{ |
| 1449 |
user_mailok = account -> getUserMailok( ); |
user_mailok = account -> getUserMailok( ); |
| 1450 |
|
|
| 1451 |
if( ( sqlcode = SQLExecute( hstmt ) ) == SQL_SUCCESS ){ |
if( ( sqlcode = SQLExecute( hstmt ) ) == SQL_SUCCESS ){ |
| 1452 |
SQLINTEGER count = 0; |
SQLLEN count = 0; |
| 1453 |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
| 1454 |
//ユーザIDを取得する |
//ユーザIDを取得する |
| 1455 |
sql = "SELECT LAST_INSERT_ID()"; |
sql = "SELECT LAST_INSERT_ID()"; |
| 1523 |
notice_mail_since = account -> getNoticeMailSince( ); |
notice_mail_since = account -> getNoticeMailSince( ); |
| 1524 |
|
|
| 1525 |
if( ( sqlcode = SQLExecute( hstmt ) ) == SQL_SUCCESS ){ |
if( ( sqlcode = SQLExecute( hstmt ) ) == SQL_SUCCESS ){ |
| 1526 |
SQLINTEGER count = 0; |
SQLLEN count = 0; |
| 1527 |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
| 1528 |
ret = RES_OK; |
ret = RES_OK; |
| 1529 |
if( ret == RES_OK ){ |
if( ret == RES_OK ){ |
| 1759 |
uid = account -> getUID( ); |
uid = account -> getUID( ); |
| 1760 |
|
|
| 1761 |
if( ( sqlcode = SQLExecute( hstmt ) ) == SQL_SUCCESS ){ |
if( ( sqlcode = SQLExecute( hstmt ) ) == SQL_SUCCESS ){ |
| 1762 |
SQLINTEGER count = 0; |
SQLLEN count = 0; |
| 1763 |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
| 1764 |
ret = RES_OK; |
ret = RES_OK; |
| 1765 |
}else{ |
}else{ |
| 1835 |
uid = account -> getUID( ); |
uid = account -> getUID( ); |
| 1836 |
|
|
| 1837 |
if( ( sqlcode = SQLExecute( hstmt ) ) == SQL_SUCCESS ){ |
if( ( sqlcode = SQLExecute( hstmt ) ) == SQL_SUCCESS ){ |
| 1838 |
SQLINTEGER count = 0; |
SQLLEN count = 0; |
| 1839 |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
| 1840 |
ret = RES_OK; |
ret = RES_OK; |
| 1841 |
}else{ |
}else{ |
| 1893 |
userid_t* dst = 0; |
userid_t* dst = 0; |
| 1894 |
string sql; |
string sql; |
| 1895 |
SQLRETURN sqlcode; |
SQLRETURN sqlcode; |
| 1896 |
SQLINTEGER count = 0; |
SQLLEN count = 0; |
| 1897 |
|
|
| 1898 |
|
|
| 1899 |
sql = "SELECT uid FROM " + dbprefix + "_xnpaccount_users "; |
sql = "SELECT uid FROM " + dbprefix + "_xnpaccount_users "; |
| 2018 |
string sql; |
string sql; |
| 2019 |
SQLRETURN sqlcode; |
SQLRETURN sqlcode; |
| 2020 |
SQLHANDLE hstmt = NULL; |
SQLHANDLE hstmt = NULL; |
| 2021 |
SQLINTEGER count = 0; |
SQLLEN count = 0; |
| 2022 |
groupid_t* dst = 0; |
groupid_t* dst = 0; |
| 2023 |
|
|
| 2024 |
sql = "SELECT gid FROM " + dbprefix + "_xnpaccount_groups_users_link"; |
sql = "SELECT gid FROM " + dbprefix + "_xnpaccount_groups_users_link"; |
| 2103 |
|
|
| 2104 |
bool ret = false; |
bool ret = false; |
| 2105 |
string sql; |
string sql; |
| 2106 |
SQLINTEGER count = 0; |
SQLLEN count = 0; |
| 2107 |
|
|
| 2108 |
sql = "SELECT * FROM " + dbprefix + "_xnpaccount_groups_users_link "; |
sql = "SELECT * FROM " + dbprefix + "_xnpaccount_groups_users_link "; |
| 2109 |
sql += "WHERE gid=" + string( unsignedIntToString( gid ) ); |
sql += "WHERE gid=" + string( unsignedIntToString( gid ) ); |
| 2145 |
groupid_t* dst = 0; |
groupid_t* dst = 0; |
| 2146 |
string sql; |
string sql; |
| 2147 |
SQLRETURN sqlcode; |
SQLRETURN sqlcode; |
| 2148 |
SQLINTEGER count = 0; |
SQLLEN count = 0; |
| 2149 |
|
|
| 2150 |
sql = "SELECT gid FROM " + dbprefix + "_xnpaccount_groups "; |
sql = "SELECT gid FROM " + dbprefix + "_xnpaccount_groups "; |
| 2151 |
sql += criteria2str( cri ); |
sql += criteria2str( cri ); |
| 2205 |
result_t ret = RES_ERROR; |
result_t ret = RES_ERROR; |
| 2206 |
string sql; |
string sql; |
| 2207 |
SQLRETURN sqlcode; |
SQLRETURN sqlcode; |
| 2208 |
SQLINTEGER count = 0; |
SQLLEN count = 0; |
| 2209 |
|
|
| 2210 |
sql = "SELECT uid FROM " + dbprefix + "_xnpaccount_groups_users_link "; |
sql = "SELECT uid FROM " + dbprefix + "_xnpaccount_groups_users_link "; |
| 2211 |
sql += " WHERE is_admin=1 and gid=" + unsignedIntToString( gid ); |
sql += " WHERE is_admin=1 and gid=" + unsignedIntToString( gid ); |
| 2296 |
sql += " AND uid=" + string( unsignedIntToString( uid ) ); |
sql += " AND uid=" + string( unsignedIntToString( uid ) ); |
| 2297 |
if( ( sqlcode = SQLAllocHandle( SQL_HANDLE_STMT, hdbc, &hstmt ) ) == SQL_SUCCESS ) { |
if( ( sqlcode = SQLAllocHandle( SQL_HANDLE_STMT, hdbc, &hstmt ) ) == SQL_SUCCESS ) { |
| 2298 |
if( ( sqlcode = SQLExecDirect( hstmt, (SQLCHAR*)sql.c_str(), sql.length() ) ) == SQL_SUCCESS ){ |
if( ( sqlcode = SQLExecDirect( hstmt, (SQLCHAR*)sql.c_str(), sql.length() ) ) == SQL_SUCCESS ){ |
| 2299 |
SQLINTEGER count = 0; |
SQLLEN count = 0; |
| 2300 |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
| 2301 |
ret = RES_OK; |
ret = RES_OK; |
| 2302 |
}else{ |
}else{ |
| 2359 |
sql += string( unsignedIntToString( uid ) ) + ", "; |
sql += string( unsignedIntToString( uid ) ) + ", "; |
| 2360 |
sql += string( admin ? "1" : "0" ) + ") "; |
sql += string( admin ? "1" : "0" ) + ") "; |
| 2361 |
if( ( sqlcode = SQLExecDirect( hstmt, (SQLCHAR*)sql.c_str(), sql.length() ) ) == SQL_SUCCESS ){ |
if( ( sqlcode = SQLExecDirect( hstmt, (SQLCHAR*)sql.c_str(), sql.length() ) ) == SQL_SUCCESS ){ |
| 2362 |
SQLINTEGER count = 0; |
SQLLEN count = 0; |
| 2363 |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
| 2364 |
ret = RES_OK; |
ret = RES_OK; |
| 2365 |
}else{ |
}else{ |
| 2504 |
sql += "WHERE gid = " + string( unsignedIntToString( gid ) ); |
sql += "WHERE gid = " + string( unsignedIntToString( gid ) ); |
| 2505 |
if( ( sqlcode = SQLAllocHandle( SQL_HANDLE_STMT, hdbc, &hstmt ) ) == SQL_SUCCESS ) { |
if( ( sqlcode = SQLAllocHandle( SQL_HANDLE_STMT, hdbc, &hstmt ) ) == SQL_SUCCESS ) { |
| 2506 |
if( ( sqlcode = SQLExecDirect( hstmt, (SQLCHAR*)sql.c_str(), sql.length() ) ) == SQL_SUCCESS ){ |
if( ( sqlcode = SQLExecDirect( hstmt, (SQLCHAR*)sql.c_str(), sql.length() ) ) == SQL_SUCCESS ){ |
| 2507 |
SQLINTEGER count = 0; |
SQLLEN count = 0; |
| 2508 |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
| 2509 |
ret = RES_OK; |
ret = RES_OK; |
| 2510 |
}else{ |
}else{ |
| 2567 |
strncpy2( (char*)gname, group -> getGname( ), XNP_GROUP_GNAME_LEN ); |
strncpy2( (char*)gname, group -> getGname( ), XNP_GROUP_GNAME_LEN ); |
| 2568 |
strncpy2( (char*)gdesc, group -> getDesc( ), XNP_GROUP_GDESC_LEN ); |
strncpy2( (char*)gdesc, group -> getDesc( ), XNP_GROUP_GDESC_LEN ); |
| 2569 |
if( ( sqlcode = SQLExecute( hstmt ) ) == SQL_SUCCESS ){ |
if( ( sqlcode = SQLExecute( hstmt ) ) == SQL_SUCCESS ){ |
| 2570 |
SQLINTEGER count = 0; |
SQLLEN count = 0; |
| 2571 |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
| 2572 |
//グループIDを取得する |
//グループIDを取得する |
| 2573 |
sql = "SELECT LAST_INSERT_ID()"; |
sql = "SELECT LAST_INSERT_ID()"; |
| 2674 |
strncpy2( (char*)gname, group -> getGname( ), XNP_GROUP_GNAME_LEN ); |
strncpy2( (char*)gname, group -> getGname( ), XNP_GROUP_GNAME_LEN ); |
| 2675 |
strncpy2( (char*)gdesc, group -> getDesc( ), XNP_GROUP_GDESC_LEN ); |
strncpy2( (char*)gdesc, group -> getDesc( ), XNP_GROUP_GDESC_LEN ); |
| 2676 |
if( ( sqlcode = SQLExecute( hstmt ) ) == SQL_SUCCESS ){ |
if( ( sqlcode = SQLExecute( hstmt ) ) == SQL_SUCCESS ){ |
| 2677 |
SQLINTEGER count = 0; |
SQLLEN count = 0; |
| 2678 |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
| 2679 |
ret = RES_OK; |
ret = RES_OK; |
| 2680 |
}else{ |
}else{ |
| 2830 |
bool ret = false; |
bool ret = false; |
| 2831 |
SQLRETURN sqlcode; |
SQLRETURN sqlcode; |
| 2832 |
SQLHANDLE hstmt = NULL; |
SQLHANDLE hstmt = NULL; |
| 2833 |
SQLINTEGER count = 0; |
SQLLEN count = 0; |
| 2834 |
string sql; |
string sql; |
| 2835 |
groupid_t moderator_gid; |
groupid_t moderator_gid; |
| 2836 |
|
|
| 3256 |
last_update_date = time( NULL ); |
last_update_date = time( NULL ); |
| 3257 |
|
|
| 3258 |
if( ( sqlcode = SQLExecute( hstmt ) ) == SQL_SUCCESS ){ |
if( ( sqlcode = SQLExecute( hstmt ) ) == SQL_SUCCESS ){ |
| 3259 |
SQLINTEGER count = 0; |
SQLLEN count = 0; |
| 3260 |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
| 3261 |
//アイテムIDを取得する |
//アイテムIDを取得する |
| 3262 |
sql = "SELECT LAST_INSERT_ID()"; |
sql = "SELECT LAST_INSERT_ID()"; |
| 3484 |
result_t ret = RES_ERROR; |
result_t ret = RES_ERROR; |
| 3485 |
SQLRETURN sqlcode; |
SQLRETURN sqlcode; |
| 3486 |
SQLHANDLE hstmt = NULL; |
SQLHANDLE hstmt = NULL; |
| 3487 |
SQLINTEGER count = 0; |
SQLLEN count = 0; |
| 3488 |
string sql; |
string sql; |
| 3489 |
itemid_t* dst = 0; |
itemid_t* dst = 0; |
| 3490 |
|
|
| 3611 |
item_id = item -> getItemID( ); |
item_id = item -> getItemID( ); |
| 3612 |
|
|
| 3613 |
if( ( sqlcode = SQLExecute( hstmt ) ) == SQL_SUCCESS ){ |
if( ( sqlcode = SQLExecute( hstmt ) ) == SQL_SUCCESS ){ |
| 3614 |
SQLINTEGER count = 0; |
SQLLEN count = 0; |
| 3615 |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
| 3616 |
char* certify_item_val; |
char* certify_item_val; |
| 3617 |
if( getConfigValue( XNP_CONFIG_CERTIFY_ITEM_KEY, &certify_item_val ) == RES_OK ){ |
if( getConfigValue( XNP_CONFIG_CERTIFY_ITEM_KEY, &certify_item_val ) == RES_OK ){ |
| 3743 |
sql += "WHERE item_id = " + string( unsignedIntToString( itemid ) ); |
sql += "WHERE item_id = " + string( unsignedIntToString( itemid ) ); |
| 3744 |
if( ( sqlcode = SQLAllocHandle( SQL_HANDLE_STMT, hdbc, &hstmt ) ) == SQL_SUCCESS ) { |
if( ( sqlcode = SQLAllocHandle( SQL_HANDLE_STMT, hdbc, &hstmt ) ) == SQL_SUCCESS ) { |
| 3745 |
if( ( sqlcode = SQLExecDirect( hstmt, (SQLCHAR*)sql.c_str(), sql.length() ) ) == SQL_SUCCESS ){ |
if( ( sqlcode = SQLExecDirect( hstmt, (SQLCHAR*)sql.c_str(), sql.length() ) ) == SQL_SUCCESS ){ |
| 3746 |
SQLINTEGER count = 0; |
SQLLEN count = 0; |
| 3747 |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
| 3748 |
ret = RES_OK; |
ret = RES_OK; |
| 3749 |
}else{ |
}else{ |
| 3774 |
sql += "WHERE item_id = " + string( unsignedIntToString( itemid ) ); |
sql += "WHERE item_id = " + string( unsignedIntToString( itemid ) ); |
| 3775 |
if( ( sqlcode = SQLAllocHandle( SQL_HANDLE_STMT, hdbc, &hstmt ) ) == SQL_SUCCESS ) { |
if( ( sqlcode = SQLAllocHandle( SQL_HANDLE_STMT, hdbc, &hstmt ) ) == SQL_SUCCESS ) { |
| 3776 |
if( ( sqlcode = SQLExecDirect( hstmt, (SQLCHAR*)sql.c_str(), sql.length() ) ) == SQL_SUCCESS ){ |
if( ( sqlcode = SQLExecDirect( hstmt, (SQLCHAR*)sql.c_str(), sql.length() ) ) == SQL_SUCCESS ){ |
| 3777 |
SQLINTEGER count = 0; |
SQLLEN count = 0; |
| 3778 |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
| 3779 |
ret = RES_OK; |
ret = RES_OK; |
| 3780 |
}else{ |
}else{ |
| 3806 |
sql += "WHERE item_id = " + string( unsignedIntToString( itemid ) ); |
sql += "WHERE item_id = " + string( unsignedIntToString( itemid ) ); |
| 3807 |
if( ( sqlcode = SQLAllocHandle( SQL_HANDLE_STMT, hdbc, &hstmt ) ) == SQL_SUCCESS ) { |
if( ( sqlcode = SQLAllocHandle( SQL_HANDLE_STMT, hdbc, &hstmt ) ) == SQL_SUCCESS ) { |
| 3808 |
if( ( sqlcode = SQLExecDirect( hstmt, (SQLCHAR*)sql.c_str(), sql.length() ) ) == SQL_SUCCESS ){ |
if( ( sqlcode = SQLExecDirect( hstmt, (SQLCHAR*)sql.c_str(), sql.length() ) ) == SQL_SUCCESS ){ |
| 3809 |
SQLINTEGER count = 0; |
SQLLEN count = 0; |
| 3810 |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
| 3811 |
ret = RES_OK; |
ret = RES_OK; |
| 3812 |
}else{ |
}else{ |
| 3862 |
itemid_t* dst = 0; |
itemid_t* dst = 0; |
| 3863 |
string sql; |
string sql; |
| 3864 |
SQLRETURN sqlcode; |
SQLRETURN sqlcode; |
| 3865 |
SQLINTEGER count = 0; |
SQLLEN count = 0; |
| 3866 |
userid_t sess_uid; |
userid_t sess_uid; |
| 3867 |
|
|
| 3868 |
if( ( ret = sessionID2UID( sid, &sess_uid ) ) != RES_OK ) return ret; |
if( ( ret = sessionID2UID( sid, &sess_uid ) ) != RES_OK ) return ret; |
| 3977 |
itemid_t* dst = 0; |
itemid_t* dst = 0; |
| 3978 |
string sql; |
string sql; |
| 3979 |
SQLRETURN sqlcode; |
SQLRETURN sqlcode; |
| 3980 |
SQLINTEGER count = 0; |
SQLLEN count = 0; |
| 3981 |
userid_t uid; |
userid_t uid; |
| 3982 |
|
|
| 3983 |
if( ( ret = sessionID2UID( sid, &uid ) ) != RES_OK ) return ret; |
if( ( ret = sessionID2UID( sid, &uid ) ) != RES_OK ) return ret; |
| 4067 |
itemid_t* dst = 0; |
itemid_t* dst = 0; |
| 4068 |
string sql; |
string sql; |
| 4069 |
SQLRETURN sqlcode; |
SQLRETURN sqlcode; |
| 4070 |
SQLINTEGER count = 0; |
SQLLEN count = 0; |
| 4071 |
|
|
| 4072 |
sql = "SELECT t1.item_id FROM " + dbprefix + "_xnpaccount_item_basic as t1, " |
sql = "SELECT t1.item_id FROM " + dbprefix + "_xnpaccount_item_basic as t1, " |
| 4073 |
+ dbprefix + "_xnpbinder_binder_item_link as t2 "; |
+ dbprefix + "_xnpbinder_binder_item_link as t2 "; |
| 4178 |
|
|
| 4179 |
result_t ret = RES_ERROR; |
result_t ret = RES_ERROR; |
| 4180 |
string sql; |
string sql; |
| 4181 |
SQLINTEGER count = 0; |
SQLLEN count = 0; |
| 4182 |
userid_t sess_uid; |
userid_t sess_uid; |
| 4183 |
|
|
| 4184 |
if( ( ret = sessionID2UID( sid, &sess_uid ) ) != RES_OK ) return ret; |
if( ( ret = sessionID2UID( sid, &sess_uid ) ) != RES_OK ) return ret; |
| 4759 |
|
|
| 4760 |
bool ret = false; |
bool ret = false; |
| 4761 |
string sql; |
string sql; |
| 4762 |
SQLINTEGER count = 0; |
SQLLEN count = 0; |
| 4763 |
|
|
| 4764 |
sql = "SELECT * FROM " + dbprefix + "_xnpaccount_groups_users_link "; |
sql = "SELECT * FROM " + dbprefix + "_xnpaccount_groups_users_link "; |
| 4765 |
sql += "WHERE gid=" + string( unsignedIntToString( gid ) ); |
sql += "WHERE gid=" + string( unsignedIntToString( gid ) ); |
| 5798 |
SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_LONGVARCHAR, SQL_DESC_LENGTH, 0, (SQLCHAR*)value, strlen(value), &cbValue ); |
SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_LONGVARCHAR, SQL_DESC_LENGTH, 0, (SQLCHAR*)value, strlen(value), &cbValue ); |
| 5799 |
SQLBindParameter(hstmt, 2, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_LONGVARCHAR, XNP_CONFIG_NAME_LEN, 0, (SQLCHAR*)key , strlen(key) , &cbKey ); |
SQLBindParameter(hstmt, 2, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_LONGVARCHAR, XNP_CONFIG_NAME_LEN, 0, (SQLCHAR*)key , strlen(key) , &cbKey ); |
| 5800 |
if( ( sqlcode = SQLExecDirect( hstmt, (SQLCHAR*)sql.c_str(), sql.length() ) ) == SQL_SUCCESS ){ |
if( ( sqlcode = SQLExecDirect( hstmt, (SQLCHAR*)sql.c_str(), sql.length() ) ) == SQL_SUCCESS ){ |
| 5801 |
SQLINTEGER count = 0; |
SQLLEN count = 0; |
| 5802 |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
if( ( sqlcode = SQLRowCount( hstmt, &count ) ) == SQL_SUCCESS && count > 0 ){ |
| 5803 |
ret = RES_OK; |
ret = RES_OK; |
| 5804 |
}else if( ( sqlcode = SQLAllocHandle( SQL_HANDLE_STMT, hdbc, &hstmt2 ) ) == SQL_SUCCESS ) { |
}else if( ( sqlcode = SQLAllocHandle( SQL_HANDLE_STMT, hdbc, &hstmt2 ) ) == SQL_SUCCESS ) { |
| 5879 |
if( ( sqlcode = SQLExecDirect( hstmt, (SQLCHAR*)sql.c_str(), sql.length() ) ) == SQL_SUCCESS ){ |
if( ( sqlcode = SQLExecDirect( hstmt, (SQLCHAR*)sql.c_str(), sql.length() ) ) == SQL_SUCCESS ){ |
| 5880 |
while( SQLFetch( hstmt ) == SQL_SUCCESS ){ |
while( SQLFetch( hstmt ) == SQL_SUCCESS ){ |
| 5881 |
string valuestr; |
string valuestr; |
| 5882 |
SQLINTEGER length = 0; |
SQLLEN length = 0; |
| 5883 |
syslog_printf( "\nsql at %d=%s", __LINE__, sql.c_str() ); |
syslog_printf( "\nsql at %d=%s", __LINE__, sql.c_str() ); |
| 5884 |
// get amount of data |
// get amount of data |
| 5885 |
if( SQLGetData(hstmt, 1, SQL_C_BINARY, *value, 0, &length) |
if( SQLGetData(hstmt, 1, SQL_C_BINARY, *value, 0, &length) |
| 5959 |
result_t ret = RES_ERROR; |
result_t ret = RES_ERROR; |
| 5960 |
SQLRETURN sqlcode; |
SQLRETURN sqlcode; |
| 5961 |
SQLHANDLE hstmt = NULL; |
SQLHANDLE hstmt = NULL; |
| 5962 |
SQLINTEGER count = 0; |
SQLLEN count = 0; |
| 5963 |
string sql; |
string sql; |
| 5964 |
SQLLEN len = 0; |
SQLLEN len = 0; |
| 5965 |
time_t log_date = 0; |
time_t log_date = 0; |
| 6481 |
indexid_t* dst_xids = 0; |
indexid_t* dst_xids = 0; |
| 6482 |
string sql; |
string sql; |
| 6483 |
SQLRETURN sqlcode; |
SQLRETURN sqlcode; |
| 6484 |
SQLINTEGER count = 0; |
SQLLEN count = 0; |
| 6485 |
userid_t sess_uid; |
userid_t sess_uid; |
| 6486 |
|
|
| 6487 |
if( ( ret = sessionID2UID( sid, &sess_uid ) ) != RES_OK ) return ret; |
if( ( ret = sessionID2UID( sid, &sess_uid ) ) != RES_OK ) return ret; |
| 6551 |
itemtype_t* dst= 0; |
itemtype_t* dst= 0; |
| 6552 |
string sql; |
string sql; |
| 6553 |
SQLRETURN sqlcode; |
SQLRETURN sqlcode; |
| 6554 |
SQLINTEGER count = 0; |
SQLLEN count = 0; |
| 6555 |
|
|
| 6556 |
sql = "SELECT item_type_id, name, mid, display_name "; |
sql = "SELECT item_type_id, name, mid, display_name "; |
| 6557 |
sql += " FROM " + dbprefix + "_xnpaccount_item_type order by item_type_id"; |
sql += " FROM " + dbprefix + "_xnpaccount_item_type order by item_type_id"; |
| 6611 |
result_t ret = RES_ERROR; |
result_t ret = RES_ERROR; |
| 6612 |
SQLRETURN sqlcode; |
SQLRETURN sqlcode; |
| 6613 |
SQLHANDLE hstmt = NULL; |
SQLHANDLE hstmt = NULL; |
| 6614 |
SQLINTEGER count = 0; |
SQLLEN count = 0; |
| 6615 |
string sql; |
string sql; |
| 6616 |
indexid_t xid = 0; |
indexid_t xid = 0; |
| 6617 |
SQLLEN len = 0; |
SQLLEN len = 0; |
| 6672 |
itemid_t* dst = 0; |
itemid_t* dst = 0; |
| 6673 |
string sql; |
string sql; |
| 6674 |
SQLRETURN sqlcode; |
SQLRETURN sqlcode; |
| 6675 |
SQLINTEGER count = 0; |
SQLLEN count = 0; |
| 6676 |
userid_t sess_uid; |
userid_t sess_uid; |
| 6677 |
|
|
| 6678 |
if( ( ret = sessionID2UID( sid, &sess_uid ) ) != RES_OK ) return ret; |
if( ( ret = sessionID2UID( sid, &sess_uid ) ) != RES_OK ) return ret; |