]> git.mxchange.org Git - mailer.git/commitdiff
Even more fixes for broken first installation attempt (sorry all)
authorRoland Häder <roland@mxchange.org>
Sat, 29 Jan 2011 04:32:55 +0000 (04:32 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 29 Jan 2011 04:32:55 +0000 (04:32 +0000)
inc/extensions/ext-bonus.php
inc/extensions/ext-nickname.php
inc/extensions/ext-register.php
inc/extensions/ext-task.php
inc/extensions/ext-user.php
inc/functions.php
inc/modules/admin.php
inc/monthly/monthly_beg.php
inc/wrapper-functions.php
templates/de/html/admin/admin_reg_form.tpl

index c588e54c9e5bb00a5c4b9917f206b9ac3440f87a..cf900d1c474740d801bdc16f0953909dcc0e8567 100644 (file)
@@ -41,10 +41,10 @@ if (!defined('__SECURITY')) {
 } // END - if
 
 // Version of this extension
-setThisExtensionVersion('0.9.3');
+setThisExtensionVersion('0.9.4');
 
 // Version history array (add more with , '0.1.0' and so on)
-setExtensionVersionHistory(array('0.0', '0.1.6', '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'));
+setExtensionVersionHistory(array('0.0', '0.1.6', '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'));
 
 switch (getExtensionMode()) {
        case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
@@ -136,7 +136,6 @@ PRIMARY KEY  (`id`)
                                // Use actual month for this update
                                addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `login_bonus` FLOAT(20,3) NOT NULL DEFAULT 0.000");
                                addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `turbo_bonus` FLOAT(20,3) NOT NULL DEFAULT 0.000");
-                               addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET `ext_has_css`='Y' WHERE `ext_name`='bonus' AND `ext_has_css`='N' LIMIT 1");
 
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Login-Bonus und Turbo-Klick-Bonus intergriert.");
@@ -592,6 +591,14 @@ ORDER BY
                                // Update notes
                                setExtensionUpdateNotes("Typos gefixt.");
                                break;
+
+                       case '0.9.4': // SQL queries for v0.9.4
+                               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_links` CHANGE `bonus_id` `bonus_id` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL");
+                               addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_user_links` SET `bonus_id`=NULL WHERE `bonus_id`=0");
+
+                               // Update notes
+                               setExtensionUpdateNotes("Konfliktierende SQL-Befehle aus ext-user verschoben.");
+                               break;
                } // END - switch
                break;
 
index 52aa5e12d29279639582353730452d637e1bdd4e..fc4c8fac9e884c65e1dd4c95a842e478abac64b4 100644 (file)
@@ -77,10 +77,8 @@ switch (getExtensionMode()) {
                                // This update depends on sql_patches update!
                                addExtensionDependency('sql_patches');
 
-                               addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET `ext_has_css`='Y' WHERE `ext_name`='nickname' AND `ext_has_css`='N' LIMIT 1");
-
                                // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("CSS-Datei kann per Adminbereich ein- und ausgeschaltet werden.");
+                               setExtensionUpdateNotes("Veraltetes Update entfernt.");
                                break;
 
                        case '0.0.3': // SQL queries for v0.0.3
index 3d6815ece544cf0a3d5e54fc2120d461cd0b0571..3369e4f220c613d66fd58928f02d3900ffa79142 100644 (file)
@@ -101,10 +101,8 @@ PRIMARY KEY (`id`)
                                // This update depends on sql_patches update!
                                addExtensionDependency('sql_patches');
 
-                               addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET `ext_has_css`='Y' WHERE `ext_name`='register' AND `ext_has_css`='N' LIMIT 1");
-
                                // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("CSS-Datei kann per Admin-Bereich ein- und ausgeschaltet werden.");
+                               setExtensionUpdateNotes("Veraltetes Update entfernt.");
                                break;
 
                        case '0.1.3': // SQL queries for v0.1.3
index f89b57d379c25068d2cdfc9f0b0105e3be6ce08c..97ba04d72a958eaf62062cfbe496f1bc09a7c301 100644 (file)
@@ -78,10 +78,8 @@ switch (getExtensionMode()) {
                                // This update depends on sql_patches update!
                                addExtensionDependency('sql_patches');
 
-                               addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET `ext_has_css`='Y' WHERE `ext_name`='task' AND `ext_has_css`='N' LIMIT 1");
-
                                // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("CSS-Datei kann per Admin-Bereich ein- und ausgeschaltet werden.");
+                               setExtensionUpdateNotes("Veraltetes Update entfernt.");
                                break;
 
                        case '0.0.1': // SQL queries for v0.0.1
index 819fddcbee60447a3d56add3dcee60c1c154e340..e20c788f8d756e511481d2a555379d87406bce84 100644 (file)
@@ -382,7 +382,6 @@ PRIMARY KEY (`id`)
                                addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_del` CHANGE `userid` `userid` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL");
                                addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_links` CHANGE `stats_id` `stats_id` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL");
                                addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_links` CHANGE `userid` `userid` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL");
-                               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_links` CHANGE `bonus_id` `bonus_id` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL");
                                addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_points` CHANGE `userid` `userid` BIGINT( 22 ) UNSIGNED NULL DEFAULT NULL");
                                addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_points` CHANGE `ref_depth` `ref_depth` TINYINT( 3 ) UNSIGNED NULL DEFAULT NULL");
                                addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_refs` CHANGE `userid` `userid` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL");
@@ -398,7 +397,6 @@ PRIMARY KEY (`id`)
                                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_cats` WHERE `userid` IS NULL OR `cat_id` IS NULL");
                                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_del` WHERE `userid` IS NULL");
                                addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_user_links` SET `stats_id`=NULL WHERE `stats_id`=0");
-                               addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_user_links` SET `bonus_id`=NULL WHERE `bonus_id`=0");
                                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `userid` IS NULL");
                                addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_user_points` SET `ref_depth`=NULL WHERE `ref_depth`=0");
                                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_points` WHERE `userid` IS NULL");
index f4c11ee73f7b3bc559a875973ec415f12911a926..aeb0ac419f36d907c3eeaeaf1fb390ea38faa3b8 100644 (file)
@@ -118,12 +118,12 @@ function sendEmail ($toEmail, $subject, $message, $isHtml = 'N', $mailHeader = '
                                $toEmail = getUserData('email');
                        } else {
                                // Set webmaster
-                               $toEmail = getConfig('WEBMASTER');
+                               $toEmail = getWebmaster();
                        }
                }
        } elseif ($toEmail == '0') {
                // Is the webmaster!
-               $toEmail = getConfig('WEBMASTER');
+               $toEmail = getWebmaster();
        }
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "TO={$toEmail}<br />");
 
@@ -170,7 +170,7 @@ Message : ' . htmlentities(utf8_decode($message)) . '
                return sendRawEmail($toEmail, $subject, $message, $mailHeader);
        } elseif ($isHtml != 'Y') {
                // Problem detected while sending a mail, forward it to admin
-               return sendRawEmail(getConfig('WEBMASTER'), '[PROBLEM:]' . $subject, $message, $mailHeader);
+               return sendRawEmail(getWebmaster(), '[PROBLEM:]' . $subject, $message, $mailHeader);
        }
 
        // Why did we end up here? This should not happen
@@ -219,7 +219,7 @@ function sendRawEmail ($toEmail, $subject, $message, $headers) {
                $mail->Username   = getConfig('SMTP_USER');
                $mail->Password   = getConfig('SMTP_PASSWORD');
                if (empty($headers)) {
-                       $mail->From = getConfig('WEBMASTER');
+                       $mail->From = getWebmaster();
                } else {
                        $mail->From = $headers;
                }
@@ -235,10 +235,10 @@ function sendRawEmail ($toEmail, $subject, $message, $headers) {
                }
 
                $mail->AddAddress($toEmail, '');
-               $mail->AddReplyTo(getConfig('WEBMASTER'), getMainTitle());
-               $mail->AddCustomHeader('Errors-To:' . getConfig('WEBMASTER'));
-               $mail->AddCustomHeader('X-Loop:' . getConfig('WEBMASTER'));
-               $mail->AddCustomHeader('Bounces-To:' . getConfig('WEBMASTER'));
+               $mail->AddReplyTo(getWebmaster(), getMainTitle());
+               $mail->AddCustomHeader('Errors-To:' . getWebmaster());
+               $mail->AddCustomHeader('X-Loop:' . getWebmaster());
+               $mail->AddCustomHeader('Bounces-To:' . getWebmaster());
                $mail->Send();
 
                // Has an error occured?
index 13f64f1146c8cbad1b3e97e067f7adef79d546d1..65ee5460d68b550055d6117e7d4fa35b65eb0255 100644 (file)
@@ -67,12 +67,15 @@ if (!isAdminRegistered()) {
                destroyAdminSession(false);
 
                // Do registration
-               $ret = addAdminAccount(postRequestParameter('login'), $hashedPass, getConfig('WEBMASTER'));
+               $ret = addAdminAccount(postRequestParameter('login'), $hashedPass, getWebmaster());
 
                // Check if registration wents fine
                switch ($ret) {
                        case 'done':
+                               // Change ADMIN_REGISTERED entry
                                $done = changeDataInInclude(getCachePath() . 'config-local.php', 'ADMIN-SETUP', "setConfigEntry('ADMIN_REGISTERED', '", "');", 'Y', 0);
+
+                               // Was it successfull?
                                if ($done === true) {
                                        // Registering is done
                                        redirectToUrl('modules.php?module=admin&amp;register=done');
@@ -155,6 +158,7 @@ if (!isAdminRegistered()) {
                        $content['login_message'] = loadTemplate('admin_login_msg', true, $loginMessage);
                        $content['pass1_message'] = loadTemplate('admin_login_msg', true, $pass1Message);
                        $content['pass2_message'] = loadTemplate('admin_login_msg', true, $pass2Message);
+                       $content['error_message'] = loadTemplate('admin_login_msg', true, $errorMessage);
                } // END - if
 
                // Output message in seperate template
@@ -211,7 +215,10 @@ if (!isAdminRegistered()) {
 
        if (isGetRequestParameterSet('register')) {
                // Registration of first admin is done
-               if (getRequestParameter('register') == 'done') loadTemplate('admin_settings_saved', false, '{--ADMIN_REGISTER_DONE--}');
+               if (getRequestParameter('register') == 'done') {
+                       // Regisration done!
+                       loadTemplate('admin_settings_saved', false, '{--ADMIN_REGISTER_DONE--}');
+               } // END - if
        } // END - if
 
        // Check if the admin has submitted data or not
@@ -235,13 +242,17 @@ if (!isAdminRegistered()) {
                                } // END - if
 
                                // Add data to URL
-                               if (isWhatSet())        $url .= 'what='.getWhat();
-                                elseif (isActionSet()) $url .= 'action='.getAction();
-                                elseif (isGetRequestParameterSet('area'))  $url .= 'area='.getRequestParameter('area');
+                               if (isWhatSet()) {
+                                       $url .= 'what=' . getWhat();
+                               } elseif (isActionSet()) {
+                                       $url .= 'action=' . getAction();
+                               } elseif (isGetRequestParameterSet('area')) {
+                                       $url .= 'area=' . getRequestParameter('area');
+                               }
 
-                        // Load URL
-                        redirectToUrl($url);
-                        break;
+                               // Load URL
+                               redirectToUrl($url);
+                               break;
 
                        case '404': // Administrator login not found
                                setPostRequestParameter('ok', $ret);
@@ -274,7 +285,8 @@ if (!isAdminRegistered()) {
 
                if (isFormSent()) {
                        // Set messages to zero
-                       $loginMessage = ''; $passwdMessage = '';
+                       $loginMessage = '';
+                       $passwdMessage = '';
 
                        // No login entered?
                        if (!isPostRequestParameterSet('login')) $loginMessage = '{--ADMIN_NO_LOGIN--}';
index 2826065fbec20b050a5ce704c0dc5766b613a090..43f6a24111ab09193fc828cb510fec6531fdd5d2 100644 (file)
@@ -63,7 +63,7 @@ if ((getBegRanks() > 0) && (!isCssOutputMode())) {
        // Let's check if there are some points left we can pay...
        if (isExtensionActive('autopurge')) {
                // Use last online stamp only when autopurge for inactive members is activated
-               if ((getApInactiveSince() > 0) && (isBegActiveEnabled()) {
+               if ((getApInactiveSince() > 0) && (isBegActiveEnabled())) {
                        // Okay, include last online timestamp
                        $whereStatement1 .= " AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})";
                } // END - if
index 7df4d8f710d4d926766c406e03c405a52eade6e3..7f85fb8c35255dcac8306eb7e8a43f64c9382d70 100644 (file)
@@ -2222,7 +2222,7 @@ function changeDataInInclude ($FQFN, $comment, $prefix, $suffix, $DATA, $seek=0)
        $FQFN = getPath() . $FQFN;
 
        // Call inner function
-       changeDataInFile($FQFN, $comment, $prefix, $suffix, $DATA, $seek);
+       return changeDataInFile($FQFN, $comment, $prefix, $suffix, $DATA, $seek);
 }
 
 // Shortens ucfirst(strtolower()) calls
index ac9e2b78e288dedcd493fc2aa3082588f056002f..53b37c4f6239da554c5690c5419a593f8912ee51 100644 (file)
@@ -6,6 +6,7 @@
                        <strong>{--CREATE_FIRST_ADMIN_ACCOUNT--}</strong>
                </td>
        </tr>
+       $content[error_message]
        <tr>
                <td align="right">{--ADMIN_ACCOUNT_FIRST_CREATION_LOGIN--}:</td>
                <td>