templates/de/html/surfbar/surfbar_frame_textlinks.tpl -text
templates/de/html/surfbar/surfbar_frame_top.tpl -text
templates/de/html/surfbar/surfbar_frameset.tpl -text
+templates/de/html/surfbar/surfbar_login_form.tpl -text
templates/de/html/surfbar/surfbar_start_banner.tpl -text
templates/de/html/surfbar/surfbar_stopped.tpl -text
templates/de/html/task/.htaccess -text
// Really all done here... ;-)
shutdown();
-//
+// [EOF]
?>
// Really all done here... ;-)
shutdown();
-//
+// [EOF]
?>
// Load footer
loadIncludeOnce('inc/footer.php');
-//
+// [EOF]
?>
// Really all done here... ;-)
shutdown();
-//
+// [EOF]
?>
require($INC);
}
-// Merges $GLOBALS['config'] with data in given array
-function mergeConfig ($newConfig) {
- $GLOBALS['config'] = merge_array(getConfigArray(), $newConfig);
+// Init the config array
+function initConfig () {
+ // Init not if already found
+ if ((isset($GLOBALS['config'])) && (count($GLOBALS['config']) >= 3)) {
+ // Already initialized
+ trigger_error(sprintf("[%s:%s] Configuration is already initialized.", __FUNCTION__, __LINE__));
+ } // END - if
+
+ // Set a minimum dummy configuration
+ $GLOBALS['config'] = array(
+ 'code_length' => 0,
+ 'patch_level' => 0,
+ 'last_update' => time(),
+ 'DEBUG_MODE' => 'N',
+ 'sql_count' => 0,
+ 'num_templates' => 0,
+ 'default_theme' => 'default',
+ );
}
// Getter for $GLOBALS['config'] entries
$value = null;
// Is the entry there?
- if (isConfigEntrySet($configEntry)) {
- // Then use it
- $value = $GLOBALS['config'][$configEntry];
+ if (!isConfigEntrySet($configEntry)) {
+ // Raise an error of missing entries
+ trigger_error(sprintf("[%s:%s] Configuration entry <em>%s</em> is missing.", __FUNCTION__, __LINE__, $configEntry));
} // END - if
// Return it
- return $value;
+ return $GLOBALS['config'][$configEntry];
}
// Setter for $GLOBALS['config'] entries
return (isset($GLOBALS['config'][$configEntry]));
}
+// Merges $GLOBALS['config'] with data in given array
+function mergeConfig ($newConfig) {
+ $GLOBALS['config'] = merge_array(getConfigArray(), $newConfig);
+}
+
// Increment or init with given value or 1 as default the given config entry
function incrementConfigEntry ($configEntry, $value=1) {
// Increment it if set or init it with 1
return ((isset($GLOBALS['config'])) && (is_array($GLOBALS['config'])) && (count($GLOBALS['config']) > 0));
}
-// Init the config array
-function initConfig () {
- // Set a minimum dummy configuration
- $GLOBALS['config'] = array(
- 'code_length' => 0,
- 'patch_level' => 0,
- 'last_update' => time()
- );
-}
-
// Load configuration and return it as an arry
function loadConfiguration ($no = '0') {
// Check for cache extension, cache-array and if the requested configuration is in cache
// One day
setConfigEntry('one_day', (60*60*24));
-//
// Timestamp for yesterday, today ... all at 00:00 am
setConfigEntry('START_YDAY', makeTime(0, 0, 0, time() - getConfig('one_day')));
setConfigEntry('START_TDAY', makeTime(0, 0, 0, time()));
loadIncludeOnce($funcsInclude);
} elseif ((isDebugModeEnabled()) && ($ext_name != 'sql_patches') && (substr($ext_name, 0, 10) != 'admintheme')) {
// No functions file is not so good...
- DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("WARNING: Extension %s has no own functions file or we cannot read from it.",
+ DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("NOTICE: Extension %s has no own functions file or we cannot read from it.",
$ext_name
));
} // END - if
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_low_interval` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".getConfig('one_day')."");
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_migrate_order` ENUM('Y','N') NOT NULL DEFAULT 'Y'");
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_notification_mode` ENUM('INSTANT','RESET') NOT NULL DEFAULT 'INSTANT'");
+ ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_guest_login_form` ENUM('Y','N') NOT NULL DEFAULT 'Y'");
// Extend user data
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD `surfbar_low_notified` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00'");
if (!empty($message)) {
// Use and log it
$debug = sprintf("Note: %s<br />\n",
- $message
+ $message
);
// @TODO Add a little more infos here
$errline
);
- // Write debug log message
- DEBUG_LOG($errfile, $errline, $message, true);
-
// Output message to user and die
- if (EXT_IS_ACTIVE('debug')) {
- // Debug extension found! So Output a small message
- app_die($errfile, $errline, "Error message written to debug.log. Please try to call <a href=\"{!URL!}\">the main page</a> to continue.");
- } elseif ($GLOBALS['error_handler']['exit_on_error'] === true) {
- // No debug extension found, so regular output
- debug_report_bug($message);
- }
+ debug_report_bug($message);
}
// Init error handler
loadIncludeOnce($languageInclude);
} elseif ((isDebugModeEnabled()) && ($ext_name != 'sql_patches') && (substr($ext_name, 0, 10) != 'admintheme')) {
// No language file is not so good...
- DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("WARNING: Extension %s has no language file or we cannot read from it. lang=%s",
+ DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("NOTICE: Extension %s has no language file or we cannot read from it. lang=%s",
$ext_name, getLanguage()
));
}
define('ADMIN_CONFIG_SURFBAR_NOTIFICATION_MODE', "Benachrichtigungen sofort oder beim täglichen Reset aussenden? ("Sofort" kann zu Verzögerungen und/oder Belastung des Servers führen!");
define('ADMIN_CONFIG_SURFBAR_NOTIFICATION_MODE_INSTANT', "Sofort aussenden");
define('ADMIN_CONFIG_SURFBAR_NOTIFICATION_MODE_RESET', "Beim täglichen Reset");
+define('ADMIN_CONFIG_SURFBAR_GUEST_LOGIN_FORM', "Soll bei Aufruf der Surfbar durch einen Gast ein Loginformular angezeigt oder zur Startseite weitergeleitet werden?");
+define('ADMIN_CONFIG_SURFBAR_GUEST_LOGIN_FORM_Y', "Loginformular angzeigen.");
+define('ADMIN_CONFIG_SURFBAR_GUEST_LOGIN_FORM_N', "Zur Startseite weiterleiten.");
// Admin non-config titles
define('ADMIN_SURFBAR_STATS_TITLE', "Mitglieder-Statistik der Surfbar");
define('ADMIN_SURFBAR_NOTIFY_SUBJECT_404', "Admin-Betreffzeile %s nicht gefunden.");
define('MEMBER_SURFBAR_NOTIFY_SUBJECT_404', "Mitglieder-Betreffzeile %s nicht gefunden.");
+// Guest texts
+define('GUEST_SURFBAR_LOGIN_HEADER', "Login zur Surfbar:");
//
?>
// Determine depleted user account
$UIDs = SURFBAR_DETERMINE_DEPLETED_USERIDS();
+ // If we dont get any user ids back, there are no URLs
+ if (count($UIDs['uid']) == 0) {
+ // No user ids found, no URLs!
+ return 0;
+ } // END - if
+
// Is the exlude userid set?
if ($excludeUserId > 0) {
// Then add it
} // END - if
// Get amount from database
- $result = SQL_QUERY_ESC("SELECT COUNT(id) AS cnt
+ $result = SQL_QUERY_ESC("SELECT COUNT(`id`) AS cnt
FROM `{!_MYSQL_PREFIX!}_surfbar_urls`
-WHERE userid NOT IN (".implode(',', $UIDs['uid']).") AND `status`='%s'",
- array($status), __FUNCTION__, __LINE__
+WHERE `userid` NOT IN (".implode(', ', $UIDs['uid']).") AND `status`='%s'",
+ array($status), __FUNCTION__, __LINE__
);
// Fetch row
}
// Do the user login
-function USER_DO_LOGIN ($uid, $passwd) {
+function USER_DO_LOGIN ($uid, $passwd, $successUrl = '') {
// Init variables
- $dmy = '';
+ $dmy = ''; $add = '';
// Add last_login if available
$lastOnline = '';
if (GET_EXT_VERSION('sql_patches') >= '0.2.8') {
- $lastOnline = ', last_login';
+ $lastOnline = ', `last_login`';
} // END - if
// Init array
SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `total_logins`=`total_logins`+1" . $add . " WHERE `userid`=%s LIMIT 1",
array($uid), __FUNCTION__, __LINE__);
if (SQL_AFFECTEDROWS() == 1) {
- // Procedure to checking for login data
- if (($GLOBALS['bonus_payed']) && (EXT_IS_ACTIVE('bonus'))) {
- // Bonus added (just displaying!)
- $URL = 'modules.php?module=chk_login&mode=bonus';
+ // Is a success URL set?
+ if (empty($successUrl)) {
+ // Procedure to checking for login data
+ if (($GLOBALS['bonus_payed']) && (EXT_IS_ACTIVE('bonus'))) {
+ // Bonus added (just displaying!)
+ $URL = 'modules.php?module=chk_login&mode=bonus';
+ } else {
+ // Bonus not added
+ $URL = 'modules.php?module=chk_login&mode=login';
+ }
} else {
- // Bonus not added
- $URL = 'modules.php?module=chk_login&mode=login';
+ // Use this URL
+ $URL = $successUrl;
}
} else {
// Cannot update counter!
define('__CONFIG_SURFBAR_MIGRATE_ORDER_N', ' checked="checked"');
}
+ // Prepare order migration
+ if (getConfig('surfbar_guest_login_form') == 'Y') {
+ // Yes selected
+ define('__CONFIG_SURFBAR_GUEST_LOGIN_FORM_Y', ' checked="checked"');
+ define('__CONFIG_SURFBAR_GUEST_LOGIN_FORM_N', '');
+ } else {
+ // No selected
+ define('__CONFIG_SURFBAR_GUEST_LOGIN_FORM_Y', '');
+ define('__CONFIG_SURFBAR_GUEST_LOGIN_FORM_N', ' checked="checked"');
+ }
+
// Pause URL mode
if (getConfig('surfbar_pause_mode') == 'INTERNAL') {
// Internal pause page
require('inc/wrapper-functions.php');
// Load more function libraries or includes
-foreach (array('request-functions', 'session-functions', 'config-functions', 'code-functions', 'inc-functions', 'language-functions', 'filters', 'mysql-manager', 'extensions', 'db/lib', 'handler', 'hooks') as $lib) {
+foreach (array('request-functions', 'session-functions', 'config-functions', 'code-functions', 'inc-functions', 'language-functions', 'filters', 'mysql-manager', 'extensions', 'handler', 'hooks') as $lib) {
// Load special functions
loadIncludeOnce('inc/' . $lib . '.php');
} // END - foreach
+// Initialize the configuration
+initConfig();
+
// Set error handler
set_error_handler('__errorHandler');
// Load configuration file(s) here
loadIncludeOnce('inc/load_config.php');
+ // Load database layer here
+ loadIncludeOnce('inc/db/lib.php');
+
// Check for write-permission for config.php and inc directory
if (!isModuleSet()) setModule(REQUEST_GET('module'));
if (!isModuleSet()) setModule('index');
return (
(
// New config file found and loaded
- getConfig('MXCHANGE_INSTALLED') == 'Y'
+ isIncludeReadable('inc/cache/config-local.php')
) || (
- // Fall-back!
- isIncludeReadable('inc/config.php')
+ // Fall-back to config
+ getConfig('MXCHANGE_INSTALLED') == 'Y'
) || (
(
// New config file found, but not yet read
// Footer
loadIncludeOnce('inc/footer.php');
-//
+// [EOF]
?>
// Shutdown
shutdown();
-//
+// [EOF]
?>
$isModuleValid = false; $check = 'failed';
// Is the maintenance mode active or goes all well?
-if ((getConfig('maintenance') == 'Y') && (!IS_ADMIN()) && (getModule() != 'admin')) {
+if ((EXT_IS_ACTIVE('maintenance')) && (getConfig('maintenance') == 'Y') && (!IS_ADMIN()) && (getModule() != 'admin')) {
// Maintain mode is active and you are no admin
addFatalMessage(__FILE__, __LINE__, getMessage('LANG_DOWN_MAINTAINCE'));
} elseif ((SQL_IS_LINK_UP()) && (getTotalFatalErrors() == 0)) {
// No member?
if (!IS_MEMBER()) {
- // Redirect
- // @TODO Display quick login form here or redirect as configured
- redirectToUrl('modules.php?module=index');
+ // Should we display login window or redirect to main page?
+ if ((getConfig('surfbar_guest_login_form') == 'Y') && (EXT_IS_ACTIVE('user'))) {
+ // Is the form sent?
+ if ((isFormSent()) && (REQUEST_ISSET_POST('id')) && (REQUEST_ISSET_POST('password'))) {
+ // Do the login procedure
+ $URL = USER_DO_LOGIN(REQUEST_POST('id'), REQUEST_POST('password'), basename(__FILE__));
+
+ // And redirect to the URL
+ redirectToUrl($URL);
+ } else {
+ // Load header
+ loadIncludeOnce('inc/header.php');
+
+ // Display login form
+ LOAD_TEMPLATE('surfbar_login_form');
+
+ // Allow footer here
+ $GLOBALS['header_sent'] = 2;
+
+ // Load footer
+ loadIncludeOnce('inc/footer.php');
+ }
+ } else {
+ // Redirect
+ redirectToUrl('index.php');
+ }
} // END - if
// Initialize the surfbar
</tr>
<tr><td height="3" colspan="2" class="seperator"> </td></tr>
<tr>
- <td width="65%" height="30" align="right" style="padding-right:5px">
+ <td width="60%" height="30" align="right" style="padding-right:5px">
{--ADMIN_CONFIG_SURFBAR_STATIC_REWARD--}
</td>
- <td width="35%">
+ <td width="40%">
<input type="text" name="surfbar_static_reward" size="6" maxlength="20" value="$content[surfbar_static_reward]" /> {!POINTS!}
</td>
</tr>
<td height="30" align="right" style="padding-right:5px">
{--ADMIN_CONFIG_SURFBAR_STATIC_COSTS--}
</td>
- <td>
+ <td style="padding-left:5px">
<input type="text" name="surfbar_static_costs" size="6" maxlength="20" value="$content[surfbar_static_costs]" /> {!POINTS!}
</td>
</tr>
<td height="30" align="right" style="padding-right:5px">
{--ADMIN_CONFIG_SURFBAR_STATIC_TIME--}
</td>
- <td>
+ <td style="padding-left:5px">
$content[surfbar_static_time]
</td>
</tr>
<td height="30" align="right" style="padding-right:5px">
{--ADMIN_CONFIG_SURFBAR_STATIC_LOCK--}
</td>
- <td>
+ <td style="padding-left:5px">
$content[surfbar_static_lock]
</td>
</tr>
<td height="30" align="right" style="padding-right:5px">
{--ADMIN_CONFIG_SURFBAR_DYNAMIC_PERCENT--}
</td>
- <td>
+ <td style="padding-left:5px">
<input type="text" name="surfbar_dynamic_percent" size="6" maxlength="20" value="$content[surfbar_dynamic_percent]" />%
</td>
</tr>
<td height="30" align="right" style="padding-right:5px">
{--ADMIN_CONFIG_SURFBAR_MAX_ORDER--}
</td>
- <td>
+ <td style="padding-left:5px">
<input type="text" name="surfbar_max_order" size="6" maxlength="20" value="$content[surfbar_max_order]" />
</td>
</tr>
<td height="30" align="right" style="padding-right:5px">
{--ADMIN_CONFIG_SURFBAR_RESTART_TIME--}
</td>
- <td>
+ <td style="padding-left:5px">
$content[surfbar_restart_time]
</td>
</tr>
<td height="30" align="right" style="padding-right:5px">
{--ADMIN_CONFIG_SURFBAR_STATS_RELOAD--}
</td>
- <td>
+ <td style="padding-left:5px">
$content[surfbar_stats_reload]
</td>
</tr>
<td height="30" align="right" style="padding-right:5px">
{--ADMIN_CONFIG_SURFBAR_PURGE_DELETED--}
</td>
- <td>
+ <td style="padding-left:5px">
$content[surfbar_purge_deleted]
</td>
</tr>
<td height="30" align="right" style="padding-right:5px">
{--ADMIN_CONFIG_SURFBAR_PURGE_MIGRATED--}
</td>
- <td>
+ <td style="padding-left:5px">
$content[surfbar_purge_migrated]
</td>
</tr>
<td height="30" align="right" style="padding-right:5px">
{--ADMIN_CONFIG_SURFBAR_PAYMENT_MODEL_STATIC--}
</td>
- <td>
+ <td style="padding-left:5px">
<input type="radio" name="surfbar_pay_model" value="STATIC"{!__CONFIG_SURFBAR_PAY_MODEL_STATIC!} />
</td>
</tr>
<td height="30" align="right" style="padding-right:5px">
{--ADMIN_CONFIG_SURFBAR_PAYMENT_MODEL_DYNAMIC--}
</td>
- <td>
+ <td style="padding-left:5px">
<input type="radio" name="surfbar_pay_model" value="DYNAMIC"{!__CONFIG_SURFBAR_PAY_MODEL_DYNAMIC!} />
</td>
</tr>
<td height="30" align="right" style="padding-right:5px">
{--ADMIN_CONFIG_SURFBAR_PAUSE_MODE_INTERNAL--}
</td>
- <td>
+ <td style="padding-left:5px">
<input type="radio" name="surfbar_pause_mode" value="INTERNAL"{!__CONFIG_SURFBAR_PAUSE_MODE_INTERNAL!} />
</td>
</tr>
<td height="30" align="right" style="padding-right:5px">
{--ADMIN_CONFIG_SURFBAR_PAUSE_MODE_EXTERNAL--}
</td>
- <td>
+ <td style="padding-left:5px">
<input type="radio" name="surfbar_pause_mode" value="EXTERNAL"{!__CONFIG_SURFBAR_PAUSE_MODE_EXTERNAL!} />
</td>
</tr>
<td height="30" align="right" style="padding-right:5px">
{--ADMIN_CONFIG_SURFBAR_PAUSE_URL--}
</td>
- <td>
+ <td style="padding-left:5px">
<input type="text" name="surfbar_pause_url" size="15" maxlength="255" value="$content[surfbar_pause_url]" />
</td>
</tr>
<td height="30" align="right" style="padding-right:5px">
{--ADMIN_CONFIG_SURFBAR_WARN_LOW_POINTS--}
</td>
- <td>
+ <td style="padding-left:5px">
<input type="text" name="surfbar_warn_low_points" size="5" maxlength="20" value="$content[surfbar_warn_low_points]" /> {!POINTS!}
</td>
</tr>
<td height="30" align="right" style="padding-right:5px">
{--ADMIN_CONFIG_SURFBAR_LOW_INTERVAL--}
</td>
- <td>
+ <td style="padding-left:5px">
$content[surfbar_low_interval]
</td>
</tr>
</td>
</tr>
<tr><td height="3" colspan="2" class="seperator bottom2"> </td></tr>
+ <tr><td height="3" colspan="2" class="seperator"> </td></tr>
+ <tr>
+ <td height="30" align="center">
+ {--ADMIN_CONFIG_SURFBAR_GUEST_LOGIN_FORM--}
+ </td>
+ <td align="left" style="padding-left: 5px">
+ <input type="radio" name="surfbar_guest_login_form" value="Y"{!__CONFIG_SURFBAR_GUEST_LOGIN_FORM_Y!} /> {--ADMIN_CONFIG_SURFBAR_GUEST_LOGIN_FORM_Y--}<br />
+ <input type="radio" name="surfbar_guest_login_form" value="N"{!__CONFIG_SURFBAR_GUEST_LOGIN_FORM_N!} /> {--ADMIN_CONFIG_SURFBAR_GUEST_LOGIN_FORM_N--}
+ </td>
+ </tr>
+ <tr><td height="3" colspan="2" class="seperator bottom2"> </td></tr>
<tr>
<td colspan="2" class="admin_footer">
<input type="reset" class="admin_reset" value="{--CLEAR_FORM--}" />
--- /dev/null
+<div align="center" style="margin-bottom: 10px">
+<form action="{!URL!}/surfbar.php" method="post" style="margin-bottom: 0px">
+<table border="0" cellspacing="0" cellpadding="0" class="guest_login dashed" width="480">
+ <tr>
+ <td colspan="9" height="3" class="seperator"> </td>
+ </tr>
+ <tr>
+ <td width="10" class="seperator"> </td>
+ <td colspan="7" align="center" class="guest_login_header">
+ <strong>{--GUEST_SURFBAR_LOGIN_HEADER--}</strong>
+ </td>
+ <td width="10" class="seperator"> </td>
+ </tr>
+ <tr>
+ <td colspan="9" height="3" class="seperator"> </td>
+ </tr>
+ <tr>
+ <td width="10" class="seperator"> </td>
+ <td width="80" align="right">{--GUEST_ENTER_LOGIN--}:</td>
+ <td width="10" class="seperator"> </td>
+ <td>
+ <input type="text" name="id" class="guest_normal" size="4" maxlength="9" />
+ </td>
+ <td width="10" class="seperator"> </td>
+ <td width="80" align="right">{--GUEST_ENTER_PASSWORD--}:</td>
+ <td width="10" class="seperator"> </td>
+ <td>
+ <input type="password" name="password" class="guest_normal" size="10" maxlength="255" />
+ </td>
+ <td width="10" class="seperator"> </td>
+ </tr>
+ <tr>
+ <td colspan="9" height="3" class="seperator"> </td>
+ </tr>
+ <tr>
+ <td width="10" class="seperator"> </td>
+ <td colspan="7" align="center">
+ <input type="reset" class="guest_reset" value="{--CLEAR_FORM--}" />
+ <input type="submit" name="ok" class="guest_submit" value="{--LOGIN_SUBMIT--}" />
+ </td>
+ <td width="10" class="seperator"> </td>
+ </tr>
+ <tr>
+ <td colspan="9" height="3" class="seperator"> </td>
+ </tr>
+</table>
+</form>
+</div>
// Shutdown
shutdown();
-//
+// [EOF]
?>