Closed abertranb closed 10 years ago
Thank you for the bug report! You are correct, it should be $current_user->ID.
The lti_launch_func is designed to show/launch content for logged-in users, however it will execute and render an error message instead (see https://github.com/Saltbox/wordpress-lti-consumer/blob/master/lti-consumer.php#L425 ) if an anonymous user views a page containing the lti-launch shortcode.
You are using wp_get_current_user and try to get the user_id as 'user_id' => $current_user->user_id
But the wordpress api should be $current_user->ID http://codex.wordpress.org/Function_Reference/wp_get_current_user
return array( 'user_id' => $current_user->ID, 'lis_person_contact_email_primary' => $current_user->user_email, 'lis_person_name_given' => $current_user->user_firstname, 'lis_person_name_family' => $current_user->user_lastname, );
And I think the lti_launch_func only will be executed if there are a user logged in
Bests regards