/** * 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(); } }
form_release_key(getStringFromRequest("form_key")); exit_error(_('Error'), $mailingList->getErrorMessage()); } else { $feedback .= _('List Added'); } // // Change status // } elseif (getStringFromPost('change_status') == 'y') { $mailingList = new MailingList($Group, getIntFromGet('group_list_id')); if (!$mailingList || !is_object($mailingList)) { exit_error(_('Error'), _('Error getting the list')); } elseif ($mailingList->isError()) { exit_error(_('Error'), $mailingList->getErrorMessage()); } if (!$mailingList->update(unInputSpecialChars(getStringFromPost('description')), getIntFromPost('is_public', MAIL__MAILING_LIST_IS_PUBLIC))) { exit_error(_('Error'), $mailingList->getErrorMessage()); } else { $feedback .= _('List updated'); } } } // // Form to add list // if (getIntFromGet('add_list')) { mail_header(array('title' => _('Add a Mailing List'))); printf(_('<p>Lists are named in this manner:<br /><strong>projectname-listname@%1$s</strong></p><p>It will take <span class="important">6-24 Hours</span> for your list to be created.</p>'), $GLOBALS['sys_lists_host']); $mlFactory = new MailingListFactory($Group); if (!$mlFactory || !is_object($mlFactory) || $mlFactory->isError()) { exit_error(_('Error'), $mlFactory->getErrorMessage());
* 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 US */ require_once '../../../www/env.inc.php'; require_once $gfcommon . 'include/escapingUtils.php'; require_once $gfwww . 'include/squal_pre.php'; if (!$sys_use_scm) { exit_disabled(); } $env_group = getStringFromPost('group'); $env_user = getStringFromPost('user'); # Group must contain 3 - 15 alphanumeric chars or - preg_match("/^([[:alnum:]-]{3,15})\$/", $env_group, $matches); # User rules # 1. Must only contain alphanumeric chars or _ or - # 2. Must be 3 - 15 chars preg_match("/[[:alnum:]_-]{3,15}/", $env_user, $matches2); if (count($matches) == 0) { exit_error('', 'Invalid CVS repository : ' . $env_group); } else { if (count($matches2) == 0) { exit_error('', 'Invalid username : ' . $env_user); } $userName = $matches2[count($matches2) - 1]; $User =& user_get_object_by_name($userName); if (!$User || !is_object($User)) {
* * 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 $gfcommon . 'include/GroupJoinRequest.class.php'; $group_id = getIntFromGet('group_id'); $submit = getStringFromPost('submit'); $comments = getStringFromPost('comments'); if (!$group_id) { exit_no_group(); } if (!session_loggedin()) { exit_not_logged_in(); } $group =& group_get_object($group_id); if ($submit) { $gjr = new GroupJoinRequest($group); $usr =& session_get_user(); if (!$gjr->create($usr->getId(), $comments)) { exit_error('Error', $gjr->getErrorMessage()); } else { $feedback .= _('Your request has been submitted.'); }
* 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 $gfcommon . 'include/license.php'; require_once $gfwww . 'admin/admin_utils.php'; session_require(array('group' => '1', 'admin_flags' => 'A')); $group_id = getIntFromGet('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 (getStringFromPost('submit')) { $sure = getIntFromPost('sure'); $reallysure = getIntFromPost('reallysure'); $reallyreallysure = getIntFromPost('reallyreallysure'); if (!$group->delete($sure, $reallysure, $reallyreallysure)) { exit_error('Error', $group->getErrorMessage()); } else { plugin_hook('delete_link', $_GET['group_id']); header("Location: " . util_make_url("/admin/?feedback=DELETED")); } } site_admin_header(array('title' => _('Permanently Delete Project'))); echo '<h2>' . _('Permanently and irretrievably delete project') . ': ' . $group->getPublicName() . '</h2>'; ?> <p>
exit_error(_('ERROR'), $category->getErrorMessage()); } $do = getStringFromRequest('do'); switch ($do) { case 'addTranslation': $label = new TroveCategoryLabel($category); $label->create(getStringFromPost('label'), getIntFromPost('language_id')); // TODO : gestion d'erreurs, affichage d'un flag break; case 'removeTranslation': $label = new TroveCategoryLabel($category, getIntFromRequest('label_id')); $label->remove(); // TODO : gestion d'erreurs, affichage d'un flag break; case 'updateCategory': if (!$category->update(getStringFromPost('shortName'), getStringFromPost('fullName'), getStringFromPost('description'))) { echo $category->getErrorMessage(); } break; case 'moveCategory': break; case 'removeCategory': break; case 'createSubcategory': break; } /* Main Code */ site_admin_header(array('title' => _('Site Admin: Trove - Category List'))); ?>
if (!$user || !is_object($user)) { echo json_encode(array('message' => _('Invalid User'))); exit; } else { if ($user->isError()) { echo json_encode(array('message' => $user->getErrorMessage())); exit; } else { if (!$user->isActive()) { echo json_encode(array('message' => _('Invalid User : Not active'))); exit; } } } $group_id = getIntFromPost('group_id'); $action = getStringFromPost('action'); error_log('AJAX :' . print_r($_POST, 1)); if (!$group_id) { echo json_encode(array('message' => _('Cannot Process your request : No ID specified'))); exit; } else { $group = group_get_object($group_id); if (!$group) { echo json_encode(array('message' => _('Group is not found'))); exit; } $taskboard = new TaskBoardHtml($group); $allowedActions = array('load_taskboard', 'drop_card', 'update', 'add'); if (in_array($action, $allowedActions)) { include $gfplugins . 'taskboard/www/ajax_' . $action . '.php'; } else {
$vtp->AddSession($handle, "FORMSEARCH"); $vtp->SetVar($handle, "FORMSEARCH.TITLE", _('Search in documents')); $vtp->SetVar($handle, "FORMSEARCH.GROUP_ID", $_GET["group_id"]); $vtp->SetVar($handle, "FORMSEARCH.TEXTSEARCH", getStringFromPost("textsearch")); $vtp->SetVar($handle, "FORMSEARCH.ALLCHECKED", $allchecked); $vtp->SetVar($handle, "FORMSEARCH.ONECHECKED", $onechecked); $vtp->SetVar($handle, "FORMSEARCH.SUBMIT_PROMPT", _('Search')); $vtp->SetVar($handle, "FORMSEARCH.SEARCH_ALL_WORDS", _('With all the words')); $vtp->SetVar($handle, "FORMSEARCH.SEARCH_ONE_WORD", _('With at least one of words')); $vtp->CloseSession($handle, "FORMSEARCH"); if (getStringFromPost('cmd') == "search") { $textsearch = getStringFromPost("textsearch"); $textsearch = prepare_search_text($textsearch); $mots = preg_split("/[\\s,]+/", $textsearch); $WHERE = "WHERE TRUE "; if (getStringFromPost('search_type') == "one") { if (count($mots) > 0) { $WHERE .= "AND (FALSE "; foreach ($mots as $mot) { $mot = strtolower($mot); $WHERE .= "OR title LIKE '%{$mot}%' OR description LIKE '%{$mot}%' OR data_words LIKE '%{$mot}%' "; // $WHERE .= "OR data_words LIKE '%$mot%' "; } $WHERE .= " ) "; } } else { // search_type = all if (count($mots) > 0) { $WHERE .= "AND (TRUE "; foreach ($mots as $mot) { $WHERE .= "AND (title LIKE '%{$mot}%' OR description LIKE '%{$mot}%' OR data_words LIKE '%{$mot}%') ";
$feedback = ''; if (!$group_id) { exit_no_group(); } $Group =& group_get_object($group_id); if (!$Group || !is_object($Group) || $Group->isError()) { exit_no_group(); } $perm =& $Group->getPermission(session_get_user()); if (!$perm || !is_object($perm) || $perm->isError() || !$perm->isAdmin()) { exit_permission_denied(); } $ml = new MailingList($Group, getIntFromGet('group_list_id')); if (getStringFromPost('submit')) { $sure = getStringFromPost('sure'); $really_sure = getStringFromPost('really_sure'); if (!$ml->delete($sure, $really_sure)) { exit_error('Error', $ml->getErrorMessage()); } else { header("Location: index.php?group_id={$group_id}&feedback=DELETED"); } } mail_header(array('title' => _('Permanently Delete List'))); ?> <h3><?php echo $ml->getName(); ?> </h3> <p> <form method="post" action="<?php echo getStringFromServer('PHP_SELF');