]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/PagePerm.php
fixed important WikiDB bug with DEBUG > 0: wrong assertion
[SourceForge/phpwiki.git] / lib / PagePerm.php
1 <?php // -*-php-*-
2 rcs_id('$Id: PagePerm.php,v 1.14 2004-05-15 22:54:49 rurban Exp $');
3 /*
4  Copyright 2004 $ThePhpWikiProgrammingTeam
5
6  This file is part of PhpWiki.
7
8  PhpWiki is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation; either version 2 of the License, or
11  (at your option) any later version.
12
13  PhpWiki is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  GNU General Public License for more details.
17
18  You should have received a copy of the GNU General Public License
19  along with PhpWiki; if not, write to the Free Software
20  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  */
22
23 /**
24    Permissions per page and action based on current user, 
25    ownership and group membership implemented with ACL's (Access Control Lists),
26    opposed to the simplier unix like ugo:rwx system.
27    The previous system was only based on action and current user. (lib/main.php)
28
29    Permissions maybe inherited its parent pages, and ultimativly the 
30    optional master page (".")
31    Pagenames starting with "." have special default permissions.
32    For Authentication see WikiUserNew.php, WikiGroup.php and main.php
33    Page Permssions are in PhpWiki since v1.3.9 and enabled since v1.4.0
34
35    This file might replace the following functions from main.php:
36      Request::_notAuthorized($require_level)
37        display the denied message and optionally a login form 
38        to gain higher privileges
39      Request::getActionDescription($action)
40        helper to localize the _notAuthorized message per action, 
41        when login is tried.
42      Request::getDisallowedActionDescription($action)
43        helper to localize the _notAuthorized message per action, 
44        when it aborts
45      Request::requiredAuthority($action)
46        returns the needed user level
47        has a hook for plugins on POST
48      Request::requiredAuthorityForAction($action)
49        just returns the level per action, will be replaced with the 
50        action + page pair
51
52      The defined main.php actions map to simplier access types:
53        browse => view
54        edit   => edit
55        create => edit or create
56        remove => remove
57        rename => change
58        store prefs => change
59        list in PageList => list
60 */
61
62 /* Symbolic special ACL groups. Untranslated to be stored in page metadata*/
63 define('ACL_EVERY',        '_EVERY');
64 define('ACL_ANONYMOUS',    '_ANONYMOUS');
65 define('ACL_BOGOUSERS',    '_BOGOUSERS');
66 define('ACL_HASHOMEPAGE',  '_HASHOMEPAGE');
67 define('ACL_SIGNED',       '_SIGNED');
68 define('ACL_AUTHENTICATED','_AUTHENTICATED');
69 define('ACL_ADMIN',        '_ADMIN');
70 define('ACL_OWNER',        '_OWNER');
71 define('ACL_CREATOR',      '_CREATOR');
72
73 // Return an page permissions array for this page.
74 // To provide ui helpers to view and change page permissions:
75 //   <tr><th>Group</th><th>Access</th><th>Allow or Forbid</th></tr>
76 //   <tr><td>$group</td><td>_($access)</td><td> [ ] </td></tr>
77 function pagePermissions($pagename) {
78     global $request;
79     $page = $request->getPage($pagename);
80     // Page not found (new page); returned inherited permissions, to be displayed in gray
81     if (! $page->exists() ) {
82         if ($pagename == '.') // stop recursion
83             return array('default',new PagePermission());
84         else {
85             return array('inherited',pagePermissions(getParentPage($pagename)));
86         }
87     } elseif ($perm = getPagePermissions($page)) {
88         return array('page',$perm);
89     // or no permissions defined; returned inherited permissions, to be displayed in gray
90     } else {
91         return array('inherited',pagePermissions(getParentPage($pagename)));
92     }
93 }
94
95 function pagePermissionsSimpleFormat($perm_tree,$owner,$group=false) {
96     list($type,$perm) = pagePermissionsAcl($perm_tree[0], $perm_tree);
97     /*
98     $type = $perm_tree[0];
99     $perm = pagePermissionsAcl($perm_tree);
100     if (is_object($perm_tree[1]))
101         $perm = $perm_tree[1];
102     elseif (is_array($perm_tree[1])) {
103         $perm_tree = pagePermissionsSimpleFormat($perm_tree[1],$owner,$group);
104         if (isa($perm_tree[1],'pagepermission'))
105             $perm = $perm_tree[1];
106         elseif (isa($perm_tree,'htmlelement'))
107             return $perm_tree;
108     }
109     */
110     if ($type == 'page')
111         return HTML::tt(HTML::bold($perm->asRwxString($owner,$group).'+'));
112     elseif ($type == 'default')
113         return HTML::tt($perm->asRwxString($owner,$group));
114     elseif ($type == 'inherited') {
115         return HTML::tt(array('class'=>'inherited','style'=>'color:#aaa;'),
116                         $perm->asRwxString($owner,$group));
117     }
118 }
119
120 function pagePermissionsAcl($type,$perm_tree) {
121     $perm = $perm_tree[1];
122     while (!is_object($perm)) {
123         $perm_tree = pagePermissionsAcl($type, $perm);
124         $perm = $perm_tree[1];
125     }
126     return array($type,$perm);
127 }
128
129 // view => who
130 // edit => who
131 function pagePermissionsAclFormat($perm_tree, $editable=false) {
132     list($type,$perm) = pagePermissionsAcl($perm_tree[0], $perm_tree);
133     if ($editable)
134         return $perm->asEditableTable($type);
135     else
136         return $perm->asTable($type);
137 }
138
139 /**
140  * Check permission per page.
141  * Returns true or false.
142  */
143 function mayAccessPage ($access, $pagename) {
144     return _requiredAuthorityForPagename($access, $pagename);
145 }
146
147 /** Check the permissions for the current action.
148  * Walk down the inheritance tree. Collect all permissions until 
149  * the minimum required level is gained, which is not 
150  * overruled by more specific forbid rules.
151  * Todo: cache result per access and page in session?
152  */
153 function requiredAuthorityForPage ($action) {
154     $auth = _requiredAuthorityForPagename(action2access($action),
155                                           $GLOBALS['request']->getArg('pagename'));
156     assert($auth !== -1);
157     if ($auth)
158         return $GLOBALS['request']->_user->_level;
159     else
160         return WIKIAUTH_UNOBTAINABLE;
161 }
162
163 // Translate action or plugin to the simplier access types:
164 function action2access ($action) {
165     global $request;
166     switch ($action) {
167     case 'browse':
168     case 'viewsource':
169     case 'diff':
170     case 'select':
171     case 'xmlrpc':
172     case 'search':
173     case 'pdf':
174         return 'view';
175     case 'zip':
176     case 'ziphtml':
177     case 'dumpserial':
178     case 'dumphtml':
179         return 'dump';
180     case 'edit':
181         return 'edit';
182     case 'create':
183         $page = $request->getPage();
184         $current = $page->getCurrentRevision();
185         if ($current->hasDefaultContents())
186             return 'edit';
187         else
188             return 'view'; 
189         break;
190     case 'upload':
191     case 'loadfile': 
192         // probably create/edit but we cannot check all page permissions, can we?
193     case 'remove':
194     case 'lock':
195     case 'unlock':
196     case 'upgrade':
197             return 'change';
198     default:
199         //Todo: Plugins should be able to override its access type
200         if (isWikiWord($action))
201             return 'view';
202         else
203             return 'change';
204         break;
205     }
206 }
207
208 // Recursive helper to do the real work
209 function _requiredAuthorityForPagename($access, $pagename) {
210     global $request;
211     $page = $request->getPage($pagename);
212     // Page not found; check against default permissions
213     if (! $page->exists() ) {
214         $perm = new PagePermission();
215         return ($perm->isAuthorized($access,$request->_user) === true);
216     }
217     // no ACL defined; check for special dotfile or walk down
218     if (! ($perm = getPagePermissions($page))) { 
219         if ($pagename[0] == '.') {
220             $perm = new PagePermission(PagePermission::dotPerms());
221             return ($perm->isAuthorized($access,$request->_user) === true);
222         }
223         return _requiredAuthorityForPagename($access,getParentPage($pagename));
224     }
225     // ACL defined; check if isAuthorized returns true or false or undecided
226     $authorized = $perm->isAuthorized($access,$request->_user);
227     if ($authorized != -1) // -1 for undecided
228         return $authorized;
229     else
230         return _requiredAuthorityForPagename($access,getParentPage($pagename));
231 }
232
233 /**
234  * @param  string $pagename   page from which the parent page is searched.
235  * @return string parent      pagename or the (possibly pseudo) dot-pagename.
236  */
237 function getParentPage($pagename) {
238     if (isSubPage($pagename)) {
239         return subPageSlice($pagename,0);
240     } else {
241         return '.';
242     }
243 }
244
245 // Read the ACL from the page
246 // Done: Not existing pages should NOT be queried. 
247 // Check the parent page instead and don't take the default ACL's
248 function getPagePermissions ($page) {
249     if ($hash = $page->get('perm'))  // hash => object
250         return new PagePermission(unserialize($hash));
251     else 
252         return false;
253 }
254
255 // Store the ACL in the page
256 function setPagePermissions ($page,$perm) {
257     $perm->store($page);
258 }
259
260 function getAccessDescription($access) {
261     static $accessDescriptions;
262     if (! $accessDescriptions) {
263         $accessDescriptions = array(
264                                     'list'     => _("List this page and all subpages"),
265                                     'view'     => _("View this page and all subpages"),
266                                     'edit'     => _("Edit this page and all subpages"),
267                                     'create'   => _("Create a new (sub)page"),
268                                     'dump'     => _("Download the page contents"),
269                                     'change'   => _("Change page attributes"),
270                                     'remove'   => _("Remove this page"),
271                                     );
272     }
273     if (in_array($access, array_keys($accessDescriptions)))
274         return $accessDescriptions[$access];
275     else
276         return $access;
277 }
278
279 /**
280  * The ACL object per page. It is stored in a page, but can also 
281  * be merged with ACL's from other pages or taken from the master (pseudo) dot-file.
282  *
283  * A hash of "access" => "requires" pairs.
284  *   "access"   is a shortcut for common actions, which map to main.php actions
285  *   "requires" required username or groupname or any special group => true or false
286  *
287  * Define any special rules here, like don't list dot-pages.
288  */ 
289 class PagePermission {
290     var $perm;
291
292     function PagePermission($hash = array()) {
293         $this->_group = &WikiGroup::getGroup($GLOBALS['request']);
294         if (is_array($hash) and !empty($hash)) {
295             $accessTypes = $this->accessTypes();
296             foreach ($hash as $access => $requires) {
297                 if (in_array($access,$accessTypes))
298                     $this->perm[$access] = $requires;
299                 else
300                     trigger_error(sprintf(_("Unsupported ACL access type %s ignored."),$access),
301                                   E_USER_WARNING);
302             }
303         } else {
304             // set default permissions, the so called dot-file acl's
305             $this->perm = $this->defaultPerms();
306         }
307         return $this;
308     }
309
310     /**
311      * The workhorse to check the user against the current ACL pairs.
312      * Must translate the various special groups to the actual users settings 
313      * (userid, group membership).
314      */
315     function isAuthorized($access,$user) {
316         if (!empty($this->perm{$access})) {
317             foreach ($this->perm[$access] as $group => $bool) {
318                 if ($this->isMember($user,$group)) {
319                     return $bool;
320                 }
321             }
322         }
323         return -1; // undecided
324     }
325
326     /**
327      * Translate the various special groups to the actual users settings 
328      * (userid, group membership).
329      */
330     function isMember($user,$group) {
331         global $request;
332         if ($group === ACL_EVERY) return true;
333         if (!isset($this->_group)) $member =& WikiGroup::getGroup($request);
334         else $member =& $this->_group;
335         //$user = & $request->_user;
336         if ($group === ACL_ADMIN)   // WIKI_ADMIN or member of _("Administrators")
337             return $user->isAdmin() or 
338                    ($user->isAuthenticated() and 
339                    $member->isMember(GROUP_ADMIN));
340         if ($group === ACL_ANONYMOUS) 
341             return ! $user->isSignedIn();
342         if ($group === ACL_BOGOUSERS)
343             if (ENABLE_USER_NEW) return isa($user,'_BogoUser');
344             else return isWikiWord($user->UserName());
345         if ($group === ACL_HASHOMEPAGE)
346             return $user->hasHomePage();
347         if ($group === ACL_SIGNED)
348             return $user->isSignedIn();
349         if ($group === ACL_AUTHENTICATED)
350             return $user->isAuthenticated();
351         if ($group === ACL_OWNER) {
352             $page = $request->getPage();
353             return ($page->get('author') === $user->UserName() and 
354                     $user->isAuthenticated());
355         }
356         if ($group === ACL_CREATOR) {
357             $page = $request->getPage();
358             $rev = $page->getRevision(1);
359             return ($rev->get('author') === $user->UserName() and 
360                     $user->isAuthenticated());
361         }
362         /* Or named groups or usernames.
363          Note: We don't seperate groups and users here. 
364          Users overrides groups with the same name. */
365         return $user->UserName() === $group or
366                $member->isMember($group);
367     }
368
369     /**
370      * returns hash of default permissions.
371      * check if the page '.' exists and returns this instead.
372      */
373     function defaultPerms() {
374         //Todo: check for the existance of '.' and take this instead.
375         //Todo: honor more index.php auth settings here
376         $perm = array('view'   => array(ACL_EVERY => true),
377                       'edit'   => array(ACL_EVERY => true),
378                       'create' => array(ACL_EVERY => true),
379                       'list'   => array(ACL_EVERY => true),
380                       'remove' => array(ACL_ADMIN => true,
381                                         ACL_OWNER => true),
382                       'change' => array(ACL_ADMIN => true,
383                                         ACL_OWNER => true));
384         if (defined('ZIPDUMP_AUTH') && ZIPDUMP_AUTH)
385             $perm['dump'] = array(ACL_ADMIN => true,
386                                   ACL_OWNER => true);
387         else
388             $perm['dump'] = array(ACL_EVERY => true);
389         if (defined('REQUIRE_SIGNIN_BEFORE_EDIT') && REQUIRE_SIGNIN_BEFORE_EDIT)
390             $perm['edit'] = array(ACL_SIGNED => true);
391         if (defined('ALLOW_ANON_USER') && ! ALLOW_ANON_USER) {
392             if (defined('ALLOW_BOGO_USER') && ALLOW_BOGO_USER) {
393                 $perm['view'] = array(ACL_BOGOUSER => true);
394                 $perm['edit'] = array(ACL_BOGOUSER => true);
395             } elseif (defined('ALLOW_USER_PASSWORDS') && ALLOW_USER_PASSWORDS) {
396                 $perm['view'] = array(ACL_AUTHENTICATED => true);
397                 $perm['edit'] = array(ACL_AUTHENTICATED => true);
398             } else {
399                 $perm['view'] = array(ACL_SIGNED => true);
400                 $perm['edit'] = array(ACL_SIGNED => true);
401             }
402         }
403         return $perm;
404     }
405
406     function sanify() {
407         foreach ($this->perm as $access => $groups) {
408             foreach ($groups as $group => $bool) {
409                 $this->perm[$access][$group] = (boolean) $bool;
410             }
411         }
412     }
413     
414     /**
415      * returns list of all supported access types.
416      */
417     function accessTypes() {
418         return array_keys($this->defaultPerms());
419     }
420
421     /**
422      * special permissions for dot-files, beginning with '.'
423      * maybe also for '_' files?
424      */
425     function dotPerms() {
426         $def = array(ACL_ADMIN => true,
427                      ACL_OWNER => true);
428         $perm = array();
429         foreach ($this->accessTypes() as $access) {
430             $perm[$access] = $def;
431         }
432         return $perm;
433     }
434
435     /**
436      *  dead code. not needed inside the object. see getPagePermissions($page)
437      */
438     function retrieve($page) {
439         $hash = $page->get('perm');
440         if ($hash)  // hash => object
441             $perm = new PagePermission(unserialize($hash));
442         else 
443             $perm = new PagePermission();
444         $perm->sanify();
445         return $perm;
446     }
447
448     function store($page) {
449         // object => hash
450         $this->sanify();
451         return $page->set('perm',serialize($this->perm));
452     }
453
454     function groupName ($group) {
455         if ($group[0] == '_') return constant("GROUP".$group);
456         else return $group;
457     }
458     
459     /* type: page, default, inherited */
460     function asTable($type) {
461         $table = HTML::table();
462         foreach ($this->perm as $access => $perms) {
463             $td = HTML::table(array('class' => 'cal','valign' => 'top'));
464             foreach ($perms as $group => $bool) {
465                 $td->pushContent(HTML::tr(HTML::td(array('align'=>'right'),$group),
466                                                    HTML::td($bool ? '[X]' : '[ ]')));
467             }
468             $table->pushContent(HTML::tr(array('valign' => 'top'),
469                                          HTML::td($access),HTML::td($td)));
470         }
471         if ($type == 'default')
472             $table->setAttr('style','border: dotted thin black; background-color:#eee;');
473         elseif ($type == 'inherited')
474             $table->setAttr('style','border: dotted thin black; background-color:#ddd;');
475         elseif ($type == 'page')
476             $table->setAttr('style','border: solid thin black; font-weight: bold;');
477         return $table;
478     }
479     
480     /* type: page, default, inherited */
481     function asEditableTable($type) {
482         global $Theme;
483         if (!isset($this->_group)) { 
484             $this->_group =& WikiGroup::getGroup($GLOBALS['request']);
485         }
486         $table = HTML::table();
487         $table->pushContent(HTML::tr(
488                                      HTML::th(array('align' => 'left'),
489                                               _("Access")),
490                                      HTML::th(array('align'=>'right'),
491                                               _("Group/User")),
492                                      HTML::th(_("Grant")),
493                                      HTML::th(_("Del/Add")),
494                                      HTML::th(_("Description"))));
495         
496         $allGroups = $this->_group->_specialGroups();
497         foreach ($this->_group->getAllGroupsIn() as $group) {
498             if (!in_array($group,$this->_group->specialGroups()))
499                 $allGroups[] = $group;
500         }
501         //array_unique(array_merge($this->_group->getAllGroupsIn(),
502         $deletesrc = $Theme->getButtonURL('delete');
503         $nbsp = HTML::raw('&nbsp;');
504         foreach ($this->perm as $access => $groups) {
505             //$permlist = HTML::table(array('class' => 'cal','valign' => 'top'));
506             $first_only = true;
507             $newperm = HTML::input(array('type' => 'checkbox',
508                                          'name' => "acl[_new_perm][$access]",
509                                          'value' => 1));
510             $addbutton = HTML::input(array('type' => 'checkbox',
511                                            'name' => "acl[_add_group][$access]",
512                                            //'src'  => $addsrc,
513                                            //'alt'   => "Add",
514                                            'title' => _("Add this ACL"),
515                                            'value' => 1));
516             $newgroup = HTML::select(array('name' => "acl[_new_group][$access]",
517                                            'style'=> 'text-align: right;',
518                                            'size' => 1));
519             foreach ($allGroups as $groupname) {
520                 if (!isset($groups[$groupname]))
521                     $newgroup->pushContent(HTML::option(array('value' => $groupname),
522                                                         $this->groupName($groupname)));
523             }
524             if (empty($groups)) {
525                 $addbutton->setAttr('checked','checked');
526                 $newperm->setAttr('checked','checked');
527                 $table->pushContent(
528                     HTML::tr(array('valign' => 'top'),
529                              HTML::td(HTML::strong($access.":")),
530                              HTML::td($newgroup),
531                              HTML::td($nbsp,$newperm),
532                              HTML::td($nbsp,$addbutton),
533                              HTML::td(HTML::em(getAccessDescription($access)))));
534             }
535             foreach ($groups as $group => $bool) {
536                 $checkbox = HTML::input(array('type' => 'checkbox',
537                                               'name' => "acl[$access][$group]",
538                                               'title' => _("Allow / Deny"),
539                                               'value' => 1));
540                 if ($bool) $checkbox->setAttr('checked','checked');
541                 $checkbox = HTML(HTML::input(array('type' => 'hidden',
542                                                    'name' => "acl[$access][$group]",
543                                                    'value' => 0)),
544                                  $checkbox);
545                 $deletebutton = HTML::input(array('type' => 'checkbox',
546                                                   'name' => "acl[_del_group][$access][$group]",
547                                                   //'src'  => $deletesrc,
548                                                   //'alt'   => "Del",
549                                                   'title' => _("Delete this ACL"),
550                                                   'value' => 1));
551                 if ($first_only) {
552                     $table->pushContent(
553                         HTML::tr(
554                                  HTML::td(HTML::strong($access.":")),
555                                  HTML::td(array('class' => 'cal-today','align'=>'right'),
556                                           $this->groupName($group)),
557                                  HTML::td($nbsp,$checkbox),
558                                  HTML::td($nbsp,$deletebutton),
559                                  HTML::td(HTML::em(getAccessDescription($access)))));
560                     $first_only = false;
561                 } else {
562                     $table->pushContent(
563                         HTML::tr(
564                                  HTML::td(),
565                                  HTML::td(array('class' => 'cal-today','align'=>'right'),
566                                           $this->groupName($group)),
567                                  HTML::td($nbsp,$checkbox),
568                                  HTML::td($nbsp,$deletebutton),
569                                  HTML::td()));
570                 }
571             }
572             if (!empty($groups))
573                 $table->pushContent(
574                     HTML::tr(array('valign' => 'top'),
575                              HTML::td(array('align'=>'right'),_("add ")),
576                              HTML::td($newgroup),
577                              HTML::td($nbsp,$newperm),
578                              HTML::td($nbsp,$addbutton),
579                              HTML::td(HTML::small(_("Check to add this Acl")))));
580         }
581         if ($type == 'default')
582             $table->setAttr('style','border: dotted thin black; background-color:#eee;');
583         elseif ($type == 'inherited')
584             $table->setAttr('style','border: dotted thin black; background-color:#ddd;');
585         elseif ($type == 'page')
586             $table->setAttr('style','border: solid thin black; font-weight: bold;');
587         return $table;
588     }
589
590     // this is just a bad hack for testing
591     // simplify the ACL to a unix-like "rwx------" string
592     function asRwxString($owner,$group=false) {
593         global $request;
594         // simplify object => rwxrw---x+ string as in cygwin (+ denotes additional ACLs)
595         $perm =& $this->perm;
596         // get effective user and group
597         $s = '---------';
598         if (isset($perm['view'][$owner]) or 
599             (isset($perm['view'][ACL_AUTHENTICATED]) and $request->_user->isAuthenticated()))
600             $s[0] = 'r';
601         if (isset($perm['edit'][$owner]) or 
602             (isset($perm['edit'][ACL_AUTHENTICATED]) and $request->_user->isAuthenticated()))
603             $s[1] = 'w';
604         if (isset($perm['change'][$owner]) or 
605             (isset($perm['change'][ACL_AUTHENTICATED]) and $request->_user->isAuthenticated()))
606             $s[2] = 'x';
607         if (!empty($group)) {
608             if (isset($perm['view'][$group]) or 
609                 (isset($perm['view'][ACL_AUTHENTICATED]) and $request->_user->isAuthenticated()))
610                 $s[3] = 'r';
611             if (isset($perm['edit'][$group]) or 
612                 (isset($perm['edit'][ACL_AUTHENTICATED]) and $request->_user->isAuthenticated()))
613                 $s[4] = 'w';
614             if (isset($perm['change'][$group]) or 
615                 (isset($perm['change'][ACL_AUTHENTICATED]) and $request->_user->isAuthenticated()))
616                 $s[5] = 'x';
617         }
618         if (isset($perm['view'][ACL_EVERY]) or 
619             (isset($perm['view'][ACL_AUTHENTICATED]) and $request->_user->isAuthenticated()))
620             $s[6] = 'r';
621         if (isset($perm['edit'][ACL_EVERY]) or 
622             (isset($perm['edit'][ACL_AUTHENTICATED]) and $request->_user->isAuthenticated()))
623             $s[7] = 'w';
624         if (isset($perm['change'][ACL_EVERY]) or 
625             (isset($perm['change'][ACL_AUTHENTICATED]) and $request->_user->isAuthenticated()))
626             $s[8] = 'x';
627         return $s;
628     }
629 }
630
631 // $Log: not supported by cvs2svn $
632 // Revision 1.13  2004/05/15 19:48:33  rurban
633 // fix some too loose PagePerms for signed, but not authenticated users
634 //  (admin, owner, creator)
635 // no double login page header, better login msg.
636 // moved action_pdf to lib/pdf.php
637 //
638 // Revision 1.12  2004/05/04 22:34:25  rurban
639 // more pdf support
640 //
641 // Revision 1.11  2004/05/02 21:26:38  rurban
642 // limit user session data (HomePageHandle and auth_dbi have to invalidated anyway)
643 //   because they will not survive db sessions, if too large.
644 // extended action=upgrade
645 // some WikiTranslation button work
646 // revert WIKIAUTH_UNOBTAINABLE (need it for main.php)
647 // some temp. session debug statements
648 //
649 // Revision 1.10  2004/04/29 22:32:56  zorloc
650 // Slightly more elegant fix.  Instead of WIKIAUTH_FORBIDDEN, the current user's level + 1 is returned on a false.
651 //
652 // Revision 1.9  2004/04/29 17:18:19  zorloc
653 // Fixes permission failure issues.  With PagePermissions and Disabled Actions when user did not have permission WIKIAUTH_FORBIDDEN was returned.  In WikiUser this was ok because WIKIAUTH_FORBIDDEN had a value of 11 -- thus no user could perform that action.  But WikiUserNew has a WIKIAUTH_FORBIDDEN value of -1 -- thus a user without sufficent permission to do anything.  The solution is a new high value permission level (WIKIAUTH_UNOBTAINABLE) to be the default level for access failure.
654 //
655 // Revision 1.8  2004/03/14 16:24:35  rurban
656 // authenti(fi)cation spelling
657 //
658 // Revision 1.7  2004/02/28 22:25:07  rurban
659 // First PagePerm implementation:
660 //
661 // $Theme->setAnonEditUnknownLinks(false);
662 //
663 // Layout improvement with dangling links for mostly closed wiki's:
664 // If false, only users with edit permissions will be presented the
665 // special wikiunknown class with "?" and Tooltip.
666 // If true (default), any user will see the ?, but will be presented
667 // the PrintLoginForm on a click.
668 //
669 // Revision 1.6  2004/02/24 15:20:05  rurban
670 // fixed minor warnings: unchecked args, POST => Get urls for sortby e.g.
671 //
672 // Revision 1.5  2004/02/23 21:30:25  rurban
673 // more PagePerm stuff: (working against 1.4.0)
674 //   ACL editing and simplification of ACL's to simple rwx------ string
675 //   not yet working.
676 //
677 // Revision 1.4  2004/02/12 13:05:36  rurban
678 // Rename functional for PearDB backend
679 // some other minor changes
680 // SiteMap comes with a not yet functional feature request: includepages (tbd)
681 //
682 // Revision 1.3  2004/02/09 03:58:12  rurban
683 // for now default DB_SESSION to false
684 // PagePerm:
685 //   * not existing perms will now query the parent, and not
686 //     return the default perm
687 //   * added pagePermissions func which returns the object per page
688 //   * added getAccessDescription
689 // WikiUserNew:
690 //   * added global ->prepare (not yet used) with smart user/pref/member table prefixing.
691 //   * force init of authdbh in the 2 db classes
692 // main:
693 //   * fixed session handling (not triple auth request anymore)
694 //   * don't store cookie prefs with sessions
695 // stdlib: global obj2hash helper from _AuthInfo, also needed for PagePerm
696 //
697 // Revision 1.2  2004/02/08 13:17:48  rurban
698 // This should be the functionality. Needs testing and some minor todos.
699 //
700 // Revision 1.1  2004/02/08 12:29:30  rurban
701 // initial version, not yet hooked into lib/main.php
702 //
703 //
704
705 // Local Variables:
706 // mode: php
707 // tab-width: 8
708 // c-basic-offset: 4
709 // c-hanging-comment-ender-p: nil
710 // indent-tabs-mode: nil
711 // End:
712 ?>