function file_ftp_get($p_conn_id, $p_local_filename, $p_remote_filename) { helper_begin_long_process(); $download = ftp_get($p_conn_id, $p_local_filename, $p_remote_filename, FTP_BINARY); }
require_api('category_api.php'); require_api('config_api.php'); require_api('constant_inc.php'); require_api('custom_field_api.php'); require_api('event_api.php'); require_api('form_api.php'); require_api('gpc_api.php'); require_api('helper_api.php'); require_api('html_api.php'); require_api('lang_api.php'); require_api('print_api.php'); require_api('string_api.php'); require_api('utility_api.php'); require_api('version_api.php'); auth_ensure_user_authenticated(); helper_begin_long_process(); $f_action = gpc_get_string('action'); $f_custom_field_id = gpc_get_int('custom_field_id', 0); $f_bug_arr = gpc_get_int_array('bug_arr', array()); $f_bug_notetext = gpc_get_string('bugnote_text', ''); $f_bug_noteprivate = gpc_get_bool('private'); $t_form_name = 'bug_actiongroup_' . $f_action; form_security_validate($t_form_name); $t_custom_group_actions = config_get('custom_group_actions'); foreach ($t_custom_group_actions as $t_custom_group_action) { if ($f_action == $t_custom_group_action['action']) { require_once $t_custom_group_action['action_page']; exit; } } $t_failed_ids = array();
function run($p_execute, $p_limit, $p_advanced) { if (!php_version_at_least('4.1.0')) { global $_SERVER; } if ($p_execute) { # Mark this as a long process and ignore user aborts helper_begin_long_process(true); # Disable compression so we can stream compress_disable(); # Flush the output buffer @ob_end_flush(); echo '<b>Please be patient, this may take a while...</b>'; } # Form echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; # Execute All Button echo "<input type=\"submit\" name=\"{$this->upgrade_file}_execute_all\" value=\"Execute All\" />"; # Print All Button echo "<input type=\"submit\" name=\"{$this->upgrade_file}_print_all\" value=\"Print All\" /><br /><br />"; if ($p_advanced) { # Execute Selected Button echo "<input type=\"submit\" name=\"{$this->upgrade_file}_execute_selected\" value=\"Execute Selected\" />"; # Print Selected Button echo "<input type=\"submit\" name=\"{$this->upgrade_file}_print_selected\" value=\"Print Selected\" />"; } # Table echo '<table width="80%" bgcolor="#222222" border="0" cellpadding="10" cellspacing="1">'; echo "<tr><td bgcolor=\"#e8e8e8\" colspan=\"3\"><span class=\"title\">{$this->upgrade_name}</span></td></tr>"; # Headings echo '<tr bgcolor="#ffffff"><th width="70%">Description</th><th nowrap="nowrap">Upgrade ID</th><th width="30%">Status</th></tr>'; $t_error = false; foreach ($this->item_array as $item) { $t_state = ''; if ($item->is_applied()) { if (!$p_advanced) { continue; #next one } $t_state = 'disabled="disabled"'; $t_color = '#00ff88'; $t_message = 'Previously Applied'; } else { if (null !== $p_limit && is_array($p_limit) && !in_array($item->id, $p_limit)) { $t_color = '#ffff88'; $t_message = 'Skipped'; } else { if ($p_execute) { if ($t_error) { $t_state = 'checked="checked"'; $t_color = '#ff0088'; $t_message = 'Skipped due to previous error'; continue; # next one } if ($item->execute()) { $t_state = 'disabled="disabled"'; $t_color = '#00ff88'; $t_message = 'Applied'; } else { $t_state = 'checked="checked"'; $t_color = '#ff0088'; $t_message = 'ERROR: ' . $item->error; $t_error = true; } } else { # not applied but not executing $t_color = '#ff0088'; $t_message = 'Not Applied'; $t_state = 'checked="checked"'; } } } echo '<tr bgcolor="#ffffff"><td>'; echo $item->description; # description echo '</td>'; echo '<td nowrap="nowrap">'; if ($p_advanced) { echo "<input type=\"checkbox\" name=\"{$this->upgrade_file}_execute_list[]\" value=\"{$item->id}\" {$t_state} /> "; } echo "{$item->id}</td>"; echo "<td bgcolor=\"{$t_color}\">{$t_message}</td>"; echo '</tr>'; } echo '</table>'; # Execute All Button echo "<br /><input type=\"submit\" name=\"{$this->upgrade_file}_execute_all\" value=\"Execute All\" />"; # Print All Button echo "<input type=\"submit\" name=\"{$this->upgrade_file}_print_all\" value=\"Print All\" />"; if ($p_advanced) { # Execute Selected Button echo "<input type=\"submit\" name=\"{$this->upgrade_file}_execute_selected\" value=\"Execute Selected\" />"; # Print Selected Button echo "<input type=\"submit\" name=\"{$this->upgrade_file}_print_selected\" value=\"Print Selected\" />"; } }