From: <var...@us...> - 2008-10-10 12:50:01
|
Revision: 6294 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6294&view=rev Author: vargenau Date: 2008-10-10 12:49:53 +0000 (Fri, 10 Oct 2008) Log Message: ----------- Revert: file was committed by mistake Modified Paths: -------------- trunk/lib/plugin/WikiAdminSetAcl.php Modified: trunk/lib/plugin/WikiAdminSetAcl.php =================================================================== --- trunk/lib/plugin/WikiAdminSetAcl.php 2008-10-07 16:02:56 UTC (rev 6293) +++ trunk/lib/plugin/WikiAdminSetAcl.php 2008-10-10 12:49:53 UTC (rev 6294) @@ -2,7 +2,6 @@ rcs_id('$Id$'); /* Copyright 2004 $ThePhpWikiProgrammingTeam - Copyright 2008 Marc-Etienne Vargenau, Alcatel-Lucent This file is part of PhpWiki. @@ -190,28 +189,21 @@ $header->pushContent(HTML::p(_("Select the pages to change:"))); } - if ($next_action == 'verify') { - $req = $request->getArgs(); - } else { - $req = $request->getArgs(); - unset($req['acl']); - } - $buttons = HTML::p(Button('submit:admin_setacl[acl]', $button_label, 'wikiadmin'), Button('submit:admin_setacl[cancel]', _("Cancel"), 'button')); return HTML::form(array('action' => $request->getPostURL(), 'method' => 'post'), $header, - $buttons, $pagelist->getContent(), - HiddenInputs( $req, + HiddenInputs($request->getArgs(), false, array('admin_setacl')), HiddenInputs(array('admin_setacl[action]' => $next_action)), ENABLE_PAGEPERM ? '' - : HiddenInputs(array('require_authority_for_post' => WIKIAUTH_ADMIN))); + : HiddenInputs(array('require_authority_for_post' => WIKIAUTH_ADMIN)), + $buttons); } function setaclForm(&$header, $post_args, $pagehash) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-02-13 16:21:03
|
Revision: 6497 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6497&view=rev Author: vargenau Date: 2009-02-13 16:20:08 +0000 (Fri, 13 Feb 2009) Log Message: ----------- Valid XHTML Modified Paths: -------------- trunk/lib/plugin/WikiAdminSetAcl.php Modified: trunk/lib/plugin/WikiAdminSetAcl.php =================================================================== --- trunk/lib/plugin/WikiAdminSetAcl.php 2009-02-13 16:18:19 UTC (rev 6496) +++ trunk/lib/plugin/WikiAdminSetAcl.php 2009-02-13 16:20:08 UTC (rev 6497) @@ -138,7 +138,7 @@ $pages = $p; elseif ($this->_list) $pages = $this->_list; - $header = HTML::p(); + $header = HTML::div(); if ($p && $request->isPost() && !empty($post_args['acl']) && empty($post_args['cancel'])) { // without individual PagePermissions: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-03-22 14:32:18
|
Revision: 6685 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6685&view=rev Author: vargenau Date: 2009-03-22 14:32:13 +0000 (Sun, 22 Mar 2009) Log Message: ----------- More compact ACL display Modified Paths: -------------- trunk/lib/plugin/WikiAdminSetAcl.php Modified: trunk/lib/plugin/WikiAdminSetAcl.php =================================================================== --- trunk/lib/plugin/WikiAdminSetAcl.php 2009-03-22 14:04:19 UTC (rev 6684) +++ trunk/lib/plugin/WikiAdminSetAcl.php 2009-03-22 14:32:13 UTC (rev 6685) @@ -268,7 +268,20 @@ class _PageList_Column_acl extends _PageList_Column { function _getValue ($page_handle, &$revision_handle) { $perm_tree = pagePermissions($page_handle->_pagename); - return pagePermissionsAclFormat($perm_tree); + + list($type, $perm) = pagePermissionsAcl($perm_tree[0], $perm_tree); + if ($type == 'inherited') { + $type = sprintf(_("page permission inherited from %s"), $perm_tree[1][0]); + } elseif ($type == 'page') { + $type = _("invidual page permission"); + } elseif ($type == 'default') { + $type = _("default page permission"); + } + $result = HTML::span(); + $result->pushContent($type); + $result->pushContent(HTML::br()); + $result->pushContent($perm->asAclLines()); + return $result; } }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-03-22 14:41:30
|
Revision: 6686 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6686&view=rev Author: vargenau Date: 2009-03-22 14:41:25 +0000 (Sun, 22 Mar 2009) Log Message: ----------- Put buttons next to question Modified Paths: -------------- trunk/lib/plugin/WikiAdminSetAcl.php Modified: trunk/lib/plugin/WikiAdminSetAcl.php =================================================================== --- trunk/lib/plugin/WikiAdminSetAcl.php 2009-03-22 14:32:13 UTC (rev 6685) +++ trunk/lib/plugin/WikiAdminSetAcl.php 2009-03-22 14:41:25 UTC (rev 6686) @@ -195,6 +195,7 @@ return HTML::form(array('action' => $request->getPostURL(), 'method' => 'post'), $header, + $buttons, $pagelist->getContent(), HiddenInputs($request->getArgs(), false, @@ -202,8 +203,7 @@ HiddenInputs(array('admin_setacl[action]' => $next_action)), ENABLE_PAGEPERM ? '' - : HiddenInputs(array('require_authority_for_post' => WIKIAUTH_ADMIN)), - $buttons); + : HiddenInputs(array('require_authority_for_post' => WIKIAUTH_ADMIN))); } function setaclForm(&$header, $post_args, $pagehash) { @@ -260,7 +260,7 @@ HTML::br(),HTML::em(_("(Currently not working)")) ); } - $header->pushContent(HTML::hr(),HTML::p()); + $header->pushContent(HTML::hr()); return $header; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-03-22 20:33:47
|
Revision: 6689 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6689&view=rev Author: vargenau Date: 2009-03-22 20:33:39 +0000 (Sun, 22 Mar 2009) Log Message: ----------- Do not display getfacl Modified Paths: -------------- trunk/lib/plugin/WikiAdminSetAcl.php Modified: trunk/lib/plugin/WikiAdminSetAcl.php =================================================================== --- trunk/lib/plugin/WikiAdminSetAcl.php 2009-03-22 17:39:00 UTC (rev 6688) +++ trunk/lib/plugin/WikiAdminSetAcl.php 2009-03-22 20:33:39 UTC (rev 6689) @@ -228,7 +228,6 @@ elseif ($type == 'default') $type = _("default page permission"); $header->pushContent(HTML::strong(_("Type").': '), HTML::tt($type),HTML::br()); - $header->pushContent(HTML::strong(_("getfacl").': '), pagePermissionsSimpleFormat($perm_tree, $owner),HTML::br()); $header->pushContent(HTML::strong(_("ACL").': '), HTML::tt($perm->asAclGroupLines()),HTML::br()); $header->pushContent(HTML::p(HTML::strong(_("Description").': '), @@ -236,7 +235,7 @@ _("To ignore delete the line."), _("To add check 'Add' near the dropdown list.") )); - $header->pushContent(HTML::blockquote($table)); + $header->pushContent($table); // // display array of checkboxes for existing perms // and a dropdown for user/group to add perms. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-03-23 07:41:19
|
Revision: 6690 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6690&view=rev Author: vargenau Date: 2009-03-23 07:41:14 +0000 (Mon, 23 Mar 2009) Log Message: ----------- Create new revision so that ACL change appears in history Modified Paths: -------------- trunk/lib/plugin/WikiAdminSetAcl.php Modified: trunk/lib/plugin/WikiAdminSetAcl.php =================================================================== --- trunk/lib/plugin/WikiAdminSetAcl.php 2009-03-22 20:33:39 UTC (rev 6689) +++ trunk/lib/plugin/WikiAdminSetAcl.php 2009-03-23 07:41:14 UTC (rev 6690) @@ -99,6 +99,18 @@ elseif (mayAccessPage('change', $pagename)) { setPagePermissions ($page, $perm); $ul->pushContent(HTML::li(fmt("ACL changed for page '%s'.",$pagename))); + + // Create new revision so that ACL change appears in history. + $current = $page->getCurrentRevision(); + $version = $current->getVersion(); + $meta = $current->_data; + $text = $current->getPackedContent(); + $meta['summary'] = sprintf(_("ACL changed for page '%s'."), $pagename); + $meta['is_minor_edit'] = 0; + $meta['author'] = $request->_user->UserName(); + unset($meta['mtime']); // force new date + $page->save($text, $version + 1, $meta); + $count++; } else { $ul->pushContent(HTML::li(fmt("Access denied to change page '%s'.",$pagename))); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-06-02 15:21:53
|
Revision: 6842 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6842&view=rev Author: vargenau Date: 2009-06-02 15:21:49 +0000 (Tue, 02 Jun 2009) Log Message: ----------- Give more information: ACL changed from X to Y Modified Paths: -------------- trunk/lib/plugin/WikiAdminSetAcl.php Modified: trunk/lib/plugin/WikiAdminSetAcl.php =================================================================== --- trunk/lib/plugin/WikiAdminSetAcl.php 2009-06-01 13:44:55 UTC (rev 6841) +++ trunk/lib/plugin/WikiAdminSetAcl.php 2009-06-02 15:21:49 UTC (rev 6842) @@ -65,7 +65,7 @@ } function setaclPages(&$request, $pages, $acl) { - $ul = HTML::ul(); + $result = HTML::div(); $count = 0; $dbi =& $request->_dbi; // check new_group and new_perm @@ -94,18 +94,28 @@ $oldperm = getPagePermissions($page); if ($oldperm) $oldperm->sanify(); - if ($oldperm and $perm->equal($oldperm->perm)) // (serialize($oldperm->perm) == serialize($perm->perm)) - $ul->pushContent(HTML::li(fmt("ACL not changed for page '%s'.",$pagename))); - elseif (mayAccessPage('change', $pagename)) { + if ($oldperm and $perm->equal($oldperm->perm)) { + $result->setAttr('class', 'error'); + $result->pushContent(HTML::p(fmt("ACL not changed for page '%s'.",$pagename))); + } elseif (mayAccessPage('change', $pagename)) { setPagePermissions ($page, $perm); - $ul->pushContent(HTML::li(fmt("ACL changed for page '%s'.",$pagename))); + $result->setAttr('class', 'feedback'); + $result->pushContent(HTML::p(fmt("ACL changed for page '%s'", + $pagename))); + $result->pushContent(HTML::p(fmt("from '%s'", + $oldperm ? $oldperm->asAclGroupLines() : "None"))); + $result->pushContent(HTML::p(fmt("to '%s'.", + $perm->asAclGroupLines()))); // Create new revision so that ACL change appears in history. $current = $page->getCurrentRevision(); $version = $current->getVersion(); $meta = $current->_data; $text = $current->getPackedContent(); - $meta['summary'] = sprintf(_("ACL changed for page '%s'."), $pagename); + $meta['summary'] = sprintf(_("ACL changed for page '%s' from '%s' to '%s'."), + $pagename, + $oldperm ? $oldperm->asAclGroupLines() : "None", + $perm->asAclGroupLines()); $meta['is_minor_edit'] = 0; $meta['author'] = $request->_user->UserName(); unset($meta['mtime']); // force new date @@ -113,20 +123,24 @@ $count++; } else { - $ul->pushContent(HTML::li(fmt("Access denied to change page '%s'.",$pagename))); + $result->setAttr('class', 'error'); + $result->pushContent(HTML::p(fmt("Access denied to change page '%s'.",$pagename))); } } } else { - $ul->pushContent(HTML::li(fmt("Invalid ACL"))); + $result->pushContent(HTML::p(fmt("Invalid ACL"))); } if ($count) { $dbi->touch(); - return HTML($ul, - HTML::p(fmt("%s pages have been changed.",$count))); + $result->setAttr('class', 'feedback'); + if ($count > 1) { + $result->pushContent(HTML::p(fmt("%s pages have been changed.",$count))); + } } else { - return HTML($ul, - HTML::p(fmt("No pages changed."))); + $result->setAttr('class', 'error'); + $result->pushContent(HTML::p(fmt("No pages changed."))); } + return $result; } function run($dbi, $argstr, &$request, $basepage) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-08-10 12:30:53
|
Revision: 7637 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7637&view=rev Author: vargenau Date: 2010-08-10 12:30:47 +0000 (Tue, 10 Aug 2010) Log Message: ----------- Remove commented code Modified Paths: -------------- trunk/lib/plugin/WikiAdminSetAcl.php Modified: trunk/lib/plugin/WikiAdminSetAcl.php =================================================================== --- trunk/lib/plugin/WikiAdminSetAcl.php 2010-08-10 07:38:13 UTC (rev 7636) +++ trunk/lib/plugin/WikiAdminSetAcl.php 2010-08-10 12:30:47 UTC (rev 7637) @@ -136,8 +136,6 @@ } function run($dbi, $argstr, &$request, $basepage) { - //if (!DEBUG) - // return $this->disabled("WikiAdminSetAcl not yet enabled. Set DEBUG to try it."); if ($request->getArg('action') != 'browse') if ($request->getArg('action') != _("PhpWikiAdministration/SetAcl")) return $this->disabled("(action != 'browse')"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-12-09 13:58:32
|
Revision: 10755 http://sourceforge.net/p/phpwiki/code/10755 Author: vargenau Date: 2021-12-09 13:58:30 +0000 (Thu, 09 Dec 2021) Log Message: ----------- WikiAdminSetAcl plugin: factor code Modified Paths: -------------- trunk/lib/plugin/WikiAdminSetAcl.php Modified: trunk/lib/plugin/WikiAdminSetAcl.php =================================================================== --- trunk/lib/plugin/WikiAdminSetAcl.php 2021-12-09 13:47:59 UTC (rev 10754) +++ trunk/lib/plugin/WikiAdminSetAcl.php 2021-12-09 13:58:30 UTC (rev 10755) @@ -57,7 +57,7 @@ )); } - protected function setaclPages(&$request, $pages, $acl) + protected function setaclPages($request, $pages, $acl) { $result = HTML::div(); $count = 0; @@ -194,15 +194,15 @@ $pages = $this->collectPages($pages, $dbi, $args['sortby'], $args['limit'], $args['exclude']); } + $pagelist = new PageList_Selectable($args['info'], + $args['exclude'], + array('types' => array( + 'perm' + => new _PageList_Column_perm('perm', _("Permission")), + 'acl' + => new _PageList_Column_acl('acl', _("ACL"))))); + $pagelist->addPageList($pages); if ($next_action == 'verify') { - $pagelist = new PageList_Selectable($args['info'], - $args['exclude'], - array('types' => array( - 'perm' - => new _PageList_Column_perm('perm', _("Permission")), - 'acl' - => new _PageList_Column_acl('acl', _("ACL"))))); - $pagelist->addPageList($pages); $button_label = _("Yes"); $header = $this->setaclForm($header, $post_args, $pages); $header->pushContent( @@ -209,14 +209,6 @@ HTML::p(HTML::strong( _("Are you sure you want to permanently change access rights to the selected pages?")))); } else { - $pagelist = new PageList_Selectable($args['info'], - $args['exclude'], - array('types' => array( - 'perm' - => new _PageList_Column_perm('perm', _("Permission")), - 'acl' - => new _PageList_Column_acl('acl', _("ACL"))))); - $pagelist->addPageList($pages); $button_label = _("Change Access Rights"); $header = $this->setaclForm($header, $post_args, $pages); $header->pushContent(HTML::legend(_("Select the pages where to change access rights"))); @@ -240,7 +232,7 @@ : HiddenInputs(array('require_authority_for_post' => WIKIAUTH_ADMIN))); } - function setaclForm(&$header, $post_args, $pagehash) + private function setaclForm($header, $post_args, $pagehash) { /** * @var WikiRequest $request @@ -247,8 +239,6 @@ */ global $request; - $acl = $post_args['acl']; - //FIXME: find intersection of all pages perms, not just from the last pagename $pages = array(); foreach ($pagehash as $name => $checked) { @@ -258,13 +248,12 @@ $table = pagePermissionsAclFormat($perm_tree, !empty($pages)); $header->pushContent(HTML::strong(_("Selected Pages: ")), HTML::samp(join(', ', $pages)), HTML::br()); $first_page = $request->_dbi->getPage($name); - $owner = $first_page->getOwner(); list($type, $perm) = pagePermissionsAcl($perm_tree[0], $perm_tree); - //if (DEBUG) $header->pushContent(HTML::pre("Permission tree for $name:\n",print_r($perm_tree,true))); if ($type == 'inherited') $type = sprintf(_("page permission inherited from %s"), $perm_tree[1][0]); elseif ($type == 'page') - $type = _("individual page permission"); elseif ($type == 'default') + $type = _("individual page permission"); + elseif ($type == 'default') $type = _("default page permission"); $header->pushContent(HTML::strong(_("Type") . _(": ")), HTML::samp($type), HTML::br()); $header->pushContent(HTML::strong(_("ACL") . _(": ")), HTML::samp($perm->asAclLines()), HTML::br()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2022-01-06 10:50:45
|
Revision: 10847 http://sourceforge.net/p/phpwiki/code/10847 Author: vargenau Date: 2022-01-06 10:50:44 +0000 (Thu, 06 Jan 2022) Log Message: ----------- lib/plugin/WikiAdminSetAcl.php: selected pages --> following pages Modified Paths: -------------- trunk/lib/plugin/WikiAdminSetAcl.php Modified: trunk/lib/plugin/WikiAdminSetAcl.php =================================================================== --- trunk/lib/plugin/WikiAdminSetAcl.php 2022-01-06 10:43:10 UTC (rev 10846) +++ trunk/lib/plugin/WikiAdminSetAcl.php 2022-01-06 10:50:44 UTC (rev 10847) @@ -207,7 +207,7 @@ $header = $this->setaclForm($header, $post_args, $pages); $header->pushContent( HTML::p(HTML::strong( - _("Are you sure you want to permanently change access rights to the selected pages?")))); + _("Are you sure you want to permanently change access rights to the following pages?")))); } else { $button_label = _("Change Access Rights"); $header = $this->setaclForm($header, $post_args, $pages); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |