-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement registration validation (Version 2) #622
base: main
Are you sure you want to change the base?
Implement registration validation (Version 2) #622
Conversation
Check to see if current user is capable of creating meetings with the registration option
Set 'use_pmi' to false when registration is requested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @paulandm,
This looks really good! I have a few suggestions that may help. If you have any questions, please let us know.
classes/webservice.php
Outdated
*/ | ||
public function get_user_registration_capable() { | ||
global $USER; | ||
$zoomuser = $this->get_user($USER->email); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We lookup users based on the configured field, so there's a different code pattern for getting the person. Also, there is a function that caches the results, so we can avoid unnecessary API calls.
$zoomuser = $this->get_user($USER->email); | |
$zoomuser = zoom_get_user(zoom_get_api_identifier($USER)); |
mod_form.php
Outdated
// Check licensing of the user. | ||
$registrationcapableuserfound = zoom_webservice()->get_user_registration_capable(); | ||
if (!$registrationcapableuserfound) { | ||
$errors['registration'] = get_string('err_registration', 'zoom'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use the full frankenstyle name, not the activity module shortname.
$errors['registration'] = get_string('err_registration', 'zoom'); | |
$errors['registration'] = get_string('err_registration', 'mod_zoom'); |
mod_form.php
Outdated
$registrationcapableuserfound = zoom_webservice()->get_user_registration_capable(); | ||
if (!$registrationcapableuserfound) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel weird about the use of the English word "capable", because it implies "fitness". Translation to other languages may also be negatively affected. "allowed" or "permitted" seem more appropriate to me, because they imply "licensed", "granted", "has the permission".
Implemented PR feedback/suggestions.
Hi @jrchamp Thanks for your feedback. I've implemented the requested changes. |
Check to see if current user is capable of creating meetings with the registration option enabled.
It seems like only users with a 'Pro' license are capable of creating such meetings.