From 55ffbd0926d1a420226e02b0c171f0cc1ce67169 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 6 Dec 2020 07:30:02 +0100 Subject: [PATCH] Continued, finally: - primera API is no longer available on their servers - better support for JS inclusion and also (maybe?) possible as "compiled" asset MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- inc/classes/primera_api.class.php | 238 +----------------- inc/classes/rdf.class.php | 2 +- inc/expression-functions.php | 16 +- inc/extensions/ext-sql_patches.php | 4 +- inc/extensions/sql_patches/mode-update.php | 11 +- templates/de/html/admin/admin_ajax_main.tpl | 8 +- .../admin/admin_list_network_query_api.tpl | 8 +- .../de/html/install/install_main_ajax.tpl | 8 +- .../de/html/install/install_main_plain.tpl | 2 +- .../de/html/install/install_selector.tpl | 6 +- templates/de/html/page_header.tpl | 4 +- 11 files changed, 40 insertions(+), 267 deletions(-) diff --git a/inc/classes/primera_api.class.php b/inc/classes/primera_api.class.php index 707d9a3afb..7d6dceec92 100644 --- a/inc/classes/primera_api.class.php +++ b/inc/classes/primera_api.class.php @@ -1,238 +1,2 @@ payPrimera($PayReceiver, $PayAmount, $PayDescription); - * - * Wobei $PayReicer der Username des Empf�ngers bei - * Primusportal.de ist. $PayAmount ist der gerundete( !! ) Betrag an Primera, - * die der Empf�nger erhalten soll. $PayDescription ist eine von Ihnen - * festgelegte kurze Beschreibung. Die L�nge dieses Textes darf 100 Zeichen - * nicht �berschreiten. Beispiel: - * $status = $Interface->payPrimera("garbage", 10000, "Auszahlung IhreSeite.de - id: 12345"); - * 3. �berpr�fung des Status (R�ckgabecode): - * CODE: - * if (!$status) { - * // Ein Fehler ist aufgetreten - * // Fehlerbehandlung hier einf�gen... - * }else { - * // Auszahlung erfolgreich durchgef�hrt - * // F�hren Sie hier Ihre Datenbankabfragen durch, um die Auszahlung zu - * // best�tigen... - * } - * - * Die komplette R�ckgabe des Interfaces wird als assoziatives Array in der Klassen- - * variable __data gespeichert: - * __data => array('status' => R�ckgabecode (PI_DONE, PI_SENDER_ERROR, ...), - * "statustext" => Status in Worten (z.B.: "Transaktion erfolgreich durchgef�hrt"), - * ") - * - * - * @author Andreas Schmidt - * @author Roland Haeder - * @version 1.0 - beta - * @copyright (c) 2007 by Primusportal.de - * @copyright (c) 2008 by Roland Haeder - * @copyright 2009, 2010 by Mailer Developer Team - */ -class PrimeraApi { - /** - * Fehler - Interfacebenutzer - */ - const PI_ERROR = -1; - - /** - * Statuscode f�r erfolgreich ausgef�hrte Transaktion - */ - const PI_DONE = 200; - - /** - * Fehler - User existiert nicht oder ist gesperrt - */ - const PI_RECEIVER_ERROR = 301; - - /** - * Sender-Account Fehler (User nicht existent, gesperrt, ...) - */ - const PI_SENDER_ERROR = 401; - - /** - * Betrag fehler - */ - const PI_AMOUNT_ERROR = 501; - - /** - * Zu wenig Primera - */ - const PI_TOO_LESS_PRIMERA = 502; - - /** - * User nicht aktiv oder existiert nicht - */ - const PI_USER_CHECK_ERROR = 601; - - /** - * User aktiv - */ - const PI_USER_CHECK_OK = 602; - - /** - * Primerastand erfolgreich geholt - */ - const PI_GET_PRIMERA_DONE = 701; - - /** - * URL f�r das Interface auf dem Primusserver: - */ - var $host = 'http://www.primusportal.de'; - var $path = '/transfer.interface.2.0.php'; - - var $errno = '0'; - var $err = ''; - - var $separator = ':'; - - var $username = ''; - var $password = ''; - - var $data = array(); - - var $headers = ''; - - /** - * Konstruktor - */ - function PrimeraApi ($PPUsername, $PPPassword) { - // Set data - $this->username = $PPUsername; - $this->password = $PPPassword; - } - - /** - * Anfrage senden und R�ckgabecode in Variable speichern - */ - function queryApi ( $data = array() ) { - // Base64-encode username and password hash - $data['PrimusInterface_Username'] = base64_encode($this->username); - $data['PrimusInterface_Password'] = base64_encode($this->password); - - // Send POST request - $return = sendHttpPostRequest($this->host.$this->path, $data); - - // Convert the array into a full string - $returnStr = implode(chr(10), $return); - - // Extract the real content, strip header away - $content = explode('', $returnStr); - - // Store headers away for debugging - $this->headers = $content[0]; - - // Return the content - return $content[1]; - } - - /** - * Funktion parst die R�ckgabe vom Transferskript: - */ - function parseContent ( $content ) { - $x = explode(chr(10), $content); - $return = array(); - foreach ($x as $currentLine) { - $line_exploded = explode(':', $currentLine,2); - if (count($line_exploded) > 1) { - $return[$line_exploded[0]] = $line_exploded[1]; - } - } - return $return; - } - - /** - * @param int/string $Receiver UserID / Username des Empf�ngers - * @param int $Amount Betrag in ganzzahligen Primera - * @param string $Description Beschreibung (Sichtbar in Einzelauflistung) - */ - function payPrimera ($Receiver, $Amount, $Description = '') { - $valid = FALSE; - $postData = array('PrimusInterface_Action' => 'Pay', - 'PrimusInterface_Receiver' => base64_encode($Receiver), - 'PrimusInterface_Amount' => base64_encode($Amount), - 'PrimusInterface_Description' => base64_encode($Description) ); - - $postReturn = $this->parseContent( $this->queryApi($postData) ); - - $this->data = $postReturn; - if ($postReturn['status'] == '200') { - $valid = TRUE; - } - return $valid; - } - - /** - * �berpr�ft den Status eines Primus-Users - * - existiert der User - * - ist er aktiv - * @param string/int $User Userid / Username - */ - function CheckPrimusUser($User) { - $valid = FALSE; - $postData = array('PrimusInterface_Action'=> 'CheckPrimusUser', - 'PrimusInterface_CheckPrimusUser' => $User); - - $postReturn = $this->parseContent( $this->queryApi($postData) ); - - $this->data = $postReturn; - - if ($postReturn['status'] == self::PI_USER_CHECK_OK) { - $valid = TRUE; - } - return $valid; - } - - /** - * Die Funktion liefer den aktuellen Primerastand - */ - function getPrimera() { - $primera = FALSE; - $postData = array( 'PrimusInterface_Action' => 'GetPrimera' ); - $postReturn = $this->parseContent( $this->queryApi($postData) ); - - $this->data = $postReturn; - if ($postReturn['status'] == self::PI_GET_PRIMERA_DONE) { - $primera = $postReturn['primera']; - } - return $primera; - } - - /** - * Getter fuer data - */ - function getData () { - return $this->data; - } -} - -// [EOF] -?> +// @DEPRECATED diff --git a/inc/classes/rdf.class.php b/inc/classes/rdf.class.php index a30a4e5b19..5133d37a6d 100644 --- a/inc/classes/rdf.class.php +++ b/inc/classes/rdf.class.php @@ -384,7 +384,7 @@ class fase4_rdf { * @author Stefan Saasen * @see _refresh */ - function fase4_rdf () { + function __construct () { // default Value, to be overwritten in set_refresh() $this->_refresh = (time() - 1200); $this->_clear_cItems(); diff --git a/inc/expression-functions.php b/inc/expression-functions.php index 7b90cbc03b..afb7a7bf53 100644 --- a/inc/expression-functions.php +++ b/inc/expression-functions.php @@ -515,7 +515,7 @@ function doExpressionFormClose ($data) { // Expression call-back to handle jquery inclusion function doExpressionJquery ($data) { - // Default is compressed + // Default is uncompressed $scriptName = 'jquery'; $data['output_mode'] = ''; @@ -531,8 +531,8 @@ function doExpressionJquery ($data) { $scriptName .= '-' . $data['value']; } // END - if - // Is debug mode enabled? - if ((!isGetRequestElementSet('jquery')) && (!isSessionVariableSet('jquery'))) { + // Is debug-mode enabled and parameter/session key 'jquery' given? + if ((!isDebugModeEnabled()) || ((!isGetRequestElementSet('jquery')) && (!isSessionVariableSet('jquery')))) { // Productive systems want minimized version $scriptName .= '.min'; } else { @@ -540,11 +540,8 @@ function doExpressionJquery ($data) { setSession('jquery', '1'); } - // Complete script name - $scriptName = sprintf('js/jquery/%s.js', $scriptName); - // Add {%url%} around it - $replacer = sprintf('{%%url%s=%s?dummy=1%%}', $data['output_mode'], $scriptName); + $replacer = sprintf('{%%url%s=js/jquery/%s.js?dummy=1%%}', $data['output_mode'], $scriptName); // Replace the code $code = replaceExpressionCode($data, $replacer); @@ -552,3 +549,8 @@ function doExpressionJquery ($data) { // Return the (maybe) replaced code return $code; } + +// Expression call-back to handle JavaScript inclusion +function doExpressionJs ($data) { + die('
'.print_r($data, TRUE));
+}
diff --git a/inc/extensions/ext-sql_patches.php b/inc/extensions/ext-sql_patches.php
index 99153ab390..cff6887435 100644
--- a/inc/extensions/ext-sql_patches.php
+++ b/inc/extensions/ext-sql_patches.php
@@ -41,10 +41,10 @@ if (!defined('__SECURITY')) {
 } // END - if
 
 // Version number
-setThisExtensionVersion('1.0.4');
+setThisExtensionVersion('1.0.5');
 
 // Version history array (add more with , '0.0.1' and so on)
-setExtensionVersionHistory(array('0.0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8', '0.0.9', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8', '0.3.9', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5', '0.4.6', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5', '0.5.6', '0.5.7', '0.5.8', '0.5.9', '0.6.0', '0.6.1', '0.6.2', '0.6.3', '0.6.4', '0.6.5', '0.6.6', '0.6.7', '0.6.8', '0.6.9', '0.7.0', '0.7.1', '0.7.2', '0.7.3', '0.7.4', '0.7.5', '0.7.6', '0.7.7', '0.7.8', '0.7.9', '0.8.0', '0.8.1', '0.8.2', '0.8.3', '0.8.4', '0.8.5', '0.8.6', '0.8.7', '0.8.8', '0.8.9', '0.9.0', '0.9.1', '0.9.2', '0.9.3', '0.9.4', '0.9.5', '0.9.6', '0.9.7', '0.9.8', '0.9.9', '1.0.0', '1.0.1', '1.0.2', '1.0.3', '1.0.4'));
+setExtensionVersionHistory(array('0.0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8', '0.0.9', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8', '0.3.9', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5', '0.4.6', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5', '0.5.6', '0.5.7', '0.5.8', '0.5.9', '0.6.0', '0.6.1', '0.6.2', '0.6.3', '0.6.4', '0.6.5', '0.6.6', '0.6.7', '0.6.8', '0.6.9', '0.7.0', '0.7.1', '0.7.2', '0.7.3', '0.7.4', '0.7.5', '0.7.6', '0.7.7', '0.7.8', '0.7.9', '0.8.0', '0.8.1', '0.8.2', '0.8.3', '0.8.4', '0.8.5', '0.8.6', '0.8.7', '0.8.8', '0.8.9', '0.9.0', '0.9.1', '0.9.2', '0.9.3', '0.9.4', '0.9.5', '0.9.6', '0.9.7', '0.9.8', '0.9.9', '1.0.0', '1.0.1', '1.0.2', '1.0.3', '1.0.4', '1.0.5'));
 
 // Keep this extension always active!
 setExtensionAlwaysActive('Y');
diff --git a/inc/extensions/sql_patches/mode-update.php b/inc/extensions/sql_patches/mode-update.php
index e86971185b..d5562501e8 100644
--- a/inc/extensions/sql_patches/mode-update.php
+++ b/inc/extensions/sql_patches/mode-update.php
@@ -179,7 +179,7 @@ if (!defined('__SECURITY')) {
 				break;
 
 			case '0.2.1': // SQL queries for v0.2.1
-				addConfigAddSql('css_php', "ENUM('DIRECT','FILE','INLINE') NOT NULL DEFAULT 'FILE'");
+				addConfigAddSql('css_php', "ENUM('DIRECT','FILE','INLINE','ASSET') NOT NULL DEFAULT 'FILE'");
 
 				// Update notes (these will be set as task text!)
 				setExtensionUpdateNotes("Ausgabe der CSS-Dateien entweder per css.php oder sie sind direkt eingebunden.");
@@ -587,7 +587,7 @@ UNIQUE INDEX `name_function` (`filter_name`, `filter_function`)",
 				break;
 
 			case '0.6.5': // SQL queries for v0.6.5
-				addConfigChangeSql('css_php', 'css_php', "ENUM('DIRECT','FILE','INLINE') NOT NULL DEFAULT 'FILE'");
+				addConfigChangeSql('css_php', 'css_php', "ENUM('DIRECT','FILE','INLINE','ASSET') NOT NULL DEFAULT 'FILE'");
 
 				// Update notes (these will be set as task text!)
 				setExtensionUpdateNotes("Ausgabe der CSS-Dateien entweder per css.php oder sie sind direkt eingebunden.");
@@ -932,6 +932,13 @@ INDEX (`history_last_used` DESC)",
 				// Update notes (these will be set as task text!)
 				setExtensionUpdateNotes("jQuery aktualisiert.");
 				break;
+
+			case '1.0.5': // SQL queries for v1.0.5
+				addConfigChangeSql('css_php', 'css_php', "ENUM('DIRECT','FILE','INLINE','ASSET') NOT NULL DEFAULT 'FILE'");
+
+				// Update notes (these will be set as task text!)
+				setExtensionUpdateNotes("Ausgabe der CSS-Dateien entweder per css.php, als style-Tag, als minifiziertes Asset "kompiliert" oder sie sind direkt eingebunden.");
+				break;
 		} // END - switch
 
 // [EOF]
diff --git a/templates/de/html/admin/admin_ajax_main.tpl b/templates/de/html/admin/admin_ajax_main.tpl
index 9d8097461e..21427484b0 100644
--- a/templates/de/html/admin/admin_ajax_main.tpl
+++ b/templates/de/html/admin/admin_ajax_main.tpl
@@ -13,15 +13,15 @@
 
 
 
-
+