Verified Commit 71390aea authored by Cyril Vazquez's avatar Cyril Vazquez
Browse files

Standardize controller variable names

parent b80900b9
......@@ -122,7 +122,8 @@ class authentication
throw \laabs::newException("auth/authenticationException", "Missing authentication credential", 401);
}
$servicePosition = \laabs::newController("organization/servicePosition")->getPosition($account->accountId);
$servicePositionController = \laabs::newController("organization/servicePosition");
$servicePosition = $servicePositionController->getPosition($account->accountId);
if ($servicePosition != null) {
\laabs::setToken("ORGANIZATION", $servicePosition->organization);
......@@ -130,7 +131,8 @@ class authentication
} else {
$organization = \laabs::getToken("ORGANIZATION");
$userPositions = \laabs::newController("organization/userPosition")->getMyPositions();
$userPositionController = \laabs::newController("organization/userPosition");
$userPositions = $userPositionController->getMyPositions();
if (!empty($organization)) {
$isUserPosition = false;
......
......@@ -57,8 +57,8 @@ class authorization
$account = $this->sdoFactory->read("auth/account", $accountToken->accountId);
switch ($account->accountType) {
case 'service':
$accountController = \laabs::newController('auth/serviceAccount');
$privileges = $accountController->getPrivileges($accountToken->accountId);
$serviceAccountController = \laabs::newController('auth/serviceAccount');
$privileges = $serviceAccountController->getPrivileges($accountToken->accountId);
foreach ($privileges as $privilege) {
if (fnmatch(strtolower($privilege->serviceURI), $serviceName)) {
......
......@@ -557,7 +557,8 @@ class scheduling
$GLOBALS["TOKEN"]['AUTH'] = $authToken;
if ($account->accountType == "service") {
$servicePosition = \laabs::newController("organization/servicePosition")->getPosition($serviceAccountId);
$servicePositionController = \laabs::newController("organization/servicePosition");
$servicePosition = $servicePositionController->getPosition($serviceAccountId);
if ($servicePosition != null) {
$orgToken = new \core\token($servicePosition->organization, 0);
......
......@@ -415,10 +415,10 @@ class organization
$services = $this->sdoFactory->find("organization/servicePosition", "orgId = '$orgId'");
$services = \laabs::castMessageCollection($services, 'organization/servicePositionTree');
$accountController = \laabs::newController('auth/userAccount');
$userAccountController = \laabs::newController('auth/userAccount');
foreach ($services as $service) {
$service->displayName = $accountController->edit((string) $service->serviceAccountId)->displayName;
$service->displayName = $userAccountController->edit((string) $service->serviceAccountId)->displayName;
}
return $services;
......@@ -1067,8 +1067,8 @@ class organization
*/
public function isUsed($registrationNumber)
{
$recordsManagementController = \laabs::newController("recordsManagement/archive");
$count = $recordsManagementController->countByOrg($registrationNumber);
$archiveController = \laabs::newController("recordsManagement/archive");
$count = $archiveController->countByOrg($registrationNumber);
return $count > 0 ? true : false;
}
......
......@@ -604,7 +604,8 @@ class archive
public function checkRights($archive)
{
$accountToken = \laabs::getToken('AUTH');
$account = \laabs::newController('auth/userAccount')->edit($accountToken->accountId);
$userAccountController = \laabs::newController('auth/userAccount');
$account = $userAccountController->edit($accountToken->accountId);
$currentOrganization = \laabs::getToken("ORGANIZATION");
......
......@@ -137,7 +137,8 @@ class authentication
\laabs::setToken('AUTH', $accountToken, $sessionTimeout);
$organization = \laabs::getToken("ORGANIZATION");
$userPositions = \laabs::newController("organization/userPosition")->getMyPositions();
$userPositionController = \laabs::newController("organization/userPosition");
$userPositions = $userPositionController->getMyPositions();
if (!empty($organization)) {
$isUserPosition = false;
......
......@@ -136,7 +136,8 @@ class cluster
{
$this->view->addContentFile('digitalResource/cluster/edit.html');
$repositories = \laabs::newController("digitalResource/repository")->index();
$repositoryController = \laabs::newController("digitalResource/repository");
$repositories = $repositoryController->index();
if ($cluster != null && $cluster->clusterId != null) {
$repositoriesCopy = $repositories;
......
......@@ -81,10 +81,10 @@ class contentType
{
if ($contentType != null) {
$contentType->puids = (array) $contentType->puids;
$controlerFormat = \laabs::newController('digitalResource/format');
$formatController = \laabs::newController('digitalResource/format');
foreach ($contentType->puids as $key => $puid) {
$contentType->puids[$key] = $controlerFormat->get($puid);
$contentType->puids[$key] = $formatController->get($puid);
}
}
......
......@@ -62,8 +62,9 @@ class welcome
$currentOrganization = \laabs::getToken("ORGANIZATION");
$accountToken = \laabs::getToken('AUTH');
$user = \laabs::newController('auth/userAccount')->get($accountToken->accountId);
$userAccountController = \laabs::newController('auth/userAccount');
$user = $userAccountController->get($accountToken->accountId);
// File plan tree
$filePlanPrivileges = \laabs::callService('auth/userAccount/readHasprivilege', "archiveManagement/filePlan");
......
......@@ -38,7 +38,8 @@ class dashboard
$this->storage = new \stdClass();
if ($accountToken = \laabs::getToken('AUTH')) {
$user = \laabs::newController('auth/userAccount')->get($accountToken->accountId);
$userAccountController = \laabs::newController('auth/userAccount');
$user = $userAccountController->get($accountToken->accountId);
$this->storage->user = $user;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment