Quote:
Originally Posted by alan_el_more
Is this right? If i want to remove the key if not used within 2 weeks
|
That would remove all keys, not just that one.
If you want to remove one key for the timestamp, then you would do something like this:
Code:
stock fvault_prune_key( const szVault[ ], const szKey[ ], const iPruneStart=-1, const iPruneEnd=-1 ) {
static szData[ 2 ], iTimeStamp;
if( fvault_get_data( szVault, szKey, szData, 1, iTimeStamp ) && iTimeStamp != -1 ) {
if( iPruneStart == -1 ) {
if( iPruneEnd == -1
|| iTimeStamp <= iPruneEnd ) {
fvault_remove_key( szVault, szKey );
return 1;
}
}
else if( iPruneEnd == -1 ) {
if( iTimeStamp >= iPruneStart ) {
fvault_remove_key( szVault, szKey );
return 1;
}
}
else if( iPruneStart <= iTimeStamp <= iPruneEnd ) {
fvault_remove_key( szVault, szKey );
return 1;
}
}
return 0;
}
__________________