$request =& HTTPRequest::instance(); if ($request->exist('group_id')) { $group_id = $request->get('group_id'); session_require(array('group' => $group_id, 'admin_flags' => 'A')); echo '<table><tr><td><div style="overflow:auto; height:250px; border:1px solid gray">'; // First make a quick hash of this project's restricted users $current_group_restricted_users = array(); $sql = "SELECT user.user_id from user, user_group WHERE user.status='R' AND user.user_id=user_group.user_id AND user_group.group_id={$group_id}"; $res = db_query($sql); while ($row = db_fetch_array($res)) { $current_group_restricted_users[$row['user_id']] = true; } $hp = Codendi_HTMLPurifier::instance(); $sql = "SELECT user_id, user_name, realname, status FROM user WHERE status='A' OR status='R' ORDER BY user_name"; $res = db_query($sql); $member_id = array(); while ($row = db_fetch_array($res)) { // Don't display restricted users that don't belong to the project if ($row['status'] == 'R') { if (!isset($current_group_restricted_users[$row['user_id']]) || !$current_group_restricted_users[$row['user_id']]) { continue; } } echo '<div><b>' . $row['user_name'] . '</b> (' . $hp->purify($row['realname'], CODENDI_PURIFIER_CONVERT_HTML) . ")</div>\n"; } echo '</div></td></tr></table>'; } else { $feedback = new Feedback(); $feedback->log('error', $GLOBALS['Language']->getText('global', 'missing_parameters')); echo $feedback->fetch(); }
/** * AJAX response which marked as deleted record. * return json of feedback with DELETED state. * role: administrator */ public function get_data_feedback_deleted() { $model_feedback = new Feedback(); $data = $model_feedback->fetch(Feedback::DELETED); echo json_encode($data); }
$name = $request->get('name'); $package_id = $request->get('package_id'); $date = $request->get('date'); $group_id = $request->get('group_id'); $release_id = $request->get('release_id'); $validator = new frsValidator(); $release = array('name' => $name, 'release_id' => $release_id, 'package_id' => $package_id, 'date' => $date); if ($validator->isValidForUpdate($release, $group_id)) { //frs valid $header = array('valid' => true); } else { //frs non valid $errors = $validator->getErrors(); $feedback = new Feedback(); $feedback->log('error', $errors[0]); $header = array('valid' => false, 'msg' => $feedback->fetch()); } header(json_header($header)); } } else { if ($action == 'refresh_file_list') { $project = $request->getProject(); $frsff = new FRSFileFactory(); $file_list = $frsff->getUploadedFileNames($project); $available_ftp_files = implode(",", $file_list); $purifier = Codendi_HTMLPurifier::instance(); $available_ftp_files = $purifier->purify($available_ftp_files, CODENDI_PURIFIER_JS_DQUOTE); echo '{"valid":true, "msg":"' . $available_ftp_files . '"}'; } } }