We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit f9babf6a authored by Evan Prodromou's avatar Evan Prodromou

Check for config file when running

When running the full system, check for a config file, and throw an
error if none is found.
parent 09ebc965
......@@ -61,6 +61,14 @@ function main()
{
global $user, $action;
if (!_have_config()) {
$msg = sprintf(_("No configuration file found. Try running ".
"the installation program first."));
$sac = new ServerErrorAction($msg);
$sac->showPage();
return;
}
// For database errors
PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'handleError');
......
......@@ -187,6 +187,12 @@ foreach ($_config_files as $_config_file) {
}
}
function _have_config()
{
global $_have_a_config;
return $_have_a_config;
}
// XXX: Throw a conniption if database not installed
// Fixup for laconica.ini
......
......@@ -81,7 +81,7 @@ function common_language()
// If there is a user logged in and they've set a language preference
// then return that one...
if (common_logged_in()) {
if (_have_config() && common_logged_in()) {
$user = common_current_user();
$user_language = $user->language;
if ($user_language)
......@@ -315,6 +315,10 @@ function common_current_user()
{
global $_cur;
if (!_have_config()) {
return null;
}
if ($_cur === false) {
if (isset($_REQUEST[session_name()]) || (isset($_SESSION['userid']) && $_SESSION['userid'])) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment