Skip to content

Commit

Permalink
CIL-540 Show missing name/email attribues in Certificate Information …
Browse files Browse the repository at this point in the history
…box.
  • Loading branch information
terrencegf committed Feb 29, 2020
1 parent 24c0599 commit 0d68785
Showing 1 changed file with 69 additions and 5 deletions.
74 changes: 69 additions & 5 deletions src/Service/Content.php
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ public static function printGetCertificate()
'with all required information.';
}

echo '<div class="alert alert-danger role="alert">';
echo '<div class="alert alert-danger" role="alert">';
echo $disabledmsg;
echo '</div>';
} else { // PKCS12 downloading is okay
Expand Down Expand Up @@ -713,9 +713,9 @@ public static function printCertInfo()
</tr>
</tbody>
</table>';
} else {
} else { // No DN? Show missing name(s) or email address.
echo '
<div class="card-body px-5">
<div class="card-body">
';
static::printErrorBox(
'
Expand All @@ -724,9 +724,73 @@ public static function printCertInfo()
has not provided CILogon with all required information.
</div> <!-- end card-text -->'
);
$firstname = Util::getSessionVar('firstname');
$lastname = Util::getSessionVar('lastname');
$displayname = Util::getSessionVar('displayname');
$emailaddr = Util::getSessionVar('emailaddr');
echo '
<table class="table table-striped table-sm">
<tbody>';
if ((strlen($firstname) == 0) && (strlen($displayname) == 0)) {
echo '
<tr>
<th class="w-50">First Name:</th>
<td>MISSING</td>
</tr>';
}
if ((strlen($lastname) == 0) && (strlen($displayname) == 0)) {
echo '
<tr>
<th class="w-50">Last Name:</th>
<td>MISSING</td>
</tr>';
}
if (
(strlen($displayname) == 0) &&
((strlen($firstname) == 0) || (strlen($lastname) == 0))
) {
echo '
<tr>
<th class="w-50">Display Name:</th>
<td>MISSING</td>
</tr>';
}
$emailvalid = filter_var($emailaddr, FILTER_VALIDATE_EMAIL);
if ((strlen($emailaddr) == 0) || (!$emailvalid)) {
echo '
<tr>
<th class="w-50">Email Address:</th>
<td>' , ((strlen($emailaddr) == 0) ? 'MISSING' : 'INVALID') , '</td>
</tr>';
}
$idp = Util::getSessionVar('idp');
$idpname = Util::getSessionVar('idpname');
if (Util::isEduGAINAndGetCert($idp, $idpname)) {
$idplist = Util::getIdpList();
if (!$idplist->isREFEDSRandS($idp)) {
echo '
<tr>
<th class="w-50"><a target="_blank"
href="http://refeds.org/category/research-and-scholarship">Research
and Scholarship</a>:</th>
<td>MISSING</td>
</tr>';
}
if (!$idplist->isSIRTFI($idp)) {
echo '
<tr>
<th class="w-50"><a target="_blank"
href="https://refeds.org/sirtfi">SIRTFI</a>:</th>
<td>MISSING</td>
</tr>';
}
}
echo '
</tbody>
</table>';
}
echo '
</div> <!-- end card-body -->';
</div> <!-- end card-body -->';
static::printCollapseEnd();
}

Expand Down Expand Up @@ -1201,7 +1265,7 @@ public static function printIdPMetadata()
<td><a style="text-decoration:underline" target="_blank"
href="https://met.refeds.org/met/entity/',
rawurlencode($idp),
'">', $idp, '</td>
'">', $idp, '</a></td>
<td> </td>
</tr>
';
Expand Down

0 comments on commit 0d68785

Please sign in to comment.