| 47 |
ZEND_FUNCTION(vp_is_group_admin ); |
ZEND_FUNCTION(vp_is_group_admin ); |
| 48 |
ZEND_FUNCTION(vp_dump_gids ); |
ZEND_FUNCTION(vp_dump_gids ); |
| 49 |
ZEND_FUNCTION(vp_dump_group_admins ); |
ZEND_FUNCTION(vp_dump_group_admins ); |
| 50 |
|
/* |
| 51 |
ZEND_FUNCTION(vp_delete_member ); |
ZEND_FUNCTION(vp_delete_member ); |
| 52 |
ZEND_FUNCTION(vp_insert_member ); |
ZEND_FUNCTION(vp_insert_member ); |
| 53 |
ZEND_FUNCTION(vp_get_members ); |
ZEND_FUNCTION(vp_get_members ); |
| 54 |
/* |
*/ |
| 55 |
ZEND_FUNCTION(vp_delete_group ); |
ZEND_FUNCTION(vp_delete_group ); |
| 56 |
ZEND_FUNCTION(vp_insert_group ); |
ZEND_FUNCTION(vp_insert_group ); |
|
*/ |
|
| 57 |
ZEND_FUNCTION(vp_update_group ); |
ZEND_FUNCTION(vp_update_group ); |
| 58 |
ZEND_FUNCTION(vp_get_group ); |
ZEND_FUNCTION(vp_get_group ); |
| 59 |
ZEND_FUNCTION(vp_get_groups ); |
ZEND_FUNCTION(vp_get_groups ); |
| 89 |
ZEND_FE(vp_is_group_admin ,NULL) |
ZEND_FE(vp_is_group_admin ,NULL) |
| 90 |
ZEND_FE(vp_dump_gids ,NULL) |
ZEND_FE(vp_dump_gids ,NULL) |
| 91 |
ZEND_FE(vp_dump_group_admins ,NULL) |
ZEND_FE(vp_dump_group_admins ,NULL) |
| 92 |
|
/* |
| 93 |
ZEND_FE(vp_delete_member ,NULL) |
ZEND_FE(vp_delete_member ,NULL) |
| 94 |
ZEND_FE(vp_insert_member ,NULL) |
ZEND_FE(vp_insert_member ,NULL) |
| 95 |
ZEND_FE(vp_get_members ,NULL) |
ZEND_FE(vp_get_members ,NULL) |
| 96 |
/* |
*/ |
| 97 |
ZEND_FE(vp_delete_group ,NULL) |
ZEND_FE(vp_delete_group ,NULL) |
| 98 |
ZEND_FE(vp_insert_group ,NULL) |
ZEND_FE(vp_insert_group ,NULL) |
|
*/ |
|
| 99 |
ZEND_FE(vp_update_group ,NULL) |
ZEND_FE(vp_update_group ,NULL) |
| 100 |
ZEND_FE(vp_get_group ,NULL) |
ZEND_FE(vp_get_group ,NULL) |
| 101 |
ZEND_FE(vp_get_groups ,NULL) |
ZEND_FE(vp_get_groups ,NULL) |
| 538 |
char* key = 0; |
char* key = 0; |
| 539 |
|
|
| 540 |
key = "gid"; |
key = "gid"; |
| 541 |
zend_hash_find( z -> value.ht, key, strlen( key ) + 1, ( void** )&tmp ); |
if( zend_hash_find( z -> value.ht, key, strlen( key ) + 1, ( void** )&tmp ) == SUCCESS ){ |
| 542 |
convert_to_long_ex( tmp ) ; |
convert_to_long_ex( tmp ) ; |
| 543 |
pGroup -> setGID( (*tmp) -> value.lval ); |
pGroup -> setGID( (*tmp) -> value.lval ); |
| 544 |
|
} |
| 545 |
key = "gname"; |
key = "gname"; |
| 546 |
zend_hash_find( z -> value.ht, key, strlen( key ) + 1, ( void** )&tmp ); |
if( zend_hash_find( z -> value.ht, key, strlen( key ) + 1, ( void** )&tmp ) == SUCCESS ){ |
| 547 |
convert_to_string_ex( tmp ) ; |
convert_to_string_ex( tmp ) ; |
| 548 |
pGroup -> setGname( (*tmp) -> value.str.val ); |
pGroup -> setGname( (*tmp) -> value.str.val ); |
| 549 |
|
} |
| 550 |
key = "gdesc"; |
key = "gdesc"; |
| 551 |
zend_hash_find( z -> value.ht, key, strlen( key ) + 1, ( void** )&tmp ); |
if( zend_hash_find( z -> value.ht, key, strlen( key ) + 1, ( void** )&tmp ) == SUCCESS ){ |
| 552 |
convert_to_string_ex( tmp ) ; |
convert_to_string_ex( tmp ) ; |
| 553 |
pGroup -> setDesc( (*tmp) -> value.str.val ); |
pGroup -> setDesc( (*tmp) -> value.str.val ); |
| 554 |
|
} |
| 555 |
return RES_OK; |
return RES_OK; |
| 556 |
} |
} |
| 557 |
|
|
| 1339 |
RETURN_LONG( result ); |
RETURN_LONG( result ); |
| 1340 |
} |
} |
| 1341 |
|
|
| 1342 |
|
/** グループ情報を追加する。<br> |
| 1343 |
|
int vp_insert_group( int sid, array group ) |
| 1344 |
|
@param sid セッションID |
| 1345 |
|
@param group グループ情報の連想配列 |
| 1346 |
|
@return RES_OK |
| 1347 |
|
@return RES_DB_NOT_INITIALIZED |
| 1348 |
|
@return RES_NO_SUCH_SESSION |
| 1349 |
|
@return RES_DB_QUERY_ERROR |
| 1350 |
|
*/ |
| 1351 |
|
ZEND_FUNCTION(vp_insert_group) |
| 1352 |
|
{ |
| 1353 |
|
long sid; |
| 1354 |
|
zval *zgroup; |
| 1355 |
|
group_t group; |
| 1356 |
|
|
| 1357 |
|
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "la", |
| 1358 |
|
&sid, &zgroup) == FAILURE) { |
| 1359 |
|
return; |
| 1360 |
|
} |
| 1361 |
|
|
| 1362 |
|
zvalToGroup( zgroup, &group ); |
| 1363 |
|
result_t result = insertGroup( sid, &group ); |
| 1364 |
|
RETURN_LONG( result ); |
| 1365 |
|
} |
| 1366 |
|
|
| 1367 |
|
|
| 1368 |
|
/** グループ情報を削除する。<br> |
| 1369 |
|
int vp_delete_group( int sid, int gid ) |
| 1370 |
|
@param sid セッションID |
| 1371 |
|
@param gid 削除したいグループのID |
| 1372 |
|
@return RES_OK |
| 1373 |
|
@return RES_DB_QUERY_ERROR |
| 1374 |
|
@return RES_NO_SUCH_SESSION |
| 1375 |
|
@return RES_DB_NOT_INITIALIZED |
| 1376 |
|
*/ |
| 1377 |
|
ZEND_FUNCTION(vp_delete_group) |
| 1378 |
|
{ |
| 1379 |
|
long sid; |
| 1380 |
|
long gid; |
| 1381 |
|
|
| 1382 |
|
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", |
| 1383 |
|
&sid, &gid) == FAILURE) { |
| 1384 |
|
return; |
| 1385 |
|
} |
| 1386 |
|
RETURN_LONG( deleteGroup( sid, gid ) ); |
| 1387 |
|
} |
| 1388 |
|
|
| 1389 |
|
/** グループの管理者を取得。<br> |
| 1390 |
|
int vp_dump_group_admins( int sid, int gid, array criteria, array uids ) |
| 1391 |
|
@param sid セッションID |
| 1392 |
|
@param gid グループのID |
| 1393 |
|
@param criteria uidsに書き込むときのソート条件,範囲の指定 |
| 1394 |
|
@param uids 管理者のUIDを書き込む配列 |
| 1395 |
|
@return RES_OK |
| 1396 |
|
@return RES_DB_QUERY_ERROR |
| 1397 |
|
@return RES_NO_SUCH_SESSION |
| 1398 |
|
@return RES_DB_NOT_INITIALIZED |
| 1399 |
|
*/ |
| 1400 |
|
/* |
| 1401 |
|
ZEND_FUNCTION(vp_dump_group_admins) |
| 1402 |
|
{ |
| 1403 |
|
long sid; |
| 1404 |
|
long gid; |
| 1405 |
|
zval *zcriteria; |
| 1406 |
|
zval *zuids; |
| 1407 |
|
|
| 1408 |
|
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llaa", |
| 1409 |
|
&sid, &gid, &zcriteria, &zuids) == FAILURE) { |
| 1410 |
|
return; |
| 1411 |
|
} |
| 1412 |
|
zCriteria_t zcri(zcriteria); |
| 1413 |
|
result_t result = zcri.getResult(); |
| 1414 |
|
if ( RES_OK == result ){ |
| 1415 |
|
userid_t* uids; |
| 1416 |
|
int uidsLen; |
| 1417 |
|
result_t result = dumpGroupAdmins( sid, gid, &zcri, &uids, &uidsLen ); |
| 1418 |
|
if( result != RES_OK ) RETURN_LONG( result ); |
| 1419 |
|
uidsToZval( uids, uidsLen, &zuids ); |
| 1420 |
|
fprintf( stderr, "uidsLen=%d\n", uidsLen ); |
| 1421 |
|
for( int i = 0; i < uidsLen; i++ ){ |
| 1422 |
|
fprintf( stderr, "%d, \n", uids[ i ] ); |
| 1423 |
|
} |
| 1424 |
|
freeResult( uids ); |
| 1425 |
|
RETURN_LONG( result ); |
| 1426 |
|
} |
| 1427 |
|
RETURN_LONG( result ); |
| 1428 |
|
} |
| 1429 |
|
*/ |
| 1430 |
|
|
| 1431 |
/** vpのsession_idの正当性チェック<br> |
/** vpのsession_idの正当性チェック<br> |
| 1432 |
bool vp_is_valid_session_id( int vp_session_id) |
bool vp_is_valid_session_id( int vp_session_id) |
| 1433 |
@return true 有効なvpのsession_idである |
@return true 有効なvpのsession_idである |