From d2f83291708612f38378b9b55c361c8e02c0f1e6 Mon Sep 17 00:00:00 2001 From: quix0r Date: Fri, 15 Jun 2012 19:00:15 +0000 Subject: [PATCH] Extension ext-primera is now deprecated (see ticket #8's last comment) --- .gitattributes | 1 + inc/classes/primera_api.class.php | 238 +++++++++++++++ inc/extensions/ext-primera.php | 128 +------- inc/language/primera_de.php | 123 +------- inc/libs/primera_functions.php | 279 +----------------- inc/modules/admin/action-primera.php | 55 +--- inc/modules/admin/what-config_primera.php | 70 +---- inc/modules/admin/what-list_primera.php | 91 +----- inc/modules/member/what-primera.php | 191 +----------- .../de/html/admin/admin_config_primera.tpl | 54 +--- .../de/html/admin/admin_list_primera_main.tpl | 26 +- .../de/html/admin/admin_list_primera_row.tpl | 11 +- templates/de/html/ext/ext_primera.tpl | 24 +- .../html/member/member_primera_mode_list.tpl | 22 +- .../member/member_primera_mode_list_row.tpl | 7 +- .../html/member/member_primera_mode_pay.tpl | 42 +-- 16 files changed, 266 insertions(+), 1096 deletions(-) create mode 100644 inc/classes/primera_api.class.php diff --git a/.gitattributes b/.gitattributes index c2146ca33d..3abddf37b7 100644 --- a/.gitattributes +++ b/.gitattributes @@ -93,6 +93,7 @@ inc/cache/_compiled/html/.htaccess svneol=native#text/plain inc/callback-functions.php svneol=native#text/plain inc/classes/.htaccess svneol=native#text/plain inc/classes/cachesystem.class.php svneol=native#text/plain +inc/classes/primera_api.class.php svneol=native#text/plain inc/classes/rdf.class.php svneol=native#text/plain inc/classes/resolver.class.php svneol=native#text/plain inc/code-functions.php svneol=native#text/plain diff --git a/inc/classes/primera_api.class.php b/inc/classes/primera_api.class.php new file mode 100644 index 0000000000..c91d81ef9b --- /dev/null +++ b/inc/classes/primera_api.class.php @@ -0,0 +1,238 @@ +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 = sendPostRequest($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] +?> diff --git a/inc/extensions/ext-primera.php b/inc/extensions/ext-primera.php index fc54a62b9b..f551ef47b7 100644 --- a/inc/extensions/ext-primera.php +++ b/inc/extensions/ext-primera.php @@ -1,129 +1,3 @@ diff --git a/inc/language/primera_de.php b/inc/language/primera_de.php index ef8e866f7a..f551ef47b7 100644 --- a/inc/language/primera_de.php +++ b/inc/language/primera_de.php @@ -1,124 +1,3 @@ "Alle Primera-Ein-/Auszahlungen", - 'ADMIN_TASK_LIST_PRIMERA_ALL_TITLE' => "Listet alle Primera-Ein- und Auszahlungen auf.", - 'ADMIN_CONFIG_PRIMERA_TITLE' => "Einstellungen zum Primus-Portal:", - 'ADMIN_CONFIG_PRIMERA_MIN_PAYOUT' => "Minimumguthaben für Auszahlungen.", - 'ADMIN_CONFIG_PRIMERA_MIN_WITHDRAW' => "Minimumguthaben für Einzahlungen.", - 'ADMIN_CONFIG_PRIMERA_API_NAME' => "Primus-Nickname", - 'ADMIN_CONFIG_PRIMERA_API_MD5' => "Primera-Passwort (Wird als MD5-Hash gespeichert)", - 'ADMIN_CONFIG_PRIMERA_REFID' => "Primus-Referral-Id (???)", - 'ADMIN_CONFIG_PRIMERA_NOTE' => "Hier können Sie sich ein Primus-Portal-Account holen. Geben Sie immer Ihren Usernamen von Primus-Portal ein und überprüfen Sie diesen mehrmals! Er wird zum Überweisen von Primera benötigt.", - 'ADMIN_PRIMERA_NO_TRANSFERS' => "Derzeit keine Primera transferiert.", - 'ADMIN_PRIMERA_ACCOUNT' => "Account bei Primus-Portal", - 'ADMIN_PRIMERA_TRANSFERED' => "Primera transferiert", - 'ADMIN_PRIMERA_TIMESTAMP' => "Zeitpunkt Überweisung", - 'ADMIN_PRIMERA_TYPE' => "Überweisungsrichtung", - 'ADMIN_PRIMERA_API_MESSAGE' => "Nachricht von Primus-API", - 'ADMIN_PRIMERA_API_STATUS' => "Status von Primus-API", - 'MEMBER_PRIMERA_MODE_WITHDRAW' => "Primera einzahlen", - 'MEMBER_PRIMERA_MODE_PAYOUT' => "Primera auszahlen", - 'PRIMERA_STATUS_UNKNWOWN' => "Primera-Typ %s unbekannt.", - 'PRIMERA_STATUS_WITHDRAW' => "Einzahlung von Primus", - 'PRIMERA_STATUS_PAYOUT' => "Auszahlung an Primus", - 'PRIMERA_STATUS_FAILED' => "Fehlgeschlagen", - 'PRIMERA_TIMESTAMP' => "Buchungszeitmarke", - 'PRIMERA_ACCOUNT' => "Primus-Portal", - 'PRIMERA_TOTAL_PRIMERA' => "Gesamt überwiesen", - 'MEMBER_PRIMERA_LIST_PRIMERA' => "Überweisungsliste von/an Primus-Portal", - 'ADMIN_LIST_PRIMERA_TITLTE' => "Alle Transaktionen von und zum Primus-Portal auflisten:", - 'ADMIN_LIST_PRIMERA_FOOTER' => "Es sollte hier ein Hinweis eingebaut werden.", - -// API messages - 'PRIMERA_API_REQUEST_DATA_INVALID' => "Interner Fehler: Abfragedaten sind defekt.", - 'PRIMERA_API_REQUEST_DATA_MISSING' => "Interner Fehler: Abfragedaten sind nicht komplett.", - 'PRIMERA_API_REQUEST_ERROR' => "Abfragefehler: %s", - 'PRIMERA_API_REQUEST_FAILED' => "Unbekannter Fehler %s von API erhalten! Bitte im [Bug-Tracker posten], den Fehlercode nennen und wie es dazu gekommen ist.", - 'PRIMERA_API_REQUEST_FAILED_AUTH' => "Authorisierung an API fehlgeschlagen! Bitte Primera-Nickname und Passwort überprüfen. [Hier] direkt zum Primera-Account. Sie benötigen Ihren Usernamen und Passwort.", - 'PRIMERA_API_REQUEST_FAILED_USER' => "Useraccount nicht gefunden oder Primera-Passwort ist ungültig.", - 'PRIMERA_API_REQUEST_FAILED_OWN' => "Überweisung an eigenes Account nicht möglich.", - 'PRIMERA_API_REQUEST_FAILED_AMOUNT' => "Konto weist nicht genügend Deckung auf.", - 'PRIMERA_API_REQUEST_FAILED_API_AMOUNT' => "Primera-Account weist nicht genügend Deckung auf.", - 'PRIMERA_API_PURPOSE_WITHDRAW' => "Einzahlung auf {?MAIN_TITLE?} ({?URL?}), id: %s", - 'PRIMERA_API_PURPOSE_PAYOUT' => "Auszahlung von {?MAIN_TITLE?} ({?URL?}), id: %s", - -// Error messages - 'PRIMERA_ERROR_STATUS' => "Fehler-Status %s erhalten.", - 'PRIMERA_UNKNOWN_ERROR' => "Unbekannter Fehler aufgetreten.", - -// Member messages - 'MEMBER_PRIMERA_NO_ACCOUNT' => "Noch kein Primus-Account? Hier entlang.", - 'MEMBER_PRIMERA_API_DATA_MISSING' => "Diese Funktion kann derzeit nicht genutzt werden, da wir sie noch einrichten müssen.", - 'MEMBER_PRIMERA_MIN_PAYOUT_PAYOUT' => "Sie haben nicht genügend Primera zum Auszahlen! Mindestens: {%config,translateComma=primera_min_payout%} Primera.", - 'MEMBER_PRIMERA_WITHDRAW_TITLE' => "Primera bei {?MAIN_TITLE?} einzahlen:", - 'MEMBER_PRIMERA_WITHDRAW_POINTS_ACCOUNT' => "Primera hier im Account:", - 'MEMBER_PRIMERA_WITHDRAW_MIN_POINTS' => "Mindest einzuzahlendes Primera-Guthaben:", - 'MEMBER_PRIMERA_WITHDRAW_SUBMIT' => "Primera jetzt einzahlen", - 'MEMBER_PRIMERA_WITHDRAW_NOTE' => "Ihr Primera-Passwort wird bei {?MAIN_TITLE?} nicht gespeichert. Bitte bei Primera-Betrag nur gerade Beträge eingeben! Ihr Primera-Account sollte ausreichend Deckung aufweisen.", - 'MEMBER_PRIMERA_PAYOUT_TITLE' => "Primera auf Ihr Portal-Account auszahlen", - 'MEMBER_PRIMERA_PAYOUT_POINTS' => "Auszahlfähiges Primera-Guthaben", - 'MEMBER_PRIMERA_PAYOUT_MIN_POINTS' => "Mindestens auszuzahlendes Primera-Guthaben", - 'MEMBER_PRIMERA_PAYOUT_SUBMIT' => "Auszahlung durchführen", - 'MEMBER_PRIMERA_PAYOUT_NOTE' => "Ihr Primera-Passwort wird bei {?MAIN_TITLE?} nicht gespeichert. Bitte bei Primera-Betrag nur gerade Beträge eingeben! Überprüfen Sie vor dem Absenden Ihren Primus-Usernamen.", - 'MEMBER_PRIMERA_NICKNAME' => "Username bei Primus-Portal: [Vergessen?]", - 'MEMBER_PRIMERA_PASSWORD' => "Primera-Passwort (nicht Accountpasswort!): [Vergessen?]", - 'MEMBER_PRIMERA_AMOUNT' => "Zu überweisenden Betrag eingeben:", - 'MEMBER_PRIMERA_MODE_INVALID' => "Ungültiger Modus %s erkannt! Bitte links im Menü fortfahren.", - 'MEMBER_PRIMERA_EMPTY_USERNAME' => "Sie haben Ihren Primus-Usernamen nicht eingegeben.", - 'MEMBER_PRIMERA_EMPTY_PASSWORD' => "Sieh haben kein Primera-Passwort eingegeben.", - 'MEMBER_PRIMERA_EMPTY_AMOUNT' => "Sie haben keine zu überweisende Betrag angegeben.", - 'MEMBER_PRIMERA_INVALID_USERNAME' => "Bitte nur Zahlen für den Primus-Usernamen eingeben.", - 'MEMBER_PRIMERA_INVALID_AMOUNT' => "Bitte nur Zahlen für den zu überweisenden Betrag eingeben.", - 'MEMBER_PRIMERA_AMOUNT_SMALLER_MIN' => "Bitte geben Sie mindestens {%config,translateComma=primera_min_payout%} Primera an.", - 'MEMBER_PRIMERA_WITHDRAW_FAILED' => "Die Einzahlung hat nicht geklappt! Rückmeldung für den Support: %s.", - 'MEMBER_PRIMERA_WITHDRAW_DONE' => "Einzahlung auf Ihr {?MAIN_TITLE?} Konto erfolgreich abgeschlossen. :-)", - 'MEMBER_PRIMERA_PAYPOUT_FAILED' => "Die Auszahlung hat nicht geklappt! Rückmeldung für den Support: %s.", - 'MEMBER_PRIMERA_PAYOUT_DONE' => "Auszahlung auf Primus-Portal erfolgreich abgeschlossen. :-)", - 'MEMBER_PRIMERA_PAYOUT_POINTS_DEPLETED' => "Sie können nicht %s Primera auszahlen, da Sie nur %s übrig haben.", - 'MEMBER_PRIMERA_STATUS' => "Überweisungsart", -)); - -// [EOF] +// @DEPRECATED ?> diff --git a/inc/libs/primera_functions.php b/inc/libs/primera_functions.php index 9adf85660d..f551ef47b7 100644 --- a/inc/libs/primera_functions.php +++ b/inc/libs/primera_functions.php @@ -1,280 +1,3 @@ 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 = sendPostRequest($this->host.$this->path, $data); - - // Convert the array into a full string - $returnStr = implode("\n", $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("\n", $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; - } -} - -// Function to test the Primera API by getting the amount. If the returned value -// is not false the API data is valid, else invalid -function testPrimeraApi () { - // Get new instance - $api = new PrimeraApi(postRequestElement('primera_api_name'), postRequestElement('primera_api_md5')); - - // Was that fine? - return ($api->getPrimera() !== false); -} - -// Execute the withdraw of a sponsor only! -function executePrimeraWithdraw ($primusNick, $userMd5, $amount) { - // Is the sponsor extension installed? - if (!isExtensionActive('sponsor')) { - // No, abort here - return false; - } elseif (!isSponsor()) { - // No sponsor, not allowed to withdraw! - return false; - } - - // Get new instance - $api = new PrimeraApi($primusNick, $userMd5); - - // Prepare purpose - eval('$purpose = "' . doFinalCompilation(getMaskedMessage('PRIMERA_API_PURPOSE_WITHDRAW', getSession('sponsorid')), true) . '";'); - - // Pay the Primera - return $api->payPrimera($primusNick, $amount, $purpose); -} - -// Execute the payout -function executePrimeraPayout ($primusNick, $userMd5, $amount) { - // Get new instance - $api = new PrimeraApi(getConfig('primera_api_name'), getConfig('primera_api_md5')); - - // Prepare purpose - eval('$purpose = "' . doFinalCompilation(getMaskedMessage('PRIMERA_API_PURPOSE_PAYOUT', getMemberId()), true) . '";'); - - // Pay the Primera - return $api->payPrimera($primusNick, $amount, $purpose); -} - -// [EOF] +// @DEPRECATED ?> diff --git a/inc/modules/admin/action-primera.php b/inc/modules/admin/action-primera.php index b437bc1dd9..f551ef47b7 100644 --- a/inc/modules/admin/action-primera.php +++ b/inc/modules/admin/action-primera.php @@ -1,56 +1,3 @@ diff --git a/inc/modules/admin/what-config_primera.php b/inc/modules/admin/what-config_primera.php index 9518d07a31..f551ef47b7 100644 --- a/inc/modules/admin/what-config_primera.php +++ b/inc/modules/admin/what-config_primera.php @@ -1,71 +1,3 @@ diff --git a/inc/modules/admin/what-list_primera.php b/inc/modules/admin/what-list_primera.php index 502a07c846..f551ef47b7 100644 --- a/inc/modules/admin/what-list_primera.php +++ b/inc/modules/admin/what-list_primera.php @@ -1,92 +1,3 @@ diff --git a/inc/modules/member/what-primera.php b/inc/modules/member/what-primera.php index d044bbd7e2..f551ef47b7 100644 --- a/inc/modules/member/what-primera.php +++ b/inc/modules/member/what-primera.php @@ -1,192 +1,3 @@ Primus - // Is the user id and password set? - if (!isPostRequestElementSet('primera_nickname')) { - // Nothing entered in Primus nickname - displayMessage('{--MEMBER_PRIMERA_EMPTY_USERNAME--}'); - } elseif (!isPostRequestElementSet('primera_password')) { - // Nothing entered in Primera password - displayMessage('{--MEMBER_PRIMERA_EMPTY_PASSWORD--}'); - } elseif (!isPostRequestElementSet('amount')) { - // Nothing entered in amount - displayMessage('{--MEMBER_PRIMERA_EMPTY_AMOUNT--}'); - } elseif (postRequestElement('amount') != bigintval(postRequestElement('amount'))) { - // Only numbers in amount! - displayMessage('{--MEMBER_PRIMERA_INVALID_AMOUNT--}'); - } elseif (postRequestElement('amount') < getConfig('primera_min_payout')) { - // Not enougth entered! - displayMessage('{--MEMBER_PRIMERA_AMOUNT_SMALLER_MIN--}'); - } elseif (postRequestElement('amount') > $points) { - // Not enougth points left! - displayMessage(sprintf(getMessage('MEMBER_PRIMERA_PAYOUT_POINTS_DEPLETED'), bigintval(postRequestElement('amount')), bigintval($points))); - } else { - // All is fine here so do the payout - $success = executePrimeraPayout(postRequestElement('primera_nickname'), md5(postRequestElement('primera_password')), postRequestElement('amount')); - if ($success) { - // Default is locked! - $locked = true; - - // Shall I 'pay' the referral points imidiately? - if (getConfig('ref_payout') == '0') { - // Yes, 'pay' it now - $locked = false; - } // END - if - - // Subtract points from account and ignore return status - subtractPoints('primera_payout', getMemberId(), postRequestElement('amount')); - - // Update primera nickname - SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `primera_nickname`=%s WHERE `userid`=%s LIMIT 1", - array(postRequestElement('primera_nickname'), getMemberId()), __FILE__, __LINE__); - - // All done! - displayMessage('{--MEMBER_PRIMERA_PAYOUT_DONE--}'); - return; - } elseif ((GET_PRIMERA_ERROR_CODE() == 'user_failed') || (GET_PRIMERA_ERROR_CODE() == 'own_failed') || (GET_PRIMERA_ERROR_CODE() == 'amount_failed') || (GET_PRIMERA_ERROR_CODE() == 'api_amount_failed')) { - // Wrong login data - displayMessage(GET_PRIMERA_ERROR_MESSAGE()); - } else { - // Something went wrong - displayMessage('{%message,MEMBER_PRIMERA_PAYOUT_FAILED=' . GET_PRIMERA_ERROR_MESSAGE() . '%}'); - } - } - break; - - default: // Invalid mode! - logDebugMessage(__FILE__, __LINE__, sprintf("Invalid mode %s detected.", getRequestElement('do'))); - displayMessage('{%message,MEMBER_PRIMERA_MODE_INVALID=' . getRequestElement('do') . '%}'); - return; - } -} // END - if - -// Prepare mode for template name -$mode = sprintf("member_primera_mode_%s", getRequestElement('do')); - -// Load the template -loadTemplate($mode, false, $content); - -// +// @DEPRECATED ?> diff --git a/templates/de/html/admin/admin_config_primera.tpl b/templates/de/html/admin/admin_config_primera.tpl index 0ee5ecf709..11f5d85d80 100644 --- a/templates/de/html/admin/admin_config_primera.tpl +++ b/templates/de/html/admin/admin_config_primera.tpl @@ -1,53 +1 @@ -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
- {--ADMIN_CONFIG_PRIMERA_TITLE--} -
{--ADMIN_CONFIG_PRIMERA_API_NAME--}: - -
{--ADMIN_CONFIG_PRIMERA_API_MD5--}: - -
{--ADMIN_CONFIG_PRIMERA_REFID--}: - -
{--ADMIN_CONFIG_PRIMERA_MIN_PAYOUT--}: - - Wernis -
{--ADMIN_CONFIG_PRIMERA_MIN_WITHDRAW--}: - - Wernis -
-
- -
- {--ADMIN_CONFIG_PRIMERA_NOTE--} -
-
+ diff --git a/templates/de/html/admin/admin_list_primera_main.tpl b/templates/de/html/admin/admin_list_primera_main.tpl index 17f5ae699d..11f5d85d80 100644 --- a/templates/de/html/admin/admin_list_primera_main.tpl +++ b/templates/de/html/admin/admin_list_primera_main.tpl @@ -1,25 +1 @@ -
- - - - - - - - - - - - - - -$content - - - -
- {--ADMIN_LIST_PRIMERA_TITLE--} -
{--ID_SELECT--}{--_USERID--}{--ADMIN_PRIMERA_ACCOUNT--}{--ADMIN_PRIMERA_TRANSFERED--}{--ADMIN_PRIMERA_TIMESTAMP--}{--ADMIN_PRIMERA_TYPE--}{--ADMIN_PRIMERA_API_MESSAGE--}{--ADMIN_PRIMERA_API_STATUS--}
-
+ diff --git a/templates/de/html/admin/admin_list_primera_row.tpl b/templates/de/html/admin/admin_list_primera_row.tpl index 317989df3c..11f5d85d80 100644 --- a/templates/de/html/admin/admin_list_primera_row.tpl +++ b/templates/de/html/admin/admin_list_primera_row.tpl @@ -1,10 +1 @@ - - $content[id] - {%pipe,generateUserProfileLink=$content[userid]%} - $content[primera_account] - {%pipe,translateComma=$content[primera_amount]%} - $content[primera_timestamp] - {%pipe,PRIMERA_TRANSFER_STATUS=$content[primera_type]%} - {%pipe,fixEmptyContentToDashes=$content[primera_api_message]%} - $content[primera_api_status] - + diff --git a/templates/de/html/ext/ext_primera.tpl b/templates/de/html/ext/ext_primera.tpl index 4558fb26d2..26a01f3ee3 100644 --- a/templates/de/html/ext/ext_primera.tpl +++ b/templates/de/html/ext/ext_primera.tpl @@ -1,10 +1,14 @@ -Mit dieser Erweiterung können Sie Ihren Mitgliedern eine Auszahlung -ihrer Internet-Währung Primera auf ihr Primera-Account überweisen -lassen. Sie als Primera-Anbieter brauchen dazu selbstverständlich -ein Primera-Account. Mehr dazu auf www.primusportal.de. Wenn Sie möchten, können Sie -auch ganz zu Primera wechseln. Dazu geben Sie unter Sonstige -Einstellungen, "Währung Ihres {OPEN_CONFIG}mt_word2{CLOSE_CONFIG}" -einfach das Wort Primera ein. +
+ Mit dieser Erweiterung können Sie Ihren Mitgliedern eine Auszahlung + ihrer Internet-Währung Primera auf ihr Primera-Account + überweisen lassen. Sie als Primera-Anbieter brauchen dazu + selbstverständlich ein Primera-Account. Mehr dazu auf + www.primusportal.de. Wenn + Sie möchten, können Sie auch ganz zu Primera wechseln. Dazu + geben Sie unter Sonstige + Einstellungen, "Währung Ihres + {OPEN_CONFIG}mt_word2{CLOSE_CONFIG}" einfach das Wort Primera ein. +
diff --git a/templates/de/html/member/member_primera_mode_list.tpl b/templates/de/html/member/member_primera_mode_list.tpl index 0d254c574e..11f5d85d80 100644 --- a/templates/de/html/member/member_primera_mode_list.tpl +++ b/templates/de/html/member/member_primera_mode_list.tpl @@ -1,21 +1 @@ -
- - - - - - - - - - - $content[rows] - - - -
- {--MEMBER_PRIMERA_LIST_PRIMERA--} -
{--PRIMERA_TOTAL_PRIMERA--}{--PRIMERA_ACCOUNT--}{--PRIMERA_TIMESTAMP--}{--MEMBER_PRIMERA_STATUS--}
-
+ diff --git a/templates/de/html/member/member_primera_mode_list_row.tpl b/templates/de/html/member/member_primera_mode_list_row.tpl index db70d7e4a0..11f5d85d80 100644 --- a/templates/de/html/member/member_primera_mode_list_row.tpl +++ b/templates/de/html/member/member_primera_mode_list_row.tpl @@ -1,6 +1 @@ - - {%pipe,translateComma=$content[primera_amount]%} Primera - $content[primera_account] - $content[primera_timestamp] - {%pipe,PRIMERA_TRANSFER_STATUS=$content[primera_type]%} - + diff --git a/templates/de/html/member/member_primera_mode_pay.tpl b/templates/de/html/member/member_primera_mode_pay.tpl index d379b92629..11f5d85d80 100644 --- a/templates/de/html/member/member_primera_mode_pay.tpl +++ b/templates/de/html/member/member_primera_mode_pay.tpl @@ -1,41 +1 @@ -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
- {--MEMBER_PRIMERA_PAYOUT_TITLE--} -
{--MEMBER_PRIMERA_PAYOUT_POINTS--}$content[points] Primera
{--MEMBER_PRIMERA_PAYOUT_MIN_POINTS--}{%config,translateComma=primera_min_payout%} Primera
{--MEMBER_PRIMERA_NICKNAME--}
{--MEMBER_PRIMERA_PASSWORD--}
{--MEMBER_PRIMERA_AMOUNT--}
-
- -
- {--MEMBER_PRIMERA_PAYOUT_NOTE--} -
-
+ -- 2.39.5