Example #1
0
/**
 * Validates registration validation code
 *
 * @param string $event_guid guid of event
 * @param string $user_guid  guid of user
 * @param string $code       code to validate
 *
 * @return bool
 */
function event_manager_validate_registration_validation_code($event_guid, $user_guid, $code)
{
    $result = false;
    if (!empty($event_guid) && !empty($user_guid) && !empty($code)) {
        $valid_code = event_manager_generate_registration_validation_code($event_guid, $user_guid);
        if (!empty($valid_code)) {
            if ($code == $valid_code) {
                $result = true;
            }
        }
    }
    return $result;
}
Example #2
0
/**
 * Validates registration validation code
 *
 * @param string $event_guid guid of event
 * @param string $user_guid  guid of user
 * @param string $code       code to validate
 *
 * @return bool
 */
function event_manager_validate_registration_validation_code($event_guid, $user_guid, $code)
{
    if (empty($event_guid) || empty($user_guid) || empty($code)) {
        return false;
    }
    $valid_code = event_manager_generate_registration_validation_code($event_guid, $user_guid);
    if (empty($valid_code)) {
        return false;
    }
    if ($code !== $valid_code) {
        return false;
    }
    return true;
}