isError()) { exit_error($user->getErrorMessage(), 'home'); } elseif (!$user->isActive()) { exit_error(_('User not active'), 'home'); } $type = getStringFromRequest('type'); $group_id = getIntFromRequest('group_id'); $pluginname = 'wiki'; $config = getArrayFromRequest('config'); if (!$type) { exit_missing_param('', array(_('No TYPE specified')), 'home'); } elseif (!$group_id) { exit_missing_param('', array(_('No ID specified')), 'home'); } else { if ($type == 'admin_post') { $group = group_get_object($group_id); if (!$group) { exit_no_group(); } 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(); //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'); } //only project admin can access here if ($userperm->isAdmin()) { $wc = new WikiConfig($group_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_permission_denied(_('You are not a project Admin'), 'home'); } } if ($type == 'admin') { $group = group_get_object($group_id); if (!$group) { exit_no_group(); } 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(); //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'); } //only project admin can access here if ($userperm->isAdmin()) { 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($group_id); 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_permission_denied(_('You are not a project Admin'), 'home'); } } } site_project_footer(array());