Skip to content

Commit

Permalink
Merge pull request #590 from norv/elk_tweak
Browse files Browse the repository at this point in the history
Speaking of yelling. :) How about this?
  • Loading branch information
norv committed Jun 27, 2013
2 parents 050e658 + c8fe436 commit bd4d36b
Show file tree
Hide file tree
Showing 187 changed files with 231 additions and 231 deletions.
4 changes: 2 additions & 2 deletions SSI.php
Expand Up @@ -15,10 +15,10 @@
*/

// Don't do anything if ElkArte is already loaded.
if (defined('ELKARTE'))
if (defined('ELK'))
return true;

define('ELKARTE', 'SSI');
define('ELK', 'SSI');

// We're going to want a few globals... these are all set later.
global $time_start, $maintenance, $msubject, $mmessage, $mbname, $language;
Expand Down
2 changes: 1 addition & 1 deletion index.php
Expand Up @@ -22,7 +22,7 @@
$forum_version = 'ElkArte 1.0 Alpha';

// First things first, but not necessarily in that order.
define('ELKARTE', 1);
define('ELK', 1);

if (function_exists('set_magic_quotes_runtime'))
@set_magic_quotes_runtime(0);
Expand Down
6 changes: 3 additions & 3 deletions install/install.php
Expand Up @@ -296,8 +296,8 @@ function load_database()

// Need this to check whether we need the database password.
require(dirname(__FILE__) . '/Settings.php');
if (!defined('ELKARTE'))
define('ELKARTE', 1);
if (!defined('ELK'))
define('ELK', 1);

$modSettings['disableQueryCheck'] = true;

Expand Down Expand Up @@ -760,7 +760,7 @@ function action_databaseSettings()
}

// Now include it for database functions!
define('ELKARTE', 1);
define('ELK', 1);
$modSettings['disableQueryCheck'] = true;

require_once(SOURCEDIR . '/database/Database.subs.php');
Expand Down
2 changes: 1 addition & 1 deletion install/upgrade.php
Expand Up @@ -823,7 +823,7 @@ function loadEssentialData()
// Do the non-SSI stuff...
@set_magic_quotes_runtime(0);
error_reporting(E_ALL);
define('ELKARTE', 1);
define('ELK', 1);

// Start the session.
if (@ini_get('session.save_handler') == 'user')
Expand Down
2 changes: 1 addition & 1 deletion sources/BrowserDetect.class.php
Expand Up @@ -15,7 +15,7 @@
*
*/

if (!defined('ELKARTE'))
if (!defined('ELK'))
die('No access...');

/**
Expand Down
2 changes: 1 addition & 1 deletion sources/Combine.class.php
Expand Up @@ -8,7 +8,7 @@
* @version 1.0 Alpha
*/

if (!defined('ELKARTE'))
if (!defined('ELK'))
die('No access...');

/**
Expand Down
2 changes: 1 addition & 1 deletion sources/CurlFetchWeb.class.php
Expand Up @@ -9,7 +9,7 @@
*
*/

if (!defined('ELKARTE'))
if (!defined('ELK'))
die('No access...');

/**
Expand Down
2 changes: 1 addition & 1 deletion sources/Dispatcher.class.php
Expand Up @@ -9,7 +9,7 @@
*
*/

if (!defined('ELKARTE'))
if (!defined('ELK'))
die('No access...');

/**
Expand Down
2 changes: 1 addition & 1 deletion sources/DumpDatabase.php
Expand Up @@ -17,7 +17,7 @@
*
*/

if (!defined('ELKARTE'))
if (!defined('ELK'))
die('No access...');

/**
Expand Down
2 changes: 1 addition & 1 deletion sources/Errors.class.php
Expand Up @@ -9,7 +9,7 @@
*
*/

if (!defined('ELKARTE'))
if (!defined('ELK'))
die('Hacking attempt...');

/**
Expand Down
8 changes: 4 additions & 4 deletions sources/Errors.php
Expand Up @@ -19,7 +19,7 @@
*
*/

if (!defined('ELKARTE'))
if (!defined('ELK'))
die('No access...');

/**
Expand Down Expand Up @@ -73,7 +73,7 @@ function log_error($error_message, $error_type = 'general', $file = null, $line
$query_string = empty($_SERVER['QUERY_STRING']) ? (empty($_SERVER['REQUEST_URL']) ? '' : str_replace($scripturl, '', $_SERVER['REQUEST_URL'])) : $_SERVER['QUERY_STRING'];

// Don't log the session hash in the url twice, it's a waste.
$query_string = htmlspecialchars((ELKARTE == 'SSI' ? '' : '?') . preg_replace(array('~;sesc=[^&;]+~', '~' . session_name() . '=' . session_id() . '[&;]~'), array(';sesc', ''), $query_string));
$query_string = htmlspecialchars((ELK == 'SSI' ? '' : '?') . preg_replace(array('~;sesc=[^&;]+~', '~' . session_name() . '=' . session_id() . '[&;]~'), array(';sesc', ''), $query_string));

// Just so we know what board error messages are from.
if (isset($_POST['board']) && !isset($_GET['board']))
Expand Down Expand Up @@ -285,7 +285,7 @@ function setup_fatal_error_context($error_message, $error_code)
return false;

// Maybe they came from dlattach or similar?
if (ELKARTE != 'SSI' && empty($context['theme_loaded']))
if (ELK != 'SSI' && empty($context['theme_loaded']))
loadTheme();

// Don't bother indexing errors mate...
Expand All @@ -305,7 +305,7 @@ function setup_fatal_error_context($error_message, $error_code)
$context['sub_template'] = 'fatal_error';

// If this is SSI, what do they want us to do?
if (ELKARTE == 'SSI')
if (ELK == 'SSI')
{
if (!empty($ssi_on_error_method) && $ssi_on_error_method !== true && is_callable($ssi_on_error_method))
$ssi_on_error_method();
Expand Down
16 changes: 8 additions & 8 deletions sources/Load.php
Expand Up @@ -17,7 +17,7 @@
*
*/

if (!defined('ELKARTE'))
if (!defined('ELK'))
die('No access...');

/**
Expand Down Expand Up @@ -112,9 +112,9 @@ function reloadSettings()
}

// Integration is cool.
if (defined('ELKARTE_INTEGRATION_SETTINGS'))
if (defined('ELK_INTEGRATION_SETTINGS'))
{
$integration_settings = unserialize(ELKARTE_INTEGRATION_SETTINGS);
$integration_settings = unserialize(ELK_INTEGRATION_SETTINGS);
foreach ($integration_settings as $hook => $function)
add_integration_function($hook, $function, false);
}
Expand Down Expand Up @@ -249,7 +249,7 @@ function loadUserSettings()
// 2. RSS feeds and XMLHTTP requests don't count either.
// 3. If it was set within this session, no need to set it again.
// 4. New session, yet updated < five hours ago? Maybe cache can help.
if (ELKARTE != 'SSI' && !isset($_REQUEST['xml']) && (!isset($_REQUEST['action']) || $_REQUEST['action'] != '.xml') && empty($_SESSION['id_msg_last_visit']) && (empty($modSettings['cache_enable']) || ($_SESSION['id_msg_last_visit'] = cache_get_data('user_last_visit-' . $id_member, 5 * 3600)) === null))
if (ELK != 'SSI' && !isset($_REQUEST['xml']) && (!isset($_REQUEST['action']) || $_REQUEST['action'] != '.xml') && empty($_SESSION['id_msg_last_visit']) && (empty($modSettings['cache_enable']) || ($_SESSION['id_msg_last_visit'] = cache_get_data('user_last_visit-' . $id_member, 5 * 3600)) === null))
{
// @todo can this be cached?
// Do a quick query to make sure this isn't a mistake.
Expand Down Expand Up @@ -1307,7 +1307,7 @@ function loadTheme($id_theme = 0, $initialize = true)
}

// Hmm... check #2 - is it just different by a www? Send them to the correct place!!
if (empty($do_fix) && strtr($detected_url, array('://' => '://www.')) == $boardurl && (empty($_GET) || count($_GET) == 1) && ELKARTE != 'SSI')
if (empty($do_fix) && strtr($detected_url, array('://' => '://www.')) == $boardurl && (empty($_GET) || count($_GET) == 1) && ELK != 'SSI')
{
// Okay, this seems weird, but we don't want an endless loop - this will make $_GET not empty ;).
if (empty($_GET))
Expand Down Expand Up @@ -2492,20 +2492,20 @@ function loadDatabase()
$db_type = 'mysql';

// If we are in SSI try them first, but don't worry if it doesn't work, we have the normal username and password we can use.
if (ELKARTE == 'SSI' && !empty($ssi_db_user) && !empty($ssi_db_passwd))
if (ELK == 'SSI' && !empty($ssi_db_user) && !empty($ssi_db_passwd))
$db_connection = elk_db_initiate($db_server, $db_name, $ssi_db_user, $ssi_db_passwd, $db_prefix, array('persist' => $db_persist, 'non_fatal' => true, 'dont_select_db' => true), $db_type);

// Either we aren't in SSI mode, or it failed.
if (empty($db_connection))
$db_connection = elk_db_initiate($db_server, $db_name, $db_user, $db_passwd, $db_prefix, array('persist' => $db_persist, 'dont_select_db' => ELKARTE == 'SSI'), $db_type);
$db_connection = elk_db_initiate($db_server, $db_name, $db_user, $db_passwd, $db_prefix, array('persist' => $db_persist, 'dont_select_db' => ELK == 'SSI'), $db_type);

// Safe guard here, if there isn't a valid connection lets put a stop to it.
if (!$db_connection)
display_db_error();

// If in SSI mode fix up the prefix.
$db = database();
if (ELKARTE == 'SSI')
if (ELK == 'SSI')
$db_prefix = $db->fix_prefix($db_prefix, $db_name);
}

Expand Down
4 changes: 2 additions & 2 deletions sources/Logging.php
Expand Up @@ -17,7 +17,7 @@
*
*/

if (!defined('ELKARTE'))
if (!defined('ELK'))
die('No access...');

/**
Expand Down Expand Up @@ -144,7 +144,7 @@ function writeLog($force = false)
$_SESSION['timeOnlineUpdated'] = time();

// Set their login time, if not already done within the last minute.
if (ELKARTE != 'SSI' && !empty($user_info['last_login']) && $user_info['last_login'] < time() - 60)
if (ELK != 'SSI' && !empty($user_info['last_login']) && $user_info['last_login'] < time() - 60)
{
// We log IPs the request came with, around here
$req = request();
Expand Down
2 changes: 1 addition & 1 deletion sources/QueryString.php
Expand Up @@ -17,7 +17,7 @@
*
*/

if (!defined('ELKARTE'))
if (!defined('ELK'))
die('No access...');

/**
Expand Down
2 changes: 1 addition & 1 deletion sources/ScheduledTasks.php
Expand Up @@ -17,7 +17,7 @@
*
*/

if (!defined('ELKARTE'))
if (!defined('ELK'))
die('No access...');

/**
Expand Down
4 changes: 2 additions & 2 deletions sources/Security.php
Expand Up @@ -18,7 +18,7 @@
*
*/

if (!defined('ELKARTE'))
if (!defined('ELK'))
die('No access...');

/**
Expand Down Expand Up @@ -136,7 +136,7 @@ function is_not_guest($message = '', $is_fatal = true)
obExit(false);

// Attempt to detect if they came from dlattach.
if (ELKARTE != 'SSI' && empty($context['theme_loaded']))
if (ELK != 'SSI' && empty($context['theme_loaded']))
loadTheme();

// Never redirect to an attachment
Expand Down
2 changes: 1 addition & 1 deletion sources/Session.php
Expand Up @@ -19,7 +19,7 @@
*
*/

if (!defined('ELKARTE'))
if (!defined('ELK'))
die('No access...');

/**
Expand Down
2 changes: 1 addition & 1 deletion sources/Subs.php
Expand Up @@ -17,7 +17,7 @@
*
*/

if (!defined('ELKARTE'))
if (!defined('ELK'))
die('No access...');

/**
Expand Down
2 changes: 1 addition & 1 deletion sources/Subscriptions-PayPal.class.php
Expand Up @@ -18,7 +18,7 @@
// This won't be dedicated without this - this must exist in each gateway!
// ElkArte Payment Gateway: paypal

if (!defined('ELKARTE'))
if (!defined('ELK'))
die('No access...');

/**
Expand Down
2 changes: 1 addition & 1 deletion sources/admin/Admin.php
Expand Up @@ -17,7 +17,7 @@
*
*/

if (!defined('ELKARTE'))
if (!defined('ELK'))
die('No access...');

/**
Expand Down
2 changes: 1 addition & 1 deletion sources/admin/AdminDebug.php
Expand Up @@ -17,7 +17,7 @@
*
*/

if (!defined('ELKARTE'))
if (!defined('ELK'))
die('No access...');

class AdminDebug_Controller extends Action_Controller
Expand Down
2 changes: 1 addition & 1 deletion sources/admin/AdminLog.php
Expand Up @@ -9,7 +9,7 @@
*
*/

if (!defined('ELKARTE'))
if (!defined('ELK'))
die('No access...');

/**
Expand Down
2 changes: 1 addition & 1 deletion sources/admin/ManageAddonSettings.php
Expand Up @@ -9,7 +9,7 @@
*
*/

if (!defined('ELKARTE'))
if (!defined('ELK'))
die('No access...');

/**
Expand Down
2 changes: 1 addition & 1 deletion sources/admin/ManageAttachments.php
Expand Up @@ -15,7 +15,7 @@
*
*/

if (!defined('ELKARTE'))
if (!defined('ELK'))
die('No access...');

/**
Expand Down
2 changes: 1 addition & 1 deletion sources/admin/ManageAvatars.php
Expand Up @@ -9,7 +9,7 @@
*
*/

if (!defined('ELKARTE'))
if (!defined('ELK'))
die('No access...');

/**
Expand Down
2 changes: 1 addition & 1 deletion sources/admin/ManageBBC.php
Expand Up @@ -9,7 +9,7 @@
*
*/

if (!defined('ELKARTE'))
if (!defined('ELK'))
die('No access...');

/**
Expand Down
2 changes: 1 addition & 1 deletion sources/admin/ManageBadBehavior.php
Expand Up @@ -9,7 +9,7 @@
*
*/

if (!defined('ELKARTE'))
if (!defined('ELK'))
die('No access...');

class ManageBadBehavior_Controller extends Action_Controller
Expand Down
2 changes: 1 addition & 1 deletion sources/admin/ManageBans.php
Expand Up @@ -9,7 +9,7 @@
*
*/

if (!defined('ELKARTE'))
if (!defined('ELK'))
die('No access...');

/**
Expand Down
2 changes: 1 addition & 1 deletion sources/admin/ManageBoards.php
Expand Up @@ -17,7 +17,7 @@
*
*/

if (!defined('ELKARTE'))
if (!defined('ELK'))
die('No access...');

class ManageBoards_Controller extends Action_Controller
Expand Down
2 changes: 1 addition & 1 deletion sources/admin/ManageCalendar.php
Expand Up @@ -17,7 +17,7 @@
*
*/

if (!defined('ELKARTE'))
if (!defined('ELK'))
die('No access...');

class ManageCalendar_Controller extends Action_Controller
Expand Down
2 changes: 1 addition & 1 deletion sources/admin/ManageCoreFeatures.php
Expand Up @@ -18,7 +18,7 @@
*
*/

if (!defined('ELKARTE'))
if (!defined('ELK'))
die('No access...');

/**
Expand Down

0 comments on commit bd4d36b

Please sign in to comment.