remove more code.
authorx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 20 Jul 2006 18:34:56 +0000 (18:34 +0000)
committerx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 20 Jul 2006 18:34:56 +0000 (18:34 +0000)
drop group permissions, we won't have 1209123 wiki pages, KISS

git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@554 839d8a87-29fc-0310-9880-83ba4fa771e5

htdocs/javascript/wiki.js [deleted file]
htdocs/wiki.php
plugins/pmwiki.config.php
plugins/pmwiki.platalAuth.php

diff --git a/htdocs/javascript/wiki.js b/htdocs/javascript/wiki.js
deleted file mode 100644 (file)
index 7ff04a6..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-Nix = {
-    "map": null,
-    "convert": function(a) {
-        Nix.init();
-        var s='';
-        for (i=0; i<a.length; i++) {
-            var b = a.charAt(i);
-            s += ((b >= 'A' && b <= 'Z') || (b >= 'a' && b <= 'z') ? Nix.map[b] : b);
-        }
-        return s;
-    },
-    "init": function() {
-        if (Nix.map != null)
-            return;
-        var map = new Array();
-        var s = 'abcdefghijklmnopqrstuvwxyz';
-        for (i = 0; i < s.length; i++) {
-            map[s.charAt(i)] = s.charAt((i + 13) % 26);
-        }
-        for (i = 0; i < s.length; i++) {
-            map[s.charAt(i).toUpperCase()] = s.charAt((i + 13) % 26).toUpperCase();
-        }
-        Nix.map = map;
-    },
-    "decode": function(a) {
-        document.write(Nix.convert(a));
-    }
-};
-
index ab6daa2..be90e7c 100644 (file)
@@ -52,7 +52,6 @@ if ($n = wiki_pagename()) {
         // clean old tmp files
         wiki_clean_tmp();
         $page->assign('xorg_extra_header', substr($wikiAll, 0, $i));
-        $page->addJsLink('javascript/wiki.js');
 
         // create new tmp files with editing page from wiki engine
         $wiki_template = wiki_create_tmp(substr($wikiAll, $j));
index 15858ed..3c97eed 100644 (file)
@@ -1,18 +1,20 @@
 <?php if (!defined('PmWiki')) exit();
 
-$ScriptUrl       = $globals->baseurl;
-$UploadUrlFmt    = $ScriptUrl."/uploads";
-$WorkDir         = '../spool/wiki.d';
-$WikiDir         = new PageStore('$FarmD/'.$WorkDir.'/$FullName');
-$PubDirUrl       = $globals->baseurl.'/wiki';
-$InterMapFiles[] = $globals->spoolroot.'plugins/pmwiki.intermap.txt';
+$EnablePathInfo   = 1;   # in fact works with apache rewrite, name is misleading
+$EnableGUIButtons = 1;
+$EnableUpload     = 1;
+$LinkWikiWords    = 0;   # disable WikiWord links
+$EnableIMSCaching = 1;   # allow browser caching
 
-# Authorize group name to start with a number (for promo groups)
-$GroupPattern = '[[:upper:]0-9][\\w]*(?:-\\w+)*';
+$ScriptUrl        = '.';          #\
+$UploadUrlFmt     = './uploads';  # } works thanks to the <base /> in skin
+$PubDirUrl        = './wiki';     #/
 
-$EnablePathInfo = 1;
+$WorkDir          = '../spool/wiki.d';
+$WikiDir          = new PageStore('$FarmD/'.$WorkDir.'/$FullName');
+$InterMapFiles[]  = $globals->spoolroot.'plugins/pmwiki.intermap.txt';
 
-$Skin = 'empty';
+$Skin             = 'empty';
 
 XLSDV('en', array('EnterAttributes' =>
     "Entre ici les différents droit pour la page. Les champs laissés en blanc ne seront pas modifiés.
@@ -30,16 +32,13 @@ XLSDV('en', array('EnterAttributes' =>
 include_once($globals->spoolroot."/plugins/pmwiki.platalAuth.php");
 @include_once("$FarmD/cookbook/e-protect.php");
 
-$DefaultPasswords['read']   = 'has_perms: and: identified:';
-$DefaultPasswords['edit']   = 'has_perms: and: identified:';
+$DefaultPasswords['read']   = 'logged:';
+$DefaultPasswords['edit']   = 'has_perms:';
 $DefaultPasswords['attr']   = 'has_perms: and: identified:';
 $DefaultPasswords['admin']  = 'has_perms: and: identified:';
 $DefaultPasswords['upload'] = 'has_perms: and: identified:';
 
-$EnableGUIButtons = 1;
-$EnableUpload     = 1;
-$LinkWikiWords    = 0;   # disable WikiWord links
-$EnableIMSCaching = 1;   # allow browser caching
+// Theme-ing {{{
 
 ##  The following lines make additional editing buttons appear in the
 ##  edit page for subheadings, lists, tables, etc.
@@ -62,7 +61,7 @@ $GUIButtons['table'] = array(600,
                  '$GUIButtonDirUrlFmt/table.gif"$[Table]"');
 
 // set default author
-$Author = $_SESSION['forlife']."|".$_SESSION['prenom']." ".$_SESSION['nom'];
+$Author = $_SESSION['forlife'].'|'.$_SESSION['prenom'].' '.$_SESSION['nom'];
 
 $InputTags['e_form'] = array(
   ':html' => "<form action='{\$PageUrl}?action=edit' method='post'><div><input 
@@ -97,4 +96,6 @@ function doBicol($column=false)
         $TableCellAttrFmt = "class='$column'";
     }
 }
+
+// }}}
 ?>
index be37fbc..94c7db0 100644 (file)
@@ -38,7 +38,7 @@ function authPerms($pagename, $key, $could=false, $smarty=false)
             continue;
         }
         $parts = explode(':', $word);
-        $cond = $parts[0];
+        $cond  = $parts[0];
         $param = $parts[1];
         if ($cond == 'identified' && $could) {
             $cond = 'logged';
@@ -75,16 +75,13 @@ function authPerms($pagename, $key, $could=false, $smarty=false)
 }
 
 // try to find the best permission for a given page and a given level of auth
-// in order: page > group > site
-function TryAllAuths($pagename, $level, $page_read, $group_read)
+// in order: page > site
+function TryAllAuths($pagename, $level, $page_read)
 {
     global $DefaultPasswords;
     if (isset($page_read['passwd'.$level]) && $page_read['passwd'.$level] != '*') {
         return array('page', $page_read['passwd'.$level]);
     }
-    if (isset($group_read['passwd'.$level]) && $group_read['passwd'.$level] != '*') {
-        return array('group', $group_read['passwd'.$level]);
-    }
     if (isset($DefaultPasswords[$level])) {
         return array('site', $DefaultPasswords[$level]);
     }
@@ -104,17 +101,13 @@ function auth_pmwiki_to_smarty($text, $pass)
 function AuthPlatal($pagename, $level, $authprompt)
 {
     global $Conditions, $page;
-    $authUser = false;
-    $authPage = false;
 
-    $page_read  = ReadPage($pagename);
-    $groupattr  = FmtPageName('$Group/GroupAttributes', $pagename);
-    $group_read = ReadPage($groupattr);
+    $page_read = ReadPage($pagename);
 
     $levels = array('read', 'attr', 'edit', 'upload');
 
     foreach ($levels as $l) {
-        list($from, $pass) = TryAllAuths($pagename, $l, $page_read, $group_read);
+        list($from, $pass) = TryAllAuths($pagename, $l, $page_read);
         $passwds[$l]   = $pass;
         $pwsources[$l] = $from;
     }
@@ -130,7 +123,6 @@ function AuthPlatal($pagename, $level, $authprompt)
     $panel .= "[[{\$FullName}?action=upload |Upload]]\\\\\n";
     $panel .= "{/if}{if ($canattr)}\n";
     $panel .= "[[{\$FullName}?action=attr |Droits]]\\\\\n";
-    $panel .= "[[{\$Group}/GroupAttributes?action=attr|Droits du groupe]]\\\\\n";
     $panel .= "{/if}\n";
     $panel .= ">><<\n";
     $panel .= "{/if}\n";