當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DataValidator::validate_action_token方法代碼示例

本文整理匯總了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);
開發者ID:eguicciardi,項目名稱:ada,代碼行數:31,代碼來源:subscribe.php


注:本文中的DataValidator::validate_action_token方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。