本文整理匯總了PHP中DataValidator::validate_action_token方法的典型用法代碼示例。如果您正苦於以下問題:PHP DataValidator::validate_action_token方法的具體用法?PHP DataValidator::validate_action_token怎麽用?PHP DataValidator::validate_action_token使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DataValidator
的用法示例。
在下文中一共展示了DataValidator::validate_action_token方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
*/
$neededObjAr = array(AMA_TYPE_STUDENT => array('layout'), AMA_TYPE_VISITOR => array('layout'));
require_once ROOT_DIR . '/include/module_init.inc.php';
include_once ROOT_DIR . '/browsing/include/browsing_functions.inc.php';
include_once ROOT_DIR . '/include/services_functions.inc.php';
include_once ROOT_DIR . '/include/services_class.inc.php';
include_once ROOT_DIR . '/include/token_classes.inc.php';
$self = whoami();
$error_page = HTTP_ROOT_DIR . "/index.php";
$isRegistration = FALSE;
// user is asking for subscription just after registration ?
$isSubscription = FALSE;
// user is already registered ?
$id_course = DataValidator::is_uinteger($_GET['id_course']);
$r_id_user = DataValidator::is_uinteger($_GET['id_user']);
$token = DataValidator::validate_action_token($_GET['token']);
/*
* If a valid course id was not given, do not proceed.
* (Note: we are not checking $id_course !== false,
* since we do not accept as valid a course id set to 0)
*/
if ($id_course != false) {
if ($r_id_user != false && $token !== false) {
/*
* Handle a subscription request made by a user that has also asked for registration.
* To proceed, we have to check that the given token exists for this user and that
* the token is valid too.
* Additionally we have to check that the user has been correctly registered and
* that needs to confirm his/her registration.
*/
$tokenObj = TokenFinder::findTokenForUserRegistration($r_id_user, $token);