==== Wikka Mod 031 ====
Type: Feature Addition
----
===Credit:===
**[[http://web.archive.org/web/20040603201849/http://www.wakkawiki.com/NickK | NickK]]** -- Credit for the idea. http://wakka.netdome.biz/WakkaChangelog
**[[JsnX | Jason Tourtelotte]]** -- Credit for the coding.
----
Don't link to pages that the viewing user is not allowed to read in PageIndex and RecentChanges.
**actions/pageindex.php**
%%(php)
LoadAllPages())
{
foreach ($pages as $page)
{
if (!preg_match("/^Comment/", $page["tag"])) {
$firstChar = strtoupper($page["tag"][0]);
if (!preg_match("/[A-Z,a-z]/", $firstChar)) {
$firstChar = "#";
}
if ($firstChar != $curChar) {
if ($curChar) print("
\n");
print("$firstChar
\n");
$curChar = $firstChar;
}
if ($this->HasAccess("read", $page["tag"])) {
print($this->Link($page["tag"]));
}
else {
print($page["tag"]);
}
if ($page['owner'] != '')
{
if ($this->UserName() == $page['owner'])
print(" . . . . one of your pages.");
else {
if ($this->HasAccess("read", $page["owner"])) {
print(" . . . . Owner: ".$this->Format($page['owner']));
}
else {
print(" . . . . Owner: ".$page['owner']);
}
}
}
print("
\n");
}
}
}
else
{
print("No pages found.");
}
?>
%%
**actions/recentchanges.php**
%%(php)
LoadRecentlyChanged())
{
print("
$day:
");
$curday = $day;
}
// print entry
if ($page[note]) $note=" [".$page["note"]."]"; else $note ="";
if ($this->HasAccess("read", $page["tag"])) {
if ($this->HasAccess("read", $page["user"])) {
print("(".$page["time"].")(".$this->Link($page["tag"], "revisions", "history", 0).") ".$this->Link($page["tag"], "", "", 0)."⇒".$this->Format($page["user"])." ".$note."
");
}
else {
print("(".$page["time"].")(".$this->Link($page["tag"], "revisions", "history", 0).") ".$this->Link($page["tag"], "", "", 0)."⇒".$page["user"]." ".$note."
");
}
} else {
if ($this->HasAccess("read", $page["user"])) {
print("(".$page["time"].")(history) ".$page["tag"]."⇒".$this->Format($page["user"])." ".$note."
");
}
else {
print("(".$page["time"].")(history) ".$page["tag"]."⇒".$page["user"]." ".$note."
");
}
}
}
}
print "