bool CSaleAuxiliary::CheckAccess( int userID, string itemMD5, int periodLength, string periodType );
The method CheckAccess checks if the visitor userID can get access to a resource identified by itemMD5. The periodLength of the type periodType define the period of time within which the user is granted access to the resource.
Parameter | Description |
---|---|
userID | The user ID. |
itemMD5 | The string that uniquely identifies the resource. |
periodLength | The period length, within which the user has the access to the resource. |
periodType | The type of the period length. Possible values:
|
The method returns true if the user can get an access to this resource, or false otherwise.
<? if (CSaleAuxiliary::CheckAccess($USER->GetID(), "pict.jpg", 2, "D")) { echo '<a href="'.pict.jpg.'">the file is available for download</a>'; } else { echo "The file is not available for download"; } ?>
© 2001-2005 Bitrix | Bitrix Site Manager - Content Management & Portal Solutions |