Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…overy into 24.08.00
  • Loading branch information
Abhyastamita committed Jul 22, 2024
2 parents 843c5cb + c3782c9 commit 179f770
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 41 deletions.
34 changes: 34 additions & 0 deletions code/web/cron/createKeyFile.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php
require_once __DIR__ . '/../bootstrap.php';

global $serverName;

$passkeyFile = ROOT_DIR . "/../../sites/$serverName/conf/passkey";
if (!file_exists($passkeyFile)) {
// Return the file path (note that all ini files are in the conf/ directory)
$methods = [
'aes-256-gcm',
'aes-128-gcm',
];
foreach ($methods as $cipher) {
if (in_array($cipher, openssl_get_cipher_methods())) {
//Generate a 32 character password which will encode to 64 characters in hex notation
$key = bin2hex(openssl_random_pseudo_bytes(32));
break;
}
}
$passkeyFhnd = fopen($passkeyFile, 'w');
fwrite($passkeyFhnd, $cipher . ':' . $key);
fclose($passkeyFhnd);

//Make sure the file is not readable by anyone except the aspen user
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$runningOnWindows = true;
} else {
$runningOnWindows = false;
}
if (!$runningOnWindows) {
exec('chown aspen:aspen_apache ' . $passkeyFile);
exec('chmod 440 ' . $passkeyFile);
}
}
4 changes: 2 additions & 2 deletions code/web/interface/themes/responsive/EBSCO/list.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
<div class="result-head">
{* User's viewing mode toggle switch *}
{if !empty($showSearchToolsAtTop)}
{include file="Search/search-toolbar.tpl"}
{include file="Search/search-toolbar-no-display-mode.tpl"}
{else}
{include file="Search/results-displayMode-toggle.tpl"}
{include file="Search/results-no-displayMode-toggle.tpl"}
{/if}

<div class="clearer"></div>
Expand Down
4 changes: 2 additions & 2 deletions code/web/interface/themes/responsive/EBSCOhost/list.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
<div class="result-head">
{* User's viewing mode toggle switch *}
{if !empty($showSearchToolsAtTop)}
{include file="Search/search-toolbar.tpl"}
{include file="Search/search-toolbar-no-display-mode.tpl"}
{else}
{include file="Search/results-displayMode-toggle.tpl"}
{include file="Search/results-no-displayMode-toggle.tpl"}
{/if}

<div class="clearer"></div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{strip}
{* User's viewing mode toggle switch *}
<div class="row">{* browse styling replicated here *}
<div class="col-xs-6">
{if !empty($recordCount)}
{* <span class="sidebar-label">
<label for="results-sort">{translate text='Sort'}</label></span> *}
<label for="results-sort">{translate text='Sort by' isPublicFacing=true}</label>
<select id="results-sort" name="sort" onchange="document.location.href = this.options[this.selectedIndex].value;" class="input-medium">
{foreach from=$sortList item=sortData key=sortLabel}
<option value="{$sortData.sortUrl|escape}"{if !empty($sortData.selected)} selected="selected"{/if}>{translate text=$sortData.desc isPublicFacing=true inAttribute=true}</option>
{/foreach}
</select>
{/if}
</div>
<div class="col-xs-6">
<div id="selected-browse-label">
<div class="btn-group" id="hideSearchCoversSwitch">
<label for="hideCovers" class="checkbox{* control-label*}"> {translate text='Hide Covers' isPublicFacing=true}
<input id="hideCovers" type="checkbox" onclick="AspenDiscovery.Account.toggleShowCovers(!$(this).is(':checked'))" {if $showCovers == false}checked="checked"{/if}>
</label>
</div>
</div>
</div>
</div>
{/strip}
11 changes: 11 additions & 0 deletions code/web/release_notes/24.08.00.MD
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
### Account Updates
- Show account renewal links on the Library Card page when applicable. (Ticket 134192) (*MDN*)

### EBSCO/EBSCOhost Updates
- Remove unimplemented option to change search results from List to Covers mode. (*MDN*)

### Indexing Updates
- Update check for Blu-ray / 4K combo packs to look for either the word "and" or a plus symbol. (Ticket 135253) (*MDN*)
- If a record is identified as both Manga and Graphic Novel, prefer Manga. (*MDN*)
Expand All @@ -21,6 +24,7 @@

### Other Updates
- Remove setting permissions for old (deleted) solr directories during install. (*MDN*)
- Correct updating internal numeric representation of IP address ranges when editing an IP Address. (*MDN*)

// kirstien

Expand All @@ -37,10 +41,17 @@
- Fix bug where call number searches were not returning expected results. (Ticket 135530) (*KP*)

// alexander
### Summon Updates
- Adjust code to ensure that the filter applies correctly no matter what page of results users are on when they apply it. (*AB*)

// jacob

// pedro
- Updated the way the passkey file is generated. (*PA*)

To generate the passkey file, the following command should be run (as root):

`php /usr/local/aspen-discovery/code/web/cron/createKeyFile.php <serverName>`

// lucas

Expand Down
34 changes: 0 additions & 34 deletions code/web/services/API/SystemAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -571,40 +571,6 @@ public function checkWhichUpdatesHaveRun($availableUpdates) {
return $availableUpdates;
}

/** @noinspection PhpUnused */
function createKeyFile() {
global $serverName;
$passkeyFile = ROOT_DIR . "/../../sites/$serverName/conf/passkey";
if (!file_exists($passkeyFile)) {
// Return the file path (note that all ini files are in the conf/ directory)
$methods = [
'aes-256-gcm',
'aes-128-gcm',
];
foreach ($methods as $cipher) {
if (in_array($cipher, openssl_get_cipher_methods())) {
//Generate a 32 character password which will encode to 64 characters in hex notation
$key = bin2hex(openssl_random_pseudo_bytes(32));
break;
}
}
$passkeyFhnd = fopen($passkeyFile, 'w');
fwrite($passkeyFhnd, $cipher . ':' . $key);
fclose($passkeyFhnd);

//Make sure the file is not readable by anyone except the aspen user
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$runningOnWindows = true;
} else {
$runningOnWindows = false;
}
if (!$runningOnWindows) {
exec('chown aspen:aspen_apache ' . $passkeyFile);
exec('chmod 440 ' . $passkeyFile);
}
}
}

function doesKeyFileExist() {
global $serverName;
$passkeyFile = ROOT_DIR . "/../../sites/$serverName/conf/passkey";
Expand Down
5 changes: 3 additions & 2 deletions code/web/sys/IP/IPAddress.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,9 @@ function calcIpRange(): bool {
}
}
//echo("\r\n<br/>$ipAddress: " . sprintf('%u', $startIp) . " - " . sprintf('%u', $endIp));
$this->startIpVal = $startIp;
$this->endIpVal = $endIp;
$objectStructure = IPAddress::getObjectStructure();
$this->setProperty('startIpVal', $startIp, $objectStructure);
$this->setProperty('endIpVal', $endIp, $objectStructure);
if ($startIp == false || $endIp == false) {
return false;
} else {
Expand Down
2 changes: 1 addition & 1 deletion code/web/sys/SearchObject/SummonSearcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ public function getFacetSet() {
if ($isApplied) {
$facetSettings['removalUrl'] = $this->renderLinkWithoutFilter($facetId . ':' . $facetValue);
} else {
$facetSettings['url'] = $this->renderSearchUrl() . '&filter[]=' . $facetId . ':' . urlencode($facetValue);
$facetSettings['url'] = $this->renderSearchUrl() . '&filter[]=' . $facetId . ':' . urlencode($facetValue) . '&page=1';
}
$list[] = $facetSettings;
}
Expand Down

0 comments on commit 179f770

Please sign in to comment.