From: Peter T. <pet...@us...> - 2000-10-23 08:23:39
|
Update of /cvsroot/TWiki/twiki/bin In directory slayer.i.sourceforge.net:/tmp/cvs-serv22594 Modified Files: attach edit save upload wiki.pm Log Message: Codev.AuthenticationBasedOnGroups Index: attach =================================================================== RCS file: /cvsroot/TWiki/twiki/bin/attach,v retrieving revision 1.1.1.5 retrieving revision 1.2 diff -C2 -r1.1.1.5 -r1.2 *** attach 2000/05/06 10:39:11 1.1.1.5 --- attach 2000/10/23 08:23:36 1.2 *************** *** 3,8 **** # TWiki WikiClone (see $wikiversion in wiki.pm for version) # ! # Copyright (C) 1999 Peter Thoeny, pet...@ta... , ! # TakeFive Software Inc. # # This program is free software; you can redistribute it and/or --- 3,7 ---- # TWiki WikiClone (see $wikiversion in wiki.pm for version) # ! # Copyright (C) 1999-2000 Peter Thoeny, pe...@th... # # This program is free software; you can redistribute it and/or *************** *** 24,28 **** #open(STDERR,'>&STDOUT'); # redirect error to browser $| = 1; # no buffering - print "Content-type: text/html\n\n"; &main(); --- 23,26 ---- *************** *** 68,83 **** my $theUrl = $query->url; ! ( $topic, $webName ) = &wiki::initialize( $thePathInfo, $theRemoteUser, $theTopic, $theUrl ); ! my $tmpl="", $text="", $atext="", $fileName=""; if( ! &wiki::webExists( $webName ) ) { $tmpl= &wiki::readTemplate( "noweb" ); $tmpl = &wiki::handleCommonTags( $tmpl, $topic ); print $tmpl; return; } $fileName = $query->param( 'filename' ) || ""; --- 66,94 ---- my $theUrl = $query->url; ! ( $topic, $webName, $dummy, $userName ) = &wiki::initialize( $thePathInfo, $theRemoteUser, $theTopic, $theUrl ); + $dummy = ""; # to suppress warning ! my $tmpl = ""; ! my $text = ""; ! my $atext = ""; ! my $fileName = ""; ! my $wikiUserName = &wiki::userToWikiName( $userName ); if( ! &wiki::webExists( $webName ) ) { $tmpl= &wiki::readTemplate( "noweb" ); $tmpl = &wiki::handleCommonTags( $tmpl, $topic ); + print "Content-type: text/html\n\n"; print $tmpl; return; } + # check access permission + if( ! &wiki::checkAccessPermission( "change", $wikiUserName, "", $topic, $webName ) ) { + my $url = &wiki::getOopsUrl( $webName, $topic, "oopsaccesschange" ); + print $query->redirect( $url ); + return; + } + $fileName = $query->param( 'filename' ) || ""; *************** *** 118,121 **** --- 129,133 ---- $tmpl =~ s/%FILEPATH%/$filePath/go; $tmpl =~ s/%FILECOMMENT%/$fileComment/go; + print "Content-type: text/html\n\n"; print $tmpl; } Index: edit =================================================================== RCS file: /cvsroot/TWiki/twiki/bin/edit,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** edit 2000/07/28 18:04:40 1.6 --- edit 2000/10/23 08:23:36 1.7 *************** *** 6,11 **** # Copyright (C) 1998 Markus Peter - SPiN GmbH (wa...@sp...) # Some changes by Dave Harris (dr...@bh...) incorporated ! # Copyright (C) 1999 Peter Thoeny, pet...@ta... , ! # TakeFive Software Inc. # # This program is free software; you can redistribute it and/or --- 6,10 ---- # Copyright (C) 1998 Markus Peter - SPiN GmbH (wa...@sp...) # Some changes by Dave Harris (dr...@bh...) incorporated ! # Copyright (C) 1999-2000 Peter Thoeny, pe...@th... # # This program is free software; you can redistribute it and/or *************** *** 149,156 **** my $breakLock = $query->param( 'breaklock' ) || ""; my $onlyWikiName = $query->param( 'onlywikiname' ) || ""; ! my $tmpl="", $tcat="", $icat="", $text=""; ! my $before="", $atext="", $ctext="", $after=""; ! my $catname="", $catmod="", $catvalue=""; my $extra = ""; if( ! &wiki::webExists( $webName ) ) { --- 148,164 ---- my $breakLock = $query->param( 'breaklock' ) || ""; my $onlyWikiName = $query->param( 'onlywikiname' ) || ""; ! my $tmpl = ""; ! my $tcat = ""; ! my $icat = ""; ! my $text = ""; ! my $before = ""; ! my $atext = ""; ! my $ctext = ""; ! my $after = ""; ! my $catname = ""; ! my $catmod = ""; ! my $catvalue = ""; my $extra = ""; + my $wikiUserName = &wiki::userToWikiName( $userName ); if( ! &wiki::webExists( $webName ) ) { *************** *** 168,171 **** --- 176,189 ---- } + # check access permission + if( &wiki::topicExists( $webName, $topic ) ) { + $text = &wiki::readTopic( $topic ); + } + if( ! &wiki::checkAccessPermission( "change", $wikiUserName, $text, $topic, $webName ) ) { + my $url = &wiki::getOopsUrl( $webName, $topic, "oopsaccesschange" ); + print $query->redirect( $url ); + return; + } + my( $lockUser, $lockTime ) = &wiki::topicIsLocked( $topic ); if( ( ! $breakLock ) && ( $lockUser ) ) { *************** *** 187,193 **** $tmpl= &wiki::readTemplate( "edit", $topic ); $icat= &wiki::readTemplate( "twikicatitems" ); ! if( &wiki::topicExists( $webName, $topic ) ) { ! $text= &wiki::readTopic($topic); ! } else { $text= &wiki::readTemplate( "notedited" ); $extra = "(not exist)"; --- 205,209 ---- $tmpl= &wiki::readTemplate( "edit", $topic ); $icat= &wiki::readTemplate( "twikicatitems" ); ! if( ! &wiki::topicExists( $webName, $topic ) ) { $text= &wiki::readTemplate( "notedited" ); $extra = "(not exist)"; *************** *** 195,200 **** my $foo = &wiki::getLocaldate(); $text =~ s/%DATE%/$foo/go; ! $foo = &wiki::userToWikiName( $userName ); ! $text =~ s/%USERNAME%/$foo/go; } --- 211,215 ---- my $foo = &wiki::getLocaldate(); $text =~ s/%DATE%/$foo/go; ! $text =~ s/%USERNAME%/$wikiUserName/go; } Index: save =================================================================== RCS file: /cvsroot/TWiki/twiki/bin/save,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** save 2000/07/08 00:17:49 1.3 --- save 2000/10/23 08:23:36 1.4 *************** *** 6,11 **** # Copyright (C) 1998 Markus Peter - SPiN GmbH (wa...@sp...) # Some changes by Dave Harris (dr...@bh...) incorporated ! # Copyright (C) 1999 Peter Thoeny, pet...@ta... , ! # TakeFive Software Inc. # # This program is free software; you can redistribute it and/or --- 6,10 ---- # Copyright (C) 1998 Markus Peter - SPiN GmbH (wa...@sp...) # Some changes by Dave Harris (dr...@bh...) incorporated ! # Copyright (C) 1999-2000 Peter Thoeny, pe...@th... # # This program is free software; you can redistribute it and/or *************** *** 35,42 **** my $theUrl = $query->url; ! ( $topic, $webName) = &wiki::initialize( $thePathInfo, $theRemoteUser, $theTopic, $theUrl ); ! my $text = "", $tmp = "", $atext = "", $before = "", $after = ""; if( ! &wiki::webExists( $webName ) ) { --- 34,47 ---- my $theUrl = $query->url; ! ( $topic, $webName, $dummy, $userName ) = &wiki::initialize( $thePathInfo, $theRemoteUser, $theTopic, $theUrl ); ! $dummy = ""; # to suppress warning ! my $text = ""; ! my $tmp = ""; ! my $atext = ""; ! my $before = ""; ! my $after = ""; ! my $wikiUserName = &wiki::userToWikiName( $userName ); if( ! &wiki::webExists( $webName ) ) { *************** *** 45,48 **** --- 50,60 ---- print $tmpl; return; + } + + # check access permission + if( ! &wiki::checkAccessPermission( "change", $wikiUserName, "", $topic, $webName ) ) { + my $url = &wiki::getOopsUrl( $webName, $topic, "oopsaccesschange" ); + print $query->redirect( $url ); + return; } Index: upload =================================================================== RCS file: /cvsroot/TWiki/twiki/bin/upload,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** upload 2000/09/27 00:58:26 1.5 --- upload 2000/10/23 08:23:36 1.6 *************** *** 3,8 **** # TWiki WikiClone (see $wikiversion in wiki.pm for version) # ! # Copyright (C) 1999 Peter Thoeny, pet...@ta... , ! # TakeFive Software Inc. # # This program is free software; you can redistribute it and/or --- 3,7 ---- # TWiki WikiClone (see $wikiversion in wiki.pm for version) # ! # Copyright (C) 1999 Peter Thoeny, pe...@th... # # This program is free software; you can redistribute it and/or *************** *** 360,363 **** --- 359,379 ---- $dummy = ""; # to suppress warning + my $wikiUserName = &wiki::userToWikiName( $userName ); + + if( ! &wiki::webExists( $webName ) ) { + $tmpl= &wiki::readTemplate( "noweb" ); + $tmpl = &wiki::handleCommonTags( $tmpl, $topic ); + print "Content-type: text/html\n\n"; + print $tmpl; + return; + } + + # check access permission + if( ! &wiki::checkAccessPermission( "change", $wikiUserName, "", $topic, $webName ) ) { + my $url = &wiki::getOopsUrl( $webName, $topic, "oopsaccesschange" ); + print $query->redirect( $url ); + return; + } + my $filePath = $query->param( 'filepath' ) || ""; my $fileName = $query->param( 'filename' ) || ""; *************** *** 396,401 **** # save uploaded file my $newFile = "$tempPath/$fileName"; - ## link( $tmpFilename, $newFile ); # fails, don't know why - # `$wiki::cpCmd $tmpFilename $newFile`; # ==> use shell cp copy($tmpFilename, $newFile) or warn "copy($tmpFilename, $newFile) failed: $!"; umask( 0027 ); --- 412,415 ---- Index: wiki.pm =================================================================== RCS file: /cvsroot/TWiki/twiki/bin/wiki.pm,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -r1.20 -r1.21 *** wiki.pm 2000/10/05 07:49:53 1.20 --- wiki.pm 2000/10/23 08:23:36 1.21 *************** *** 87,91 **** # =========================== # TWiki version: ! $wikiversion = "04 Oct 2000"; # =========================== --- 87,91 ---- # =========================== # TWiki version: ! $wikiversion = "22 Oct 2000"; # =========================== *************** *** 102,105 **** --- 102,109 ---- # =========================== + # read the access control part + do "wikiaccess.pm"; + + # =========================== # read the rcs related functions do "wikistore.pm"; *************** *** 122,125 **** --- 126,132 ---- delete @ENV{ qw( IFS CDPATH ENV BASH_ENV ) }; + # initialize access control + initializeAccess(); + # initialize user name and user to WikiName list $userName = initializeRemoteUser( $theRemoteUser ); *************** *** 611,614 **** --- 618,622 ---- my $htext = $theText; + $htext =~ s/<[^>]*>//go; # remove all HTML tags $htext =~ s/%INCLUDE[^%]*%/ /go; # remove server side includes $htext =~ s/%SEARCH[^%]*%/ /go; # remove inline search *************** *** 858,861 **** --- 866,872 ---- # Wiki extended rules $text = extendHandleCommonTags( $text, $topic, $theWeb ); + # handle tags again because of extend + &wiki::handlePreferencesTags( $text ); + handleInternalTags( $text, $topic, $theWeb ); return $text; *************** *** 988,993 **** # Entities ! s/&(\w+?)\;/$TranslationToken$1\;/go; ! s/&/&/go; s/$TranslationToken/&/go; --- 999,1005 ---- # Entities ! s/&(\w+?)\;/$TranslationToken$1\;/go; # "&abc;" ! s/&(\#[0-9]+)\;/$TranslationToken$1\;/go; # "{" ! s/&/&/go; # escape standalone "&" s/$TranslationToken/&/go; |