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

@ -1,7 +1,7 @@
<?php <?php
$basketArticle = $this->article['article']; $basketArticle = $this->article['article'];
$articleObj = new market_article(); $articleObj = new market_article();
$filesOptions =$this->article['basketarticle']->getFiles(); $filesOptions = $this->article['basketarticle']->getFiles();
?> ?>
<div class="col-sm-4"> <div class="col-sm-4">
<?php if(($basketArticle['a6_org_article'] == 0 || $basketArticle['a6_org_article'] == "") && ($this->article['basketarticle']->getLayouterId() == "" || $this->article['basketarticle']->getLayouterId() == false)): ?> <?php if(($basketArticle['a6_org_article'] == 0 || $basketArticle['a6_org_article'] == "") && ($this->article['basketarticle']->getLayouterId() == "" || $this->article['basketarticle']->getLayouterId() == false)): ?>
@ -10,7 +10,7 @@ $filesOptions =$this->article['basketarticle']->getFiles();
<?php echo $this->image()->thumbnailImage($basketArticle['title'], 'articlelist', $basketArticle['file']); ?> <?php echo $this->image()->thumbnailImage($basketArticle['title'], 'articlelist', $basketArticle['file']); ?>
<?php else: ?> <?php else: ?>
<?= $articleObj->generatePreview($basketArticle['id'],$this->article['basketarticle']->getLayouterId()); ?> <?= $articleObj->generatePreview($basketArticle['id'], $this->article['basketarticle']->getLayouterId()); ?>
<?php endif; ?> <?php endif; ?>
</div> </div>
<div class="col-sm-4"><span class="mobilelabel"><strong>Anzahl:</strong> </span> <div class="col-sm-4"><span class="mobilelabel"><strong>Anzahl:</strong> </span>
@ -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>
@ -60,7 +57,7 @@ $filesOptions =$this->article['basketarticle']->getFiles();
Gewicht: <?php echo $this->article['basketarticle']->getWeight() ?> Gewicht: <?php echo $this->article['basketarticle']->getWeight() ?>
</div> </div>
<div class="col-sm-4" style="text-align: right;"> <div class="col-sm-4" style="text-align: right;">
<?php if(!$this->designsettings()->get('display_no_price')) { ?><?php echo $this->currency->toCurrency($this->article['basketarticle']->getNetto()*$this->article['basketarticle']->getCount()) ?> <label style="font-size:14px; font-weight:100;width: 45px;">(Netto)</label><br /><strong><?php echo $this->currency->toCurrency($this->article['basketarticle']->getBrutto()*$this->article['basketarticle']->getCount()) ?></strong> <label style="font-size:14px; font-weight:100;"><?php echo $this->translate('(Brutto inkl. '.$basketArticle["mwert"].'% MwSt.)')?></label></label><?php } ?> <?php if(!$this->designsettings()->get('display_no_price')) { ?><?php echo $this->currency->toCurrency($this->article['basketarticle']->getNetto() * $this->article['basketarticle']->getCount()) ?> <label style="font-size:14px; font-weight:100;width: 45px;">(Netto)</label><br /><strong><?php echo $this->currency->toCurrency($this->article['basketarticle']->getBrutto() * $this->article['basketarticle']->getCount()) ?></strong> <label style="font-size:14px; font-weight:100;"><?php echo $this->translate('(Brutto inkl. '.$basketArticle["mwert"].'% MwSt.)')?></label></label><?php } ?>
<br/><a href="<?php echo $this->url(array('del' => $this->article['uuid']), 'basketdel') ?>"><?php echo $this->translate('Löschen'); ?></a> <br/><a href="<?php echo $this->url(array('del' => $this->article['uuid']), 'basketdel') ?>"><?php echo $this->translate('Löschen'); ?></a>
<?php if($this->article['basketarticle']->getLayouterId() != "" && !$this->article()->checkIfCollectionOrdersForTemplatePrint($this->article['basketarticle']->getLayouterId())): ?><br/><a href="<?php echo $this->url(array('key' => $this->article['uuid']), 'articleload') ?>"><?php echo $this->translate('Bearbeiten') ?></a><?php endif; ?> <?php if($this->article['basketarticle']->getLayouterId() != "" && !$this->article()->checkIfCollectionOrdersForTemplatePrint($this->article['basketarticle']->getLayouterId())): ?><br/><a href="<?php echo $this->url(array('key' => $this->article['uuid']), 'articleload') ?>"><?php echo $this->translate('Bearbeiten') ?></a><?php endif; ?>

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,57 +126,10 @@
<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>
<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>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
@ -182,7 +139,7 @@
/************************************************************************************************************************************************************************ /************************************************************************************************************************************************************************
* Zusammenfassung der Bestellung * Zusammenfassung der Bestellung
*/ */
?> ?>
<div class="col-xs-12 col-lg-9 pull-right"> <div class="col-xs-12 col-lg-9 pull-right">

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>
@ -54,7 +58,7 @@
/************************************************************************************************************************************************************************ /************************************************************************************************************************************************************************
* Zusammenfassung der Bestellung * Zusammenfassung der Bestellung
*/ */
?> ?>
<br> <br>
<br> <br>
<div class="row"> <div class="row">
@ -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

@ -222,14 +222,12 @@ class Zend_Session extends Zend_Session_Abstract
// set the ini based values // set the ini based values
if (array_key_exists($userOptionName, self::$_defaultOptions)) { if (array_key_exists($userOptionName, self::$_defaultOptions)) {
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");
@ -285,7 +283,7 @@ class Zend_Session extends Zend_Session_Abstract
[&$saveHandler, 'write'], [&$saveHandler, 'write'],
[&$saveHandler, 'destroy'], [&$saveHandler, 'destroy'],
[&$saveHandler, 'gc'] [&$saveHandler, 'gc']
); );
register_shutdown_function('session_write_close'); register_shutdown_function('session_write_close');
if (!$result) { if (!$result) {
@ -322,7 +320,7 @@ class Zend_Session extends Zend_Session_Abstract
"() before any output has been sent to the browser; output started in {$filename}/{$linenum}"); "() before any output has been sent to the browser; output started in {$filename}/{$linenum}");
} }
if ( !self::$_sessionStarted ) { if (!self::$_sessionStarted) {
self::$_regenerateIdState = -1; self::$_regenerateIdState = -1;
} else { } else {
if (!self::$_unitTestEnabled) { if (!self::$_unitTestEnabled) {
@ -379,11 +377,11 @@ class Zend_Session extends Zend_Session_Abstract
if (!self::$_sessionStarted) { // session_set_cookie_params(): Cannot change session cookie parameters when session is active if (!self::$_sessionStarted) { // session_set_cookie_params(): Cannot change session cookie parameters when session is active
$cookieParams = session_get_cookie_params(); $cookieParams = session_get_cookie_params();
session_set_cookie_params( session_set_cookie_params(
$seconds, $seconds,
$cookieParams['path'], $cookieParams['path'],
$cookieParams['domain'], $cookieParams['domain'],
$cookieParams['secure'] $cookieParams['secure']
); );
} }
// normally "rememberMe()" represents a security context change, so should use new session id // normally "rememberMe()" represents a security context change, so should use new session id
@ -431,7 +429,7 @@ class Zend_Session extends Zend_Session_Abstract
public static function start($options = false) public static function start($options = false)
{ {
// Check to see if we've been passed an invalid session ID // Check to see if we've been passed an invalid session ID
if ( self::getId() && !self::_checkId(self::getId()) ) { if (self::getId() && !self::_checkId(self::getId())) {
// Generate a valid, temporary replacement // Generate a valid, temporary replacement
self::setId(md5(self::getId())); self::setId(md5(self::getId()));
// Force a regenerate after session is started // Force a regenerate after session is started
@ -540,16 +538,19 @@ class Zend_Session extends Zend_Session_Abstract
$hashBitsPerChar = ini_get('session.sid_bits_per_character'); $hashBitsPerChar = ini_get('session.sid_bits_per_character');
if (!$hashBitsPerChar) { if (!$hashBitsPerChar) {
$hashBitsPerChar = ini_get('session.hash_bits_per_character'); $hashBitsPerChar = ini_get('session.hash_bits_per_character');
} }
if (!$hashBitsPerChar) { if (!$hashBitsPerChar) {
$hashBitsPerChar = 5; // the default value $hashBitsPerChar = 5; // the default value
} }
$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);
} }
@ -570,7 +571,7 @@ class Zend_Session extends Zend_Session_Abstract
foreach ($_SESSION['__ZF'] as $namespace => $namespace_metadata) { foreach ($_SESSION['__ZF'] as $namespace => $namespace_metadata) {
// Expire Namespace by Time (ENT) // Expire Namespace by Time (ENT)
if (isset($namespace_metadata['ENT']) && ($namespace_metadata['ENT'] > 0) && (time() > $namespace_metadata['ENT']) ) { if (isset($namespace_metadata['ENT']) && ($namespace_metadata['ENT'] > 0) && (time() > $namespace_metadata['ENT'])) {
unset($_SESSION[$namespace]); unset($_SESSION[$namespace]);
unset($_SESSION['__ZF'][$namespace]); unset($_SESSION['__ZF'][$namespace]);
} }
@ -651,7 +652,7 @@ class Zend_Session extends Zend_Session_Abstract
*/ */
public static function isRegenerated() public static function isRegenerated()
{ {
return ( (self::$_regenerateIdState > 0) ? true : false ); return ((self::$_regenerateIdState > 0) ? true : false);
} }
@ -805,7 +806,7 @@ class Zend_Session extends Zend_Session_Abstract
$cookie_params['path'], $cookie_params['path'],
$cookie_params['domain'], $cookie_params['domain'],
$cookie_params['secure'] $cookie_params['secure']
); );
} }
} }
@ -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';
@ -890,7 +891,7 @@ class Zend_Session extends Zend_Session_Abstract
$spaces = []; $spaces = [];
if (isset($_SESSION)) { if (isset($_SESSION)) {
$spaces = array_keys($_SESSION); $spaces = array_keys($_SESSION);
foreach($spaces as $key => $space) { foreach ($spaces as $key => $space) {
if (!strncmp($space, '__', 2) || !is_array($_SESSION[$space])) { if (!strncmp($space, '__', 2) || !is_array($_SESSION[$space])) {
unset($spaces[$key]); unset($spaces[$key]);
} }

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>');
}
})
}
});
}