Skip to content

Commit

Permalink
Try to make the root folder writable if it is not
Browse files Browse the repository at this point in the history
dragomano committed Aug 7, 2024
1 parent 1a4fc29 commit 17c3241
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Sources/Optimus/Handlers/SettingHandler.php
Original file line number Diff line number Diff line change
@@ -12,8 +12,8 @@

namespace Bugo\Optimus\Handlers;

use Bugo\Compat\{Actions\ACP, Config, Db, IntegrationHook};
use Bugo\Compat\{Lang, Theme, User, Utils};
use Bugo\Compat\{Actions\ACP, Config, Db, ErrorHandler};
use Bugo\Compat\{IntegrationHook, Lang, Theme, User, Utils};
use Bugo\Optimus\Robots\Generator;
use Bugo\Optimus\Tasks\Sitemap;
use Bugo\Optimus\Utils\Input;
@@ -478,6 +478,10 @@ public function sitemapTabSettings(bool $return_config = false)
Utils::$context['settings_title'] = Lang::$txt['optimus_sitemap_title'];
Utils::$context['post_url'] = Config::$scripturl . '?action=admin;area=optimus;sa=sitemap;save';

if (! Utils::makeWritable(Config::$boarddir)) {
ErrorHandler::fatalLang('optimus_root_is_not_writable');
}

Lang::load('ManageMaintenance');

$this->addDefaultSettings([
1 change: 1 addition & 0 deletions src/Themes/default/languages/Optimus/Optimus.english.php
Original file line number Diff line number Diff line change
@@ -109,6 +109,7 @@
$txt['optimus_sitemap_desc'] = '%1$s can generate a simple XML map in accordance with the settings below.';
/* Argument: string */
$txt['optimus_sitemap_info'] = 'If you do not see recent boards or topics in the map, check the %s';
$txt['optimus_root_is_not_writable'] = 'Make sure that the forum root directory is writable!';
$txt['optimus_sitemap_enable'] = 'Activate the Sitemap';
$txt['optimus_sitemap_enable_subtext'] = 'The map will be created/updated after saving the settings.';
$txt['optimus_sitemap_link'] = 'Show the Sitemap link on the footer';

0 comments on commit 17c3241

Please sign in to comment.