From: <var...@us...> - 2009-02-13 09:58:55
|
Revision: 6491 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6491&view=rev Author: vargenau Date: 2009-02-13 09:58:46 +0000 (Fri, 13 Feb 2009) Log Message: ----------- Change of page ownership now recordered in history Modified Paths: -------------- trunk/lib/plugin/WikiAdminChown.php Modified: trunk/lib/plugin/WikiAdminChown.php =================================================================== --- trunk/lib/plugin/WikiAdminChown.php 2009-02-12 18:43:27 UTC (rev 6490) +++ trunk/lib/plugin/WikiAdminChown.php 2009-02-13 09:58:46 UTC (rev 6491) @@ -2,7 +2,7 @@ rcs_id('$Id$'); /* Copyright 2004 $ThePhpWikiProgrammingTeam - Copyright 2008 Marc-Etienne Vargenau, Alcatel-Lucent + Copyright 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent This file is part of PhpWiki. @@ -39,7 +39,7 @@ } function getDescription() { - return _("Chown selected pages."); + return _("Change owner of selected pages."); } function getVersion() { @@ -64,19 +64,25 @@ $count = 0; foreach ($pages as $name) { $page = $dbi->getPage($name); + $current = $page->getCurrentRevision(); if ( ($owner = $page->getOwner()) and $newowner != $owner ) { if (!mayAccessPage('change', $name)) { $ul->pushContent(HTML::li(fmt("Access denied to change page '%s'.", WikiLink($name)))); } else { + $version = $current->getVersion(); + $meta = $current->_data; + $text = $current->getPackedContent(); + $meta['summary'] = sprintf(_("Change page owner from %s to %s"), $owner, $newowner); $page->set('owner', $newowner); + $page->save($text, $version + 1, $meta); if ($page->get('owner') === $newowner) { - $ul->pushContent(HTML::li(fmt("Chown page '%s' to '%s'.", + $ul->pushContent(HTML::li(fmt("Change owner of page '%s' to '%s'.", WikiLink($name), WikiLink($newowner)))); $count++; } else { - $ul->pushContent(HTML::li(fmt("Couldn't chown page '%s' to '%s'.", + $ul->pushContent(HTML::li(fmt("Could not change owner of page '%s' to '%s'.", WikiLink($name), $newowner))); } } @@ -154,11 +160,11 @@ $button_label = _("Yes"); $header->pushContent( HTML::p(HTML::strong( - _("Are you sure you want to permanently chown the selected files?")))); + _("Are you sure you want to permanently change the owner of the selected pages?")))); $header = $this->chownForm($header, $post_args); } else { - $button_label = _("Chown selected pages"); + $button_label = _("Change owner of selected pages"); $header->pushContent(HTML::p(_("Select the pages to change the owner:"))); $header = $this->chownForm($header, $post_args); } @@ -181,7 +187,7 @@ } function chownForm(&$header, $post_args) { - $header->pushContent(_("Chown")." "); + $header->pushContent(_("Change owner")." "); $header->pushContent(' '._("to").': '); $header->pushContent(HTML::input(array('name' => 'admin_chown[user]', 'value' => $post_args['user']))); 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:18:24
|
Revision: 6496 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6496&view=rev Author: vargenau Date: 2009-02-13 16:18:19 +0000 (Fri, 13 Feb 2009) Log Message: ----------- Set author and modification time Modified Paths: -------------- trunk/lib/plugin/WikiAdminChown.php Modified: trunk/lib/plugin/WikiAdminChown.php =================================================================== --- trunk/lib/plugin/WikiAdminChown.php 2009-02-13 16:17:09 UTC (rev 6495) +++ trunk/lib/plugin/WikiAdminChown.php 2009-02-13 16:18:19 UTC (rev 6496) @@ -75,6 +75,9 @@ $meta = $current->_data; $text = $current->getPackedContent(); $meta['summary'] = sprintf(_("Change page owner from %s to %s"), $owner, $newowner); + $meta['is_minor_edit'] = 0; + $meta['author'] = $request->_user->UserName(); + unset($meta['mtime']); // force new date $page->set('owner', $newowner); $page->save($text, $version + 1, $meta); if ($page->get('owner') === $newowner) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-04-09 16:18:37
|
Revision: 6777 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6777&view=rev Author: vargenau Date: 2009-04-09 16:18:22 +0000 (Thu, 09 Apr 2009) Log Message: ----------- Trim user name Modified Paths: -------------- trunk/lib/plugin/WikiAdminChown.php Modified: trunk/lib/plugin/WikiAdminChown.php =================================================================== --- trunk/lib/plugin/WikiAdminChown.php 2009-04-09 16:06:54 UTC (rev 6776) +++ trunk/lib/plugin/WikiAdminChown.php 2009-04-09 16:18:22 UTC (rev 6777) @@ -135,7 +135,7 @@ if ($post_args['action'] == 'verify') { // Real action return $this->chownPages($dbi, $request, array_keys($p), - $post_args['user']); + trim($post_args['user'])); } if ($post_args['action'] == 'select') { if (!empty($post_args['user'])) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-04-18 16:19:40
|
Revision: 6783 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6783&view=rev Author: vargenau Date: 2009-04-18 16:19:38 +0000 (Sat, 18 Apr 2009) Log Message: ----------- No need for empty <p> Modified Paths: -------------- trunk/lib/plugin/WikiAdminChown.php Modified: trunk/lib/plugin/WikiAdminChown.php =================================================================== --- trunk/lib/plugin/WikiAdminChown.php 2009-04-18 16:18:45 UTC (rev 6782) +++ trunk/lib/plugin/WikiAdminChown.php 2009-04-18 16:19:38 UTC (rev 6783) @@ -194,7 +194,6 @@ $header->pushContent(' '._("to").': '); $header->pushContent(HTML::input(array('name' => 'admin_chown[user]', 'value' => $post_args['user']))); - $header->pushContent(HTML::p()); return $header; } } 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:42:16
|
Revision: 10752 http://sourceforge.net/p/phpwiki/code/10752 Author: vargenau Date: 2021-12-09 13:42:14 +0000 (Thu, 09 Dec 2021) Log Message: ----------- WikiAdminChown plugin: avoid warning Modified Paths: -------------- trunk/lib/plugin/WikiAdminChown.php Modified: trunk/lib/plugin/WikiAdminChown.php =================================================================== --- trunk/lib/plugin/WikiAdminChown.php 2021-12-09 13:08:42 UTC (rev 10751) +++ trunk/lib/plugin/WikiAdminChown.php 2021-12-09 13:42:14 UTC (rev 10752) @@ -52,7 +52,7 @@ )); } - private function chownPages(&$dbi, &$request, $pages, $newowner) + private function chownPages($dbi, $request, $pages, $newowner) { $result = HTML::div(); $ul = HTML::ul(); @@ -127,6 +127,9 @@ $p = $request->getArg('p'); if (!$p) $p = $this->_list; $post_args = $request->getArg('admin_chown'); + if ($post_args === false) { + $post_args = array(); + } if (!$request->isPost() and empty($post_args['user'])) $post_args['user'] = $args['user']; $next_action = 'select'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2022-01-06 09:31:49
|
Revision: 10842 http://sourceforge.net/p/phpwiki/code/10842 Author: vargenau Date: 2022-01-06 09:31:46 +0000 (Thu, 06 Jan 2022) Log Message: ----------- lib/plugin/WikiAdminChown.php: make value readonly when confirming Modified Paths: -------------- trunk/lib/plugin/WikiAdminChown.php Modified: trunk/lib/plugin/WikiAdminChown.php =================================================================== --- trunk/lib/plugin/WikiAdminChown.php 2022-01-06 09:18:29 UTC (rev 10841) +++ trunk/lib/plugin/WikiAdminChown.php 2022-01-06 09:31:46 UTC (rev 10842) @@ -169,19 +169,23 @@ $button_label = _("Yes"); $header->pushContent(HTML::legend(_("Confirm ownership change"))); $header->pushContent(HTML::p(HTML::strong( - _("Are you sure you want to change the owner of the selected pages?")))); + _("Are you sure you want to change the owner of the following pages?")))); + $header->pushContent(_("Change owner to: ")); + $header->pushContent(HTML::input(array('name' => 'admin_chown[user]', + 'value' => $post_args['user'], + 'size' => 40, + 'readonly' => 'readonly'))); } else { $pagelist = new PageList_Selectable($args['info'], $args['exclude'], $args); $pagelist->addPageList($pages); $button_label = _("Change owner of selected pages"); $header->pushContent(HTML::legend(_("Select the pages to change the owner"))); + $header->pushContent(_("Change owner to: ")); + $header->pushContent(HTML::input(array('name' => 'admin_chown[user]', + 'value' => $post_args['user'], + 'size' => 40))); } - $header->pushContent(_("Change owner to: ")); - $header->pushContent(HTML::input(array('name' => 'admin_chown[user]', - 'value' => $post_args['user'], - 'size' => 40))); - $buttons = HTML::p(Button('submit:admin_chown[chown]', $button_label, 'wikiadmin'), HTML::raw(" "), Button('submit:admin_chown[cancel]', _("Cancel"), 'button')); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |