Skip to content

Commit

Permalink
Merge branch 'dev' into dev-11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
demiankatz committed Sep 18, 2024
2 parents 00f4a45 + 338115e commit e185493
Show file tree
Hide file tree
Showing 45 changed files with 516 additions and 167 deletions.
20 changes: 19 additions & 1 deletion config/vufind/webcrawl.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,22 @@ url[] = http://library.myuniversity.edu/sitemap.xml

[General]
; Uncomment the setting below to get more detailed output from the crawler:
;verbose = true
;verbose = true

[Cache]
; When set, the result of transforming sitemaps into Solr documents will
; be written to the specified directory in addition to being sent to Solr.
;transform_cache_dir = "/path/to/directory"

; When set to true, the transform cache will be "write-only" -- crawling
; will always fully re-fetch all data, and the cache will only be populated
; for reference/backup purposes.
; When set to false (the default), the crawler will attempt to reuse existing
; transformed data from the cache as long as the cache update date is newer
; than any last modification specified in the sitemap lastmod date. If the
; sitemap does not specify a modification date, the data will always be
; considered to be expired. The crawler can be permitted to read expired data
; from the cache with the --use-expired-cache flag, which can be useful if you
; need to very quickly rebuild your index (e.g. after a Solr upgrade) and do
; not mind if some of the data is out of date.
;transform_cache_write_only = true
2 changes: 1 addition & 1 deletion import/translation_maps/callnumber_subject_map.properties
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ DR = DR - Balkan Peninsula
DS = DS - Asia
DT = DT - Africa
DU = DU - Oceania (South Seas)
DX = DX - Gypsies
DX = DX - Romanies
E = E - United States History
F = F - General American History
G = G - General Geography
Expand Down
2 changes: 1 addition & 1 deletion module/VuFind/src/VuFind/Auth/Shibboleth.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public function authenticate($request)
foreach ($this->attribsToCheck as $attribute) {
if (isset($shib[$attribute])) {
$value = $this->getAttribute($request, $shib[$attribute]);
if ($attribute == 'email') {
if ($attribute == 'email' && !empty($value)) {
$userService->updateUserEmail($user, $value);
} elseif (
$attribute == 'cat_username' && isset($shib['prefix'])
Expand Down
3 changes: 2 additions & 1 deletion module/VuFind/src/VuFind/Controller/AbstractRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,8 @@ public function saveAction()
// by unsetting the followup and relying on default behavior in processSave.
$referer = $this->getRequest()->getServer()->get('HTTP_REFERER');
if (
!str_ends_with($referer, '/Save')
!empty($referer)
&& !str_ends_with($referer, '/Save')
&& stripos($referer, 'MyResearch/EditList/NEW') === false
&& $this->isLocalUrl($referer)
) {
Expand Down
2 changes: 1 addition & 1 deletion module/VuFind/src/VuFind/Controller/CartController.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public function searchresultsbulkAction()
// have an external site in the referer, we should ignore that!
$referer = $this->getRequest()->getServer()->get('HTTP_REFERER');
$bulk = $this->url()->fromRoute('cart-searchresultsbulk');
if ($this->isLocalUrl($referer) && !str_ends_with($referer, $bulk)) {
if (!empty($referer) && $this->isLocalUrl($referer) && !str_ends_with($referer, $bulk)) {
$this->session->url = $referer;
}

Expand Down
25 changes: 21 additions & 4 deletions module/VuFind/src/VuFind/Controller/InstallController.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ protected function installBasicConfig()
{
$config = $this->getForcedLocalConfigPath('config.ini');
if (!file_exists($config)) {
return copy($this->getBaseConfigFilePath('config.ini'), $config);
// Suppress errors so we don't cause a fatal error if copy is disallowed.
return @copy($this->getBaseConfigFilePath('config.ini'), $config);
}
return true; // report success if file already exists
}
Expand Down Expand Up @@ -184,6 +185,9 @@ public function fixbasicconfigAction()
throw new \Exception('Cannot copy file into position.');
}
$writer = new ConfigWriter($config);
// Choose secure defaults when creating initial config.ini:
$this->fixSecurityConfiguration($config, $writer);
// Set appropriate URLs:
$serverUrl = $this->getViewRenderer()->plugin('serverurl');
$path = $this->url()->fromRoute('home');
$writer->set('Site', 'url', rtrim($serverUrl($path), '/'));
Expand Down Expand Up @@ -720,9 +724,14 @@ public function fixsolrAction()
*/
protected function checkSecurity()
{
try {
$secureDb = $this->hasSecureDatabase();
} catch (\Throwable $e) {
$secureDb = false;
}
return [
'title' => 'Security',
'status' => $this->hasSecureDatabase(),
'status' => $secureDb,
'fix' => 'fixsecurity',
];
}
Expand Down Expand Up @@ -775,8 +784,16 @@ public function fixsecurityAction()
}

// If we don't need to prompt the user, or if they confirmed, do the fix:
$userRows = $this->getDbService(UserServiceInterface::class)->getInsecureRows();
$cardRows = $this->getDbService(UserCardServiceInterface::class)->getInsecureRows();
try {
$userRows = $this->getDbService(UserServiceInterface::class)->getInsecureRows();
$cardRows = $this->getDbService(UserCardServiceInterface::class)->getInsecureRows();
} catch (\Throwable $e) {
$this->flashMessenger()->addMessage(
'Cannot connect to database; please configure database before fixing security.',
'error'
);
return $this->redirect()->toRoute('install-home');
}
if (count($userRows) + count($cardRows) == 0 || $userConfirmation == 'Yes') {
return $this->forwardTo('Install', 'performsecurityfix');
}
Expand Down
Loading

0 comments on commit e185493

Please sign in to comment.