<?php $relPath = "./../../pinc/"; include_once $relPath . 'base.inc'; include_once $relPath . 'dpsql.inc'; include_once $relPath . 'TallyBoard.inc'; include_once $relPath . 'page_tally.inc'; include_once 'common.inc'; $valid_tally_names = array_keys($page_tally_names); $tally_name = get_enumerated_param($_GET, 'tally_name', null, $valid_tally_names); $timeframe = get_enumerated_param($_GET, 'timeframe', null, array('curr_month', 'prev_month', 'all_time')); $c_or_i = get_enumerated_param($_GET, 'cori', null, array('cumulative', 'increments')); // Initialize the graph before anything else. // This makes use of the jpgraph cache if enabled. // Argument to init_pages_graph is the cache timeout in minutes. $graph = init_pages_graph(60); $site_tallyboard = new TallyBoard($tally_name, 'S'); $now_timestamp = time(); $now_assoc = getdate($now_timestamp); $curr_y = $now_assoc['year']; $curr_m = $now_assoc['mon']; switch ($timeframe) { case 'curr_month': $start_timestamp = mktime(0, 0, 0, $curr_m, 1, $curr_y); $end_timestamp = mktime(0, 0, 0, $curr_m + 1, 1, $curr_y); $year_month = strftime('%Y-%m', $start_timestamp); $where_clause = "WHERE {year_month} = '{$year_month}'"; $title_timeframe = strftime(_('%B %Y'), $now_timestamp); break; case 'prev_month': $start_timestamp = mktime(0, 0, 0, $curr_m - 1, 1, $curr_y);
} else { if ($default_layout === LAYOUT_HORIZ || $default_layout === LAYOUT_VERT) { // The normal case for the session's subsequent visits. } else { // I don't know how this could happen. $default_layout = LAYOUT_HORIZ; // Alternatively, we could raise an error or warning. } } $layout = get_integer_param($_GET, 'layout', $default_layout, LAYOUT_HORIZ, LAYOUT_VERT); $_SESSION["show_good_word_suggestions_detail"]["layout"] = $layout; // $frame determines which frame we're operating from // 'master' - we're the master frame // 'left' - we're the left frame with the text // 'right' - we're the right frame for the image $frame = get_enumerated_param($_GET, 'frame', 'master', array('master', 'left', 'right')); if ($frame == "master") { slim_header_frameset(_("Suggestion Detail")); if ($layout == LAYOUT_HORIZ) { $frameSpec = 'rows="30%,70%"'; } else { $frameSpec = 'cols="30%,70%"'; } ?> <frameset <?php echo $frameSpec; ?> > <frame name="worddetailframe" src="show_good_word_suggestions_detail.php?projectid=<?php echo $projectid; ?>
$projectid = validate_projectID('projectid', @$_REQUEST['projectid']); $fileObject = get_project_word_file($projectid, "good"); $timeCutoff = get_integer_param($_REQUEST, 'timeCutoff', $fileObject->mod_time, 0, null); $freqCutoff = get_integer_param($_REQUEST, 'freqCutoff', 5, 0, null); enforce_edit_authorization($projectid); if ($timeCutoff == 0) { $time_cutoff_text = _("<b>All proofreader suggestions</b> are included in the results."); } else { $time_cutoff_text = sprintf(_("Only proofreader suggestions made <b>after %s</b> are included in the results."), strftime($datetime_format, $timeCutoff)); } // $format determines what is presented from this page: // 'html' - page is rendered with frequencies included // 'file' - all words and frequencies are presented as a // downloaded file // 'update' - update the list $format = get_enumerated_param($_REQUEST, 'format', 'html', array('html', 'file', 'update')); if ($format == "update") { $postedWords = parse_posted_words($_POST); $words = load_project_good_words($projectid); $words = array_merge($words, $postedWords); save_project_good_words($projectid, $words); $format = "html"; } list($all_suggestions_w_freq, $all_suggestions_w_occurrences, $round_suggestions_w_freq, $round_suggestions_w_occurrences, $rounds, $round_page_count, $messages) = _get_word_list($projectid, $timeCutoff); $title = _("Candidates for Good Words List from Proofreaders"); $page_text = sprintf(_("Displayed below are the words that proofreaders have suggested (via the %s button) in the WordCheck interface that have not been already included in the project's Good Words List."), "<img src='{$code_url}/graphics/Book-Plus-Small.gif'>"); $page_text .= " "; $page_text .= _("The results list also shows how many times each word occurs in the project text and how many times each word was suggested by proofreaders."); if ($format == "file") { $filename = "{$projectid}_proofer_suggestions.txt"; header("Content-type: text/plain");
<?php $relPath = "../pinc/"; include_once $relPath . 'base.inc'; include_once $relPath . 'project_states.inc'; include_once $relPath . 'project_trans.inc'; include_once $relPath . 'metarefresh.inc'; include_once $relPath . 'Project.inc'; include_once $relPath . 'ProjectTransition.inc'; require_login(); header("Content-Type: text/html; charset={$charset}"); // Get Passed parameters to code $projectid = validate_projectID('projectid', @$_POST['projectid']); $curr_state = get_enumerated_param($_POST, 'curr_state', null, $PROJECT_STATES_IN_ORDER); $next_state = get_enumerated_param($_POST, 'next_state', null, array_merge($PROJECT_STATES_IN_ORDER, array('automodify'))); $confirmed = get_enumerated_param($_POST, 'confirmed', null, array('yes'), true); $return_uri = @$_POST['return_uri']; // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX $project = new Project($projectid); if ($project->state != $curr_state) { fatal_error(sprintf(_("Your request appears to be out-of-date. The project's current state is now '%s'."), $project->state)); } $transition = get_transition($curr_state, $next_state); if (is_null($transition)) { fatal_error(_("This transition is not recognized.")); } if (!$transition->is_valid_for($project, $pguser)) { fatal_error(_("You are not permitted to perform this action.")); } function fatal_error($msg) {
<?php $relPath = "./../pinc/"; include_once $relPath . 'base.inc'; include_once $relPath . 'misc.inc'; // xmlencode() undo_all_magic_quotes(); $content = get_enumerated_param($_GET, 'content', 'posted', array('posted', 'postprocessing', 'proofing', 'news')); // Which feed the user wants $refreshDelay = 30 * 60; // Time in seconds for how often the feeds get refreshed $refreshAge = time() - $refreshDelay; // How long ago $refreshDelay was in UNIX time // Determine if we should display a 0.91 compliant RSS feed or our own feed $intlang = get_desired_language(); if (isset($_GET['type'])) { $xmlfile = "{$xmlfeeds_dir}/{$content}_rss.{$intlang}.xml"; } else { $xmlfile = "{$xmlfeeds_dir}/{$content}.{$intlang}.xml"; } // If the file does not exist or is stale, let's (re)create it if (!file_exists($xmlfile) || filemtime($xmlfile) < $refreshAge) { $relPath = "./../pinc/"; include_once $relPath . 'pg.inc'; include_once $relPath . 'project_states.inc'; $absolute_url = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://'; $absolute_url .= $_SERVER['HTTP_HOST']; $absolute_url .= $_SERVER['REQUEST_URI']; $encoded_url = xmlencode($absolute_url); if ($content == "posted" || $content == "postprocessing" || $content == "proofing") { switch ($content) {
<?php $relPath = "./pinc/"; include_once $relPath . 'base.inc'; include_once $relPath . 'misc.inc'; include_once $relPath . 'slim_header.inc'; include_once 'faq/pophelp/prefs/prefs_pophelp.inc'; include_once 'faq/pophelp/teams/teams_pophelp.inc'; $pophelp = array('prefs' => $prefs_pophelp, 'teams' => $teams_pophelp); undo_all_magic_quotes(); $category = get_enumerated_param($_GET, 'category', null, array_keys($pophelp)); $name = get_enumerated_param($_GET, 'name', null, array_keys($pophelp[$category])); $title = $pophelp[$category][$name]['title']; $content = $pophelp[$category][$name]['content']; slim_header($title); echo "<div align='center'>\n"; echo "<table border='1' width='360' cellpadding='6'>\n"; echo "<tr><td align='center' bgcolor='#cccccc'><b>{$title}</b></td></tr>\n"; echo "<tr><td>{$content}</td></tr>\n"; echo "<tr><td align='center' bgcolor='#cccccc'><b><a href='javascript:window.close();'>" . _("Close Window") . "</a></b></td></tr>\n"; echo "</table></div>\n"; // vim: sw=4 ts=4 expandtab
<?php $relPath = "./../../pinc/"; include_once $relPath . 'base.inc'; include_once $relPath . 'misc.inc'; include_once $relPath . 'privacy.inc'; include_once $relPath . 'theme.inc'; include_once $relPath . 'metarefresh.inc'; include_once $relPath . 'forum_interface.inc'; include_once '../includes/team.inc'; include_once '../includes/member.inc'; $order = get_enumerated_param($_GET, 'order', 'u_id', array('u_id', 'username', 'date_created')); $direction = get_enumerated_param($_GET, 'direction', 'asc', array('asc', 'desc')); $mstart = get_integer_param($_GET, 'mstart', 0, 0, null); $uname = @$_REQUEST['uname']; $uexact = @$_REQUEST['uexact']; if (!empty($uname)) { if ($uexact == 'yes') { $where_clause = "WHERE username='******'"; } else { $where_clause = "WHERE username LIKE '%" . addcslashes($uname, "%_") . "%'"; } $mResult = mysql_query("\n SELECT u_id, username, date_created, u_privacy\n FROM users\n {$where_clause}\n ORDER BY {$order} {$direction}\n LIMIT {$mstart},20\n "); $mRows = mysql_num_rows($mResult); if ($mRows == 1) { metarefresh(0, "mdetail.php?id=" . mysql_result($mResult, 0, "u_id") . "", '', ''); exit; } $uname = "uname=" . $uname . "&"; } else { $mResult = mysql_query("\n SELECT u_id, username, date_created, u_privacy\n FROM users\n ORDER BY {$order} {$direction}\n LIMIT {$mstart},20\n ");
?> <a name="results"></a><h2 align="center"><?php echo get_search_title(); ?> </h2> <form name="adminform" action="?<?php echo $query . $sortby; ?> " method="POST" onSubmit="return evaluateForm(this);"> <?php // argument 'view': 'enabled'(default), 'disabled', 'all' // provide links for those and also buttons for submitting/resetting form. $view = get_enumerated_param($_REQUEST, 'view', 'enabled', array('enabled', 'disabled', 'all')); $links_and_buttons = _('View:') . ' '; if ($view != 'disabled' && $view != 'all') { $links_and_buttons .= _('Enabled'); } else { $links_and_buttons .= "<a href='?{$query_without_view}{$sortby}&view=enabled#results'>" . _('Enabled') . '</a>'; } $links_and_buttons .= " | "; if ($view == 'disabled') { $links_and_buttons .= _('Disabled'); } else { $links_and_buttons .= "<a href='?{$query_without_view}{$sortby}&view=disabled#results'>" . _('Disabled') . '</a>'; } $links_and_buttons .= " | "; if ($view == 'all') { $links_and_buttons .= _('All');
<?php $relPath = "../pinc/"; include_once $relPath . 'base.inc'; include_once $relPath . 'project_states.inc'; include_once $relPath . 'theme.inc'; require_login(); $clausemap = array('nameofwork' => 'nameofwork ASC', 'modifieddate' => 'modifieddate ASC', 'PPer' => 'postproofer ASC', 'PM' => 'username ASC'); $order = get_enumerated_param($_GET, 'order', 'nameofwork', array_keys($clausemap)); $orderclause = $clausemap[$order]; // ------------------ $title = _("Books Available for PPV"); output_header($title); echo "<br><h2>{$title}</h2>\n"; // ------------------ // Header row $colspecs = array('bogus' => _('#'), 'nameofwork' => _('Name of Work'), 'PM' => _('Project Manager'), 'PPer' => _('Post-Processed By'), 'modifieddate' => _('Date Last Modified')); echo "<table border='1' cellspacing='0' cellpadding='2' style='border: 1px solid #111; border-collapse: collapse' width='99%'>\n"; echo "<tr><td colspan='5' bgcolor='" . $theme['color_headerbar_bg'] . "'><center><font color='" . $theme['color_headerbar_font'] . "'><b>{$title}</b></font></center></td></tr>"; echo "<tr bgcolor='" . $theme['color_navbar_bg'] . "'>"; foreach ($colspecs as $col_order => $col_header) { $s = $col_header; // Make each column-header a link that will sort on that column, // except for the header of the column that we're already sorting on. if ($col_order != $order && $col_order != 'bogus') { $s = "<a href='PPV_avail.php?order={$col_order}'>{$s}</a>"; } $s = "<th><center>" . $s . "</center></th>"; echo "{$s}\n"; } echo "</tr>\n";
$relPath = './../../pinc/'; include_once $relPath . 'base.inc'; include_once $relPath . 'metarefresh.inc'; include_once $relPath . 'theme.inc'; include_once $relPath . 'misc.inc'; // undo_all_magic_quotes(), attr_safe(), html_safe() include_once $relPath . 'user_is.inc'; require_login(); if (!user_is_a_sitemanager()) { die("You are not allowed to run this script."); } undo_all_magic_quotes(); $theme_args['css_data'] = "\ntable.listing { border-collapse: collapse; width: 80%; margin: auto; }\ntable.listing td { border: 1px solid #999; padding: 5px; }\ntable.listing tr.e { background-color: #eee; }\ntable.listing tr.o { background-color: #ddd; }\ntable.listing td.enabled { background-color: #9f9; text-align: center; }\ntable.listing td.disabled { background-color: #ddd; text-align: center; }\ntable.listing td.center { text-align: center; }\ntable.listing tr.month > * { border: none; border-bottom: solid 2px black; }\ntable.listing td.right,th.right { text-align: right; font-weight: normal; border: 1px solid #999; }\ntable.listing h2 { margin: 1em auto auto auto; text-align: left; }\nform { padding-top: 10px; margin: 0; }\n\ntable.source { border-collapse: collapse; width: 80%; margin: auto; margin-bottom: 1em; }\ntable.source td { border: 1px solid black; padding: 5px; background-color: #eeeeee; }\ntable.source td.pa { width: 30%; font-weight: bold; }\nh2.source { margin: 1em auto 1em auto; text-align: center; }"; $page_url = "{$code_url}/tools/site_admin/manage_special_days.php"; $action = get_enumerated_param($_REQUEST, 'action', 'show_specials', array('show_specials', 'add_special', 'update_oneshot')); // Action 'update_oneshot' is used as a target for form submit buttons. The // desired action is based on the submit button's name. Here we do the action // and set $action to 'show_specials' to display the list all in one page load. if ($action == 'update_oneshot') { global $page_url; if (isset($_POST['edit'])) { $action = 'edit_source'; } elseif (isset($_POST['save_edits'])) { // This handles both edits to existing special days, and the creation of new ones $errmsgs = ''; $spec_code = trim($_POST['spec_code']); $source = new SpecialDay($spec_code); if (!isset($_POST['editing']) && !$source->new_source) { $errmsgs .= _('A Special Day with this ID already exists. Please choose a different ID for this event.') . "<br>"; }
function handle_any_requested_db_updates($news_page_id) { $allowed_tags = '<a><b><i><u><font><img><p><div><br>'; $action = get_enumerated_param($_GET, 'action', null, array('add', 'delete', 'display', 'hide', 'archive', 'unarchive', 'moveup', 'movedown', 'edit', 'edit_update'), true); switch ($action) { case 'add': // Save a new site news item $content = strip_tags($_POST['content'], $allowed_tags); $date_posted = time(); $insert_news = mysql_query("\n INSERT INTO news_items\n SET\n id = NULL,\n news_page_id = '{$news_page_id}',\n status = 'current',\n date_posted = '{$date_posted}',\n content = '{$content}'\n "); // by default, new items go at the top $update_news = mysql_query("\n UPDATE news_items SET ordering = id WHERE id = LAST_INSERT_ID()\n "); news_change_made($news_page_id); break; case 'delete': // Delete a specific site news item $item_id = get_integer_param($_GET, 'item_id', null, null, null); $result = mysql_query("DELETE FROM news_items WHERE id={$item_id}"); break; case 'display': // Display a specific site news item $item_id = get_integer_param($_GET, 'item_id', null, null, null); $result = mysql_query("UPDATE news_items SET status = 'current' WHERE id={$item_id}"); news_change_made($news_page_id); break; case 'hide': // Hide a specific site news item $item_id = get_integer_param($_GET, 'item_id', null, null, null); $result = mysql_query("UPDATE news_items SET status = 'recent' WHERE id={$item_id}"); news_change_made($news_page_id); break; case 'archive': // Archive a specific site news item $item_id = get_integer_param($_GET, 'item_id', null, null, null); $result = mysql_query("UPDATE news_items SET status = 'archived' WHERE id={$item_id}"); break; case 'unarchive': // Unarchive a specific site news item $item_id = get_integer_param($_GET, 'item_id', null, null, null); $result = mysql_query("UPDATE news_items SET status = 'recent' WHERE id={$item_id}"); break; case 'moveup': // Move a specific site news item higher in the display list $item_id = get_integer_param($_GET, 'item_id', null, null, null); move_news_item($news_page_id, $item_id, 'up'); news_change_made($news_page_id); break; case 'movedown': // Move a specific site news item lower in the display list $item_id = get_integer_param($_GET, 'item_id', null, null, null); move_news_item($news_page_id, $item_id, 'down'); news_change_made($news_page_id); break; case 'edit_update': // Save an update to a specific site news item $content = strip_tags($_POST['content'], $allowed_tags); $item_id = get_integer_param($_POST, 'item_id', null, null, null); $result = mysql_query("UPDATE news_items SET content='{$content}' WHERE id={$item_id}"); $result = mysql_query("SELECT status FROM news_items WHERE id={$item_id}"); $row = mysql_fetch_assoc($result); $visible_change_made = $row['status'] == 'current'; if ($visible_change_made) { news_change_made($news_page_id); } break; } }
function select_and_list_tasks($sql_condition) { global $tasks_url; $columns = array('task_id' => " style='text-align: center;'", 'task_type' => "", 'task_severity' => "", 'task_summary' => " class='wrap'", 'task_priority' => "", 'date_edited' => " style='text-align: center;'", 'task_status' => "", 'votes' => "", 'percent_complete' => ""); $curr_sort_dir = get_enumerated_param($_GET, 'direction', 'desc', array('asc', 'desc')); $curr_sort_col = get_enumerated_param($_GET, 'orderby', 'date_edited', array_keys($columns)); $sql_query = "\n SELECT tasks.task_id,\n task_type,\n task_severity,\n task_summary,\n task_priority,\n date_edited,\n task_status,\n percent_complete,\n CASE WHEN\n vote_os IS NULL THEN NULL\n ELSE COUNT(*) END AS votes\n FROM tasks\n LEFT OUTER JOIN tasks_votes USING (task_id)\n WHERE {$sql_condition}\n GROUP BY task_id\n ORDER BY {$curr_sort_col} {$curr_sort_dir}\n "; $sql_result = wrapped_mysql_query($sql_query); $t = SearchParams_get_url_query_string(); echo "<table class='taskslist'><tr>\n"; foreach ($columns as $property_id => $attrs) { // Each column-header is a link; clicking on it will cause // the resulting listing to be sorted on that column. $orderby_for_link = $property_id; // But sorted in which direction? if ($property_id == $curr_sort_col) { // This column is the one that the current listing is sorted on. // A header-click will just reverse the direction of the sort. if ($curr_sort_dir == "asc") { $direction_for_link = "desc"; } else { $direction_for_link = "asc"; } } else { // This column is not the current sort-column. // A header-click will sort by that column in descending order. // (Might be better for each column to have its own default direction.) $direction_for_link = "desc"; } $url = "{$tasks_url}?{$t}orderby={$orderby_for_link}&direction={$direction_for_link}"; $label = property_get_label($property_id, TRUE); echo "<th{$attrs}><a href='{$url}'>{$label}</a></th>\n"; } echo "</tr>\n"; if (@mysql_num_rows($sql_result) >= 1) { while ($row = mysql_fetch_assoc($sql_result)) { echo "<tr bgcolor='#ffffff'>\n"; foreach ($columns as $property_id => $attrs) { $formatted_value = property_format_value($property_id, $row, TRUE); echo "<td{$attrs}>{$formatted_value}</td>\n"; } echo "</tr>\n"; } } else { echo "<tr bgcolor='#ffffff'><td colspan='7'><center>No tasks found!</center></td></tr>"; } echo "</table><br />\n"; // if 2 tasks or more found, display the number of reported tasks if (@mysql_num_rows($sql_result) > 1) { echo "<p>" . @mysql_num_rows($sql_result) . " tasks listed.</p>"; } }
<?php $relPath = '../../pinc/'; include_once $relPath . 'base.inc'; include_once $relPath . 'project_edit.inc'; include_once $relPath . 'project_trans.inc'; include_once $relPath . 'Project.inc'; include_once 'projectmgr.inc'; require_login(); abort_if_not_manager(); $curr_state = get_enumerated_param($_GET, 'curr_state', null, $PROJECT_STATES_IN_ORDER); $new_state = get_enumerated_param($_GET, 'new_state', null, $PROJECT_STATES_IN_ORDER); $projectids = array(); foreach (explode(',', @$_GET['projects']) as $projectid) { $projectids[] = validate_projectID('projects', $projectid); } echo "<pre>\n"; echo sprintf(_("Moving projects from '%1\$s' to '%2\$s'..."), $curr_state, $new_state); echo "\n\n"; foreach ($projectids as $projectid) { echo "\n"; echo "{$projectid} ...\n"; try { $project = new Project($projectid); } catch (NonexistentProjectException $exception) { echo " " . _("does not exist.") . "\n"; continue; } $result = user_can_edit_project($projectid); if ($result == USER_CANNOT_EDIT_PROJECT) { echo " " . _("You are not authorize to manage this project.") . "\n";
<?php $relPath = "../pinc/"; include_once $relPath . 'base.inc'; include_once $relPath . 'project_states.inc'; include_once $relPath . 'theme.inc'; require_login(); $ordermap = array('nameofwork' => 'nameofwork ASC', 'checkedoutby' => 'checkedoutby ASC, modifieddate ASC', 'postproofer' => 'postproofer ASC, modifieddate ASC', 'modifieddate' => 'modifieddate ASC', 'holder_t_last_activity' => 'holder_t_last_activity ASC'); $order = get_enumerated_param($_GET, 'order', 'checkedoutby', array_keys($ordermap)); $state = get_enumerated_param($_GET, 'state', PROJ_POST_FIRST_CHECKED_OUT, array(PROJ_POST_FIRST_CHECKED_OUT, PROJ_POST_SECOND_CHECKED_OUT)); if ($state == PROJ_POST_FIRST_CHECKED_OUT) { $title = _('Books Checked Out for Post Processing'); } if ($state == PROJ_POST_SECOND_CHECKED_OUT) { $title = _('Books Checked Out for Post Processing Verification'); $inPPV = 1; } $orderclause = $ordermap[$order]; // ------------------ output_header($title); echo "<br><h2>{$title}</h2>\n"; // ------------------ // Header row if (isset($inPPV)) { $colspecs = array('bogus' => _('#'), 'nameofwork' => _('Name of Work'), 'postproofer' => _('PPer'), 'checkedoutby' => _('Checked Out By'), 'modifieddate' => _('Date Last Modified'), 'holder_t_last_activity' => _('User Last on Site')); } else { $colspecs = array('bogus' => _('#'), 'nameofwork' => _('Name of Work'), 'checkedoutby' => _('Checked Out By'), 'modifieddate' => _('Date Last Modified'), 'holder_t_last_activity' => _('User Last on Site')); } echo "<table border='1' cellspacing='0' cellpadding='2' style='border: 1px solid #111; border-collapse: collapse' width='99%'>\n"; echo "<tr><td colspan='" . count($colspecs) . "' bgcolor='" . $theme['color_headerbar_bg'] . "'><center><font color='" . $theme['color_headerbar_font'] . "'><b>{$title}</b></font></center></td></tr>"; echo "<tr bgcolor='" . $theme['color_navbar_bg'] . "'>";
echo "<br><center><font size='+1' color='#ff0000'><b>{$errors}</b></font></center>"; } $pih->show_form(); if (isset($_POST['saveAndPreview'])) { $pih->preview(); } } elseif (isset($_POST['quit'])) { // if return is empty for whatever reason take them to // the PM page if (empty($return)) { $return = "{$code_url}/tools/project_manager/projectmgr.php"; } // do the redirect metarefresh(0, $return, _("Quit Without Saving"), ""); } else { $requested_action = get_enumerated_param($_REQUEST, 'action', null, array('createnew', 'clone', 'createnewfromuber', 'create_from_marc_record', 'edit')); if (in_array($requested_action, array('createnew', 'clone', 'createnewfromuber', 'create_from_marc_record'))) { check_user_can_load_projects(true); // exit if they can't } switch ($requested_action) { case 'createnew': $page_title = _("Create a Project"); $fatal_error = $pih->set_from_nothing(); break; case 'clone': $page_title = _("Clone a Project"); $fatal_error = $pih->set_from_db(FALSE); break; case 'createnewfromuber': $page_title = _("Create a Project from an Uber Project");
<?php $relPath = "./../../pinc/"; include_once $relPath . 'base.inc'; include_once $relPath . 'misc.inc'; include_once $relPath . 'stages.inc'; include_once $relPath . 'project_states.inc'; include_once $relPath . 'page_tally.inc'; include_once 'common.inc'; $day_options = array("0", "1", "7", "28", "180"); $days = get_enumerated_param($_GET, "days", NULL, $day_options, TRUE); if ($days !== NULL) { display_graph($days); exit; } $title = _("Equilibria"); output_header($title); echo "<h1>{$title}</h1>"; echo "<p>" . _('Only "today" is real-time; others updated at stats run time.') . "</p>"; foreach ($day_options as $days) { echo "<img src='?days={$days}'><br><br>"; } // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX function display_graph($d) { $total_pages = 0; if ($d == 0) { $graph = init_pie_graph(660, 400, 5); $title = _("Net pages saved so far today"); for ($rn = 1; $rn <= MAX_NUM_PAGE_EDITING_ROUNDS; $rn++) { $round = get_Round_for_round_number($rn);
if (mysql_num_rows($res2) == 0) { $error_messages[] = sprintf(_("no page '%1\$s' in project with projectID '%2\$s'"), html_safe($page), html_safe($projectid)); } else { $is_valid_page = true; } mysql_free_result($res2); } else { $error_messages[] = _("select a project page"); } } // $frame determines which frame we're operating from // 'master' - we're the master frame // 'top' - we're the top frame with the basic info // 'image' - frame with the image // 'text' - we're the bottom frame for the text $frame = get_enumerated_param($_GET, "frame", "master", array("master", "top", "image", "text")); if ($frame == "master") { slim_header_frameset(_("Image and text for page")); $projectid = urlencode($projectid); $page = urlencode($page); $round_id = urlencode($round_id); ?> <frameset rows="15%,50%,35%"> <frame name="topframe" src="view_page_text_image.php?projectid=<?php echo $projectid; ?> &page=<?php echo $page; ?> &round_id=<?php echo $round_id;
$queryWordText = str_replace("\r", "", $queryWordText); $queryWords = explode("\n", $queryWordText); // do some cleanup on the resulting words $queryWords = array_map('ltrim', $queryWords); $queryWords = preg_replace('/\\s+.*$/', '', $queryWords); $queryWords = array_unique($queryWords); // remove any empty words $queryWords = array_diff($queryWords, array('')); // now reset the input string to our sanitized values $queryWordText = implode("\r\n", $queryWords); enforce_edit_authorization($projectid); // $format determins what is presented from this page: // 'html' - page is rendered with frequencies included // 'update' - update the list $format = get_enumerated_param($_REQUEST, 'format', 'html', array('html', 'update')); $wordListTarget = get_enumerated_param($_POST, 'wordlisttarget', 'bad', array('good', 'bad')); if ($format == "update") { $postedWords = parse_posted_words($_POST); if ($wordListTarget == "good") { $words = load_project_good_words($projectid); $words = array_merge($words, $postedWords); save_project_good_words($projectid, $words); } elseif ($wordListTarget == "bad") { $words = load_project_bad_words($projectid); $words = array_merge($words, $postedWords); save_project_bad_words($projectid, $words); } $format = "html"; } $title = _("Ad Hoc Word Details"); $page_text = _("Insert words, one per line, in the box below and click the Show details button to get frequency and context details for them.");
************************************ */ $relPath = '../../pinc/'; include_once $relPath . 'base.inc'; include_once $relPath . 'theme.inc'; include_once $relPath . 'project_states.inc'; include_once $relPath . 'misc.inc'; // html_safe() include_once $relPath . 'Project.inc'; // validate_projectID() include_once $relPath . 'DpTableClass.inc'; require_login(); // --------------------------------------------------------------- // get the args $round_id = get_enumerated_param($_GET, 'round_id', null, array_keys($Round_for_round_id_), True); $projectid = validate_projectID('projectid', @$_POST['projectid'], True); // Gather the valid mentoring rounds $mentoring_rounds = get_mentoring_rounds(); if (count($mentoring_rounds) == 0) { die(_("There are no mentoring rounds.")); } // --------------------------------------------------------------- // Establish the mentoring round, and validate the user $mentoring_round = get_mentoring_round($round_id); if (!user_can_mentor_in_round($mentoring_round)) { $errmsg = sprintf(_("You do not have access to 'Mentors Only' projects in %s."), $mentoring_round->id); die($errmsg); } // --------------------------------------------------------------- // We're done with validations, show the data.
$datetime_format = _("%A, %B %e, %Y at %X"); // TRANSLATORS: This is a strftime-formatted string for the date and time $date_format = _("%A, %B %e, %Y"); // TRANSLATORS: This is a strftime-formatted string for the time $time_format = _("%X"); error_reporting(E_ALL); // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX // Usually, the user arrives here by clicking on the title of a project // in a list of projects. // But there are lots of other less-used pages that link here. $MIN_DETAIL_LEVEL = 1; $MAX_DETAIL_LEVEL = 4; $DEFAULT_DETAIL_LEVEL = 3; // Validate all the input $projectid = validate_projectID('id', @$_GET['id']); $expected_state = get_enumerated_param($_GET, 'expected_state', null, $PROJECT_STATES_IN_ORDER, true); $detail_level = get_integer_param($_GET, 'detail_level', $DEFAULT_DETAIL_LEVEL, $MIN_DETAIL_LEVEL, $MAX_DETAIL_LEVEL); // ----------------------------------------------------------------------------- $project = new Project($projectid); // TRANSLATORS: this is the project page title. // In a tabbed browser, the page-title passed to output_header() will appear // in the tab, which tends to be small, as soon as you have a few of them. // So, put the distinctive part of the page-title (i.e. the name of the // project) first. $title_for_theme = sprintf(_('"%s" project page'), $project->nameofwork); $title = sprintf(_("Project Page for '%s'"), $project->nameofwork); // ----------------------------------------------------------------------------- if (!$user_is_logged_in) { // Guests see a reduced version of the project page. output_header($title_for_theme, NO_STATSBAR); echo "<h1>{$title}</h1>\n";
include_once $relPath . 'User.inc'; include_once $relPath . 'misc.inc'; // attr_safe() require_login(); if (!user_is_a_sitemanager()) { die("permission denied"); } // -------------------------------------- // These settings are set in the users table, not in the usersettings // table, although the Settings class provides a view into them. $user_table_settings = array('manager' => _("Grants project management (PM) privileges")); $boolean_user_settings = array_merge($user_table_settings, array('proj_facilitator' => _("Grants project facilitator (PF) privileges"), 'access_request_reviewer' => _("Creates level evaluators; gives access to special reviewer-only scripts; <b>must</b> be combined with PF access"), 'image_sources_manager' => _("Grants ability to create new image source listings and manage existing records"), 'site_news_editor' => _("Grants ability to create and edit news on any of the site pages"), 'task_center_mgr' => _("Grants administrative access to the Task Center; typically granted to developers so they can manage their own tasks"), 'authors_db_manager' => _("Grants ability to manage author records"), 'send_to_post' => _("Send user's projects to the PP pool"), 'disable_project_loads' => _("Revoke user's ability to load projects"))); $value_user_settings = array('remote_file_manager' => array('disabled' => _("Revokes user access to remote file manager"), 'common' => _("Grants user access to Commons upload directory"), 'self' => _("Grants user access their own private upload directory"), '' => _("Value is not set"))); $freeform_user_settings = array('pp_limit_value' => _("Post-processing projects limit, -1 means unlimited")); $username = array_get($_POST, 'username', array_get($_GET, 'username', NULL)); $action = get_enumerated_param($_POST, 'action', NULL, array('update'), TRUE); $title = _("Manage Site Access Privileges"); output_header($title); echo "<h1>{$title}</h1>\n"; echo "<p>" . _("This page allows you to grant or revoke various site access permissions for a user and adjust some limits. Round accesses are managed from the user's statistics page.") . "</p>"; show_username_form($username); if ($username) { try { $user = new User($username); } catch (NonexistentUserException $exception) { echo "<p class='error'>" . _("Invalid username") . "</p>"; exit; } $user_settings =& Settings::get_settings($username); echo "<hr>"; echo "<h2>{$username} ({$user->real_name})</h2>";
$watch->start(); set_time_limit(0); // no time limit $freqCutoff = get_integer_param($_REQUEST, 'freqCutoff', 5, 0, null); $timeCutoff = get_integer_param($_REQUEST, 'timeCutoff', -1, -1, null); // load the PM $pm = array_get($_REQUEST, "pm", $pguser); if (!user_is_a_sitemanager() && !user_is_proj_facilitator()) { $pm = $pguser; } // $frame determines which frame we're operating from // none - we're the master frame // 'left' - we're the left frame with the text // 'right' - we're the right frame for the context info // 'update' - not a frame at all - process the incoming data $frame = get_enumerated_param($_REQUEST, 'frame', 'master', array('master', 'left', 'right', 'update')); if ($frame == "update") { $newProjectWords = array(); foreach ($_POST as $key => $val) { if (preg_match("/cb_(projectID[0-9a-f]{13})_(\\d+)/", $key, $matches)) { $projectid = $matches[1]; $word = decode_word($val); if (!is_array(@$newProjectWords[$projectid])) { $newProjectWords[$projectid] = array(); } array_push($newProjectWords[$projectid], $word); } } foreach ($newProjectWords as $projectid => $projectWords) { $words = load_project_good_words($projectid); $words = array_merge($words, $projectWords);
<?php $relPath = '../pinc/'; include_once $relPath . 'base.inc'; include_once $relPath . 'dpsql.inc'; include_once $relPath . 'prefs_options.inc'; // PRIVACY_* include_once $relPath . 'theme.inc'; include_once $relPath . 'user_is.inc'; include_once $relPath . 'page_tally.inc'; require_login(); $valid_tally_names = array_keys($page_tally_names); $tally_name = get_enumerated_param($_GET, 'tally_name', null, $valid_tally_names); $title = sprintf(_('Top 100 Proofreaders for Round %s'), $tally_name); output_header($title); echo "<br><h2>{$title}</h2>\n"; echo "<br>\n"; echo "<br>\n"; // the $sql_anonymous = mysql_real_escape_string(_("Anonymous")); if (isset($GLOBALS['pguser'])) { // hide names of users who don't want even logged on people to see their names $proofreader_expr = "IF(u_privacy = " . PRIVACY_ANONYMOUS . ",'{$sql_anonymous}', username)"; } else { // hide names of users who don't want unlogged on people to see their names $proofreader_expr = "IF(u_privacy != " . PRIVACY_PUBLIC . ",'{$sql_anonymous}', username)"; } $subtitle = sprintf(_('Users with the Highest Number of Pages Saved-as-Done in Round %s'), $tally_name); echo "<h3>{$subtitle}</h3>\n"; $users_tallyboard = new TallyBoard($tally_name, 'U'); list($joined_with_user_page_tallies, $user_page_tally_column) = $users_tallyboard->get_sql_joinery_for_current_tallies('users.u_id');
<?php $relPath = "./pinc/"; include_once $relPath . 'base.inc'; include_once $relPath . 'theme.inc'; include_once $relPath . 'project_states.inc'; include_once $relPath . 'list_projects.inc'; include_once $relPath . 'misc.inc'; // undo_all_magic_quotes() undo_all_magic_quotes(); $x = get_enumerated_param($_GET, 'x', 'g', array('g', 's', 'b')); $sort = get_integer_param($_GET, 'sort', 0, 0, 5); $per_page = get_integer_param($_GET, 'per_page', 20, 1, NULL); $offset = get_integer_param($_GET, 'offset', 0, 0, NULL); $boilerplate = _("These e-texts are the product of hundreds of hours of labor donated by all of our volunteers. The list is sorted with the most recently submitted e-texts at the top. You can sort them based upon your own preferences by clicking below. Enjoy!!"); if ($x == "g") { $type = "Gold"; $title = _("Completed Gold E-Texts"); $state = SQL_CONDITION_GOLD; $info = _("Below is the list of Gold e-texts that have been produced on this site. Gold e-texts are books that have passed through all phases of proofreading, formatting, and post-processing. They have been submitted to Project Gutenberg and are now available for your enjoyment and download."); } elseif ($x == "s") { $type = "Silver"; $title = _("In Progress Silver E-Texts"); $state = SQL_CONDITION_SILVER; $info = _("Below is the list of Silver e-texts that have almost completed processing on our site. Silver e-texts are books that have passed through all phases of proofreading and formatting and are now in the post-processing phase. Post-processing is the final assembly stage in which one volunteer performs a series of checks for consistency and correctness before the e-book is submitted to Project Gutenberg for your enjoyment and download."); } elseif ($x == "b") { $type = "Bronze"; $title = _("Now Proofreading Bronze E-Texts"); $state = SQL_CONDITION_BRONZE; $info = _("Below is the list of Bronze e-texts that are currently available for proofreading on this site. Bronze e-texts are what our newest volunteers see and what you can work on now by logging in. These e-texts are in the initial stages of proofreading where everyone has a chance to correct any OCR errors which may be found. After going through a number of other phases, the e-text then goes to an experienced volunteer for final assembly (post-processing), after which the e-text is submitted to Project Gutenberg for your enjoyment and download."); } else {
<?php $relPath = "./../../pinc/"; include_once $relPath . 'base.inc'; include_once $relPath . 'dpsql.inc'; include_once $relPath . 'project_states.inc'; include_once 'common.inc'; $which = get_enumerated_param($_GET, 'which', null, $project_status_descriptors); // Initialize the graph before anything else. // This makes use of the jpgraph cache if enabled. // Argument to init_projects_graph is the cache timeout in minutes. $graph = init_projects_graph(60); // Create "projects Xed per day" graph for current month $psd = get_project_status_descriptor($which); $todaysTimeStamp = time(); $year = date("Y", $todaysTimeStamp); $month = date("m", $todaysTimeStamp); $monthVar = _(date("F", $todaysTimeStamp)); $timeframe = "{$monthVar} {$year}"; $maxday = get_number_of_days_in_current_month(); //query db and put results into arrays $result = mysql_query("\n SELECT day, SUM(num_projects)\n FROM project_state_stats\n WHERE month = '{$month}' AND year = '{$year}' AND ({$psd->state_selector})\n GROUP BY day\n ORDER BY day\n"); list($datax, $y_cumulative) = dpsql_fetch_columns($result); $datay1 = array_successive_differences($y_cumulative); // Pad out the rest of the month for ($i = count($datay1); $i < $maxday; $i++) { $datax[$i] = $i + 1; $datay1[$i] = 0; } draw_projects_graph($graph, $datax, $datay1, 'increments', $psd->color, "{$psd->per_day_title} ({$timeframe})"); // vim: sw=4 ts=4 expandtab
<?php $relPath = "../pinc/"; include_once $relPath . 'base.inc'; include_once $relPath . 'misc.inc'; include_once $relPath . 'project_states.inc'; include_once $relPath . 'theme.inc'; require_login(); $title = _("Books To Be Released"); output_header($title); echo "<br><h2>{$title}</h2>\n"; $order = get_enumerated_param($_GET, 'order', 'default', array('default', 'username', 'modifieddate')); if ($order == 'default') { $order = 'nameofwork'; } //get projects that have been checked out $result = mysql_query("SELECT nameofwork, username, modifieddate, language, genre\n FROM projects\n WHERE state = '" . PROJ_P1_WAITING_FOR_RELEASE . "'\n ORDER BY {$order} ASC"); $numrows = mysql_numrows($result); $rownum = 0; echo "<table border='1' cellspacing='0' cellpadding='0' style='border: 1px solid #111; border-collapse: collapse' width='99%'>\n"; echo "<tr bgcolor='" . $theme['color_headerbar_bg'] . "'>\n"; echo "<td colspan='6'><center><font color='" . $theme['color_headerbar_font'] . "'><b>{$title}</b></font></center></td></tr>\n"; echo "<tr bgcolor='" . $theme['color_navbar_bg'] . "'>\n"; echo "<th>" . _("Index") . "</th>\n <th>" . _("Name of Work") . "</th>\n <th><a href =\"to_be_released.php?order=username\">" . _("Project Manager") . "</a></th>\n <th><a href =\"to_be_released.php?order=modifieddate\">" . _("Date Last Modified") . "</a></th>\n <th>" . _("Language") . "</th>\n <th>" . _("Genre") . "</th>\n </tr>"; $index = 0; while ($rownum < $numrows) { $nameofwork = mysql_result($result, $rownum, "nameofwork"); $username = mysql_result($result, $rownum, "username"); $modifieddate = mysql_result($result, $rownum, "modifieddate"); $language = mysql_result($result, $rownum, "language"); $genre = mysql_result($result, $rownum, "genre");
<?php // Display lists of image sources, or lists of projects that used image sources // List contents vary with user permissions $relPath = '../../pinc/'; include_once $relPath . 'base.inc'; include_once $relPath . 'theme.inc'; include_once $relPath . 'project_states.inc'; include_once $relPath . 'dpsql.inc'; include_once $relPath . 'misc.inc'; // array_get() include_once $relPath . 'pg.inc'; require_login(); $theme_args['css_data'] = "\nh1 { margin-top: 1em; }\ntable.individual { border-collapse: collapse; width: 80%; margin: auto; }\ntable.individual td,th { border: 1px solid #999; padding: 5px; }\ntable.individual td.center { text-align: center; }\ntable.individual th { background-color: #eeeeee; }\n.headerbg { background-color: " . $theme['color_logobar_bg'] . "; }\n\ntable.listing { width: 90%; margin: auto; border: solid black 1px; border-collapse: collapse; }\ntable.listing td,th { padding: 5px; }\ntable.listing th { background-color: #eeeeee; }\ntable.listing th + td { vertical-align: top; border: none; }\ntable.listing th.tl { vertical-align: top; text-align: left; border: none;}\ntable.listing td.center { text-align: center; }\ntr.first { border-top: double black; }\n.fullname { font-size: 120%; }\n.sourcelink { font-size: 90%; margin: 10px 0px 3px 25px; }\n.w15 { width: 15%; }\n"; $which = get_enumerated_param($_GET, 'which', 'DONE', array('ALL', 'DONE', 'INPROG')); $locuserSettings =& Settings::get_Settings($pguser); // --------------------------------------- // Page construction varies with whether the user is logged in or out if (isset($GLOBALS['pguser'])) { $logged_in = TRUE; } else { $logged_in = FALSE; } if ($logged_in) { if (user_is_image_sources_manager()) { $min_vis_level = 0; } else { if (user_is_PM()) { $min_vis_level = 1; } else { $min_vis_level = 2;
<?php $relPath = "./../pinc/"; include_once $relPath . 'base.inc'; include_once $relPath . 'stages.inc'; include_once $relPath . 'SettingsClass.inc'; include_once $relPath . 'special_colors.inc'; include_once $relPath . 'theme.inc'; include_once $relPath . 'site_news.inc'; include_once $relPath . 'showavailablebooks.inc'; require_login(); $pool_id = get_enumerated_param($_GET, 'pool_id', null, array_keys($Pool_for_id_)); $pool = get_Pool_for_id($pool_id); output_header("{$pool->id}: {$pool->name}"); global $pguser; $userSettings =& Settings::get_Settings($pguser); $uao = $pool->user_access($pguser); $pool->page_top($uao); // Show user how to access this round if (!$uao->can_access) { echo "<hr width='75%'>\n"; show_user_access_object($uao); } show_news_for_page($pool->id); echo "<hr width='75%'>\n"; echo "<br>\n"; echo implode("\n", $pool->blather); echo "<br><p>" . _("If there's a project you're interested in, you can get to a page about that project by clicking on the title of the work. (We strongly recommend you right-click and open this project-specific page in a new window or tab.) The page will let you see the project comments and check the project in or out as well as download the associated text and image files.") . "</p>"; // special colours legend // Don't display if the user has selected the // setting "Show Special Colors: No".
$relPath = "./../../pinc/"; include_once $relPath . 'base.inc'; include_once $relPath . 'project_states.inc'; include_once $relPath . 'stages.inc'; include_once $relPath . 'Project.inc'; include_once './post_files.inc'; require_login(); $valid_round_ids = array_keys($Round_for_round_id_); array_unshift($valid_round_ids, '[OCR]'); if (@$_REQUEST['projectid'] == 'many') { $projectid = 'many'; } else { $projectid = validate_projectID('projectid', @$_REQUEST['projectid']); } $round_id = get_enumerated_param($_REQUEST, 'round_id', null, $valid_round_ids); $which_text = get_enumerated_param($_REQUEST, 'which_text', null, array('EQ', 'LE')); $include_proofers = get_integer_param($_REQUEST, 'include_proofers', 0, 0, 1); $save_files = get_integer_param($_REQUEST, 'save_files', 0, 0, 1); // only sitemanagers are allowed to save files if ($save_files && !user_is_a_sitemanager()) { echo _('You are not authorized to invoke this script.'); exit; } // only people who can see names on the page details page // can see names here. $project = new Project($projectid); if ($include_proofers && !$project->names_can_be_seen_by_current_user) { echo _('You are not authorized to invoke this script.'); exit; } // if we are not saving files, then we are just downloading the zip.
} } $from_image_ = array_get($_POST, 'from_image_', NULL); if (is_array($from_image_)) { foreach ($from_image_ as $which => $filename) { if ($filename) { validate_page_image_filename("from_image_[{$which}]", $filename); } } } $action = get_enumerated_param($_POST, 'action', 'showform', array('showform', 'showagain', 'check', 'docopy')); $page_name_handling = get_enumerated_param($_POST, 'page_name_handling', null, array('PRESERVE_PAGE_NAMES', 'RENUMBER_PAGES'), true); $transfer_notifications = get_integer_param($_POST, 'transfer_notifications', 0, 0, 1); $add_deletion_reason = get_integer_param($_POST, 'add_deletion_reason', 0, 0, 1); $merge_wordcheck_files = get_integer_param($_POST, 'merge_wordcheck_files', 0, 0, 1); $repeat_project = get_enumerated_param($_POST, 'repeat_project', null, array('TO', 'FROM', 'NONE'), true); switch ($action) { case 'showform': display_form($projectid_, $from_image_, $page_name_handling, $transfer_notifications, $add_deletion_reason, $merge_wordcheck_files, $repeat_project, FALSE); break; case 'showagain': display_form($projectid_, $from_image_, $page_name_handling, $transfer_notifications, $add_deletion_reason, $merge_wordcheck_files, $repeat_project, TRUE); break; case 'check': do_stuff($projectid_, $from_image_, $page_name_handling, $transfer_notifications, $add_deletion_reason, $merge_wordcheck_files, TRUE); echo "<form method='post' action='" . attr_safe($copy_pages_url) . "'>\n"; display_hiddens($projectid_, $from_image_, $page_name_handling, $transfer_notifications, $add_deletion_reason, $merge_wordcheck_files); echo "\n<input type='hidden' name='action' value='docopy'>"; echo "\n<input type='submit' name='submit_button' value='" . attr_safe(_("Do it")) . "'>"; echo "\n</form>"; echo "<div style='height: 4em;'> </div>";