Revision history for LoggedUsersHomepage
Revision [19877]
Last edited on 2008-04-24 05:23:41 by MarcElser [Added functionality to also redirect when you just type in the wiki-url without params (e.g. wikkawi]Additions:
===Logged Users Homepage===
Here's a quick way to create two distinct homepages, the first for anonymous visitors, the second for registered users:
~-Add the following line to ##wakka.config.php##: %%(php)"logged_in_homepage" => "IntraNet",%%
~-Make the following modification in ##header.php##:
**original:**
%%(php)
<?php echo $this->Link($this->config["root_page"]); ?> ::
%%
**modified:**
%%(php)
<?php echo ($this->GetUser() ? $this->Link($this->config["logged_in_homepage"]) : $this->Link($this->config["root_page"])); ?> ::
%%
You will then need to setup the appropriate ACLs for the ""IntraNet"" page
-- DarTar
~& Marc Elser: --- I recommend adding this to libs/Wakka.class.php make the redirection also when you just type in the wiki-url (without params), for example wikkawiki.org. Make sure you move the page with the ""$this-SetUser()"" command before the redirection to make it work. %%(php)
// do our stuff!
if (!$this->method = trim($method)) $this->method = "show";
if (!$this->GetUser() && ($user = $this->LoadUser($this->GetCookie('user_name'), $this->GetCookie('pass')))) $this->SetUser($user);
if (!$this->tag = trim($tag)) $this->Redirect($this->Href("", $this->GetUser() ? $this->config["logged_in_homepage"] : $this->config["root_page"]));
%%
----
Here's a quick way to create two distinct homepages, the first for anonymous visitors, the second for registered users:
~-Add the following line to ##wakka.config.php##: %%(php)"logged_in_homepage" => "IntraNet",%%
~-Make the following modification in ##header.php##:
**original:**
%%(php)
<?php echo $this->Link($this->config["root_page"]); ?> ::
%%
**modified:**
%%(php)
<?php echo ($this->GetUser() ? $this->Link($this->config["logged_in_homepage"]) : $this->Link($this->config["root_page"])); ?> ::
%%
You will then need to setup the appropriate ACLs for the ""IntraNet"" page
-- DarTar
~& Marc Elser: --- I recommend adding this to libs/Wakka.class.php make the redirection also when you just type in the wiki-url (without params), for example wikkawiki.org. Make sure you move the page with the ""$this-SetUser()"" command before the redirection to make it work. %%(php)
// do our stuff!
if (!$this->method = trim($method)) $this->method = "show";
if (!$this->GetUser() && ($user = $this->LoadUser($this->GetCookie('user_name'), $this->GetCookie('pass')))) $this->SetUser($user);
if (!$this->tag = trim($tag)) $this->Redirect($this->Href("", $this->GetUser() ? $this->config["logged_in_homepage"] : $this->config["root_page"]));
%%
----
Deletions:
Here's a quick way to create two distinct homepages, the first for anonymous visitors, the second for registered users:
~-Add the following line to ##wakka.config.php##: %%(php)"logged_in_homepage" => "IntraNet",%%
~-Make the following modification in ##header.php##:
**original:**
%%(php)
<?php echo $this->Link($this->config["root_page"]); ?> ::
%%
**modified:**
%%(php)
<?php echo ($this->GetUser() ? $this->Link($this->config["logged_in_homepage"]) : $this->Link($this->config["root_page"])); ?> ::
%%
You will then need to setup the appropriate ACLs for the ""IntraNet"" page
-- DarTar
----
Revision [18256]
Edited on 2008-01-28 00:10:47 by NilsLindenberg [Modified links pointing to docs server]No Differences
Additions:
CategoryUserContributions
Deletions:
Revision [3388]
Edited on 2004-12-17 23:54:54 by JavaWoman [modified code on one line (makes syntax clearer)]Additions:
<?php echo ($this->GetUser() ? $this->Link($this->config["logged_in_homepage"]) : $this->Link($this->config["root_page"])); ?> ::
Deletions:
$this->Link($this->config["root_page"])); ?> ::
Additions:
===Logged Users Homepage===
Here's a quick way to create two distinct homepages, the first for anonymous visitors, the second for registered users:
~-Add the following line to ##wakka.config.php##: %%(php)"logged_in_homepage" => "IntraNet",%%
~-Make the following modification in ##header.php##:
**original:**
%%(php)
<?php echo $this->Link($this->config["root_page"]); ?> ::
%%
**modified:**
%%(php)
<?php echo ($this->GetUser() ? $this->Link($this->config["logged_in_homepage"]) :
$this->Link($this->config["root_page"])); ?> ::
%%
You will then need to setup the appropriate ACLs for the ""IntraNet"" page
-- DarTar
----
CategoryDevelopment
Here's a quick way to create two distinct homepages, the first for anonymous visitors, the second for registered users:
~-Add the following line to ##wakka.config.php##: %%(php)"logged_in_homepage" => "IntraNet",%%
~-Make the following modification in ##header.php##:
**original:**
%%(php)
<?php echo $this->Link($this->config["root_page"]); ?> ::
%%
**modified:**
%%(php)
<?php echo ($this->GetUser() ? $this->Link($this->config["logged_in_homepage"]) :
$this->Link($this->config["root_page"])); ?> ::
%%
You will then need to setup the appropriate ACLs for the ""IntraNet"" page
-- DarTar
----
CategoryDevelopment
Deletions:
Here's a quick way to create two distinct homepages, the first for anonymous visitors, the second for registered users:
~-Add the following line to ##wakka.config.php##: %%(php)"logged_in_homepage" => "IntraNet",%%
~-Make the following modification in ##header.php##:
**original:**
%%(php)<?php echo $this->Link($this->config["root_page"]); ?> ::
%%
**modified:**
%%(php)<?php echo ($this->GetUser() ? $this->Link($this->config["logged_in_homepage"]) :
$this->Link($this->config["root_page"])); ?> ::
%%
You will then need to setup the appropriate ACLs for the ""IntraNet"" page
-- DarTar