Rewrote 2 str_replace() calls to one with array()
authorRoland Häder <roland@mxchange.org>
Sun, 1 Sep 2013 20:13:27 +0000 (20:13 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 1 Sep 2013 20:13:27 +0000 (20:13 +0000)
18 files changed:
.gitattributes
inc/extensions/ext-wernis.php
inc/extensions/wernis/mode-update.php
inc/filter/wernis_filter.php
inc/functions.php
inc/install-functions.php
inc/language/order_de.php
inc/language/wernis_de.php
inc/libs/wernis_functions.php
inc/modules/admin/what-config_wernis.php
inc/modules/guest/what-wernis_portal.php
inc/modules/member/what-wernis.php
inc/wrapper-functions.php
templates/de/html/admin/admin_config_wernis.tpl
templates/de/html/guest/guest_confirm_link.tpl
templates/de/html/guest/guest_stats_table.tpl
templates/de/html/guest/guest_top10.tpl
templates/de/html/guest/guest_wernis_registration_form.tpl [new file with mode: 0644]

index edd6d170adeeec94215ecb7d694aec1322e50e95..c23039256ff9df505597f1896cdd4477e47be84f 100644 (file)
@@ -1877,6 +1877,7 @@ templates/de/html/guest/guest_top10_row_earner.tpl svneol=native#text/plain
 templates/de/html/guest/guest_top10_row_login.tpl svneol=native#text/plain
 templates/de/html/guest/guest_top10_row_refs.tpl svneol=native#text/plain
 templates/de/html/guest/guest_wernis_news.tpl svneol=native#text/plain
+templates/de/html/guest/guest_wernis_registration_form.tpl svneol=native#text/plain
 templates/de/html/impressum.tpl svneol=native#text/plain
 templates/de/html/index.tpl svneol=native#text/plain
 templates/de/html/index_forward.tpl svneol=native#text/plain
index 3c5e659fcb43003ccb06dcbfc6b48e93bf4ca37d..8e4f120424bac7c98ca58ff531d1409d252543c6 100644 (file)
@@ -41,10 +41,10 @@ if (!defined('__SECURITY')) {
 } // END - if
 
 // Version of this extension
-setThisExtensionVersion('0.0.7');
+setThisExtensionVersion('0.0.8');
 
 // 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'));
+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'));
 
 switch (getExtensionMode()) {
        case 'setup': // Do stuff when installation is running
@@ -88,6 +88,7 @@ INDEX (`userid`)",
        case 'remove': // Do stuff when removing extension
                // SQL commands to run
                addDropTableSql('user_wernis');
+               addDropTableSql('wernis_regs');
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='wernis'");
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='wernis' LIMIT 1");
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `what`='wernis_portal' LIMIT 1");
index 6be7b14ec70973be32f5ea7cd94941048c943fea..4f431d409d3ad0176d73fb643b119e694906d3e4 100644 (file)
@@ -113,6 +113,27 @@ switch (getCurrentExtensionVersion()) {
                // Update notes
                setExtensionUpdateNotes("Anmeldung &uuml;rber WDS66 API angefangen: Filter registriert.");
                break;
+
+       case '0.0.8': // SQL queries for v0.0.8
+               addConfigAddSql('wernis_base_url', "VARCHAR(255) NOT NULL DEFAULT 'http://www.wds66.com'");
+
+               // SQL commands to run
+               addDropTableSql('wernis_regs');
+               addCreateTableSql('wernis_regs', "
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`local_userid` BIGINT(20) UNSIGNED NULL DEFAULT NULL,
+`wernis_userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`api_auth_status` VARCHAR(255) NOT NULL DEFAULT 'UNKNOWN',
+`api_auth_key` VARCHAR(255) NOT NULL DEFAULT 'INVALID',
+`api_redirect_challenge` VARCHAR(255) NOT NULL DEFAULT 'INVALID',
+`record_inserted` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+PRIMARY KEY (`id`),
+INDEX (`wernis_userid`)",
+                       'Registrations (also pending) over WDS66 API');
+
+               // Update notes (these will be set as task text!)
+               setExtensionUpdateNotes("Basis-URL f&uuml;r alle Scripte (Referral-Link, auth.php-Umleitung usw. nicht aber API) und Tabelle f&uuml;r API-Aufrufe von auth.php hinzugef&uuml;gt.");
+               break;
 } // END - switch
 
 // [EOF]
index 5264ed0232e6cfa8c67d57e1100b30c0a814a4d2..0de661bac38fda585eadca9b0e9879a6f5ea0aef 100644 (file)
@@ -102,6 +102,7 @@ function FILTER_WERNIS_USER_REGISTRATION_FORM () {
        // Is WDS66 user registration selected?
        if (((isGetRequestElementSet('provider')) && (getRequestElement('provider') == 'wernis')) || ((!isGetRequestElementSet('provider')) && (getDefaultRegistrationProvider() == 'wernis'))) {
                // Run it
+               doDisplayWernisUserRegistrationForm();
 
                // Interrupt filter chain
                interruptFilterChain();
index f7c2247656835dd9c582791c8f158c5b67629422..f08e83420ed3fa27698613111e3aa40f341d8442 100644 (file)
@@ -466,7 +466,7 @@ function redirectToUrl ($url, $allowSpider = TRUE) {
        // Three different ways to debug...
        //* DEBUG: */ reportBug(__FUNCTION__, __LINE__, 'URL=' . $url);
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'URL=' . $url);
-       //* DEBUG: */ die($url);
+       /* DEBUG: */ die($url);
 
        // We should not sent a redirect if headers are already sent
        if (!headers_sent()) {
@@ -2742,6 +2742,9 @@ function hashSha256 ($str) {
                $hex .= padLeftZero(dechex(ord(substr($hash, $i, 1))), 2);
        } // END - if
 
+       // Make sure 'length modulo 2' = 0
+       assert((strlen($hex) % 2) == 0);
+
        // Return it
        return $hex;
 }
index 4222ee2e9570c99cad783211bf9a7addb50a29f3..5f027b3f7e1bf44e9e349f585a808337f2c0778f 100644 (file)
@@ -164,8 +164,7 @@ function readSqlDump ($FQFN) {
        $content = readFromFile($FQFN);
 
        // Remove some unwanted chars
-       $content = str_replace(chr(13), '', $content);
-       $content = str_replace(PHP_EOL . PHP_EOL, PHP_EOL, $content);
+       $content = str_replace(array(chr(13), PHP_EOL . PHP_EOL), array('', PHP_EOL), $content);
 
        // Return the content
        return $content;
index 47a9d6a37de2e6569e62d296acb7e05baf363bfe..b7af735d5ebfbec41723a7de4340f8ab9677f692 100644 (file)
@@ -85,7 +85,7 @@ addMessages(array(
        // Member strings
        'MEMBER_ORDER_ALLOWED_RECEIVE' => "Sie k&ouml;nnen heute noch <span class=\"data\">%s</span> von <span class=\"data\">%s</span> Mailbuchungen aufgeben.",
        'MEMBER_ORDER_ALLOWED_MAX' => "Sie k&ouml;nnen solange Mailbuchungen aufgeben, bis alle Mitglieder nicht mehr empfangsbereit sind.",
-       'MEMBER_ORDER_ALLOWED_UNKNOWN' => "Fehler in Konfiguration erkannt! cfg=<span class=\"data\">{?order_max_full?}</span> Bitte den Administrator benachrichtigen.",
+       'MEMBER_ORDER_ALLOWED_UNKNOWN' => "Fehler in Konfiguration erkannt. cfg=<span class=\"data\">{?order_max_full?}</span> Bitte den Administrator benachrichtigen.",
        'MEMBER_ORDER_MAX_ALLOWED' => "Maximale Mailbuchungen",
        'MEMBER_ORDER_ALLOWED_EXHAUSTED' => "Sie k&ouml;nnen keine weiteren Mails mehr versenden, oder stellen Sie bitte den Empfang h&ouml;her ein.",
        'MEMBER_ENTER_INVALID_URL' => "Ung&uuml;ltige URL eingegeben.",
index 72179cc472bf5a50b3f2220c10e50776a5ada3b2..50972a09a15781332ff43ac33fd46f6f4ce96051 100644 (file)
@@ -59,7 +59,7 @@ addMessages(array(
        'ADMIN_CONFIG_WERNIS_API_URL' => "Basis-URL der API-Skripte",
        'ADMIN_CONFIG_WERNIS_REFID' => "Ihre Referral-Id bei WDS66-Portal (= Ihr Username!)",
        'ADMIN_CONFIG_WERNIS_WPASS' => "Wernis-Passwort (nicht Account-Passwort!)",
-       'ADMIN_CONFIG_WERNIS_NOTICE' => "[<a href=\"http://www.wds66.com/ref.php?refid=10437\" target=\"_blank\">Hier</a>] k&ouml;nnen Sie schon f&uuml;r <strong>einmalig kostenlos</strong> <strong>25.000 Abfragen</strong> ein API-Account beantragen (dazu ist ein <strong>kostenloses</strong> Wernis-Account dennoch n&ouml;tig!) Geben Sie immer Ihren Usernamen von WDS66-Hauptaccount ein und &uuml;berpr&uuml;fen Sie diesen mehrmals! Er wird zum &Uuml;berweisen von und nach WDS66-Wernis-Portal ben&ouml;tigt. Die Betreibergeb&uuml;hren und Umrechnungsfaktoren sind f&uuml;r den Betrieb Ihres {?mt_word2?} komplett in Wernis ausgelegt, diese m&uuml;ssen Sie also noch anpassen, wenn Sie z.B. Punkte haben und in Wernis auszahlen lassen wollen. Sollten Sie sowohl einen feste als auch eine prozentuale Betreibergeb&uuml;hr eingestellt haben, gilt die prozentuale.",
+       'ADMIN_CONFIG_WERNIS_NOTICE' => "[<a href=\"{?wernis_base_url?}/ref.php?refid=10437\" target=\"_blank\">Hier</a>] k&ouml;nnen Sie schon f&uuml;r <strong>einmalig kostenlos</strong> <strong>25.000 Abfragen</strong> ein API-Account beantragen (dazu ist ein <strong>kostenloses</strong> Wernis-Account dennoch n&ouml;tig!) Geben Sie immer Ihren Usernamen von WDS66-Hauptaccount ein und &uuml;berpr&uuml;fen Sie diesen mehrmals! Er wird zum &Uuml;berweisen von und nach WDS66-Wernis-Portal ben&ouml;tigt. Die Betreibergeb&uuml;hren und Umrechnungsfaktoren sind f&uuml;r den Betrieb Ihres {?mt_word2?} komplett in Wernis ausgelegt, diese m&uuml;ssen Sie also noch anpassen, wenn Sie z.B. Punkte haben und in Wernis auszahlen lassen wollen. Sollten Sie sowohl einen feste als auch eine prozentuale Betreibergeb&uuml;hr eingestellt haben, gilt die prozentuale.",
        'ADMIN_WERNIS_NO_TRANSFERS' => "Derzeit keine Wernis transferiert.",
        'ADMIN_WERNIS_WDS66_ACCOUNT' => "Account bei WDS66-Portal",
        'ADMIN_WERNIS_TRANSFERED' => "Wernis transferiert",
@@ -86,7 +86,7 @@ addMessages(array(
        'WERNIS_API_REQUEST_ERROR' => "Abfragefehler: <span class=\"data\">%s</span>",
        'WERNIS_API_REQUEST_PROBLEM' => "Abfrageproblem: Status=<span class=\"data\">%s</span>, R&uuml;ckmeldung=<span class=\"data\">%s</span>",
        'WERNIS_API_REQUEST_FAILED' => "Unbekannter Fehler <span class=\"data\">%s</span> von API erhalten! Bitte im [<a href=\"http://bugs.mxchange.org\" target=\"_blank\" title=\"Direktlink zum Bug-Tracker\">Bug-Tracker posten</a>], den Fehlercode nennen und wie es dazu gekommen ist.",
-       'WERNIS_API_REQUEST_FAILED_AUTH' => "Authorisierung an API fehlgeschlagen! Bitte API-Id und Key &uuml;berpr&uuml;fen. [<a href=\"http://www.wds66.com/modules.php?module=export\" target=\"_blank\" title=\"Direkt zum WDS66-Exportaccount\">Hier</a>] direkt zum Export-Account. Sie ben&ouml;tigen Ihren Usernamen und Passwort.",
+       'WERNIS_API_REQUEST_FAILED_AUTH' => "Authorisierung an API fehlgeschlagen! Bitte API-Id und Key &uuml;berpr&uuml;fen. [<a href=\"{?wernis_base_url?}/modules.php?module=export\" target=\"_blank\" title=\"Direkt zum WDS66-Exportaccount\">Hier</a>] direkt zum Export-Account. Sie ben&ouml;tigen Ihren Usernamen und Passwort.",
        'WERNIS_API_REQUEST_FAILED_USER' => "Useraccount nicht gefunden oder Wernis-Passwort ist ung&uuml;ltig.",
        'WERNIS_API_REQUEST_FAILED_OWN' => "&Uuml;berweisung an eigenes Account nicht m&ouml;glich.",
        'WERNIS_API_REQUEST_FAILED_AMOUNT' => "Konto weist nicht gen&uuml;gend Deckung auf.",
@@ -114,10 +114,10 @@ addMessages(array(
        'MEMBER_WERNIS_PAYOUT_MIN_POINTS' => "Mindestens auszuzahlendes Wernis-Guthaben",
        'MEMBER_WERNIS_PAYOUT_SUBMIT' => "Auszahlung durchf&uuml;hren",
        'MEMBER_WERNIS_PAYOUT_NOTICE' => "Ihr Wernis-Passwort wird bei {?MAIN_TITLE?} nicht gespeichert. Bitte bei Wernis-Betrag nur gerade Betr&auml;ge eingeben! &Uuml;berpr&uuml;fen Sie vor dem Absenden Ihren WDS66-Usernamen.",
-       'MEMBER_WERNIS_WDS66_ID' => "Username bei WDS66-Portal: [<a href=\"http://www.wds66.com/modules.php?module=wpass\" target=\"_blank\">Vergessen?</a>]",
-       'MEMBER_WERNIS_WDS66_PASSWORD' => "Wernis-Passwort (nicht Accountpasswort!): [<a href=\"http://www.wds66.com/modules.php?module=wpass\" target=\"_blank\">Vergessen?</a>]",
+       'MEMBER_WERNIS_WDS66_ID' => "Username bei WDS66-Portal: [<a href=\"{?wernis_base_url?}/modules.php?module=wpass\" target=\"_blank\">Vergessen?</a>]",
+       'MEMBER_WERNIS_WDS66_PASSWORD' => "Wernis-Passwort (nicht Accountpasswort): [<a href=\"{?wernis_base_url?}/modules.php?module=wpass\" target=\"_blank\">Vergessen?</a>]",
        'MEMBER_WERNIS_WDS66_AMOUNT' => "Zu &uuml;berweisenden Betrag eingeben:",
-       'MEMBER_WERNIS_MODE_INVALID' => "Ung&uuml;ltiger Modus <span class=\"data\">%s</span> erkannt! Bitte links im Men&uuml; fortfahren.",
+       'MEMBER_WERNIS_MODE_INVALID' => "Ung&uuml;ltiger Modus <span class=\"data\">%s</span> erkannt. Bitte links im Men&uuml; fortfahren.",
        'MEMBER_WERNIS_EMPTY_USERNAME' => "Sie haben Ihren WDS66-Usernamen nicht eingegeben.",
        'MEMBER_WERNIS_EMPTY_PASSWORD' => "Sieh haben kein Wernis-Passwort eingegeben.",
        'MEMBER_WERNIS_EMPTY_AMOUNT' => "Sie haben keine zu &uuml;berweisende Betrag angegeben.",
@@ -125,9 +125,9 @@ addMessages(array(
        'MEMBER_WERNIS_INVALID_AMOUNT' => "Bitte nur Zahlen f&uuml;r den zu &uuml;berweisenden Betrag eingeben.",
        'MEMBER_WERNIS_WITHDRAW_AMOUNT_SMALLER_MIN' => "Bitte geben Sie mindestens <span class=\"data\">{OPEN_TEMPLATE}config,translateComma=wernis_min_withdraw{CLOSE_TEMPLATE}</span> Wernis f&uuml;r die Einzahlung an.",
        'MEMBER_WERNIS_PAYOUT_AMOUNT_SMALLER_MIN' => "Bitte geben Sie mindestens <span class=\"data\">{OPEN_TEMPLATE}config,translateComma=wernis_min_payout{CLOSE_TEMPLATE}</span> Wernis f&uuml;r die Auszahlung an.",
-       'MEMBER_WERNIS_WITHDRAW_FAILED' => "Die Einzahlung hat nicht geklappt! R&uuml;ckmeldung f&uuml;r den Support: <span class=\"data\">{OPEN_TEMPLATE}pipe,GET_WERNIS_ERROR_MESSAGE{CLOSE_TEMPLATE}</span>.",
+       'MEMBER_WERNIS_WITHDRAW_FAILED' => "Die Einzahlung hat nicht geklappt! R&uuml;ckmeldung f&uuml;r den Support: <span class=\"data\">{OPEN_TEMPLATE}pipe,getWernisErrorMessage{CLOSE_TEMPLATE}</span>.",
        'MEMBER_WERNIS_WITHDRAW_DONE' => "Einzahlung auf Ihr {?MAIN_TITLE?} Konto erfolgreich abgeschlossen. :-)",
-       'MEMBER_WERNIS_PAYOUT_FAILED' => "Die Auszahlung hat nicht geklappt! R&uuml;ckmeldung f&uuml;r den Support: <span class=\"data\">{OPEN_TEMPLATE}pipe,GET_WERNIS_ERROR_MESSAGE{CLOSE_TEMPLATE}</span>.",
+       'MEMBER_WERNIS_PAYOUT_FAILED' => "Die Auszahlung hat nicht geklappt! R&uuml;ckmeldung f&uuml;r den Support: <span class=\"data\">{OPEN_TEMPLATE}pipe,getWernisErrorMessage{CLOSE_TEMPLATE}</span>.",
        'MEMBER_WERNIS_PAYOUT_DONE' => "Auszahlung auf WDS66-Hauptaccount erfolgreich abgeschlossen. :-)",
        'MEMBER_WERNIS_PAYOUT_POINTS_DEPLETED' => "Sie k&ouml;nnen nicht <span class=\"data\">%s</span> Wernis auszahlen, da Sie nur <span class=\"data\">%s</span> &uuml;brig haben.",
        'MEMBER_WERNIS_STATUS' => "&Uuml;berweisungsart",
@@ -137,6 +137,19 @@ addMessages(array(
        'MEMBER_WERNIS_MODE_PAYOUT' => "Wernis auszahlen",
        'MEMBER_WERNIS_LIST_WERNIS' => "&Uuml;berweisungsliste von/an WDS66-Hauptaccount",
 
+       // Guest messages - registration
+       'GUEST_WERNIS_REGISTRATION_TITLE' => "Anmelung mit WDS66",
+       'GUEST_WERNIS_REGISTRATION_LEGEND' => "Bitte geben Sie Ihre WDS66 Mitgliedsnummer und das Wernis-Passwort ein:",
+       'GUEST_ENTER_WERNIS_ID' => "Ihre WDS66 Mitgliedsnummer:",
+       'GUEST_ENTER_WERNIS_PASSWORD' => "Ihr Wernis-Passwort:",
+       'GUEST_WERNIS_REGISTRATION_SUBMIT' => "Mit WDS66 anmelden",
+       'GUEST_WERNIS_REGISTRATION_NOTICE' => "Bitte verwenden Sie Ihr Wernis-Passwort zur Anmeldung, Ihr Accountpasswort wird hier nicht funktionieren, da dieses zum Anmelden an WDS66 gedacht ist.",
+       'GUEST_WERNIS_SIGNUP_NOTICE' => "Sie haben noch keinen WDS66-Account? <a rel=\"external\" target=\"_blank\" href=\"{?wernis_base_url?}/ref.php?refid={?wernis_refid?}\">Hier geht es zur kostenlosen Anmeldung.",
+       'GUEST_WERNIS_RESTORE_PASSWORD_NOTICE' => "Sie haben kein Wernis-Passwort oder haben es vergessen? <a rel=\"external\" target=\"_blank\" href=\"{?wernis_base_url?}/modules.php?module=wpass\">Hier ein neues einstellen.",
+       'GUEST_WERNIS_REGISTRATION_ID_NOT_SET' => "Bitte geben Sie Ihre Wernis-Id ein. Tipp: Mit dieser Id-Nummer melden Sie sich auch bei WDS66 an.",
+       'GUEST_WERNIS_REGISTRATION_PASSWORD_NOT_SET' => "Bitte geben Sie Ihr Wernis-Passwort ein. Tipp: Dies ist <strong>nicht</strong> Ihr Account-Passwort.",
+       'GUEST_WERNIS_REGISTRATION_INVALID_CHALLENGE_RESPONSE' => "Es ist beim Anmeldeversuch ein Fehler unterlaufen: Falsche Challenge-Response",
+
        // Points accounts - subject
        'POINTS_SUBJECT_WERNIS_WITHDRAW' => "Einzahlung vom WDS66-Account",
 
index 1e8dc198005711d9ccbc78bacba7f9bc86c64879..ff782fac567f9dbf6643cae438b06893ad6e0e46 100644 (file)
@@ -41,13 +41,13 @@ if (!defined('__SECURITY')) {
 } // END - if
 
 // Sets a status message and code
-function WERNIS_STATUS_MESSAGE ($message, $status) {
+function setWernisStatusMessage ($message, $status) {
        $GLOBALS['wernis_data']['message'] = $message;
        $GLOBALS['wernis_data']['status']  = $status;
 }
 
 // Get the status message
-function GET_WERNIS_ERROR_MESSAGE () {
+function getWernisErrorMessage () {
        if (isset($GLOBALS['wernis_data']['message'])) {
                // Use raw message
                return $GLOBALS['wernis_data']['message'];
@@ -61,7 +61,7 @@ function GET_WERNIS_ERROR_MESSAGE () {
 }
 
 // Get the status code
-function GET_WERNIS_ERROR_CODE () {
+function getWernisErrorCode () {
        if (isset($GLOBALS['wernis_data']['status'])) {
                // Use raw message
                return $GLOBALS['wernis_data']['status'];
@@ -72,7 +72,7 @@ function GET_WERNIS_ERROR_CODE () {
 }
 
 // Sends out a request to the API and returns it's result
-function WERNIS_SEND_REQUEST ($scriptName, $requestData = array()) {
+function sendWernisApiRequest ($scriptName, $requestData = array()) {
        // Is the requestData an array?
        if (!is_array($requestData)) {
                // Then abort here!
@@ -210,7 +210,7 @@ function WERNIS_SEND_REQUEST ($scriptName, $requestData = array()) {
 }
 
 // Tests the function by calling balance.php on the API
-function WERNIS_TEST_API () {
+function doAdminTestWernisApi () {
        // Only as admin
        assert(isAdmin());
 
@@ -224,7 +224,7 @@ function WERNIS_TEST_API () {
        );
 
        // Return the result from the lower functions
-       $return = WERNIS_SEND_REQUEST('balance.php', $requestData);
+       $return = sendWernisApiRequest('balance.php', $requestData);
 
        // Did it went smoothly?
        if ($return['status'] == 'OK') {
@@ -232,7 +232,7 @@ function WERNIS_TEST_API () {
                $result = TRUE;
        } else {
                // Status failure text
-               WERNIS_STATUS_MESSAGE($return['message'], $return['status']);
+               setWernisStatusMessage($return['message'], $return['status']);
        }
 
        // Return result
@@ -240,7 +240,7 @@ function WERNIS_TEST_API () {
 }
 
 // Widthdraw this amount
-function WERNIS_EXECUTE_WITHDRAW ($wdsId, $userMd5, $amount) {
+function executeWernisWithdraw ($wdsId, $userMd5, $amount) {
        // Is the sponsor extension installed?
        if (!isWernisWithdrawActive()) {
                if (!isExtensionActive('sponsor')) {
@@ -266,29 +266,28 @@ function WERNIS_EXECUTE_WITHDRAW ($wdsId, $userMd5, $amount) {
        );
 
        // Return the result from the lower functions
-       $return = WERNIS_SEND_REQUEST('book.php', $requestData);
+       $return = sendWernisApiRequest('book.php', $requestData);
 
        if ($return['status'] == 'OK') {
                // All fine!
                $result = TRUE;
 
                // Log the transfer
-               WERNIS_LOG_TRANSFER($wdsId, $amount, 'WITHDRAW');
+               logWernisTransfer($wdsId, $amount, 'WITHDRAW');
        } else {
                // Status failure text
-               WERNIS_STATUS_MESSAGE($return['message'], $return['status']);
+               setWernisStatusMessage($return['message'], $return['status']);
 
                // Log the transfer
-               WERNIS_LOG_TRANSFER($wdsId, $amount, 'FAILED', $return['message'], $return['status']);
+               logWernisTransfer($wdsId, $amount, 'FAILED', $return['message'], $return['status']);
        }
 
        // Return result
        return $result;
 }
 
-
 // Payout this amount
-function WERNIS_EXECUTE_PAYOUT ($wdsId, $amount) {
+function executeWernisPayout ($wdsId, $amount) {
        // Default is failed attempt
        $result = FALSE;
 
@@ -303,26 +302,41 @@ function WERNIS_EXECUTE_PAYOUT ($wdsId, $amount) {
        );
 
        // Return the result from the lower functions
-       $return = WERNIS_SEND_REQUEST('book.php', $requestData);
+       $return = sendWernisApiRequest('book.php', $requestData);
 
        if ($return['status'] == 'OK') {
                // All fine!
                $result = TRUE;
 
                // Log the transfer
-               WERNIS_LOG_TRANSFER($wdsId, $amount, 'PAYOUT');
+               logWernisTransfer($wdsId, $amount, 'PAYOUT');
        } else {
                // Status failure text
-               WERNIS_STATUS_MESSAGE($return['message'], $return['status']);
+               setWernisStatusMessage($return['message'], $return['status']);
 
                // Log the transfer
-               WERNIS_LOG_TRANSFER($wdsId, $amount, 'FAILED', $return['message'], $return['status']);
+               logWernisTransfer($wdsId, $amount, 'FAILED', $return['message'], $return['status']);
        }
 
        // Return result
        return $result;
 }
 
+// Execute auth.php request
+function executeWernisAuth ($wernisId, $wernisPassword) {
+       // Prepare request data
+       $requestData = array(
+               't_uid'       => bigintval($wernisId),
+               't_md5'       => hashSha256($wernisPassword),
+       );
+
+       // Call auth.php
+       $return = sendWernisApiRequest('auth.php', $requestData);
+
+       // Return full array
+       return $return;
+}
+
 // Translate the status IN/OUT
 function translateWernisTransferStatus ($status) {
        // Default status is unknown
@@ -342,7 +356,7 @@ function translateWernisTransferStatus ($status) {
 }
 
 // Log the transfer
-function WERNIS_LOG_TRANSFER ($wdsId, $amount, $type = 'FAILED', $message = '', $status = '') {
+function logWernisTransfer ($wdsId, $amount, $type = 'FAILED', $message = '', $status = '') {
        // Register this wernis movement
        sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_user_wernis` (`userid`, `wernis_account`, `wernis_amount`, `wernis_timestamp`, `wernis_type`, `wernis_api_message`, `wernis_api_status`) VALUES (%s, %s, %s, UNIX_TIMESTAMP(), '%s', '%s', '%s')",
                array(
@@ -355,8 +369,8 @@ function WERNIS_LOG_TRANSFER ($wdsId, $amount, $type = 'FAILED', $message = '',
                ), __FUNCTION__, __LINE__);
 }
 
-// Take fees and factor
-function WERNIS_TAKE_FEE ($points, $mode) {
+// Calulcate fees and factor
+function calculateWernisFee ($points, $mode) {
        // Payout or withdraw are allowed modes!
        //* DEBUG: */ debugOutput('mode=' . $mode . ',points=' . $points);
        if (!in_array($mode, array('payout', 'withdraw'))) {
@@ -389,7 +403,8 @@ function WERNIS_TAKE_FEE ($points, $mode) {
 }
 
 // Add withdraw fees and factor
-function WERNIS_ADD_WITHDRAW_FEE ($points) {
+// @TODO Unused?
+function calulcateWernisWithdrawFee ($points) {
        // Is there a percentage or fixed fee?
        if (getWernisWithdrawFeePercent() > 0) {
                // Percentage fee
@@ -403,6 +418,139 @@ function WERNIS_ADD_WITHDRAW_FEE ($points) {
        return $points;
 }
 
+// Displays registration form for WDS66 registration
+function doDisplayWernisUserRegistrationForm () {
+       // Is the form sent?
+       if (isFormSent('register')) {
+               // Is wernis_id set?
+               if (!isPostRequestElementSet('wernis_id')) {
+                       // Id not set
+                       displayMessage('{--GUEST_WERNIS_REGISTRATION_ID_NOT_SET--}');
+               } elseif (!isPostRequestElementSet('wernis_password')) {
+                       // Password not set
+                       displayMessage('{--GUEST_WERNIS_REGISTRATION_PASSWORD_NOT_SET--}');
+               } else {
+                       // So far, all fine, then let's do the call-back on auth.php ...
+                       $response = executeWernisAuth(postRequestElement('wernis_id'), postRequestElement('wernis_password'));
+
+                       // Was the status okay?
+                       if ((isset($response['status'])) && ($response['status'] == 'OK') && (!empty($response['response']))) {
+                               // All fine, then analyze response
+                               $args = convertApiResponseToArray($response['response'], '&', '=');
+
+                               // Is status set?
+                               assert(isset($args['auth_status']));
+
+                               // Add WDS66 userid
+                               $args['wernis_userid'] = postRequestElement('wernis_id');
+
+                               // "Detect" auth status
+                               $callbackFunction = 'doWernisAuth' . capitalizeUnderscoreString($args['auth_status']);
+
+                               // Is the call-back there?
+                               if (!is_callable($callbackFunction, FALSE, $callableName)) {
+                                       // Not there, could be bad. :(
+                                       reportBug(__FUNCTION__, __LINE__, 'Unsupported auth_status=' . $args['auth_status'] . ',args()=' . count($args) . ',callbackFunction=' . $callbackFunction . ' detected.');
+                               } // END - if
+
+                               // Then call it
+                               $status = call_user_func($callbackFunction, $args);
+                               die(__FUNCTION__ . ': status[' . gettype($status) . ']=' . $status);
+                       } else {
+                               // Something bad happened
+                               displayMessage($response['message']);
+                       }
+               }
+       } // END - if
+
+       // Is the form not sent? (E.g. missing form fields)
+       if ((isGetRequestElementSet('status')) && (isGetRequestElementSet('challenge')) && (isGetRequestElementSet('__challenge_response'))) {
+               // Redirect from modules.php?module=auth, so validate challenge response ...
+               // 1) Get first 24 characters = salt
+               $salt = substr(getRequestElement('__challenge_response'), 0, 24);
+
+               // 2) Generate hash again
+               $response = $salt . hashSha256($salt . getWernisApiMd5() . getRequestElement('challenge'));
+
+               // Is the response valid?
+               if ($response != getRequestElement('__challenge_response')) {
+                       // Not valid
+                       displayMessage('{--GUEST_WERNIS_REGISTRATION_INVALID_CHALLENGE_RESPONSE--}');
+                       return;
+               } // END - if
+
+               /*
+                * Now, that the challenge-response is the same, the challenge itself
+                * is also the same. So get.php can be called.
+                */
+               die('!ojk');
+       } elseif (!isFormSent('register')) {
+               // Form not send, so load form template
+               loadTemplate('guest_wernis_registration_form');
+       } // END - if
+}
+
+//-----------------------------------------------------------------------------
+//                      Auth status callback functions
+//-----------------------------------------------------------------------------
+
+// Handler for auth_status=PENDING
+function doWernisAuthPending ($args) {
+       // auth_key must be set
+       assert(isset($args['auth_key']));
+
+       // Generate a challenge that will be added to the URL
+       $challenge = hashSha256(generatePassword(128));
+
+       // Search entry in database by auth_key
+       if (countSumTotalData($args['auth_key'], 'wernis_regs', 'id', 'api_auth_key', TRUE) == 0) {
+               // "Register" this call
+               sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_wernis_regs` (
+       `wernis_userid`,
+       `api_auth_status`,
+       `api_auth_key`,
+       `api_redirect_challenge`
+) VALUES (
+       %s,
+       'PENDING',
+       '%s',
+       '%s'
+)",
+                       array(
+                               bigintval($args['wernis_userid']),
+                               $args['auth_key'],
+                               $challenge
+                       ), __FUNCTION__, __LINE__
+               );
+
+               // Should be inserted
+               assert(sqlAffectedRows() == 1);
+       } else {
+               // Update challenge
+               sqlQueryEscaped("UPDATE
+       `{?_MYSQL_PREFIX?}_wernis_regs`
+SET
+       `api_redirect_challenge`='%s'
+WHERE
+       `api_auth_key`='%s' AND
+       `wernis_userid`=%s
+       `api_auth_status`='PENDING'
+LIMIT 1",
+                       array(
+                               $challenge,
+                               $args['auth_key'],
+                               bigintval($args['wernis_userid'])
+                       ), __FUNCTION__, __LINE__
+               );
+
+               // Should always be updated
+               assert(sqlAffectedRows() == 1);
+       }
+
+       // Redirect to WDS66 module=auth ...
+       redirectToUrl(getWernisBaseUrl() . '/modules.php?module=auth&amp;auth_key=' . $args['auth_key'] . '&amp;params=' . urlencode(base64_encode('&module=' . getModule() . '&what=' . getWhat())) . '&amp;challenge=' . $challenge);
+}
+
 //-----------------------------------------------------------------------------
 //                             Wrapper functions
 //-----------------------------------------------------------------------------
@@ -611,5 +759,17 @@ function getWernisMinWithdraw () {
        return $GLOBALS[__FUNCTION__];
 }
 
+// Wrapper function for 'wernis_base_url'
+function getWernisBaseUrl () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Get config entry
+               $GLOBALS[__FUNCTION__] = getConfig('wernis_base_url');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
 // [EOF]
 ?>
index 7acf89891c3005189802e1f4a4ec270992c34425..a5fb7df05470ad43fe3c5983070aebacefd97659 100644 (file)
@@ -43,30 +43,40 @@ if ((!defined('__SECURITY')) || (!isAdmin())) {
 // Add description as navigation point
 addYouAreHereLink('admin', __FILE__);
 
+// Form sent?
 if (isFormSent('save_config')) {
-       // Hash the password and remove clear-text
-       setPostRequestElement('wernis_pass_md5', hashSha256(postRequestElement('wernis_pass')));
+       // Is wernis_pass set?
+       if (isPostRequestElementSet('wernis_pass')) {
+               // Hash the password and remove clear-text
+               setPostRequestElement('wernis_pass_md5', hashSha256(postRequestElement('wernis_pass')));
 
-       // First merge temporarily the new API data into the current config
-       mergeConfig(postRequestArray());
+               // First merge temporarily the new API data into the current config
+               mergeConfig(postRequestArray());
 
-       // Let's test the API first (hold your horses here, cowboy! Thank you. :) )
-       if (WERNIS_TEST_API()) {
-               // Revert german commata
-               foreach (array('payout_factor', 'withdraw_factor', 'payout_fee_percent', 'withdraw_fee_percent') as $revert) {
-                       setPostRequestElement('wernis_' . $revert, postRequestElement('wernis_' . $revert));
-               } // END - if
+               // Let's test the API first (hold your horses here, cowboy! Thank you. :) )
+               if (doAdminTestWernisApi()) {
+                       // Revert german commata
+                       foreach (array('payout_factor', 'withdraw_factor', 'payout_fee_percent', 'withdraw_fee_percent') as $revert) {
+                               setPostRequestElement('wernis_' . $revert, postRequestElement('wernis_' . $revert));
+                       } // END - if
 
+                       // Remove clear password
+                       unsetPostRequestElement('wernis_pass');
+
+                       // Save settings
+                       adminSaveSettingsFromPostData();
+               } else {
+                       // Failed to test the API!
+                       displayMessage(getWernisErrorMessage());
+               }
+       } else {
                // Remove clear password
                unsetPostRequestElement('wernis_pass');
 
-               // Save settings
+               // Save it, anyway
                adminSaveSettingsFromPostData();
-       } else {
-               // Failed to test the API!
-               displayMessage(GET_WERNIS_ERROR_MESSAGE());
        }
-}  else {
+} else {
        // Load template
        loadTemplate('admin_config_wernis');
 }
index b886468a0ec5fbc53ebd2493cfec4bae55cf0427..05532dd76d3ae53f73c0e5faa1315f1539b12196 100644 (file)
@@ -62,7 +62,7 @@ $rdf->set_max_item(10);
 $rdf->set_Options(
        array(
                'textinput' => 'hidden',
-               'sitelink'  => 'http://www.wds66.com',
+               'sitelink'  => getWernisBaseUrl(),
                'refid'     => getWernisRefid(),
                'reflink'   => '/ref.php?refid=',
        )
@@ -80,7 +80,7 @@ if (isProxyUsed()) {
        } // END  - if
 } // END - if
 
-$rdf->parse_RDF('http://www.wds66.com/rss.xml');
+$rdf->parse_RDF(getWernisBaseUrl() . '/rss.xml');
 
 // Load template
 loadTemplate('guest_wernis_news', FALSE, $rdf->finish(TRUE));
index b5d5e31cfdd861dd8b5788196d7130e0ba4cb566..f3b54ec8a246f21cd0101f9b00e2b146c6894080 100644 (file)
@@ -117,7 +117,7 @@ if ((!isGetRequestElementSet('do')) || (getRequestElement('do') == 'choose')) {
        $points = getTotalPoints(getMemberId()) - getPointsRegister();
 
        // Is there a percentage or fixed fee?
-       $points = WERNIS_TAKE_FEE($points, 'payout');
+       $points = calculateWernisFee($points, 'payout');
 
        // Is this enougth for a payout?
        if ($points < getConfig('wernis_min_payout')) {
@@ -172,7 +172,7 @@ if ((isFormSent()) && (isGetRequestElementSet('do'))) {
                                        displayMessage('{--MEMBER_WERNIS_WITHDRAW_AMOUNT_SMALLER_MIN--}');
                                } else {
                                        // All is fine here so do the withdraw
-                                       $success = WERNIS_EXECUTE_WITHDRAW(postRequestElement('wernis_userid'), hashSha256(postRequestElement('wds66_password')), postRequestElement('amount'));
+                                       $success = executeWernisWithdraw(postRequestElement('wernis_userid'), hashSha256(postRequestElement('wds66_password')), postRequestElement('amount'));
                                        if ($success === TRUE) {
                                                // Add it to this amount
                                                initReferralSystem();
@@ -185,9 +185,9 @@ if ((isFormSent()) && (isGetRequestElementSet('do'))) {
                                                // All done!
                                                displayMessage('{--MEMBER_WERNIS_WITHDRAW_DONE--}');
                                                return;
-                                       } elseif ((GET_WERNIS_ERROR_CODE() == 'user_failed') || (GET_WERNIS_ERROR_CODE() == 'own_failed') || (GET_WERNIS_ERROR_CODE() == 'amount_failed')) {
+                                       } elseif ((getWernisErrorCode() == 'user_failed') || (getWernisErrorCode() == 'own_failed') || (getWernisErrorCode() == 'amount_failed')) {
                                                // Wrong login data
-                                               displayMessage(GET_WERNIS_ERROR_MESSAGE());
+                                               displayMessage(getWernisErrorMessage());
                                        } else {
                                                // Something went wrong
                                                displayMessage('{--MEMBER_WERNIS_WITHDRAW_FAILED--}');
@@ -204,7 +204,7 @@ if ((isFormSent()) && (isGetRequestElementSet('do'))) {
                                        displayMessage(sprintf(getMessage('MEMBER_WERNIS_PAYOUT_POINTS_DEPLETED'), bigintval(postRequestElement('amount')), bigintval($points)));
                                } else {
                                        // All is fine here so do the withdraw
-                                       $success = WERNIS_EXECUTE_PAYOUT(postRequestElement('wernis_userid'), postRequestElement('amount'));
+                                       $success = executeWernisPayout(postRequestElement('wernis_userid'), postRequestElement('amount'));
                                        if ($success === TRUE) {
                                                // Sub points and ignore return status
                                                subtractPoints('wernis_payout', getMemberId(), postRequestElement('amount'));
@@ -216,9 +216,9 @@ if ((isFormSent()) && (isGetRequestElementSet('do'))) {
                                                // All done!
                                                displayMessage('{--MEMBER_WERNIS_PAYOUT_DONE--}');
                                                return;
-                                       } elseif ((GET_WERNIS_ERROR_CODE() == 'user_failed') || (GET_WERNIS_ERROR_CODE() == 'own_failed') || (GET_WERNIS_ERROR_CODE() == 'amount_failed') || (GET_WERNIS_ERROR_CODE() == 'api_amount_failed')) {
+                                       } elseif ((getWernisErrorCode() == 'user_failed') || (getWernisErrorCode() == 'own_failed') || (getWernisErrorCode() == 'amount_failed') || (getWernisErrorCode() == 'api_amount_failed')) {
                                                // Wrong login data
-                                               displayMessage(GET_WERNIS_ERROR_MESSAGE());
+                                               displayMessage(getWernisErrorMessage());
                                        } else {
                                                // Something went wrong
                                                displayMessage('{--MEMBER_WERNIS_PAYOUT_FAILED--}');
index 135f3d3dc45e79ed04ef8b9dc863c9536b0b0890..e20a4abd2139350827cf4f5e69ec2794cb233cc5 100644 (file)
@@ -3556,5 +3556,27 @@ function ifSubjectHasReferralSuffix ($subject) {
        return $GLOBALS[__FUNCTION__][$subject];
 }
 
+// Converts an API response to an associative array
+function convertApiResponseToArray ($responseString, $keyDelimiter, $valueDelimiter) {
+       // Explode for key delimiter
+       $keys = explode($keyDelimiter, $responseString);
+
+       // Init returned array and "walk" through all entries
+       $returned = array();
+       foreach ($keys as $keyValue) {
+               // Explode it
+               $parts = explode($valueDelimiter, $keyValue);
+
+               // Count must be 2
+               assert(count($parts) == 2);
+
+               // Then add both: 0=key, 1=value
+               $returned[sqlEscapeString($parts[0])] = sqlEscapeString($parts[1]);
+       } // END - if
+
+       // Return finished array
+       return $returned;
+}
+
 // [EOF]
 ?>
index 4590b606183b6b3f00b39a6309ad4f62d83d89b9..c03b6a841a57c084dbc82ca66aaf36f3cfca607c 100644 (file)
                        <input type="text" class="form_field" name="wernis_api_url" value="{?wernis_api_url?}" size="25" maxlength="255" />
                </td>
        </tr>
+       <tr>
+               <td align="right">
+                       {--ADMIN_CONFIG_WERNIS_BASE_URL--}
+               </td>
+               <td>
+                       <input type="text" class="form_field" name="wernis_base_url" value="{?wernis_base_url?}" size="25" maxlength="255" />
+               </td>
+       </tr>
        <tr>
                <td align="right">
                        {--ADMIN_CONFIG_WERNIS_REFID--}
index 4f1407d618acce444dac0a35443739af016011cb..0238402eb1a31ff5ec697796964bbb673a8058ae 100644 (file)
@@ -1,28 +1,31 @@
 <div align="center">
 {%form,formMethodPost=modules.php?module=index&amp;what=confirm%}
 <table border="0" cellspacing="0" cellpadding="0" class="table dashed">
-       <tr>
-               <td align="center" colspan="2" class="table_header bottom">
-                       <strong>{--GUEST_REQUEST_CONFIRM_LINK_TITLE--}</strong>
-               </td>
-       </tr>
-       <tr>
-               <td align="center" colspan="2">
-                       {--GUEST_CONFIRM_LINK_NOTICE--}
-               </td>
-       </tr>
-       <tr>
-               <td class="bottom" align="right">{--GUEST_ENTER_EMAIL--}:</td>
-               <td class="bottom">
-                       <input type="text" class="form_field" name="email" size="30" maxlength="255" />
-               </td>
-       </tr>
-       <tr>
-               <td align="center" colspan="2" class="table_footer">
-                       <input type="reset" class="form_reset" value="{--CLEAR_FORM--}" />
-                       <input type="submit" class="form_submit" name="ok" value="{--GUEST_REQUEST_CONFIRM_LINK--}" />
-               </td>
-       </tr>
+<tr>
+       <td align="center" colspan="2" class="table_header bottom">
+               <strong>{--GUEST_REQUEST_CONFIRM_LINK_TITLE--}</strong>
+       </td>
+</tr>
+
+<tr>
+       <td align="center" colspan="2">
+               {--GUEST_CONFIRM_LINK_NOTICE--}
+       </td>
+</tr>
+
+<tr>
+       <td class="bottom" align="right">{--GUEST_ENTER_EMAIL--}:</td>
+       <td class="bottom">
+               <input type="text" class="form_field" name="email" size="30" maxlength="255" />
+       </td>
+</tr>
+
+<tr>
+       <td align="center" colspan="2" class="table_footer">
+               <input type="reset" class="form_reset" value="{--CLEAR_FORM--}" />
+               <input type="submit" class="form_submit" name="ok" value="{--GUEST_REQUEST_CONFIRM_LINK--}" />
+       </td>
+</tr>
 </table>
 {%form_close%}
 </div>
index 5b00eca0119804b7f58be31afcf4277178673088..64ce2dd561300882b37975409d91d425e3fb6fa8 100644 (file)
@@ -1,11 +1,13 @@
 <div align="center">
-<table border="0" cellspacing="0" cellpadding="0" class="table dashed" width="310">
+<table border="0" cellspacing="0" cellpadding="0" class="table dashed">
 <tr>
        <td align="center" class="table_header bottom" colspan="2">
                <strong>{--GUEST_TOPTEN_STATS--}</strong>
        </td>
 </tr>
+
 $content[rows]
+
 <tr>
        <td align="center" class="table_footer" colspan="2">
                <a href="{%url=modules.php?module=index&amp;what=stats&amp;do=$content[lmode]%}">$content[ltitle]</a>
index 8cad95a800cc511a4393aaf2f48f79e4f2625551..f71d4e2728879d8e10acc480a5cad93a50b7869f 100644 (file)
@@ -1,6 +1,5 @@
 <div align="center">
-<table border="0" cellspacing="0" cellpadding="0" width="90%"
-       class="table dashed">
+<table border="0" cellspacing="0" cellpadding="0" width="90%" class="table dashed">
        <tr>
                <td colspan="5" class="table_header bottom">
                        <strong>{--GUEST_TOP10_LOGINS_TITLE--}</strong>
diff --git a/templates/de/html/guest/guest_wernis_registration_form.tpl b/templates/de/html/guest/guest_wernis_registration_form.tpl
new file mode 100644 (file)
index 0000000..74d606a
--- /dev/null
@@ -0,0 +1,45 @@
+<div class="para">
+<div align="center">
+       {%form,formMethodPost=modules.php?module=index&amp;what=register&amp;provider=wernis%}
+       <div class="table dashed">
+               <div class="table_header bottom">
+                       {--GUEST_WERNIS_REGISTRATION_TITLE--}
+               </div>
+
+               <fieldset id="wernis_registration_fields">
+                       <legend>{--GUEST_WERNIS_REGISTRATION_LEGEND--}</legend>
+
+                       <div class="guest_input" align="left">
+                               <label for="wernis_id">{--GUEST_ENTER_WERNIS_ID--}</label>
+                               <input type="text" class="form_field" id="base_path" name="wernis_id" size="10" maxlength="20" />
+                       </div>
+
+                       <div class="clear"></div>
+
+                       <div class="guest_input" align="left">
+                               <label for="wernis_password">{--GUEST_ENTER_WERNIS_PASSWORD--}</label>
+                               <input type="password" class="form_field" id="base_path" name="wernis_password" size="10" maxlength="255" />
+                       </div>
+
+                       <div class="clear"></div>
+               </fieldset>
+
+               <div class="table_footer top">
+                       <input type="reset" class="form_reset" value="{--CLEAR_FORM--}" />
+                       <input type="submit" class="form_submit" name="register" value="{--GUEST_WERNIS_REGISTRATION_SUBMIT--}" />
+               </div>
+       </div>
+       {%form_close%}
+
+       <div class="notice">
+               {--GUEST_WERNIS_REGISTRATION_NOTICE--}
+       </div>
+</div>
+</div>
+
+<div class="para" align="left">
+       <ul>
+               <li>{--GUEST_WERNIS_SIGNUP_NOTICE--}</li>
+               <li>{--GUEST_WERNIS_RESTORE_PASSWORD_NOTICE--}</li>
+       </ul>
+</div>