summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorSarven Capadisli <csarven@status.net>2010-01-31 23:42:19 +0100
committerSarven Capadisli <csarven@status.net>2010-01-31 23:42:19 +0100
commit7558e2fd61c527b31b5a49d29a59b6b0b1d6d542 (patch)
tree4f71863c12f8b20b261dad09496f65ca872f5712 /index.php
parent4d0ee6a41f3cfb2e99dcb92e7b14f3183393f1a5 (diff)
parent81087e45c5b797028e90181459e4c673cd7be278 (diff)
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into testing
Diffstat (limited to 'index.php')
-rw-r--r--index.php18
1 files changed, 14 insertions, 4 deletions
diff --git a/index.php b/index.php
index 5520d690b..06ff9900f 100644
--- a/index.php
+++ b/index.php
@@ -146,7 +146,7 @@ function formatBacktraceLine($n, $line)
return $out;
}
-function checkMirror($action_obj, $args)
+function setupRW()
{
global $config;
@@ -161,6 +161,11 @@ function checkMirror($action_obj, $args)
foreach ($alwaysRW as $table) {
$config['db']['table_'.$table] = 'rw';
}
+}
+
+function checkMirror($action_obj, $args)
+{
+ global $config;
if (common_config('db', 'mirror') && $action_obj->isReadOnly($args)) {
if (is_array(common_config('db', 'mirror'))) {
@@ -237,9 +242,13 @@ function main()
PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'handleError');
+ // Make sure RW database is setup
+
+ setupRW();
+
// XXX: we need a little more structure in this script
- // get and cache current user
+ // get and cache current user (may hit RW!)
$user = common_current_user();
@@ -276,8 +285,9 @@ function main()
if (!$user && common_config('site', 'private')
&& !isLoginAction($action)
&& !preg_match('/rss$/', $action)
- && !preg_match('/^Api/', $action)
- ) {
+ && $action != 'robotstxt'
+ && !preg_match('/^Api/', $action)) {
+
// set returnto
$rargs =& common_copy_args($args);
unset($rargs['action']);