} // 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)
// 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.");
// 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;
// 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
// 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
// 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
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");
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");
$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 />");
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
$mail->Username = getConfig('SMTP_USER');
$mail->Password = getConfig('SMTP_PASSWORD');
if (empty($headers)) {
- $mail->From = getConfig('WEBMASTER');
+ $mail->From = getWebmaster();
} else {
$mail->From = $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?
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&register=done');
$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
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
} // 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);
if (isFormSent()) {
// Set messages to zero
- $loginMessage = ''; $passwdMessage = '';
+ $loginMessage = '';
+ $passwdMessage = '';
// No login entered?
if (!isPostRequestParameterSet('login')) $loginMessage = '{--ADMIN_NO_LOGIN--}';
// 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
$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
<strong>{--CREATE_FIRST_ADMIN_ACCOUNT--}</strong>
</td>
</tr>
+ $content[error_message]
<tr>
<td align="right">{--ADMIN_ACCOUNT_FIRST_CREATION_LOGIN--}:</td>
<td>