} else { if (removejob($v)) { $results['messages'] .= "Removed job {$v}.\n"; } else { $results['messages'] .= "Error removing job {$v}: " . $GLOBALS['lasterror'] . "\n"; } } $anydone = true; } } break; case 'reattach': if (sizeof($jobs) != 1) { $results["error"] = "Reattach must only be performed with exactly one job selected and you selected " . sizeof($jobs); } else { if (!getmenumodule($jobs[0])) { $results["error"] = "Reattach could not find job {$v} information.\n"; } else { error_log($GLOBALS["getmenumodule"], 3, "/tmp/mylog"); $results["_switch"] = $GLOBALS["getmenumodule"] . "/" . $GLOBALS["getmenumoduleproject"] . "/" . $jobs[0]; $results["-close"] = true; } } $anydone = true; break; default: $results["error"] = "PHP received an unsupported ACTION " . $_REQUEST['action']; $anydone = true; break; } if (!$anydone) {
} if (!isset($_REQUEST["_logon"])) { unset($_SESSION[$window]['logon']); $results['_logon'] = ""; } if (!isset($_REQUEST['_uuid'])) { $results["error"] = "No _uuid specified in the request"; $results['_status'] = 'failed'; echo json_encode($results); exit; } $getinput = isset($_REQUEST['_getinput']) && $_REQUEST['_getinput'] == "true"; $GLOBALS['logon'] = isset($_SESSION[$window]['logon']) ? $_SESSION[$window]['logon'] : 'not logged in'; require_once "joblog.php"; $id = $_REQUEST['_uuid']; if (!getmenumodule($id)) { $results['error'] = "Could not find job id {$id}"; $results['_status'] = 'failed'; echo json_encode($results); exit; } $results['_fs_refresh'] = $GLOBALS["getmenumoduleproject"]; $dir = $GLOBALS['getmenumoduledir']; $logdir = $GLOBALS['getmenumodulelogdir']; // if ( isprojectlocked( $dir ) ) // { // $results[ '_status' ] = 'running'; // // echo (json_encode($results)); // exit(); // }
require_once "../mail.php"; date_default_timezone_set('UTC'); $json = json_decode(file_get_contents("/home/abhishek/Desktop/GenApp/abhishektest/appconfig.json")); $GLOBALS['REMOTE_ADDR'] = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : "not from an ip"; // $subject = gethostname() . "/abhishektest " . $_REQUEST[ 'level' ] . " feedback from " . $results[ '_logon' ] . "@" . $GLOBALS[ 'REMOTE_ADDR' ] . ( isset( $results[ '_project' ] ) ? " project " . $results[ '_project' ] : "" ); $subject = "[" . gethostname() . "/abhishektest-feedback][" . $_REQUEST['level'] . "] '" . $_REQUEST['subject'] . "' " . $_REQUEST['email']; $add = "\n" . "subject : " . $_REQUEST['subject'] . "\n" . "from : " . $results['_logon'] . "\n" . "email : " . $_REQUEST['email'] . "\n" . "level : " . $_REQUEST['level'] . "\n------------------------\n" . $_REQUEST['text1']; $data = "project : " . (isset($results['_project']) ? $results['_project'] : "no_project_specified") . "\n" . "remote ip : " . $GLOBALS['REMOTE_ADDR'] . "\n" . "browser : " . $_REQUEST['_navigator'] . "\n------------------------\n" . $_REQUEST['_eventlog'] . "\n"; $ats = array("json input" => "_args", "command" => "_cmds_", "output" => "_stdout_", "error output" => "_stderr_"); $attach = array(); $attachinfo = ""; $attachdata = array(); if (isset($_REQUEST['job1_altval']) && count($_REQUEST['job1_altval'])) { require_once "../joblog.php"; foreach ($_REQUEST['job1_altval'] as $v) { if (getmenumodule($v)) { $attachinfo .= "related job {$v}\n" . " module : " . $GLOBALS["getmenumodule"] . "\n" . " project: " . $GLOBALS["getmenumoduleproject"] . "\n" . " status : " . $GLOBALS["getmenumodulestatus"] . "\n"; // attach log files $logdir = $GLOBALS["getmenumodulelogdir"]; foreach ($ats as $k1 => $v1) { $f = "{$logdir}/{$v1}{$v}"; if (file_exists($f)) { $attachinfo .= " attach : {$k1} as {$v1}{$v}\n"; $attach[] = $f; } } } else { $attachinfo .= "Related job {$v} information not found in database\n"; } $attachinfo .= "------------------------\n"; }