Howdie folks,
i´m setting up a multisite with global module and global template folder.
Most of the page render depends on $input->get, templates are delegated via
<?php if($page->template){$t = new TemplateFile($config->paths->templates . "views/view_{$page->route}.php");} echo $t->render(); ?>
Template delegation happens in a controller.php named file on which this piece of code:
<img src="<?= $user->userimage->url ?>" class="img-circle" />
returns the 403 Forbidden, but only if i´m on the homepage and no other page data is called based on a get variable.
Short overview regarding the multisite setup:
Index.php in root:
$siteDir = 'clientspaces/site-admin';
$config = new Config();
$config->urls = new Paths($rootURL);
$config->urls->wire = "$wireDir/";
$config->urls->site = "$siteDir/";
$config->urls->modules = "$wireDir/modules/";
$config->urls->siteModules = "modules/";
$config->urls->core = "$coreDir/";
$config->urls->assets = "$assetsDir/";
$config->urls->cache = "$assetsDir/cache/";
$config->urls->logs = "$assetsDir/logs/";
$config->urls->files = "$assetsDir/files/";
$config->urls->tmp = "$assetsDir/tmp/";
$config->urls->templates = "application/";
$config->urls->adminTemplates = is_dir("$siteDir/$adminTplDir") ? "$siteDir/$adminTplDir/" : "$wireDir/$adminTplDir/";
$config->paths = clone $config->urls;
$config->paths->root = $rootPath . '/';
$config->paths->sessions = $config->paths->assets . "sessions/";
index.config.php:
function ProcessWireHostSiteConfig() {
return array(
'foo.example.de' => 'clientspaces/foo',
'*' => 'clientspaces/site-admin',
);
}
I started with deleting all restrictions in .htacces, but this wasnt a success.
EDIT:
Creating the url by hand will serve the file, but without the abillity to access the imageClass methods
<img src="<?= $config->urls->assets ?>files/<?= $user->id ?>/<?= $user->userimage ?>" />