From: <var...@us...> - 2010-05-04 13:49:33
|
Revision: 7378 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7378&view=rev Author: vargenau Date: 2010-05-04 13:49:26 +0000 (Tue, 04 May 2010) Log Message: ----------- Add Gforge Wiki Configurator Added Paths: ----------- trunk/wikiadmin.php Added: trunk/wikiadmin.php =================================================================== --- trunk/wikiadmin.php (rev 0) +++ trunk/wikiadmin.php 2010-05-04 13:49:26 UTC (rev 7378) @@ -0,0 +1,177 @@ +<?php // -*-php-*- +rcs_id('$Id$'); +/* + * Copyright (C) 2009 Alain Peyrat, Alcatel-Lucent + * Copyright (C) 2009 Marc-Etienne Vargenau, Alcatel-Lucent + * + * This file is part of PhpWiki. + * + * PhpWiki is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * PhpWiki is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with PhpWiki; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* + * Standard Alcatel-Lucent disclaimer for contributing to open source + * + * "The Wiki Configurator ("Contribution") has not been tested and/or + * validated for release as or in products, combinations with products or + * other commercial use. Any use of the Contribution is entirely made at + * the user's own responsibility and the user can not rely on any features, + * functionalities or performances Alcatel-Lucent has attributed to the + * Contribution. + * + * THE CONTRIBUTION BY ALCATEL-LUCENT IS PROVIDED AS IS, WITHOUT WARRANTY + * OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, COMPLIANCE, + * NON-INTERFERENCE AND/OR INTERWORKING WITH THE SOFTWARE TO WHICH THE + * CONTRIBUTION HAS BEEN MADE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * ALCATEL-LUCENT BE LIABLE FOR ANY DAMAGES OR OTHER LIABLITY, WHETHER IN + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * CONTRIBUTION OR THE USE OR OTHER DEALINGS IN THE CONTRIBUTION, WHETHER + * TOGETHER WITH THE SOFTWARE TO WHICH THE CONTRIBUTION RELATES OR ON A STAND + * ALONE BASIS." + */ + +require_once dirname(__FILE__)."/../../env.inc.php"; +require_once $gfwww.'include/pre.php'; +require_once $sys_plugins_path.'wiki/common/WikiPlugin.class.php'; +require_once $sys_plugins_path.'wiki/common/wikiconfig.class.php'; + +// the header that displays for the user portion of the plugin +function wiki_Project_Header($params) { + global $id; + $params['toptab']='wiki'; + $params['group']=$id; + /* + Show horizontal links + */ + site_project_header($params); +} + +$user = session_get_user(); // get the session user + +if (!$user || !is_object($user) || $user->isError() || !$user->isActive()) { + exit_error("Invalid User", "Cannot Process your request for this user."); +} + +$type = getStringFromRequest('type'); +$id = getIntFromRequest('id'); +$pluginname = 'wiki'; +$config = getArrayFromRequest('config'); + +if (!$type) { + exit_error("Cannot Process your request","No TYPE specified"); +} elseif (!$id) { + exit_error("Cannot Process your request","No ID specified"); +} else { + if ($type == 'admin_post') { + $group = group_get_object($id); + if ( !$group) { + exit_error(_('Invalid Project'), _('Inexistent Project')); + } + if (!($group->usesPlugin($pluginname))) { //check if the group has the wiki plugin active + exit_error("Error", "First activate the $pluginname plugin through the Project's Admin Interface"); + } + $userperm = $group->getPermission($user); //we'll check if the user belongs to the group + if ( !$userperm->IsMember()) { + exit_error(_('Access Denied'), _('You are not a member of this project')); + } + //only project admin can access here + if ( $userperm->isAdmin() ) { + + $wc = new WikiConfig($id); + + foreach ($wc->getWikiConfigNames() as $c) { + if ( ! array_key_exists($c, $config)) { + $config[$c] = 0; + } + } + + foreach ($config as $config_name => $config_value) { + $r = $wc->updateWikiConfig($config_name, $config_value); + if (!$r) exit_error("Error", $wc->getErrorMessage()); + } + + $type = 'admin'; + $feedback = _('Configuration saved.'); + } else { + exit_error(_('Access Denied'), _('You are not a project Admin')); + } + } + if ($type == 'admin') { + $group = group_get_object($id); + if ( !$group) { + exit_error(_('Invalid Project'), _('Inexistent Project')); + } + if ( ! ($group->usesPlugin ($pluginname)) ) {//check if the group has the plugin active + exit_error("Error", "First activate the $pluginname plugin through the Project's Admin Interface"); + } + $userperm = $group->getPermission($user); //we'll check if the user belongs to the group + if ( !$userperm->IsMember()) { + exit_error(_('Access Denied'), _('You are not a member of this project')); + } + //only project admin can access here + if ( $userperm->isAdmin() ) { + wiki_Project_Header(array('title'=>$pluginname . ' Project Plugin!','pagename'=>"$pluginname",'sectionvals'=>array(group_getname($id)))); + + $wc = new WikiConfig($id); + + print "\n<h1>"._("Configuration for your project's Wiki")."</h1>\n"; + + print "<table>\n"; + print "<tr>\n"; + print "<td>\n"; + print "<fieldset>\n"; + print "<legend>"._('Wiki Configuration')."</legend>\n"; + print "<form action=\"/plugins/wiki/wikiadmin.php\" method=\"post\">\n"; + print "<input type=\"hidden\" name=\"id\" value=\"$id\" />\n"; + print "<input type=\"hidden\" name=\"pluginname\" value=\"$pluginname\" />\n"; + print "<input type=\"hidden\" name=\"type\" value=\"admin_post\" />\n"; + + print '<table class="listing">'; + print "\n<thead>\n<tr>\n<th>". + _("Parameter"). + "</th>" . + "<th>". + _("Value"). + "</th>\n" . + "</tr>\n</thead>\n"; + + foreach ($wc->getWikiConfigNames() as $c) { + $checked = $wc->getWikiConfig($c) ? ' checked="checked"' : ''; + $desc = $wc->getWikiConfigDescription($c); + + print "<tr>\n<td>$desc</td>\n" . + "<td align=\"center\">" . + "<input type=\"checkbox\" name=\"config[$c]\" value=\"1\"$checked /></td>\n" . + "</tr>\n"; + } + print "</table>\n"; + print "<p align=\"right\"><input type=\"submit\" value=\"" . + _("Save Configuration"). + "\" /></p>"; + print "</form>\n"; + print "</fieldset>\n"; + print "</td>\n"; + print "</tr>\n"; + print "</table>\n"; + } else { + exit_error(_('Access Denied'), _('You are not a project Admin')); + } + } +} + +site_project_footer(array()); + +?> Property changes on: trunk/wikiadmin.php ___________________________________________________________________ Added: svn:keywords + Id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-05-05 09:05:01
|
Revision: 7380 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7380&view=rev Author: vargenau Date: 2010-05-05 09:04:53 +0000 (Wed, 05 May 2010) Log Message: ----------- rcs_id function not defined here Modified Paths: -------------- trunk/wikiadmin.php Modified: trunk/wikiadmin.php =================================================================== --- trunk/wikiadmin.php 2010-05-04 16:04:17 UTC (rev 7379) +++ trunk/wikiadmin.php 2010-05-05 09:04:53 UTC (rev 7380) @@ -1,5 +1,4 @@ -<?php // -*-php-*- -rcs_id('$Id$'); +<?php // -*-php-*- $Id$ /* * Copyright (C) 2009 Alain Peyrat, Alcatel-Lucent * Copyright (C) 2009 Marc-Etienne Vargenau, Alcatel-Lucent This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-06-23 14:43:35
|
Revision: 7560 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7560&view=rev Author: vargenau Date: 2010-06-23 14:43:29 +0000 (Wed, 23 Jun 2010) Log Message: ----------- Better header Modified Paths: -------------- trunk/wikiadmin.php Modified: trunk/wikiadmin.php =================================================================== --- trunk/wikiadmin.php 2010-06-23 14:26:54 UTC (rev 7559) +++ trunk/wikiadmin.php 2010-06-23 14:43:29 UTC (rev 7560) @@ -1,7 +1,7 @@ <?php // -*-php-*- $Id$ /* * Copyright (C) 2009 Alain Peyrat, Alcatel-Lucent - * Copyright (C) 2009 Marc-Etienne Vargenau, Alcatel-Lucent + * Copyright (C) 2009-2010 Marc-Etienne Vargenau, Alcatel-Lucent * * This file is part of PhpWiki. * @@ -122,7 +122,7 @@ } //only project admin can access here if ( $userperm->isAdmin() ) { - wiki_Project_Header(array('title'=>$pluginname . ' Project Plugin!','pagename'=>"$pluginname",'sectionvals'=>array(group_getname($id)))); + wiki_Project_Header(array('title'=>"Configuration for your project's Wiki",'pagename'=>"$pluginname",'sectionvals'=>array(group_getname($id)))); $wc = new WikiConfig($id); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-09-02 19:40:58
|
Revision: 7669 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7669&view=rev Author: vargenau Date: 2010-09-02 19:40:52 +0000 (Thu, 02 Sep 2010) Log Message: ----------- Fix deprecated sys_plugins_path Modified Paths: -------------- trunk/wikiadmin.php Modified: trunk/wikiadmin.php =================================================================== --- trunk/wikiadmin.php 2010-09-02 19:34:57 UTC (rev 7668) +++ trunk/wikiadmin.php 2010-09-02 19:40:52 UTC (rev 7669) @@ -43,9 +43,9 @@ */ require_once dirname(__FILE__)."/../../env.inc.php"; -require_once $gfwww.'include/pre.php'; -require_once $sys_plugins_path.'wiki/common/WikiPlugin.class.php'; -require_once $sys_plugins_path.'wiki/common/wikiconfig.class.php'; +require_once $gfcommon.'include/pre.php'; +require_once forge_get_config('plugins_path').'wiki/common/WikiPlugin.class.php'; +require_once forge_get_config('plugins_path').'wiki/common/wikiconfig.class.php'; // the header that displays for the user portion of the plugin function wiki_Project_Header($params) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-10-08 13:56:13
|
Revision: 7713 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7713&view=rev Author: vargenau Date: 2010-10-08 13:56:07 +0000 (Fri, 08 Oct 2010) Log Message: ----------- Fix directory in Fusionforge Modified Paths: -------------- trunk/wikiadmin.php Modified: trunk/wikiadmin.php =================================================================== --- trunk/wikiadmin.php 2010-10-08 13:55:13 UTC (rev 7712) +++ trunk/wikiadmin.php 2010-10-08 13:56:07 UTC (rev 7713) @@ -137,7 +137,7 @@ print "<td>\n"; print "<fieldset>\n"; print "<legend>"._('Wiki Configuration')."</legend>\n"; - print "<form action=\"/plugins/wiki/wikiadmin.php\" method=\"post\">\n"; + print "<form action=\"/wiki/wikiadmin.php\" method=\"post\">\n"; print "<input type=\"hidden\" name=\"id\" value=\"$id\" />\n"; print "<input type=\"hidden\" name=\"pluginname\" value=\"$pluginname\" />\n"; print "<input type=\"hidden\" name=\"type\" value=\"admin_post\" />\n"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2011-01-19 13:34:03
|
Revision: 7841 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7841&view=rev Author: vargenau Date: 2011-01-19 13:33:57 +0000 (Wed, 19 Jan 2011) Log Message: ----------- Translate string Modified Paths: -------------- trunk/wikiadmin.php Modified: trunk/wikiadmin.php =================================================================== --- trunk/wikiadmin.php 2011-01-18 08:44:58 UTC (rev 7840) +++ trunk/wikiadmin.php 2011-01-19 13:33:57 UTC (rev 7841) @@ -126,12 +126,12 @@ } //only project admin can access here if ( $userperm->isAdmin() ) { - wiki_Project_Header(array('title'=>"Configuration for your project's Wiki",'pagename'=>"$pluginname",'sectionvals'=>array(group_getname($id)))); + wiki_Project_Header(array('title' => _("Configuration for your project's wiki"), + 'pagename' => "$pluginname", + 'sectionvals' => array(group_getname($id)))); $wc = new WikiConfig($id); - print "\n<h1>"._("Configuration for your project's Wiki")."</h1>\n"; - print "<table>\n"; print "<tr>\n"; print "<td>\n"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2011-01-20 09:22:18
|
Revision: 7845 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7845&view=rev Author: vargenau Date: 2011-01-20 09:22:12 +0000 (Thu, 20 Jan 2011) Log Message: ----------- Use group_id Modified Paths: -------------- trunk/wikiadmin.php Modified: trunk/wikiadmin.php =================================================================== --- trunk/wikiadmin.php 2011-01-20 08:38:06 UTC (rev 7844) +++ trunk/wikiadmin.php 2011-01-20 09:22:12 UTC (rev 7845) @@ -47,17 +47,6 @@ require_once forge_get_config('plugins_path').'wiki/common/WikiPlugin.class.php'; require_once forge_get_config('plugins_path').'wiki/common/wikiconfig.class.php'; -// the header that displays for the user portion of the plugin -function wiki_Project_Header($params) { - global $id; - $params['toptab']='wiki'; - $params['group']=$id; - /* - Show horizontal links - */ - site_project_header($params); -} - $user = session_get_user(); // get the session user if (!$user || !is_object($user)) { @@ -69,17 +58,17 @@ } $type = getStringFromRequest('type'); -$id = getIntFromRequest('id'); +$group_id = getIntFromRequest('group_id'); $pluginname = 'wiki'; $config = getArrayFromRequest('config'); if (!$type) { - exit_missing_params($_SERVER['HTTP_REFERER'],array(_('No TYPE specified')),'home'); -} elseif (!$id) { - exit_missing_params($_SERVER['HTTP_REFERER'],array(_('No ID specified')),'home'); + exit_missing_param($_SERVER['HTTP_REFERER'],array(_('No TYPE specified')),'home'); +} elseif (!$group_id) { + exit_missing_param($_SERVER['HTTP_REFERER'],array(_('No ID specified')),'home'); } else { if ($type == 'admin_post') { - $group = group_get_object($id); + $group = group_get_object($group_id); if ( !$group) { exit_no_group(); } @@ -93,7 +82,7 @@ //only project admin can access here if ( $userperm->isAdmin() ) { - $wc = new WikiConfig($id); + $wc = new WikiConfig($group_id); foreach ($wc->getWikiConfigNames() as $c) { if ( ! array_key_exists($c, $config)) { @@ -113,7 +102,7 @@ } } if ($type == 'admin') { - $group = group_get_object($id); + $group = group_get_object($group_id); if ( !$group) { exit_no_group(); } @@ -126,11 +115,13 @@ } //only project admin can access here if ( $userperm->isAdmin() ) { - wiki_Project_Header(array('title' => _("Configuration for your project's wiki"), - 'pagename' => "$pluginname", - 'sectionvals' => array(group_getname($id)))); + site_project_header(array('title' => _("Configuration for your project's wiki"), + 'pagename' => $pluginname, + 'group' => $group_id, + 'toptab' => 'wiki', + 'sectionvals' => array(group_getname($group_id)))); - $wc = new WikiConfig($id); + $wc = new WikiConfig($group_id); print "<table>\n"; print "<tr>\n"; @@ -138,7 +129,7 @@ print "<fieldset>\n"; print "<legend>"._('Wiki Configuration')."</legend>\n"; print "<form action=\"/wiki/wikiadmin.php\" method=\"post\">\n"; - print "<input type=\"hidden\" name=\"id\" value=\"$id\" />\n"; + print "<input type=\"hidden\" name=\"group_id\" value=\"$group_id\" />\n"; print "<input type=\"hidden\" name=\"pluginname\" value=\"$pluginname\" />\n"; print "<input type=\"hidden\" name=\"type\" value=\"admin_post\" />\n"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2011-01-21 14:48:33
|
Revision: 7856 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7856&view=rev Author: vargenau Date: 2011-01-21 14:48:27 +0000 (Fri, 21 Jan 2011) Log Message: ----------- No HTTP_REFERER Modified Paths: -------------- trunk/wikiadmin.php Modified: trunk/wikiadmin.php =================================================================== --- trunk/wikiadmin.php 2011-01-21 14:19:38 UTC (rev 7855) +++ trunk/wikiadmin.php 2011-01-21 14:48:27 UTC (rev 7856) @@ -63,9 +63,9 @@ $config = getArrayFromRequest('config'); if (!$type) { - exit_missing_param($_SERVER['HTTP_REFERER'],array(_('No TYPE specified')),'home'); + exit_missing_param('',array(_('No TYPE specified')),'home'); } elseif (!$group_id) { - exit_missing_param($_SERVER['HTTP_REFERER'],array(_('No ID specified')),'home'); + exit_missing_param('',array(_('No ID specified')),'home'); } else { if ($type == 'admin_post') { $group = group_get_object($group_id); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2012-09-28 13:34:41
|
Revision: 8292 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8292&view=rev Author: vargenau Date: 2012-09-28 13:34:30 +0000 (Fri, 28 Sep 2012) Log Message: ----------- Massive move to getPermission() : no more user argument Modified Paths: -------------- trunk/wikiadmin.php Modified: trunk/wikiadmin.php =================================================================== --- trunk/wikiadmin.php 2012-09-28 13:31:15 UTC (rev 8291) +++ trunk/wikiadmin.php 2012-09-28 13:34:30 UTC (rev 8292) @@ -75,7 +75,7 @@ if (!($group->usesPlugin($pluginname))) { //check if the group has the wiki plugin active exit_error(sprintf(_('First activate the %s plugin through the Project\'s Admin Interface'),$pluginname),'home'); } - $userperm = $group->getPermission($user); //we'll check if the user belongs to the group + $userperm = $group->getPermission(); //we'll check if the user belongs to the group if ( !$userperm->IsMember()) { exit_permission_denied(_('You are not a member of this project'),'home'); } @@ -109,7 +109,7 @@ if ( ! ($group->usesPlugin ($pluginname)) ) {//check if the group has the plugin active exit_error(sprintf(_('First activate the %s plugin through the Project\'s Admin Interface'),$pluginname),'home'); } - $userperm = $group->getPermission($user); //we'll check if the user belongs to the group + $userperm = $group->getPermission(); //we'll check if the user belongs to the group if ( !$userperm->IsMember()) { exit_permission_denied(_('You are not a member of this project'),'home'); } @@ -167,4 +167,3 @@ } site_project_footer(array()); - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2013-02-15 16:03:27
|
Revision: 8731 http://sourceforge.net/p/phpwiki/code/8731 Author: vargenau Date: 2013-02-15 16:03:24 +0000 (Fri, 15 Feb 2013) Log Message: ----------- Fix path Modified Paths: -------------- trunk/wikiadmin.php Modified: trunk/wikiadmin.php =================================================================== --- trunk/wikiadmin.php 2013-02-15 15:59:57 UTC (rev 8730) +++ trunk/wikiadmin.php 2013-02-15 16:03:24 UTC (rev 8731) @@ -44,8 +44,8 @@ require_once dirname(__FILE__) . "/../../env.inc.php"; require_once $gfcommon . 'include/pre.php'; -require_once forge_get_config('plugins_path') . 'wiki/common/WikiPlugin.class.php'; -require_once forge_get_config('plugins_path') . 'wiki/common/wikiconfig.class.php'; +require_once forge_get_config('plugins_path') . '/wiki/common/WikiPlugin.class.php'; +require_once forge_get_config('plugins_path') . '/wiki/common/wikiconfig.class.php'; $user = session_get_user(); // get the session user This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |