本文整理汇总了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);