* Laconica - a distributed open-source microblogging tool
* Copyright (C) 2008, Controlez-Vous, Inc.
*
* Laconica - a distributed open-source microblogging tool
* Copyright (C) 2008, Controlez-Vous, Inc.
*
define('INSTALLDIR', dirname(__FILE__));
define('LACONICA', true);
define('INSTALLDIR', dirname(__FILE__));
define('LACONICA', true);
// parts of the site, redirect to login
if (!$user && common_config('site', 'private') &&
// parts of the site, redirect to login
if (!$user && common_config('site', 'private') &&
- !in_array($action, array('login', 'openidlogin', 'finishopenidlogin', 'api', 'doc')))
-{
+ !in_array($action, array('login', 'openidlogin', 'finishopenidlogin',
+ 'recoverpassword', 'api', 'doc', 'register'))) {
common_redirect(common_local_url('login'));
}
$actionfile = INSTALLDIR."/actions/$action.php";
if (file_exists($actionfile)) {
common_redirect(common_local_url('login'));
}
$actionfile = INSTALLDIR."/actions/$action.php";
if (file_exists($actionfile)) {
- if ($config['db']['mirror'] && $action_obj->is_readonly()) {
- if (is_array($config['db']['mirror'])) {
- # "load balancing", ha ha
- $k = array_rand($config['db']['mirror']);
- $mirror = $config['db']['mirror'][$k];
- } else {
- $mirror = $config['db']['mirror'];
- }
- $config['db']['database'] = $mirror;
- }
+
+ if ($config['db']['mirror'] && $action_obj->isReadOnly()) {
+ if (is_array($config['db']['mirror'])) {
+ // "load balancing", ha ha
+ $k = array_rand($config['db']['mirror']);
+
+ $mirror = $config['db']['mirror'][$k];
+ } else {
+ $mirror = $config['db']['mirror'];
+ }
+ $config['db']['database'] = $mirror;
+ }