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

"._("Configuration for your project's Wiki")."

\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
\n"; print "
\n"; print ""._('Wiki Configuration')."\n"; print "
\n"; print "\n"; print "\n"; print "\n"; print ''; print "\n\n\n" . "\n" . "\n\n"; foreach ($wc->getWikiConfigNames() as $c) { $checked = $wc->getWikiConfig($c) ? ' checked="checked"' : ''; $desc = $wc->getWikiConfigDescription($c); print "\n\n" . "\n" . "\n"; } print "
". _("Parameter"). "". _("Value"). "
$desc" . "
\n"; print "

"; print "
\n"; print "
\n"; print "
\n"; } else { exit_error(_('Access Denied'), _('You are not a project Admin')); } } } site_project_footer(array()); ?>