$newemail = getStringFromRequest('newemail'); if (!validate_email($newemail)) { form_release_key(getStringFromRequest('form_key')); exit_error(_('Error'), _('Invalid email address.')); } $confirm_hash = substr(md5($session_hash . time()), 0, 16); $u =& user_get_object(user_getid()); if (!$u || !is_object($u)) { form_release_key(getStringFromRequest('form_key')); exit_error('Error', 'Could Not Get User'); } elseif ($u->isError()) { form_release_key(getStringFromRequest('form_key')); exit_error('Error', $u->getErrorMessage()); } if (!$u->setNewEmailAndHash($newemail, $confirm_hash)) { form_release_key(getStringFromRequest('form_key')); exit_error('Could Not Complete Operation', $u->getErrorMessage()); } $message = stripcslashes(sprintf(_('You have requested a change of email address on %1$s. Please visit the following URL to complete the email change: %2$s -- the %1$s staff'), $GLOBALS['sys_name'], util_make_url('/account/change_email-complete.php?ch=_' . $confirm_hash))); util_send_message($newemail, sprintf(_('%1$s Verification'), $GLOBALS['sys_name']), $message); site_user_header(array('title' => _('Email Change Confirmation'))); printf(_('<p>An email has been sent to the new address. Follow the instructions in the email to complete the email change. </p><a href="%1$s">[ Home ]</a>'), util_make_url('/')); site_user_footer(array()); exit; } site_user_header(array('title' => _('Email change')));
function CallHook($hookname, $params) { global $use_cvssyncmailplugin, $G_SESSION, $HTML; $group_id = $params['group']; if ($hookname == "groupisactivecheckbox") { $group =& group_get_object($group_id); if ($group->usesPlugin('scmcvs')) { //Check if the group is active // this code creates the checkbox in the project edit public info page to activate/deactivate the plugin echo "<tr>"; echo "<td>"; echo ' <input type="CHECKBOX" name="use_cvssyncmailplugin" value="1" '; // CHECKED OR UNCHECKED? if ($group->usesPlugin($this->name)) { echo "CHECKED"; } echo "><br/>"; echo "</td>"; echo "<td>"; echo "<strong>Use " . $this->text . " Plugin</strong>"; echo "</td>"; echo "</tr>"; } } elseif ($hookname == "groupisactivecheckboxpost") { // this code actually activates/deactivates the plugin after the form was submitted in the project edit public info page $group =& group_get_object($group_id); $use_cvssyncmailplugin = getStringFromRequest('use_cvssyncmailplugin'); if ($use_cvssyncmailplugin == 1) { $group->setPluginUse($this->name); } else { $group->setPluginUse($this->name, false); } } }
function header($params) { global $DOCUMENT_ROOT, $HTML, $group_id; use_javascript('/js/sortable.js'); html_use_jquery(); $params['toptab'] = 'taskboard'; $params['group'] = $group_id; $labels[] = _("View Taskboard"); $links[] = '/plugins/taskboard/index.php?group_id=' . $group_id; if (session_loggedin()) { if (forge_check_perm('tracker', $this->getID(), 'manager')) { $labels[] = _('Administration'); $links[] = '/plugins/taskboard/admin/index.php?group_id=' . $group_id; $action = getStringFromRequest('action'); if ($action == 'edit_column') { $labels[] = _('Configure Columns'); $links[] = '/plugins/taskboard/admin/index.php?group_id=' . $group_id . '&action=columns'; $column_id = getStringFromRequest('column_id', ''); if ($column_id) { $labels[] = _('Delete Column'); $links[] = '/plugins/taskboard/admin/index.php?group_id=' . $group_id . '&action=delete_column&column_id=' . $column_id; } } } } $params['submenu'] = $HTML->subMenu($labels, $links); site_project_header($params); }
/** * admin_table_postadd() - update the database based on a submitted change * * @param $table - the table to act on * @param $unit - the name of the "units" described by the table's records * @param $primary_key - the primary key of the table */ function admin_table_postadd($table, $unit, $primary_key) { if (!form_key_is_valid(getStringFromRequest('form_key'))) { exit_form_double_submit(); } $field_list = getStringFromRequest('__fields__'); $fields = split(",", $field_list); $values = array(); foreach ($fields as $field) { $values[] = "'" . getStringFromPost($field) . "'"; } $sql = "INSERT INTO {$table} (" . $field_list . ") VALUES (" . implode(",", $values) . ")"; if (db_query($sql)) { printf(_('%1$s successfully added.'), ucfirst(getUnitLabel($unit))); } else { form_release_key(getStringFromRequest('form_key')); echo db_error(); } }
$aq->makeDefault(); $query_id = $aq->getID(); // // Just load the query // } elseif ($query_action == 4) { $aq = new ArtifactQuery($ath, $query_id); if (!$aq || !is_object($aq)) { exit_error('Error', $aq->getErrorMessage()); } $aq->makeDefault(); // // Delete the query // } elseif ($query_action == 5) { if (!form_key_is_valid(getStringFromRequest('form_key'))) { exit_form_double_submit(); } $aq = new ArtifactQuery($ath, $query_id); if (!$aq || !is_object($aq)) { exit_error('Error', $aq->getErrorMessage()); } if (!$aq->delete()) { $feedback .= $aq->getErrorMessage(); } else { $feedback .= 'Query Deleted'; } $query_id = 0; } } else { $user = session_get_user();
<body> <h2>XML Parser</h2> <p> <form name="xmlparser" method="POST" action="<?php echo getStringFromServer('PHP_SELF'); ?> "> Text: <br> <textarea name="document" cols="50" rows="10"></textarea> <br> <input type="hidden" name="parser" value="yes"> <input type="submit" value="Parser"> </form> <?php } elseif (getStringFromRequest("parser") == "yes") { $data = getStringFromRequest("document"); //$data = str$data); } else { $ph = fopen("php://input", "rb"); while (!feof($ph)) { $data .= fread($ph, 4096); } //$data=addslashes($data); } if (!$data) { echo "No Data"; exit; } //printr($data,'initial-data'); // SECTION 1. DEBUG XML //$data = stripslashes($data);
exit_error(_('error - missing info'), _('Fill in all required fields')); } if (people_verify_job_group($job_id, $group_id)) { $sql = "UPDATE people_job_inventory SET skill_level_id='{$skill_level_id}',skill_year_id='{$skill_year_id}' " . "WHERE job_id='{$job_id}' AND job_inventory_id='{$job_inventory_id}'"; $result = db_query($sql); if (!$result || db_affected_rows($result) < 1) { $feedback .= _('JOB skill update FAILED'); echo db_error(); } else { $feedback .= _('JOB skill updated successfully'); } } else { $feedback .= _('JOB skill update failed - wrong project_id'); } } else { if (getStringFromRequest('delete_from_job_inventory')) { /* remove this skill from this job */ if (!$job_id) { //required info exit_error(_('error - missing info'), _('Fill in all required fields')); } if (people_verify_job_group($job_id, $group_id)) { $sql = "DELETE FROM people_job_inventory WHERE job_id='{$job_id}' AND job_inventory_id='{$job_inventory_id}'"; $result = db_query($sql); if (!$result || db_affected_rows($result) < 1) { $feedback .= _('JOB skill delete FAILED'); echo db_error(); } else { $feedback .= _('JOB skill deleted successfully');
echo _('Edit'); ?> " name="submit" /></td> </tr> </table> <p> <?php echo _('Group name will be used as a title, so it should be formatted correspondingly.'); ?> </p> </form> <?php docman_footer(array()); } else { if (getStringFromRequest('deletedoc') && $docid) { $d = new Document($g, $docid); if ($d->isError()) { exit_error('Error', $d->getErrorMessage()); } docman_header(_('Document Manager Administration'), _('Edit Groups'), ''); ?> <p> <form action="<?php echo $PHP_SELF . '?deletedoc=1&docid=' . $d->getID() . '&group_id=' . $d->Group->getID(); ?> " method="post"> <input type="hidden" name="submit" value="1" /><br /> <?php echo _('You are about to permanently delete this document.'); ?>
forum_footer(array()); } else { exit_permission_denied(); } } else { // if ($forum_id=="A") { //all messages // if (!$fa->isGroupAdmin()) { // exit_permission_denied(); // } // } else { if (!$fa->isForumAdmin($forum_id)) { exit_permission_denied(); } // } forum_header(array('title' => _('Forums: Administration'))); if (getStringFromRequest("Go")) { $fa->ExecuteAction("view_pending"); } else { $fa->ExecuteAction($action); } forum_footer(array()); } } else { //manage auth errors if ($fa->isGroupIdError()) { exit_no_group(); } elseif ($fa->isPermissionDeniedError()) { exit_permission_denied(); } }
/** * * SourceForge Sitewide Statistics * * SourceForge: Breaking Down the Barriers to Open Source Development * Copyright 1999-2001 (c) VA Linux Systems * http://sourceforge.net * * @version $Id$ * */ require_once '../env.inc.php'; require_once $gfwww . 'include/pre.php'; require_once $gfwww . 'stats/site_stats_utils.php'; $report = getStringFromRequest('report'); $orderby = getStringFromRequest('orderby'); $projects = getIntFromRequest('projects'); $trovecatid = getIntFromRequest('trovecatid'); // require you to be a member of the sfstats group (group_id = 11084) session_require(array('group' => $sys_stats_group)); $HTML->header(array('title' => sprintf(_('%1$s Site Statistics'), $GLOBALS['sys_name']))); ?> <div align="center"> <h3><?php echo _('Project Statistical Comparisons'); ?> </h3><br /> </div> <hr />
$form_userid = getIntFromRequest('form_userid'); $form_unix_name = getStringFromRequest('form_unix_name'); $role_id = getIntFromRequest('role_id'); if (!$group->addUser($form_unix_name, $role_id)) { $feedback .= $group->getErrorMessage(); } else { $gjr = new GroupJoinRequest($group, $form_userid); if (!$gjr || !is_object($gjr) || $gjr->isError()) { $feedback .= 'Error Getting GroupJoinRequest'; } else { $gjr->send_accept_mail(); $gjr->delete(true); } $feedback = _('User Added Successfully'); } } elseif (getStringFromRequest('rejectpending')) { /* reject adding user to this project */ $form_userid = getIntFromRequest('form_userid'); $gjr = new GroupJoinRequest($group, $form_userid); if (!$gjr || !is_object($gjr) || $gjr->isError()) { $feedback .= 'Error Getting GroupJoinRequest'; } else { if (!$gjr->reject()) { exit_error('Error', $gjr->getErrorMessage()); } else { $feedback .= 'Rejected'; } } }
<p /> <strong><?php echo _('Send All Updates To'); ?> :</strong><br /> <input type="text" name="send_all_posts_to" value="" size="40" maxlength="80" /><br /> <p /> <input type="submit" name="submit" value="<?php echo _('Submit'); ?> " /> </form> <?php pm_footer(array()); } else { if (getStringFromRequest('update_pg') && $group_project_id) { $pg = new ProjectGroup($g, $group_project_id); if (!$pg || !is_object($pg)) { exit_error('Error', 'Could Not Get ProjectGroup'); } elseif ($pg->isError()) { exit_error('Error', $pg->getErrorMessage()); } if (!$pg->userIsAdmin()) { exit_permission_denied(); } pm_header(array('title' => _('Change Project/Task Manager Status'))); ?> <p><?php echo _('You can modify an existing Project using this form. Please note that private projects can still be viewed by members of your project, but not the general public.'); ?> </p>
function CallHook($hookname, &$params) { if (isset($params['group_id'])) { $group_id = $params['group_id']; } elseif (isset($params['group'])) { $group_id = $params['group']; } else { $group_id = null; } if ($hookname == "groupmenu") { $project = group_get_object($group_id); if (!$project || !is_object($project)) { return; } if ($project->isError()) { return; } if (!$project->isProject()) { return; } if ($project->usesPlugin($this->name)) { $params['TITLES'][] = $this->text; $params['DIRS'][] = util_make_url('/plugins/mediawiki/wiki/' . $project->getUnixName() . '/index.php'); $params['ADMIN'][] = ''; $params['TOOLTIPS'][] = _('Mediawiki Space'); } $params['toptab'] == $this->name ? $params['selected'] = count($params['TITLES']) - 1 : ''; } elseif ($hookname == "groupisactivecheckbox") { //Check if the group is active // this code creates the checkbox in the project edit public info page to activate/deactivate the plugin $group = group_get_object($group_id); echo "<tr>"; echo "<td>"; echo ' <input type="checkbox" name="use_mediawikiplugin" value="1" '; // checked or unchecked? if ($group->usesPlugin($this->name)) { echo "checked"; } echo " /><br/>"; echo "</td>"; echo "<td>"; echo "<strong>Use " . $this->text . " Plugin</strong>"; echo "</td>"; echo "</tr>"; } elseif ($hookname == "groupisactivecheckboxpost") { // this code actually activates/deactivates the plugin after the form was submitted in the project edit public info page $group = group_get_object($group_id); $use_mediawikiplugin = getStringFromRequest('use_mediawikiplugin'); if ($use_mediawikiplugin == 1) { $group->setPluginUse($this->name); } else { $group->setPluginUse($this->name, false); } } elseif ($hookname == "project_public_area") { $project = group_get_object($group_id); if (!$project || !is_object($project)) { return; } if ($project->isError()) { return; } if (!$project->isProject()) { return; } if ($project->usesPlugin($this->name)) { echo '<div class="public-area-box">'; print '<a href="' . util_make_url('/plugins/mediawiki/wiki/' . $project->getUnixName() . '/index.php') . '">'; print html_abs_image(util_make_url('/plugins/mediawiki/wiki/' . $project->getUnixName() . '/skins/fusionforge/wiki.png'), '20', '20', array('alt' => 'Mediawiki')); print ' Mediawiki'; print '</a>'; echo '</div>'; } } elseif ($hookname == "role_get") { $role =& $params['role']; // Read access $right = new PluginSpecificRoleSetting($role, 'plugin_mediawiki_read'); $right->SetAllowedValues(array('0', '1')); $right->SetDefaultValues(array('Admin' => '1', 'Senior Developer' => '1', 'Junior Developer' => '1', 'Doc Writer' => '1', 'Support Tech' => '1')); // Edit privileges $right = new PluginSpecificRoleSetting($role, 'plugin_mediawiki_edit'); $right->SetAllowedValues(array('0', '1', '2', '3')); $right->SetDefaultValues(array('Admin' => '3', 'Senior Developer' => '2', 'Junior Developer' => '1', 'Doc Writer' => '3', 'Support Tech' => '0')); // File upload privileges $right = new PluginSpecificRoleSetting($role, 'plugin_mediawiki_upload'); $right->SetAllowedValues(array('0', '1', '2')); $right->SetDefaultValues(array('Admin' => '2', 'Senior Developer' => '2', 'Junior Developer' => '1', 'Doc Writer' => '2', 'Support Tech' => '0')); // Administrative tasks $right = new PluginSpecificRoleSetting($role, 'plugin_mediawiki_admin'); $right->SetAllowedValues(array('0', '1')); $right->SetDefaultValues(array('Admin' => '1', 'Senior Developer' => '0', 'Junior Developer' => '0', 'Doc Writer' => '0', 'Support Tech' => '0')); } elseif ($hookname == "role_normalize") { $role =& $params['role']; $new_sa =& $params['new_sa']; $new_pa =& $params['new_pa']; $projects = $role->getLinkedProjects(); foreach ($projects as $p) { $role->normalizePermsForSection($new_pa, 'plugin_mediawiki_read', $p->getID()); $role->normalizePermsForSection($new_pa, 'plugin_mediawiki_edit', $p->getID()); $role->normalizePermsForSection($new_pa, 'plugin_mediawiki_upload', $p->getID()); $role->normalizePermsForSection($new_pa, 'plugin_mediawiki_admin', $p->getID()); } } elseif ($hookname == "role_translate_strings") { $right = new PluginSpecificRoleSetting($role, 'plugin_mediawiki_read'); $right->setDescription(_('Mediawiki read access')); $right->setValueDescriptions(array('0' => _('No reading'), '1' => _('Read access'))); $right = new PluginSpecificRoleSetting($role, 'plugin_mediawiki_edit'); $right->setDescription(_('Mediawiki write access')); $right->setValueDescriptions(array('0' => _('No editing'), '1' => _('Edit existing pages only'), '2' => _('Edit and create pages'), '3' => _('Edit, create, move, delete pages'))); $right = new PluginSpecificRoleSetting($role, 'plugin_mediawiki_upload'); $right->setDescription(_('Mediawiki file upload')); $right->setValueDescriptions(array('0' => _('No uploading'), '1' => _('Upload permitted'), '2' => _('Upload and re-upload'))); $right = new PluginSpecificRoleSetting($role, 'plugin_mediawiki_admin'); $right->setDescription(_('Mediawiki administrative tasks')); $right->setValueDescriptions(array('0' => _('No administrative access'), '1' => _('Edit interface, import XML dumps'))); } elseif ($hookname == "role_get_setting") { $role = $params['role']; $reference = $params['reference']; $value = $params['value']; switch ($params['section']) { case 'plugin_mediawiki_read': if ($role->hasPermission('project_admin', $reference)) { $params['result'] = 1; } else { $params['result'] = $value; } break; case 'plugin_mediawiki_edit': if ($role->hasPermission('project_admin', $reference)) { $params['result'] = 3; } else { $params['result'] = $value; } break; case 'plugin_mediawiki_upload': if ($role->hasPermission('project_admin', $reference)) { $params['result'] = 2; } else { $params['result'] = $value; } break; case 'plugin_mediawiki_admin': if ($role->hasPermission('project_admin', $reference)) { $params['result'] = 1; } else { $params['result'] = $value; } break; } } elseif ($hookname == "role_has_permission") { $value = $params['value']; switch ($params['section']) { case 'plugin_mediawiki_read': switch ($params['action']) { case 'read': default: $params['result'] |= $value >= 1; break; } break; case 'plugin_mediawiki_edit': switch ($params['action']) { case 'editexisting': $params['result'] |= $value >= 1; break; case 'editnew': $params['result'] |= $value >= 2; break; case 'editmove': $params['result'] |= $value >= 3; break; } break; case 'plugin_mediawiki_upload': switch ($params['action']) { case 'upload': $params['result'] |= $value >= 1; break; case 'reupload': $params['result'] |= $value >= 2; break; } break; case 'plugin_mediawiki_admin': switch ($params['action']) { case 'admin': default: $params['result'] |= $value >= 1; break; } break; } } elseif ($hookname == "list_roles_by_permission") { switch ($params['section']) { case 'plugin_mediawiki_read': switch ($params['action']) { case 'read': default: $params['qpa'] = db_construct_qpa($params['qpa'], ' AND perm_val >= 1'); break; } break; case 'plugin_mediawiki_edit': switch ($params['action']) { case 'editexisting': $params['qpa'] = db_construct_qpa($params['qpa'], ' AND perm_val >= 1'); break; case 'editnew': $params['qpa'] = db_construct_qpa($params['qpa'], ' AND perm_val >= 2'); break; case 'editmove': $params['qpa'] = db_construct_qpa($params['qpa'], ' AND perm_val >= 3'); break; } break; case 'plugin_mediawiki_upload': switch ($params['action']) { case 'upload': $params['qpa'] = db_construct_qpa($params['qpa'], ' AND perm_val >= 1'); break; case 'reupload': $params['qpa'] = db_construct_qpa($params['qpa'], ' AND perm_val >= 2'); break; } break; case 'plugin_mediawiki_admin': switch ($params['action']) { case 'admin': default: $params['qpa'] = db_construct_qpa($params['qpa'], ' AND perm_val >= 1'); break; } break; } } elseif ($hookname == "project_admin_plugins") { $group_id = $params['group_id']; $group = group_get_object($group_id); if ($group->usesPlugin($this->name)) { echo util_make_link("/plugins/mediawiki/plugin_admin.php?group_id=" . $group->getID(), _("MediaWiki Plugin admin")) . "<br />"; } } elseif ($hookname == "clone_project_from_template") { $template = $params['template']; $project = $params['project']; $id_mappings = $params['id_mappings']; $sections = array('plugin_mediawiki_read', 'plugin_mediawiki_edit', 'plugin_mediawiki_upload', 'plugin_mediawiki_admin'); foreach ($template->getRoles() as $oldrole) { $newrole = RBACEngine::getInstance()->getRoleById($id_mappings['role'][$oldrole->getID()]); $oldsettings = $oldrole->getSettingsForProject($template); foreach ($sections as $section) { if (isset($oldsettings[$section][$template->getID()])) { $newrole->setSetting($section, $project->getID(), $oldsettings[$section][$template->getID()]); } } } } elseif ($hookname == 'group_delete') { $projectId = $params['group_id']; $projectObject = group_get_object($projectId); if ($projectObject->usesPlugin($this->name)) { //delete the files and db schema $schema = 'plugin_mediawiki_' . $projectObject->getUnixName(); // Sanitize schema name $schema = strtr($schema, "-", "_"); db_query_params('drop schema $1 cascade', array($schema)); exec('/bin/rm -rf ' . forge_get_config('projects_path', 'mediawiki') . '/' . $projectObject->getUnixName()); } } }
* 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 GForge; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ require_once '../env.inc.php'; require_once $gfwww . 'include/pre.php'; require_once $gfwww . 'admin/admin_utils.php'; site_admin_header(array('title' => _('Group List'))); $form_catroot = getStringFromRequest('form_catroot'); $form_pending = getStringFromRequest('form_pending'); $sortorder = getStringFromRequest('sortorder'); $group_name_search = getStringFromRequest('group_name_search'); $status = getStringFromRequest('status'); // start from root if root not passed in if (!$form_catroot) { $form_catroot = 1; } if (!isset($sortorder) || empty($sortorder)) { $sortorder = "group_name"; } if ($form_catroot == 1) { if (isset($group_name_search)) { echo "<p>" . _('Groups that begin with') . " <strong>" . $group_name_search . "</strong></p>\n"; $sql = "SELECT group_name,register_time,unix_group_name,groups.group_id,is_public,status,license_name,COUNT(user_group.group_id) AS members "; if ($sys_database_type == "mysql") { $sql .= "FROM groups LEFT JOIN user_group ON user_group.group_id=groups.group_id, licenses WHERE license_id=license AND group_name LIKE '{$group_name_search}%' "; } else { $sql .= "FROM groups LEFT JOIN user_group ON user_group.group_id=groups.group_id, licenses WHERE license_id=license AND group_name ILIKE '{$group_name_search}%' ";
} } } // Edit/Delete files in a release if (getStringFromRequest('step3')) { $step3 = getStringFromRequest('step3'); $file_id = getIntFromRequest('file_id'); $processor_id = getIntFromRequest('processor_id'); $type_id = getIntFromRequest('type_id'); $new_release_id = getIntFromRequest('new_release_id'); $release_time = getStringFromRequest('release_time'); $group_id = getIntFromRequest('group_id'); $release_id = getIntFromRequest('release_id'); $package_id = getIntFromRequest('package_id'); $file_id = getIntFromRequest('file_id'); $im_sure = getStringFromRequest('im_sure'); // If the user chose to delete the file and he's sure then delete the file if ($step3 == "Delete File") { if ($im_sure) { $frsf = new FRSFile($frsr, $file_id); if (!$frsf || !is_object($frsf)) { exit_error('Error', 'Could Not Get FRSFile'); } elseif ($frsf->isError()) { exit_error('Error', $frsf->getErrorMessage()); } else { if (!$frsf->delete()) { exit_error('Error', $frsf->getErrorMessage()); } else { $feedback .= _('File Deleted'); } }
/** * SourceForge User's bookmark delete Page * * Copyright 1999-2001 (c) VA Linux Systems * * @version $Id$ * * This file is part of GForge. * * GForge 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. * * GForge 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 GForge; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ require_once '../env.inc.php'; require_once $gfwww . 'include/pre.php'; require_once $gfwww . 'include/bookmarks.php'; $bookmark_id = getStringFromRequest('bookmark_id'); if ($bookmark_id) { bookmark_delete($bookmark_id); session_redirect('/my/'); }
$is_followup_to = getStringFromRequest('is_followup_to'); $form_key = getStringFromRequest('form_key'); $posted_by = getStringFromRequest('posted_by'); $post_date = getStringFromRequest('post_date'); $is_followup_to = getStringFromRequest('is_followup_to'); $has_followups = getStringFromRequest('has_followups'); $most_recent_date = getStringFromRequest('most_recent_date'); if ($fm->updatemsg($forum_id, $posted_by, $subject, $body, $post_date, $is_followup_to, $thread_id, $has_followups, $most_recent_date)) { $feedback .= _('Message Edited Successfully'); } else { $feedback .= $fm->getErrorMessage(); } forum_header(array('title' => _('Edit a Message'))); echo '<p>' . util_make_link('/forum/forum.php?forum_id=' . $forum_id, _("Return to the forum")); forum_footer(array()); } elseif (getStringFromRequest("cancel")) { // the user cancelled the request, go back to forum echo "<script>"; echo "window.location='/forum/message.php?msg_id={$msg_id}';"; echo "</script>"; } else { //print the edit message confirmation $f = new Forum($fa->GetGroupObject(), $forum_id); if (!$f || !is_object($f)) { exit_error('Error', 'Error Getting Forum'); } elseif ($f->isError()) { exit_error('Error', $f->getErrorMessage()); } $fm = new ForumMessage($f, $msg_id, false, false); if (!$fm || !is_object($fm)) { exit_error(_('Error'), _('Error Getting ForumMessage'));
$docdir = $homedir . '/htdocs/'; $cgidir = $homedir . '/cgi-bin/'; if (valid_hostname($vhost_name)) { $res = db_query("\n\t\t\tINSERT INTO prweb_vhost(vhost_name, docdir, cgidir, group_id) \n\t\t\tvalues ('{$vhost_name}','{$docdir}','{$cgidir}'," . $group->getID() . ")\n\t\t"); if (!$res || db_affected_rows($res) < 1) { $feedback .= "Cannot insert VHOST entry: " . db_error(); } else { $feedback .= _('Virtual Host scheduled for creation.'); $group->addHistory('Added vhost ' . $vhost_name . ' ', ''); } } else { $feedback .= sprintf(_('Not a valid hostname - %1$s'), $vhost_name); } } if (getStringFromRequest('deletevhost')) { $vhostid = getStringFromRequest('vhostid'); //schedule for deletion $res = db_query("\n\t\tSELECT * \n\t\tFROM prweb_vhost \n\t\tWHERE vhostid='{$vhostid}'\n\t"); $row_vh = db_fetch_array($res); $res = db_query("\n\t\tDELETE FROM prweb_vhost \n\t\tWHERE vhostid='{$vhostid}' \n\t\tAND group_id='{$group_id}'\n\t"); if (!$res || db_affected_rows($res) < 1) { $feedback .= "Could not delete VHOST entry:" . db_error(); } else { $feedback .= _('VHOST deleted'); $group->addHistory('Virtual Host ' . $row_vh['vhost_name'] . ' Removed', ''); } } project_admin_header(array('title' => _('Virtual Host Management'), 'group' => $group->getID())); ?> <p> </p>
* GForge 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 GForge; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ require_once '../env.inc.php'; require_once $gfwww . 'include/pre.php'; require_once $gfwww . 'include/bookmarks.php'; site_user_header(array("title" => _('My Personal Page'))); $bookmark_url = trim(getStringFromRequest('bookmark_url')); $bookmark_title = trim(getStringFromRequest('bookmark_title')); if (getStringFromRequest('submit') && $bookmark_url && $bookmark_title) { printf(_('Added bookmark for <strong>%1$s</strong> with title <strong>%2$s</strong>'), htmlspecialchars(stripslashes($bookmark_url)), htmlspecialchars(stripslashes($bookmark_title))) . ".<p> </p>"; bookmark_add($bookmark_url, $bookmark_title); print "<a href=\"{$bookmark_url}\">" . _('Visit the bookmarked page') . "</a> - "; print "<a href=\"/my/\">" . _('Back to your homepage') . "</a>"; } else { ?> <form action="<?php echo getStringFromServer('PHP_SELF'); ?> " method="post"> <p><?php echo _('Bookmark URL'); ?> :<br /> <input type="text" name="bookmark_url" value="http://" />
*/ require_once '../../env.inc.php'; require_once $gfwww . 'include/pre.php'; require_once $gfwww . 'survey/survey_utils.php'; $is_admin_page = 'y'; $group_id = getIntFromRequest('group_id'); $survey_id = getIntFromRequest('survey_id'); survey_header(array('title' => _('Add A Question'))); if (!session_loggedin() || !user_ismember($group_id, 'A')) { echo "<h1>" . _('Permission denied') . "</h1>"; survey_footer(array()); exit; } if (getStringFromRequest('post_changes')) { $question = getStringFromRequest('question'); $question_type = getStringFromRequest('question_type'); $sql = "INSERT INTO survey_questions (group_id,question,question_type) VALUES ({$group_id},'" . htmlspecialchars($question) . "',{$question_type})"; $result = db_query($sql); if ($result) { $feedback .= _('Question Added'); } else { $feedback .= _('Error inserting question'); } } ?> <script type="text/javascript"> <!-- var timerID2 = null; function show_questions() { newWindow = open("","occursDialog","height=600,width=500,scrollbars=yes,resizable=yes");
function CallHook($hookname, $params) { global $use_quota_managementplugin, $G_SESSION, $HTML; if ($hookname == "usermenu") { $text = $this->text; // this is what shows in the tab if ($G_SESSION->usesPlugin("quota_management")) { $param = '?type=user&id=' . $G_SESSION->getId() . "&pluginname=" . $this->name; // we indicate the part we´re calling is the user one echo ' | ' . $HTML->PrintSubMenu(array($text), array('/plugins/quota_management/index.php' . $param)); } } elseif ($hookname == "groupmenu") { $group_id = $params['group']; $project =& group_get_object($group_id); if (!$project || !is_object($project)) { return; } if ($project->isError()) { return; } if (!$project->isProject()) { return; } if ($project->usesPlugin($this->name)) { $params['TITLES'][] = $this->text; $params['DIRS'][] = '/plugins/quota_management/index.php?type=group&id=' . $group_id . "&pluginname=" . $this->name; // we indicate the part we´re calling is the project one } else { // $params['TITLES'][]=$this->text." is [Off]"; } $params['toptab'] == $this->name ? $params['selected'] = count($params['TITLES']) - 1 : ''; } elseif ($hookname == "groupisactivecheckbox") { //Check if the group is active } elseif ($hookname == "groupisactivecheckboxpost") { // this code actually activates/deactivates the plugin after the form was submitted in the project edit public info page $group_id = $params['group']; $group =& group_get_object($group_id); $use_quota_managementplugin = getStringFromRequest('use_quota_managementplugin'); if ($use_quota_managementplugin == 1) { $group->setPluginUse($this->name); } else { $group->setPluginUse($this->name, false); } } elseif ($hookname == "userisactivecheckbox") { //check if user is active // this code creates the checkbox in the user account manteinance page to activate/deactivate the plugin $user = $params['user']; echo "<tr>"; echo "<td>"; echo ' <input type="CHECKBOX" name="use_quota_managementplugin" value="1" '; // CHECKED OR UNCHECKED? if ($user->usesPlugin($this->name)) { echo "CHECKED"; } echo "> Use " . $this->text . " Plugin"; echo "</td>"; echo "</tr>"; } elseif ($hookname == "userisactivecheckboxpost") { // this code actually activates/deactivates the plugin after the form was submitted in the user account manteinance page $user = $params['user']; $use_quota_managementplugin = getStringFromRequest('use_quota_managementplugin'); if ($use_quota_managementplugin == 1) { $user->setPluginUse($this->name); } else { $user->setPluginUse($this->name, false); } echo "<tr>"; echo "<td>"; echo ' <input type="CHECKBOX" name="use_quota_managementplugin" value="1" '; // CHECKED OR UNCHECKED? if ($user->usesPlugin($this->name)) { echo "CHECKED"; } echo "> Use " . $this->text . " Plugin"; echo "</td>"; echo "</tr>"; } elseif ($hookname == "user_personal_links") { // this displays the link in the user´s profile page to it´s personal quota_management (if you want other sto access it, youll have to change the permissions in the index.php $userid = $params['user_id']; $user = user_get_object($userid); $text = $params['text']; //check if the user has the plugin activated if ($user->usesPlugin($this->name)) { echo ' <p>'; echo util_make_link("/plugins/quota_management/index.php?id={$userid}&type=user&pluginname=" . $this->name, _('View Personal quota_management')); echo '</p>'; } } elseif ($hookname == "project_admin_plugins") { // this displays the link in the project admin options page to it´s quota_management administration $group_id = $params['group_id']; $group =& group_get_object($group_id); if ($group->usesPlugin($this->name)) { echo util_make_link('/plugins/quota_management/index.php?id=' . $group->getID() . '&type=admin&pluginname=' . $this->name, _('View the quota_management Administration')); echo '<br />'; } } elseif ($hookname == "blahblahblah") { // ... } elseif ($hookname == "site_admin_option_hook") { // www/admin/index.php line 167 // ... ?> <li><?php echo util_make_link("/plugins/quota_management/quota.php", _('Ressources usage and quota')); ?> </li> <?php } elseif ($hookname == "quota_label_project_admin") { // www/project/admin/project_admin_utils.php line 80 $labels[] = _('Quota'); } elseif ($hookname == "quota_link_project_admin") { // www/project/admin/project_admin_utils.php line 99 $group_id = $params['group']; $links[] = '/plugins/quota_management/quota.php?group_id=' . $group_id; } }
* 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 GForge; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ require_once '../env.inc.php'; require_once $gfwww . 'include/pre.php'; require_once $sys_path_to_jpgraph . '/jpgraph.php'; require_once $sys_path_to_jpgraph . '/jpgraph_line.php'; require_once $gfcommon . 'reporting/ReportUserAdded.class.php'; session_require(array('group' => $sys_stats_group)); $SPAN = getStringFromRequest('SPAN'); $start = getStringFromRequest('start'); $end = getStringFromRequest('end'); // // Create Report // $report = new ReportUserAdded($SPAN, $start, $end); // // Check for error, such as license key problem // if ($report->isError()) { echo $report->getErrorMessage(); exit; } // Some data $ydata = $report->getData(); // Create the graph. These two calls are always required $graph = new Graph(640, 480, "auto");
$action = getStringFromRequest('action'); if ($action == 'activate') { $group_id = getIntFromRequest('group_id'); $list_of_groups = getStringFromRequest('list_of_groups'); $groups = explode(',', $list_of_groups); array_walk($groups, 'activate_group'); //plugin webcalendar //create webcal group plugin_hook('add_cal_group', $group_id); } else { if ($action == 'delete') { $group_id = getIntFromRequest('group_id'); $response_id = getIntFromRequest('response_id'); $add_to_can = getStringFromRequest('add_to_can'); $response_text = getStringFromRequest('response_text'); $response_title = getStringFromRequest('response_title'); //plugin webcalendar //create webcal group plugin_hook('del_cal_group', $group_id); $group =& group_get_object($group_id); if (!$group || !is_object($group)) { exit_error('Error', 'Could Not Get Group'); } elseif ($group->isError()) { exit_error('Error', $group->getErrorMessage()); } if (!$group->setStatus(session_get_user(), 'D')) { exit_error(_('Error during group rejection'), $this->getErrorMessage()); } $group->addHistory('rejected', 'x'); // Determine whether to send a canned or custom rejection letter and send it if ($response_id == 100) {
* * You should have received a copy of the GNU General Public License * along with GForge; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ require_once '../env.inc.php'; require_once $gfwww . 'include/pre.php'; require_once $gfwww . 'admin/admin_utils.php'; if (!$sys_use_project_database) { exit_disabled(); } session_require(array('group' => '1', 'admin_flags' => 'A')); if (getStringFromRequest('submit')) { $group_id = getIntFromRequest('group_id'); $groupname = getStringFromRequest('groupname'); $dbname = getStringFromRequest('dbname'); if ($groupname) { $group =& group_get_object_by_name($groupname); if (!$group || !is_object($group)) { exit_error('Error', 'Could Not Get Group'); } elseif ($group->isError()) { exit_error('Error', $group->getErrorMessage()); } $group_id = $group->getID(); $user =& session_get_user(); if (!$user || !is_object($user)) { exit_error('Error', 'Could Not Get User'); } elseif ($user->isError()) { exit_error('Error', $u->getErrorMessage()); } $res = db_query("\n\t\t\tINSERT INTO prdb_dbs(group_id, dbname, dbusername, dbuserpass, requestdate, dbtype, created_by, state)\n\t\t\tVALUES ({$group_id},'{$dbname}','{$dbname}','xxx'," . time() . ",1," . $user->getID() . ",1)\n\t\t");
<?php echo util_make_url('/snippet/add_snippet_to_package.php?snippet_package_version_id=' . $snippet_package_version_id, _('Add snippets to package'), array('target' => '_blank')); ?> </p> <p><?php echo _('<strong>Browse the library</strong> to find the snippets you want to add, then add them using the new window link shown above.'); ?> </p> <p> <?php snippet_footer(array()); exit; } } else { form_release_key(getStringFromRequest("form_key")); exit_error(_('Error - Go back and fill in all the information')); } } snippet_header(array('title' => _('New snippet version'))); ?> </p> <p> <?php echo _('If you have modified a version of a package and you feel it is significant enough to share with others, please do so.'); ?> </p> <p> <form action="<?php echo getStringFromServer('PHP_SELF'); ?>
<?php // // FORM TO UPDATE POP-UP BOXES // /* Allow modification of a artifact Selection Box */ $title = sprintf(_('Modify a custom field in %s'), $ath->getName()); $ath->adminHeader(array('title' => $title)); echo '<h2>' . $title . '</h2>'; $id = getStringFromRequest('id'); $ac = new ArtifactExtraField($ath, $id); if (!$ac || !is_object($ac)) { $feedback .= 'Unable to create ArtifactExtraField Object'; } elseif ($ac->isError()) { $feedback .= $ac->getErrorMessage(); } else { ?> <p> <strong><?php echo _('Type of custom field') . ': ' . $ac->getTypeName(); ?> </strong><br /> <form action="<?php echo getStringFromServer('PHP_SELF') . '?group_id=' . $group_id . '&id=' . $id . '&atid=' . $ath->getID(); ?> " method="post"> <input type="hidden" name="update_box" value="y" /> <input type="hidden" name="id" value="<?php
* by the Free Software Foundation; either version 2 of the License, * or (at your option) any later version. * * FusionForge 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 this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ $ret = array(); $columns = $taskboard->getColumns(); $ret['message'] = ''; $release = getStringFromRequest('release', NULL); $assigned_to = getIntFromRequest('assigned_to', NULL); if (!$assigned_to) { $assigned_to = NULL; } $user_stories = $taskboard->getUserStories($release, $assigned_to); $user_stories_tracker = $taskboard->getUserStoriesTrackerID(); $phases = array(); if ($user_stories_tracker) { $phases[] = array('id' => 'user-stories', 'title' => _('User stories')); } foreach ($columns as $column) { $phases[] = array('id' => $column->getID(), 'dom_id' => $column->getDomID(), 'title' => $column->getTitle(), 'titlebackground' => $column->getTitleBackgroundColor(), 'background' => $column->getColumnBackgroundColor(), 'resolutions' => array_values($column->getResolutions())); } $ret['user_stories'] = $user_stories; $ret['phases'] = $phases;
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
global $DOCUMENT_ROOT, $HTML, $user_id; $params['toptab'] = 'helloworld'; $params['user'] = $user_id; /* Show horizontal links */ site_user_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 = getStringFromRequest('id'); $pluginname = getStringFromRequest('pluginname'); if (!$type) { exit_error("Cannot Process your request", "No TYPE specified"); // you can create items in Base.tab and customize this messages } elseif (!$id) { exit_error("Cannot Process your request", "No ID specified"); } else { if ($type == 'group') { $group = group_get_object($id); if (!$group) { exit_error("Invalid Project", "Inexistent Project"); } if (!$group->usesPlugin($pluginname)) { //check if the group has the HelloWorld plugin active exit_error("Error", "First activate the {$pluginname} plugin through the Project's Admin Interface"); }
{ global $DOCUMENT_ROOT, $HTML, $user_id; $params['toptab'] = 'mediawiki'; $params['user'] = $user_id; /* Show horizontal links */ site_user_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 = 'group'; $id = getStringFromRequest('group_id'); $pluginname = 'mediawiki'; if (!$type) { exit_error("Cannot Process your request", "No TYPE specified"); // you can create items in Base.tab and customize this messages } elseif (!$id) { exit_error("Cannot Process your request", "No ID specified"); } else { if ($type == 'group') { $group = group_get_object($id); if (!$group) { exit_error("Invalid Project", "Inexistent Project"); } if (!$group->usesPlugin($pluginname)) { //check if the group has the MediaWiki plugin active exit_error("Error", "First activate the {$pluginname} plugin through the Project's Admin Interface");