Skip to content

Commit

Permalink
[GT-184] Update code with line limit
Browse files Browse the repository at this point in the history
  • Loading branch information
Sae126V committed Aug 24, 2023
1 parent 72afa09 commit 8afb986
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 13 deletions.
18 changes: 11 additions & 7 deletions htdocs/web_portal/views/site/view_site.php
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ class="header"
<th>Identifier</th>
<th>User</th>
<th style="text-align:center;white-space: nowrap">
<p>Last Renewed<p>
Last Renewed
</th>
<th style="text-align:center;white-space: nowrap">Last Used</th>
<th style="text-align:center">Write</th>
Expand Down Expand Up @@ -688,13 +688,17 @@ class="header"
/>
</td>
<td style="width: 8%; text-align: center;">
<?php if (!$portalIsReadOnly) :?>
<?php if (!$portalIsReadOnly) :
$actionURL = "index.php" .
"?Page_Type=Edit_API_Authentication_Entity"
. "&amp;" .
"authentityid=" . $APIAuthEnt->getId()
. "&amp;"
. "isRenewalRequest=true"
?>
<form
action="index.php
?Page_Type=Edit_API_Authentication_Entity&amp;
authentityid=<?= $APIAuthEnt->getId();?>&amp;
isRenewalRequest=true"
method="post"
action= <?= $actionURL ?>
method="post"
>
<button type="submit">Renew</button>
</form>
Expand Down
3 changes: 2 additions & 1 deletion lib/Gocdb_Services/APIAuthenticationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@ private function validate($data, $identifier, $type)
if (
$type == 'OIDC Subject' &&
!preg_match(
"/^([a-f0-9]{8}\-[a-f0-9]{4}\-[a-f0-9]{4}\-[a-f0-9]{4}\-[a-f0-9]{12})$/",
"/^([a-f0-9]{8}\-[a-f0-9]{4}\-[a-f0-9]{4}" .
"\-[a-f0-9]{4}\-[a-f0-9]{12})$/",
$identifier
)
) {
Expand Down
3 changes: 2 additions & 1 deletion lib/Gocdb_Services/Site.php
Original file line number Diff line number Diff line change
Expand Up @@ -1496,7 +1496,8 @@ private function validIdentifier(
if (
$type == 'OIDC Subject' &&
!preg_match(
"/^([a-z0-9]{8}\-[a-z0-9]{4}\-[a-z0-9]{4}\-[a-z0-9]{4}\-[a-z0-9]{12})$/",
"/^([a-z0-9]{8}\-[a-z0-9]{4}\-[a-z0-9]{4}" .
"\-[a-z0-9]{4}\-[a-z0-9]{12})$/",
$identifier
)
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,9 @@ public function deleteCreds($creds, $deleteThreshold, $isRenewalRequest)
* @param bool $isRenewalRequest Flag indicating the presence
* or absence of the `r`
* command-line argument.
* @return array [] An Array of credentials identifed
* for sending warning emails.
* @return array [] An Array of credentials
* identifed for
* sending warning emails.
*/
public function warnUsers(
$creds,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,11 @@ public function getThreshold()
*/
private function tryToObtainDatetime($given)
{
$this->isRenewalRequest = $this->getBoolOption($given, 'renewals', 'r');
$this->isRenewalRequest = $this->getBoolOption(
$given,
'renewals',
'r'
);

if (!$this->isRenewalRequest) {
$this->isInactiveRequest = $this->getBoolOption(
Expand All @@ -216,7 +220,10 @@ private function tryToObtainDatetime($given)
);
}

$optionProvided = ($this->isRenewalRequest || $this->isInactiveRequest);
$optionProvided = (
$this->isRenewalRequest ||
$this->isInactiveRequest
);

if (!$optionProvided) {
throw new InvalidArgumentException(
Expand Down

0 comments on commit 8afb986

Please sign in to comment.