Skip to content

Commit

Permalink
Merge pull request #319 from GOCDB/release-5.8.1
Browse files Browse the repository at this point in the history
Release 5.8.1 to master
  • Loading branch information
gregcorbett authored Dec 7, 2021
2 parents 4fe6b46 + 2ad55e9 commit a3fa60d
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 46 deletions.
22 changes: 12 additions & 10 deletions htdocs/web_portal/img/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
| Icon image name | Link to source | License info | Author information|
|-|-|-|-|
|tick.png|[Link](http://www.softicons.com/system-icons/crystal-clear-icons-by-everaldo-coelho/actions-agt-action-success-icon)|GNU Lesser General Public License |Everaldo Coelho|
|add.png|[Link](http://www.softicons.com/system-icons/crystal-project-icons-by-everaldo-coelho/actions-edit-add-icon)|GNU Lesser General Public License |Everaldo Coelho|
|Clock.png|[Link](https://findicons.com/icon/254545/history)|GNU Lesser General Public License|Alessandro Rei|
|down_arrow.png|[Link](http://www.softicons.com/toolbar-icons/marmalade-icons-by-icojam/arrow-down-icon)|Freeware commercial license| Icojam|
|Enter/Next.png|[Link](http://www.iconarchive.com/show/oxygen-icons-by-oxygen-icons.org/Actions-arrow-right-icon.html)|GNU Lesser General Public License|[Link](http://www.iconarchive.com/icons/oxygen-icons.org/oxygen/authors.txt)|
|First/Last.png|[Link](http://www.iconarchive.com/show/oxygen-icons-by-oxygen-icons.org/Actions-arrow-right-double-icon.html)|GNU Lesser General Public License|[Link](http://www.iconarchive.com/icons/oxygen-icons.org/oxygen/authors.txt)|
|user.png|[Link](http://www.iconarchive.com/show/ravenna-3d-icons-by-double-j-design/Users-icon.html)|CC Attribution 4.0|Double-J Design|
|search.png|[Link](http://www.softicons.com/business-icons/business-icons-by-petalart/search-icon)|CC Attribution-NoDerivs 3.0 Unported| PetalArt|
|project.png|[Link](http://www.icons101.com/icon/id_51397/setid_1789/Free_3D_Printer_by_AhaSoft/Project)|CC Attribution|Aha-Soft (website)|
|home.png|[Link](http://iconbug.com/detail/icon/2884/blue-home-folder/)|CC Attribution 3.0 Unported|[Link](http://www.iconarchive.com/icons/oxygen-icons.org/oxygen/authors.txt)|
|star.png|[Link](http://www.softicons.com/web-icons/web-2-icon-set-by-anders-bjarnle/star-icon)|Free Use of icon|Anders Bjarnle|
|key.png|[Link](http://www.softicons.com/toolbar-icons/build-icons-by-design-kindle/key-icon)|Free for commercial use| Design Kindle|
|network.png|[Link](https://findicons.com/icon/169709/globe)|GNU Lesser General Public License|YellowIcon|
|new_window.png|[Link](http://www.softicons.com/toolbar-icons/cyan-bitcons-icons-by-some-random-dude/new-window-icon)|CC Attribution-ShareAlike 3.0 United States|Some Random Dude (<-actually the author information)|
|ngi.png|[Link](https://findicons.com/icon/234318/package_network)|GNU Lesser General Public License|Pavel InFeRnODeMoN|
|virtualsite.png|[Link](http://www.softicons.com/android-icons/mobile-icon-set-by-webiconset.com/maps-icon)|Free Use of icon| WebIconSet.com|
|new_window.png|[Link](http://www.softicons.com/toolbar-icons/cyan-bitcons-icons-by-some-random-dude/new-window-icon)|CC Attribution-ShareAlike 3.0 United States|Some Random Dude (<- actually the author information)|
|pencil.png|[Link](http://www.softicons.com/toolbar-icons/matte-basic-icons-by-momentum/edit-add-icon)|CC Attribution-Share Alike 3.0 United States|Momentum|
|person.png|[Link](http://www.iconarchive.com/show/ecommerce-business-icons-by-designcontest/admin-icon.html)|CC Attribution 4.0|DesignContest|
|pin.png|[Link](http://www.softicons.com/system-icons/windows-8-metro-invert-icons-by-dakirby309/pin-icon)|CC Attribution 3.0 Unported| dAKirby309|
|down_arrow.png|[Link](http://www.softicons.com/toolbar-icons/marmalade-icons-by-icojam/arrow-down-icon)|Freeware commercial license| Icojam|
|project.png|[Link](http://www.icons101.com/icon/id_51397/setid_1789/Free_3D_Printer_by_AhaSoft/Project)|CC Attribution|Aha-Soft (website)|
|search.png|[Link](http://www.softicons.com/business-icons/business-icons-by-petalart/search-icon)|CC Attribution-NoDerivs 3.0 Unported| PetalArt|
|server.png|[Link](https://findicons.com/icon/185522/network_server)|GNU Lesser General Public License|silvestre herrera|
|service.png|[Link](https://findicons.com/icon/227231/server)|GNU Lesser General Public License|David Vignoni|
|network.png|[Link](https://findicons.com/icon/169709/globe)|GNU Lesser General Public License|YellowIcon|
|person.png|[Link](http://www.iconarchive.com/show/ecommerce-business-icons-by-designcontest/admin-icon.html)|CC Attribution 4.0|DesignContest|
|star.png|[Link](http://www.softicons.com/web-icons/web-2-icon-set-by-anders-bjarnle/star-icon)|Free Use of icon|Anders Bjarnle|
|tick.png|[Link](http://www.softicons.com/system-icons/crystal-clear-icons-by-everaldo-coelho/actions-agt-action-success-icon)|GNU Lesser General Public License |Everaldo Coelho|
|trash.png|[Link](http://www.softicons.com/business-icons/ecommerce-and-business-icons-by-designcontest.com/trash-icon)|CC Attribution 3.0 Unported|DesignContest.com|
|user.png|[Link](http://www.iconarchive.com/show/ravenna-3d-icons-by-double-j-design/Users-icon.html)|CC Attribution 4.0|Double-J Design|
|virtualsite.png|[Link](http://www.softicons.com/android-icons/mobile-icon-set-by-webiconset.com/maps-icon)|Free Use of icon| WebIconSet.com|
Binary file added htdocs/web_portal/img/key.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion htdocs/web_portal/static_html/goc5_logo.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!-- <img src="img/Logo-1.6.png" class="logo_image" height="39" style="vertical-align: middle;"/>-->
<h3 class="Logo_Text Small_Bottom_Margin Standard_Padding"
style="vertical-align: middle; margin-left: 0.2em;">
GOCDB 5.8.0
GOCDB 5.8.1
</h3>

</a>
Expand Down
2 changes: 1 addition & 1 deletion htdocs/web_portal/views/site/added_api_auth.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="rightPageContainer">
<h1 class="Success">Success</h1><br />
The new <?php xecho($params['apiAuthenticationEntity']->getType()) ?> credential with identifier <?php $params['apiAuthenticationEntity']->getIdentifier() ?> was successfully added.
The new <?php xecho($params['apiAuthenticationEntity']->getType()) ?> credential with identifier <?php xecho($params['apiAuthenticationEntity']->getIdentifier()) ?> was successfully added.
<br />
<a href="index.php?Page_Type=Site&amp;id=<?php echo $params['site']->getID(); ?>">
View site</a>
Expand Down
4 changes: 2 additions & 2 deletions lib/Gocdb_Services/ServiceService.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function setScopeService(Scope $scopeService) {
* Finds a single service by ID and returns its entity
*
* @param int $id the service ID
* @return Service a service object
* @return \Service a service object
*/
public function getService($id) {
$dql = "SELECT s FROM Service s
Expand Down Expand Up @@ -955,7 +955,7 @@ private function scopeCheck(\Site $site, \Scope $scope) {
* Gets a service type by ID
*
* @param integer $id The service type ID
* @return ServiceType
* @return \ServiceType
*/
private function getServiceType($id) {
$dql = "SELECT st FROM ServiceType st WHERE st.id = :id";
Expand Down
64 changes: 32 additions & 32 deletions lib/Gocdb_Services/Site.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function getSite($id) {
* cert status, NGI) in the DB.
* Returns the object id of the updated site
*
* Accepts an array $site_data as a parameter. $site_data's format is as follows:
* Accepts an array $siteData as a parameter. $siteData's format is as follows:
* Array
* (
* [Scope] => EGI
Expand Down Expand Up @@ -326,17 +326,17 @@ function editSite(\Site $site, $newValues, \User $user = null) {
* checks in the gocdb_schema.xml and applies additional logic checks
* that can't be described in the gocdb_schema.xml.
*
* @param array $site_data containing all the fields for a GOCDB_SITE
* @param array $siteData containing all the fields for a GOCDB_SITE
* object
* @throws \Exception if the site data can't be
* validated. The \Exception message will contain a human
* readable description of which field failed validation.
* @return null
*/
private function validate($site_data, $type) {
private function validate($siteData, $type) {
require_once __DIR__.'/Validate.php';
$serv = new \org\gocdb\services\Validate();
foreach($site_data as $field => $value) {
foreach($siteData as $field => $value) {
$valid = $serv->validate($type, $field, $value);
if(!$valid) {
$error = "$field contains an invalid value: $value";
Expand All @@ -345,11 +345,11 @@ private function validate($site_data, $type) {
}

// Apply additional logic for validation that can't be captured solely using gocdb_schema.xml
if (!empty($site_data['IP_V6_RANGE'])) {
if (!empty($siteData['IP_V6_RANGE'])) {
require_once __DIR__.'/validation/IPv6Validator.php';
$validator = new \IPv6Validator();
$errors = array();
$errors = $validator->validate($site_data['IP_V6_RANGE'], $errors);
$errors = $validator->validate($siteData['IP_V6_RANGE'], $errors);
if (count($errors) > 0) {
throw new \Exception($errors[0]); // show the first message.
}
Expand Down Expand Up @@ -835,10 +835,10 @@ private function uniqueCheck($shortName) {
* from the other.
*
* @param \site $site site to be moved
* @param \NGI $NGI NGI to which $site is to be moved
* @param \NGI $ngi NGI to which $site is to be moved
* @return null
*/
public function moveSite(\Site $Site, \NGI $NGI, \User $user = null) {
public function moveSite(\Site $site, \NGI $ngi, \User $user = null) {
//Check the portal is not in read only mode, throws exception if it is
$this->checkPortalIsNotReadOnlyOrUserIsAdmin($user);

Expand All @@ -848,31 +848,31 @@ public function moveSite(\Site $Site, \NGI $NGI, \User $user = null) {
$this->em->getConnection()->beginTransaction(); // suspend auto-commit
try {
//If the NGI or site have no ID - throw logic exception
$site_id = $Site->getId();
if (empty($site_id)) {
throw new LogicException('Site has no ID');
$siteId = $site->getId();
if (empty($siteId)) {
throw new \LogicException('Site has no ID');
}
$ngi_id = $NGI->getId();
if (empty($ngi_id)) {
throw new LogicException('NGI has no ID');
$ngiId = $ngi->getId();
if (empty($ngiId)) {
throw new \LogicException('NGI has no ID');
}
//find old NGI
$old_NGI = $Site->getNgi();
$oldNgi = $site->getNgi();

//If the NGI has changed, then we move the site.
if ($old_NGI != $NGI) {
if ($oldNgi != $ngi) {

//Remove the site from the old NGI FIRST if it has an old NGI
if (!empty($old_NGI)) {
$old_NGI->getSites()->removeElement($Site);
if (!empty($oldNgi)) {
$oldNgi->getSites()->removeElement($site);
}
//Add site to new NGI
$NGI->addSiteDoJoin($Site);
//$Site->setNgiDoJoin($NGI);
$ngi->addSiteDoJoin($site);
//$site->setNgiDoJoin($ngi);

//persist
$this->em->merge($NGI);
$this->em->merge($old_NGI);
$this->em->merge($ngi);
$this->em->merge($oldNgi);
}//close if

$this->em->flush();
Expand Down Expand Up @@ -964,7 +964,7 @@ public function validatePropertyActions(\User $user, \Site $site) {
* Returns true if the user has permission to edit the Site
*
* @param \User $user
* @param \Site $Site
* @param \Site $site
* @return boolian
*/
public function userCanEditSite(\User $user, \Site $site) {
Expand Down Expand Up @@ -1296,18 +1296,18 @@ public function getScopesWithParentScopeInfo(\Site $site){

$scopeNamesNotShared = array_diff($childScopesNames, $parentScopesNames);

$ScopeNamesAndParentShareInfo = array();
$scopeNamesAndParentShareInfo = array();
foreach($sharedScopesNames as $sharedScopesName){
$ScopeNamesAndParentShareInfo[$sharedScopesName]=true;
$scopeNamesAndParentShareInfo[$sharedScopesName]=true;
}
foreach($scopeNamesNotShared as $scopeNameNotShared){
$ScopeNamesAndParentShareInfo[$scopeNameNotShared]=false;
$scopeNamesAndParentShareInfo[$scopeNameNotShared]=false;
}

//can be replaced with ksort($ScopeNamesAndParentShareInfo, SORT_NATURAL); in php>=5.5
uksort($ScopeNamesAndParentShareInfo, 'strcasecmp');
//can be replaced with ksort($scopeNamesAndParentShareInfo, SORT_NATURAL); in php>=5.5
uksort($scopeNamesAndParentShareInfo, 'strcasecmp');

return $ScopeNamesAndParentShareInfo;
return $scopeNamesAndParentShareInfo;
}

/**
Expand Down Expand Up @@ -1359,11 +1359,11 @@ public function getMapXMLString(){
$xmlSite->addAttribute('Longitude', $site->getLongitude());
}

$dom_sxe = dom_import_simplexml($xml);
$domXmlMapElement = dom_import_simplexml($xml);
$dom = new \DOMDocument('1.0');
$dom->encoding='UTF-8';
$dom_sxe = $dom->importNode($dom_sxe, true);
$dom_sxe = $dom->appendChild($dom_sxe);
$domXmlMapElement = $dom->importNode($domXmlMapElement, true);
$domXmlMapElement = $dom->appendChild($domXmlMapElement);
$dom->formatOutput = true;
$xmlString = $dom->saveXML();

Expand Down

0 comments on commit a3fa60d

Please sign in to comment.