moziloCMS Supportforum

moziloWiki => Wie kann ich...? => Thema gestartet von: mozillowiki am 14. April 2010, 12:22:29

Titel: MozilloWiki PageVersionen
Beitrag von: mozillowiki am 14. April 2010, 12:22:29
Hi,

mal eine Frage es gibt bei MozilloWki ja vier Benutzerarten : Admin, Benutzer, Gast, Anonym.

Der Admin hat im Mozillo ja die möglichkeit sich eine History von einem Beitrag an zu sehen. Ich würde diese Möglichkeit auch gerne der Benutzergruppe Benutzer zur Verfügung stellen.

Habe auch versucht das in der index.php so zu ändern:
// column "action"
                if ($GRP_EDITCONTENT) {
                    if (fileIsReadonly($currentdir, $filename.$DEFAULT_PAGESEXT))
                        $table .= "<td class=$tdclass><img class="noborder" alt="-" src="pic/deletepageiconlocked.gif"  title="".$wikilanguage->get("LANG_ISPROTECTEDPAGE")."" /></td>";
                    elseif (($mainsettings->getIsAdminPage($filename) || pageIsStrangersUserpageOrDefaultpage($filename)) && !$GRP_EDITUSERS)
                        $table .= "<td class=$tdclass><img class="noborder" alt="-" src="pic/deletepageiconlocked.gif"  title="".$wikilanguage->get("LANG_ISPROTECTEDPAGE")."" /></td>";
                    elseif (entryIsLocked($filename))
                        if ($GRP_EDITUSERS || $GRP_EDITCONTENT )
                            $table .= "<td class=$tdclass><a href="index.php?action=$ACTION&amp;unlockpage=true&amp;deletefile=$filename&amp;query=".htmlentities($_GET['query'])."" title="".$wikilanguage->get("LANG_UNLOCK")." &quot;$filename&quot;"><img class="noborder" alt="".$wikilanguage->get("LANG_UNLOCK")." &quot;$filename&quot;" src="pic/unlockpageicon.gif" /></a></td>";
                        else
                            $table 
.= "<td class=$tdclass><img class="noborder" alt="-" src="pic/deletepageiconlocked.gif"  title="".$wikilanguage->get("LANG_ISLOCKEDSHORT")."" /></td>";
                    else {
                        if ($ACTION == "trashpages")
                            $table .= "<td class=$tdclass><a href="index.php?action=trashpages&amp;restore=true&amp;restorefile=$filename&amp;query=".htmlentities($_GET['query'])."" title="".$wikilanguage->get("LANG_RESTORE")." &quot;$filename&quot;"><img class="noborder" alt="".$wikilanguage->get("LANG_RESTORE")." &quot;$filename&quot;" src="pic/restorepageicon.gif" /></a></td>";
                        else
                            $table 
.= "<td class=$tdclass><a href="index.php?action=$ACTION&amp;count=$count&amp;delete=true&amp;deletefile=$filename&amp;query=".htmlentities($_GET['query'])."" title="".$wikilanguage->get("LANG_DELETE")." &quot;$filename&quot;"><img class="noborder" alt="".$wikilanguage->get("LANG_DELETE")." &quot;$filename&quot;" src="pic/deletepageicon.gif" /></a></td>";
                    }
                }
                // column "view history"
                if ($GRP_EDITUSERS && ($ACTION == "trashpages") || $GRP_EDITCONTENT && ($ACTION <> "trashpages")) {
                    $table .= "<td class=$tdclass><a href="index.php?action=pageversions&amp;vpage=$filename" title="".$wikilanguage->get("LANG_VERSIONS_VIEW")." &quot;$filename&quot;"><img class="noborder" alt="".$wikilanguage->get("LANG_VERSIONS_VIEW")." &quot;$filename&quot;" src="pic/versionsicon.gif" /></a></td>";
                }
                $table .= "</tr>";
                $counter++;
            }

und

function displayPageVersions
() {
        global $CURRENTUSER;
        global $DEFAULT_PAGESEXT;
        global $DIR_BACKUP;
        global $DIR_PAGES;
        global $GRP_ANONYMOUS;
        global $GRP_EDITUSERS;
        global $mainsettings;
        global $wikilanguage;
        global $wikiusers;
        global $wikipageversions;
        global $wikisyntax;
        global $GRP_EDITCONTENT;


        // this function only works for admins
        if ($GRP_EDITUSERS || $GRP_EDITCONTENT) {
            header("location:index.php");
        }

 

. Allerdings werden die Änderungen nicht gezogen. Hat da jemand eine Idee?

Schon mal vielen Dank im vorraus.
Titel: Re: MozilloWiki PageVersionen
Beitrag von: azett am 16. April 2010, 16:33:03
Salut und willkommen im Supportforum :)

Ich habe dir eine geänderte index.php angehängt, damit können nun auch Benutzer Eintragsversionen sehen und wiederherstellen. Probiers mal aus und sag Bescheid :)

Im Wesentlichen habe ich nur in zwei Funktionen (s.u.) die Abfrage auf Admin-Rechte... if ($GRP_EDITUSERS)  ..geändert in eine Abfrage auf Benutzerrechte: if ($GRP_EDITCONTENT) 
Geänderte Funktionen: