You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a user self-asserts their email, often they are tutorial users - for whom we do not have a real name. Other times, we get no name from Shibboleth.
When this happens, ask these users to modify their profile on the portal after they log in, to provide their name.
The text was updated successfully, but these errors were encountered:
kmsendemail.php can check if they are a tutorial user or if we have no name. If so, add a little text in the email we send asking them to confirm their email, with a link to the page to modify their profile.
Use a new function isTutorialUser(). Put that in lib/php. For now, it can just check for the [email protected] affiliation.
Add a 2nd new function shibProvidesName() that uses the Shibboleth provided attributes. Returns true if there is a displayName OR (first and last).
Then in kmsendemail: if (isTutorialUser() || ! shibProvidesName()), we add to the email: To set your name and other user information, please visit <modify.php link>.
// Return True iff the user is a tutorial userfunctionisTutorialUser() {
if (key_exists('affiliation', $_SERVER)) {
if (strpos($_SERVER['affiliation'], "[email protected]") != false) {
returnTrue;
}
}
returnFalse;
}
// Return True iff shibboleth provides a full name for the user// - displayName or givenName (first name) and sn (last name)functionshibProvidesName() {
if (key_exists('displayName', $_SERVER) && $_SERVER['displayName'] && trim($_SERVER['displayName'])) {
returnTrue;
}
if (key_exists('givenName', $_SERVER) && $_SERVER['givenName'] && trim($_SERVER['givenName'])) {
if (key_exists('sn', $_SERVER) && $_SERVER['sn'] && trim($_SERVER['sn'])) {
returnTrue;
}
}
returnFalse;
}
Code to add to the function get_user_conf_email_body, just before the line about "Questions?":
if (isTutorialUser() || !shibProvidesName()) {
$body .= "To set your name and other user information, please visit " . relative_url('modify.php') . ".\n\n";
}
When a user self-asserts their email, often they are tutorial users - for whom we do not have a real name. Other times, we get no name from Shibboleth.
When this happens, ask these users to modify their profile on the portal after they log in, to provide their name.
The text was updated successfully, but these errors were encountered: