Fixes
Some checks failed
Gitea Actions / Run-Tests-On-Arm64 (push) Failing after 16s
Gitea Actions / Run-Tests-On-Amd64 (push) Failing after 13m13s

This commit is contained in:
Thomas 2025-03-28 12:49:20 +01:00
parent e3186701d7
commit 532248c01b
10 changed files with 91 additions and 106 deletions

View File

@ -39,7 +39,7 @@ server {
add_header Access-Control-Expose-Headers Access-Control-Allow-Origin always; add_header Access-Control-Expose-Headers Access-Control-Allow-Origin always;
add_header Referrer-Policy "strict-origin" always; add_header Referrer-Policy "strict-origin" always;
add_header X-Content-Type-Options nosniff always; add_header X-Content-Type-Options nosniff always;
add_header X-Frame-Options "SAMEORIGIN" always; #add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "1; mode=block" always; add_header X-XSS-Protection "1; mode=block" always;
add_header Content-Security-Policy "default-src https: 'unsafe-eval' 'unsafe-inline'; object-src 'none'; worker-src blob:; img-src https: blob: data:" always; add_header Content-Security-Policy "default-src https: 'unsafe-eval' 'unsafe-inline'; object-src 'none'; worker-src blob:; img-src https: blob: data:" always;
fastcgi_temp_path /tmp/fastcgi 1 2; fastcgi_temp_path /tmp/fastcgi 1 2;

View File

@ -1,2 +1,3 @@
; overriding defaults ; overriding defaults
ession.cookie_secure=On session.cookie_secure=On
session.cookie_samesite=Lax

View File

@ -7,4 +7,6 @@ class MediaItem
public string $name; public string $name;
public string $description; public string $description;
public string $media;
} }

View File

@ -119,7 +119,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
if (isset($_POST['ARTID'])) { if (isset($_POST['ARTID'])) {
Zend_Registry::get('log')->debug($_POST['ARTID']); Zend_Registry::get('log')->debug($_POST['ARTID']);
try { try {
Zend_Session::setId($_POST['ARTID']); //Zend_Session::setId($_POST['ARTID']);
} catch (Exception $e) { } catch (Exception $e) {
Zend_Registry::get('log')->debug($e->getMessage()); Zend_Registry::get('log')->debug($e->getMessage());
} }

View File

@ -24,34 +24,31 @@ $filesOptions =$this->article['basketarticle']->getFiles();
<?php else: ?> <?php else: ?>
<strong><?php echo $this->layouter()->getTitle($this->article['basketarticle']->getLayouterId()); ?></strong><br /> <strong><?php echo $this->layouter()->getTitle($this->article['basketarticle']->getLayouterId()); ?></strong><br />
<?php endif; ?> <?php endif; ?>
<?php if(($this->article['options'])): ?> <?php if(($this->article['options'])): ?>
<ul> <ul id="options_<?= $basketArticle['uuid'] ?>">
<?php foreach ($this->article['options'] as $key => $option): ?> <li>Lade Optionen</li>
<?php
if(stripos($option, 'Auflage') === 0) {
$count = str_replace('Auflage: ', '', $option);
}else{
?>
<li><?php echo $option ?></li>
<?php } ?>
<?php endforeach; ?>
</ul> </ul>
<script>
$(function () {
loadDetails($("#options_<?= $basketArticle['uuid'] ?>"), '<?= json_encode(['test' => false, 'product' => $basketArticle['uuid'], 'values' => $this->article['basketarticle']->getOptions()]) ?>');
})
</script>
<ul> <ul>
<?php foreach ($filesOptions as $key => $option): ?> <?php foreach ($filesOptions as $key => $option): ?>
<li><b><a href="/uploads/<?php echo $this->shop->uid ?>/article/<?php echo $option['value'] ?>" target="_blank"><?php echo $option['name'] ?></a></b></li> <li><b><a href="/uploads/<?php echo $this->shop->uid ?>/article/<?php echo $option['value'] ?>" target="_blank"><?php echo $option['name'] ?></a></b></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
<?php if($this->shop->basketposfield1 != ""): ?><?php echo $this->shop->basketposfield1 ?> <?php if($this->shop->basketposfield1 != "" && !$this->finish): ?><?php echo $this->shop->basketposfield1 ?>
<form enctype="multipart/form-data" method="post"> <form enctype="multipart/form-data" method="post">
<div><input type="text" class="span3" style="margin-bottom: 0;" name="ref_<?php echo $this->article['uuid'] ?>" value="<?php echo $this->article['basketarticle']->getRef(); ?>"/> <div><input type="text" class="span3" style="margin-bottom: 0;" name="ref_<?php echo $this->article['uuid'] ?>" value="<?php echo $this->article['basketarticle']->getRef(); ?>"/>
<input type="submit" class="btn vouchersubmit" style="" value="<?php echo $this->translate('übernehmen')?>"/></div> <input type="submit" class="btn vouchersubmit" style="" value="<?php echo $this->translate('übernehmen')?>"/></div>
</form> </form>
<?php endif; ?> <?php endif; ?>
<?php if($this->shop->basketposfield2 != ""): ?><?php echo $this->shop->basketposfield2 ?> <?php if($this->shop->basketposfield2 != "" && !$this->finish): ?><?php echo $this->shop->basketposfield2 ?>
<form enctype="multipart/form-data" method="post"> <form enctype="multipart/form-data" method="post">
<div><input type="text" class="span3" style="margin-bottom: 0;" name="kst_<?php echo $this->article['uuid'] ?>" value="<?php echo $this->article['basketarticle']->getKst(); ?>"/> <div><input type="text" class="span3" style="margin-bottom: 0;" name="kst_<?php echo $this->article['uuid'] ?>" value="<?php echo $this->article['basketarticle']->getKst(); ?>"/>
<input type="submit" class="btn vouchersubmit" style="" value="<?php echo $this->translate('übernehmen')?>"/></div> <input type="submit" class="btn vouchersubmit" style="" value="<?php echo $this->translate('übernehmen')?>"/></div>

View File

@ -1,3 +1,7 @@
<?php
$this->headScript()->prependFile('/scripts/underscore.js');
$this->headScript()->prependFile('/' . $this->designPath . '/basket/index.js');
?>
<style> <style>
ul.breadcrumb { ul.breadcrumb {
display: none; display: none;
@ -122,56 +126,9 @@
<div class="clearfix"></div> <div class="clearfix"></div>
<?php foreach ($this->basket_articles_complete as $barticle) : ?> <?php foreach ($this->basket_articles_complete as $article) : ?>
<div class="col-lg-12 <?php echo $this->cycle(array("even", "odd"))->next() ?>"> <div class="col-lg-12 <?php echo $this->cycle(array("odd", "even"))->next() ?>">
<div class="col-sm-4"> <?php echo $this->partial($article['article']->typ . '_basket_index.phtml', array('article' => $article, 'currency' => $this->currency, 'shop' => $this->shop, 'finish' => true)) ?>
<?php if (($barticle['article']['a6_org_article'] == 0 || $barticle['article']['a6_org_article'] == "") && ($barticle['basketarticle']->getLayouterId() == "" || $barticle['basketarticle']->getLayouterId() == false)) : ?>
<?php echo $this->image()->thumbnailImage($barticle['article']['title'], 'articlelist', $barticle['article']['file']); ?>
<?php else : ?>
<?php $articleObj = new market_article(); ?>
<?= $articleObj->generatePreview($barticle['article']['id'], $barticle['basketarticle']->getLayouterId(), 'articlelist'); ?>
<?php endif; ?>
</div>
<div class="col-sm-4"><strong>Anzahl: <?php echo $barticle['basketarticle']->getAuflage() ?></strong><br /><br />
<?php if (($barticle['basketarticle']->getLayouterId() == "" || $barticle['basketarticle']->getLayouterId() == false)) : ?>
<?php echo $barticle['article']['title'] ?>
<?php else : ?>
<?php echo $this->layouter()->getTitle($barticle['basketarticle']->getLayouterId()); ?>
<?php endif; ?>
<?php if (($barticle['options'])) : ?>
<ul>
<?php foreach ($barticle['options'] as $key => $option) : ?>
<?php
if (stripos($option, 'Auflage') === 0) {
$count = str_replace('Auflage: ', '', $option);
} else {
?>
<li><?php echo $option ?>, </li>
<?php } ?>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</div>
<div class="col-sm-4">
<?php if(!$this->designsettings()->get('display_no_price')) { ?><label class="mobilelabel">Preis: <small><?php if ($this->withTax) : ?>
<label style="font-weight:100;"><?php echo $this->currency->toCurrency($barticle['basketarticle']->getNetto() * $barticle['basketarticle']->getCount()) ?></label><label style="font-size:14px; font-weight:100;width: 45px;"><?php echo $this->translate('(Netto)')?></label><br /><?php echo $this->currency->toCurrency($barticle['basketarticle']->getBrutto() * $barticle['basketarticle']->getCount()) ?> <label style="font-size:14px; font-weight:100;"><?php echo $this->translate('(Brutto inkl. '.$barticle['article']['mwert'].'% MwSt.)') ?></label>
<?php else : ?>
<label class="nomobilehead" style="display: block;width: 100%;text-align: right;font-weight:100;"><?php echo $this->currency->toCurrency($barticle['basketarticle']->getNetto() * $barticle['basketarticle']->getCount()) ?><label style="font-size:14px; font-weight:100;width: 45px;"><?php echo $this->translate('(Netto)')?></label><br /><?php echo $this->currency->toCurrency($barticle['basketarticle']->getBrutto() * $barticle['basketarticle']->getCount()) ?> <label style="font-size:14px; font-weight:100;"><?php echo $this->translate('(Brutto inkl. '.$barticle['article']['mwert'].'% MwSt.)') ?></label>
<?php endif; ?></small></label>
<label class="nomobilehead" style="display: block;width: 100%;text-align: right;"><?php if ($this->withTax) : ?>
<label style="font-weight:100;"><?php echo $this->currency->toCurrency($barticle['basketarticle']->getNetto() * $barticle['basketarticle']->getCount()) ?></label><label style="font-size:14px; font-weight:100;width: 45px;"><?php echo $this->translate('(Netto)')?></label><br /><?php echo $this->currency->toCurrency($barticle['basketarticle']->getBrutto() * $barticle['basketarticle']->getCount()) ?> <label style="font-size:14px; font-weight:100;"><?php echo $this->translate('(Brutto inkl. '.$barticle['article']['mwert'].'% MwSt.)') ?></label>
<?php else : ?>
<label class="nomobilehead" style="display: block;width: 100%;text-align: right;font-weight:100;"><?php echo $this->currency->toCurrency($barticle['basketarticle']->getNetto() * $barticle['basketarticle']->getCount()) ?><label style="font-size:14px; font-weight:100;width: 45px;"><?php echo $this->translate('(Netto)')?></label><br /><?php echo $this->currency->toCurrency($barticle['basketarticle']->getBrutto() * $barticle['basketarticle']->getCount()) ?> <label style="font-size:14px; font-weight:100;"><?php echo $this->translate('(Brutto inkl. '.$barticle['article']['mwert'].'% MwSt.)') ?></label>
<?php endif; ?></label><?php } ?>
</div>
<div class="clearfix"></div>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>

View File

@ -1,4 +1,8 @@
<style> <?php
$this->headScript()->prependFile('/scripts/underscore.js');
$this->headScript()->prependFile('/' . $this->designPath . '/basket/index.js');
?>
<style>
ul.breadcrumb { ul.breadcrumb {
display: none; display: none;
} }
@ -45,7 +49,7 @@
<div class="basketborder"> <div class="basketborder">
<?php foreach ($this->articles as $article) : ?> <?php foreach ($this->articles as $article) : ?>
<div class="col-lg-12 <?php echo $this->cycle(array("odd", "even"))->next() ?>"> <div class="col-lg-12 <?php echo $this->cycle(array("odd", "even"))->next() ?>">
<?php echo $this->partial($article['article']->typ . '_basket_index.phtml', array('article' => $article, 'currency' => $this->currency, 'shop' => $this->shop)) ?> <?php echo $this->partial($article['article']->typ . '_basket_index.phtml', array('article' => $article, 'currency' => $this->currency, 'shop' => $this->shop, 'finish' => false)) ?>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
@ -264,7 +268,7 @@
</div> </div>
</div> </div>
<div class="control-group clearfix"> <div class="control-group clearfix">
<?php if((isset($_POST["gutscheincode"]) AND $_POST["gutscheincode"] != "") AND $this->gutscheincode == "") { ?> <?php if((isset($_POST["gutscheincode"]) and $_POST["gutscheincode"] != "") and $this->gutscheincode == "") { ?>
<strong class="danger">Gutscheincode ungültig</strong> <strong class="danger">Gutscheincode ungültig</strong>
<?php } ?> <?php } ?>
<div class="controls pull-right"> <div class="controls pull-right">

View File

@ -3696,13 +3696,14 @@ class UserController extends TP_Controller_Action
public function xmlloginAction() { public function xmlloginAction() {
if ($this->_request->getParam('contact', false)) { if ($this->_request->getParam('contact', false)) {
if('nsWXSoLmx8TNEjdE8fbn' != $this->_request->getParam('apikey')) { $vars = explode("-", $this->_request->getParam('contact',false));
if('nsWXSoLmx8TNEjdE8fbn' != $vars[1]) {
die("Not allowed"); die("Not allowed");
} }
$_authAdapter = new TP_Plugin_AuthAdapter (); // put this in a constructor? $_authAdapter = new TP_Plugin_AuthAdapter (); // put this in a constructor?
$_authAdapter->setApiLogin(true); $_authAdapter->setApiLogin(true);
$_authAdapter->setIdentity($this->_getParam('contact', false)); $_authAdapter->setIdentity($vars[0]);
$result = Zend_Auth::getInstance()->authenticate($_authAdapter); $result = Zend_Auth::getInstance()->authenticate($_authAdapter);
if ($result->isValid()) { if ($result->isValid()) {
@ -3716,23 +3717,26 @@ class UserController extends TP_Controller_Action
if ($this->_request->isPost()) { if ($this->_request->isPost()) {
$formData = $this->_request->getPost(); $formData = $this->_request->getPost();
$xml = simplexml_load_string(file_get_contents("php://input")); $xml = simplexml_load_string(file_get_contents("php://input"));
$basepath = 'http://' . $_SERVER["SERVER_NAME"]; $basepath = 'https://' . $_SERVER["SERVER_NAME"];
if ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on')) { if ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on')) {
$basepath = 'https://' . $_SERVER["SERVER_NAME"]; $basepath = 'https://' . $_SERVER["SERVER_NAME"];
} }
$contact = Doctrine_Query::create()->from('Contact as c')->where('c.self_email = ? AND c.enable = 1 AND c.install_id = ?', array((string)$xml->Request->PunchOutSetupRequest->Extrinsic[1], $this->install->id))->fetchOne(); $contact = Doctrine_Query::create()->from('Contact as c')->where('c.self_email = ? AND c.enable = 1', array((string)$xml->Request->PunchOutSetupRequest->Extrinsic[1]))->fetchOne();
$payloadId = $xml['payloadID'];
$timestamp = $xml['timestamp'];
if($contact) { if($contact) {
echo '<?xml version="1.0"?>' . echo '<?xml version="1.0"?>' .
'<!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/1.1.007/cXML.dtd">' . '<!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/1.2.014/cXML.dtd">' .
'<cXML xml:lang="en" payloadID="7213656@Supplier.com" timestamp="2002-01-01T08:46:00-07:00">' . '<cXML xml:lang="de" payloadID="'.$payloadId.'" timestamp="'.$timestamp.'">' .
'<Response>' . '<Response>' .
'<Status code="200" text="success"/>' . '<Status code="200" text="success"/>' .
'<PunchOutSetupResponse>' . '<PunchOutSetupResponse>' .
'<StartPage>' . '<StartPage>' .
'<URL>'.$basepath.'/user/xmllogin?contact='.$contact->id.'&apikey=nsWXSoLmx8TNEjdE8fbn</URL>' . '<URL>'.$basepath.'/user/xmllogin?contact='.$contact->id.'-nsWXSoLmx8TNEjdE8fbn</URL>' .
'</StartPage>' . '</StartPage>' .
'</PunchOutSetupResponse>' . '</PunchOutSetupResponse>' .
'</Response>' . '</Response>' .

View File

@ -225,11 +225,9 @@ class Zend_Session extends Zend_Session_Abstract
if (!self::$_sessionStarted) { if (!self::$_sessionStarted) {
ini_set("session.$userOptionName", $userOptionValue); ini_set("session.$userOptionName", $userOptionValue);
} }
} } elseif (isset(self::$_localOptions[$userOptionName])) {
elseif (isset(self::$_localOptions[$userOptionName])) {
self::${self::$_localOptions[$userOptionName]} = $userOptionValue; self::${self::$_localOptions[$userOptionName]} = $userOptionValue;
} } else {
else {
/** @see Zend_Session_Exception */ /** @see Zend_Session_Exception */
require_once 'Zend/Session/Exception.php'; require_once 'Zend/Session/Exception.php';
throw new Zend_Session_Exception("Unknown option: $userOptionName = $userOptionValue"); throw new Zend_Session_Exception("Unknown option: $userOptionName = $userOptionValue");
@ -547,9 +545,12 @@ class Zend_Session extends Zend_Session_Abstract
} }
$pattern = ''; $pattern = '';
switch ($hashBitsPerChar) { switch ($hashBitsPerChar) {
case 4: $pattern = '^[0-9a-f]*$'; break; case 4: $pattern = '^[0-9a-f]*$';
case 5: $pattern = '^[0-9a-v]*$'; break; break;
case 6: $pattern = '^[0-9a-zA-Z-,]*$'; break; case 5: $pattern = '^[0-9a-v]*$';
break;
case 6: $pattern = '^[0-9a-zA-Z-,]*$';
break;
} }
return preg_match('#'.$pattern.'#', $id); return preg_match('#'.$pattern.'#', $id);
} }
@ -823,7 +824,7 @@ class Zend_Session extends Zend_Session_Abstract
require_once 'Zend/Loader.php'; require_once 'Zend/Loader.php';
Zend_Loader::loadClass($validator_name); Zend_Loader::loadClass($validator_name);
} }
$validator = new $validator_name; $validator = new $validator_name();
if ($validator->validate() === false) { if ($validator->validate() === false) {
/** @see Zend_Session_Validator_Exception */ /** @see Zend_Session_Validator_Exception */
require_once 'Zend/Session/Validator/Exception.php'; require_once 'Zend/Session/Validator/Exception.php';

View File

@ -0,0 +1,19 @@
function loadDetails(optionsList, data) {
$.ajax({
url: "/apps/api/plugin/system/psc/xmlcalc/price",
contentType: "application/json",
dataType: 'json',
method: 'post',
data: data,
success: function(result){
optionsList.html('');
$(result.elements).each(function(i, elm) {
if(elm.valid && elm.htmlType != 'hidden' && elm.htmlType != 'text') {
optionsList.append('<li>' + elm.name + ": " + elm.value + '</li>');
}
})
}
});
}