Skip to content

Commit

Permalink
Rename link Identity to Identifier Management
Browse files Browse the repository at this point in the history
  • Loading branch information
Sae126V committed Oct 16, 2024
1 parent ebbb7e2 commit dbda841
Show file tree
Hide file tree
Showing 16 changed files with 43 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ function Get_User_Status_HTML()
$HTML .= "Unregistered user<br />";
$HTML .= "<br/><a href=\"index.php?Page_Type=Register\">".
"Register</a><br/>".
"<a href=\"index.php?Page_Type=Link_Identity\">".
"<a href=\"index.php?Page_Type=Identifier_Management\">".
"Link Identity/Recover Account</a>";

$HTML .="</div>";
return $HTML;
}
$HTML .= "Registered as: <br />".$user->getForename() . " " . $user->getSurname() . "<br /><br />";
$HTML .= Get_User_Info_HTML($user);
$HTML .= "<br/><a href=\"index.php?Page_Type=Link_Identity\">" . "Link Identity/Recover Account</a><br/>";
$HTML .= "<br/><a href=\"index.php?Page_Type=Identifier_Management\">" . "Link Identity/Recover Account</a><br/>";
$HTML .= "</div>";
return $HTML;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
require_once __DIR__.'/utils.php';

/**
* Controller for a link identity request.
* Controller for a identifier management request.
* @global array $_POST only set if the browser has POSTed data
* @return null
*/
function link_identity() {
function identifier_management() {
//Check the portal is not in read only mode, returns exception if it is
checkPortalIsNotReadOnly();

Expand Down Expand Up @@ -56,12 +56,12 @@ function draw() {
$params['otherIdentifiers'][] = $identifier;
}
}
show_view('user/link_identity_rejected.php', $params);
show_view('user/identifier_management_rejected.php', $params);
die();
}
}

show_view('user/link_identity.php', $params, 'Link Identity');
show_view('user/identifier_management.php', $params, 'Identifier Management');
}

function submit() {
Expand Down Expand Up @@ -89,7 +89,7 @@ function submit() {
}

try {
\Factory::getLinkIdentityService()->newLinkIdentityRequest($primaryIdString, $currentIdString, $primaryAuthType, $currentAuthType, $givenEmail);
\Factory::getIdentifierManagementService()->newIdentifierManagementRequest($primaryIdString, $currentIdString, $primaryAuthType, $currentAuthType, $givenEmail);
} catch(\Exception $e) {
show_view('error.php', $e->getMessage());
die();
Expand All @@ -106,5 +106,5 @@ function submit() {
$params['requestText'] = 'identity linking';
}

show_view('user/link_identity_accepted.php', $params);
show_view('user/identifier_management_accepted.php', $params);
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function validate_identity_link() {
}

try {
$request = Factory::getLinkIdentityService()->confirmIdentityLinking($code, $currentIdString);
$request = Factory::getIdentifierManagementService()->confirmIdentityLinking($code, $currentIdString);
} catch(\Exception $e) {
show_view('error.php', $e->getMessage());
die();
Expand All @@ -37,5 +37,5 @@ function validate_identity_link() {
$params['requestText'] = 'linked';
}

show_view('user/linked_identity.php', $params);
show_view('user/identifier_management_linked.php', $params);
}
8 changes: 4 additions & 4 deletions htdocs/web_portal/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -635,14 +635,14 @@ function Draw_Page($Page_Type) {
require_once __DIR__ . '/controllers/site/delete_api_auth.php';
delete_entity();
break;
case "Link_Identity" :
case "Identifier_Management" :
rejectIfNotAuthenticated();
require_once __DIR__ . '/controllers/user/link_identity.php';
link_identity();
require_once __DIR__ . '/controllers/user/identifier_management.php';
identifier_management();
break;
case "User_Validate_Identity_Link" :
rejectIfNotAuthenticated();
require_once __DIR__ . '/controllers/user/link_identity_user_validate.php';
require_once __DIR__ . '/controllers/user/identifier_management_user_validate.php';
validate_identity_link();
break;
default:
Expand Down
2 changes: 1 addition & 1 deletion htdocs/web_portal/javascript/linking.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$(document).ready(function() {
// Add the jQuery form change event handlers
$('#linkIdentityForm').find(":input").change(function() {
$('#identifierManagementForm').find(":input").change(function() {
validate();
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<br />
<div class=Form_Holder>
<div class=Form_Holder_2>
<form name="Link_Identity" action="index.php?Page_Type=Link_Identity"
method="post" class="inputForm" id="linkIdentityForm">
<form name="Identifier_Management" action="index.php?Page_Type=Identifier_Management"
method="post" class="inputForm" id="identifierManagementForm">
<div>
Your current ID string (e.g. certificate DN) is: <label><?php echo $params['idString']; ?></label>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
complete your <?php echo $params['requestText']; ?>.</p>

<p>If you did not receive an email, please check the above details are correct, and the
<a href="index.php?Page_Type=Link_Identity">guidance on identity linking and account recovery</a>.</p>
<a href="index.php?Page_Type=Identifier_Management">guidance on identity linking and account recovery</a>.</p>
</div>
2 changes: 1 addition & 1 deletion lib/Doctrine/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
require_once $entitiesPath."/RoleActionRecord.php";
require_once $entitiesPath."/APIAuthentication.php";
require_once $entitiesPath."/UserIdentifier.php";
require_once $entitiesPath."/LinkIdentityRequest.php";
require_once $entitiesPath."/IdentifierManagementRequest.php";

//if (!class_exists("Doctrine\Common\Version", false)) {
// require_once __DIR__."/bootstrap_doctrine.php";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* a confirmation code that is sent to the user's existing email
* address - they need to provide the code to complete the identity linking transaction.
*
* @Entity @Table(name="LinkIdentityRequests")
* @Entity @Table(name="IdentifierManagementRequests")
*/
class LinkIdentityRequest {
class IdentifierManagementRequest {

/** @Id @Column(type="integer") @GeneratedValue */
protected $id;
Expand Down
18 changes: 9 additions & 9 deletions lib/Gocdb_Services/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class Factory {
private static $exService = null;
private static $notificationService = null;
private static $emailService = null;
private static $linkIdentityService = null;
private static $identifierManagementService = null;
private static $APIAuthenticationService = null;

public static $properties = array();
Expand Down Expand Up @@ -349,16 +349,16 @@ public static function getProjectService() {
}

/**
* Singleton Link Identity service
* @return org\gocdb\services\LinkIdentity
* Singleton Identifier Management service
* @return org\gocdb\services\IdentifierManagement
*/
public static function getLinkIdentityService() {
if (self::$linkIdentityService == null) {
require_once __DIR__ . '/LinkIdentity.php';
self::$linkIdentityService = new org\gocdb\services\LinkIdentity();
self::$linkIdentityService->setEntityManager(self::getEntityManager());
public static function getIdentifierManagementService() {
if (self::$identifierManagementService == null) {
require_once __DIR__ . '/IdentifierManagement.php';
self::$identifierManagementService = new org\gocdb\services\IdentifierManagement();
self::$identifierManagementService->setEntityManager(self::getEntityManager());
}
return self::$linkIdentityService;
return self::$identifierManagementService;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
namespace org\gocdb\services;

require_once __DIR__ . '/AbstractEntityService.php';
class LinkIdentity extends AbstractEntityService {
class IdentifierManagement extends AbstractEntityService {

/**
* Processes an identity link request
Expand All @@ -12,7 +12,7 @@ class LinkIdentity extends AbstractEntityService {
* @param string $currentAuthType auth type of current ID string
* @param string $givenEmail email of primary user
*/
public function newLinkIdentityRequest($primaryIdString, $currentIdString, $primaryAuthType, $currentAuthType, $givenEmail) {
public function newIdentifierManagementRequest($primaryIdString, $currentIdString, $primaryAuthType, $currentAuthType, $givenEmail) {

$serv = \Factory::getUserService();

Expand Down Expand Up @@ -46,8 +46,8 @@ public function newLinkIdentityRequest($primaryIdString, $currentIdString, $prim
// Generate confirmation code
$code = $this->generateConfirmationCode($primaryIdString);

// Create link identity request
$linkIdentityReq = new \LinkIdentityRequest($primaryUser, $currentUser, $code, $primaryIdString, $currentIdString, $primaryAuthType, $currentAuthType);
// Create identifier management request
$identifierManagementReq = new \IdentifierManagementRequest($primaryUser, $currentUser, $code, $primaryIdString, $currentIdString, $primaryAuthType, $currentAuthType);

// Recovery or identity linking
if ($currentUser === null) {
Expand All @@ -59,7 +59,7 @@ public function newLinkIdentityRequest($primaryIdString, $currentIdString, $prim
// Apply change
try {
$this->em->getConnection()->beginTransaction();
$this->em->persist($linkIdentityReq);
$this->em->persist($identifierManagementReq);
$this->em->flush();

// Send confirmation email(s) to primary user, and current user if registered with a different email
Expand Down Expand Up @@ -172,13 +172,13 @@ private function generateConfirmationCode($idString) {
}

/**
* Gets a link identity request from the database based on user ID
* Gets a identifier management request from the database based on user ID
* @param integer $userId userid of the request to be linked
* @return arraycollection
*/
private function getRequestByUserId($userId) {
$dql = "SELECT l
FROM LinkIdentityRequest l
FROM IdentifierManagementRequest l
JOIN l.primaryUser pu
JOIN l.currentUser cu
WHERE pu.id = :id OR cu.id = :id";
Expand All @@ -192,14 +192,14 @@ private function getRequestByUserId($userId) {
}

/**
* Gets a link identity request from the database based on current ID string
* Gets a identifier management request from the database based on current ID string
* ID string may be present as primary or current user
* @param string $idString ID string of user to be linked in primary account
* @return arraycollection
*/
private function getRequestByIdString($idString) {
$dql = "SELECT l
FROM LinkIdentityRequest l
FROM IdentifierManagementRequest l
WHERE l.primaryIdString = :idString
OR l.currentIdString = :idString";

Expand All @@ -218,7 +218,7 @@ private function getRequestByIdString($idString) {
*/
public function getRequestByConfirmationCode($code) {
$dql = "SELECT l
FROM LinkIdentityRequest l
FROM IdentifierManagementRequest l
WHERE l.confirmCode = :code";

$request = $this->em
Expand Down
2 changes: 1 addition & 1 deletion resources/DeleteOldRequestsRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
echo "Querying identity linking and account recovery requests\n\n";

$em = $entityManager;
$dql = "SELECT l FROM LinkIdentityRequest l";
$dql = "SELECT l FROM IdentifierManagementRequest l";
$requests = $entityManager->createQuery($dql)->getResult();

// Remove requests older than one day
Expand Down
2 changes: 1 addition & 1 deletion tests/doctrine/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
require_once $entitiesPath."/Project.php";
require_once $entitiesPath."/ServiceGroup.php";
require_once $entitiesPath."/ServiceGroupProperty.php";
require_once $entitiesPath."/LinkIdentityRequest.php";
require_once $entitiesPath."/IdentifierManagementRequest.php";
require_once $entitiesPath."/PrimaryKey.php";
require_once $entitiesPath."/ArchivedNGI.php";
require_once $entitiesPath."/ArchivedService.php";
Expand Down
2 changes: 1 addition & 1 deletion tests/doctrine/truncateDataTables.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<Downtimes_EndpointLocations/>

<Users/>
<LinkIdentityRequests/>
<IdentifierManagementRequests/>
<RoleTypes/>
<Roles/>

Expand Down

0 comments on commit dbda841

Please sign in to comment.