-
{$reportTitle}
";
-}
-
-
-function bodyOfReport($postedData)
-{
- $keys = orderedKeys($postedData);
- $titles = humanReadableTitles();
-
- // build the navigation bar that will be placed between each section of the report
- $navigationBarArray = array();
- foreach ($keys as $key) {
- $title = $titles[$key];
- if (empty($title))
- $title = $key;
- $title = htmlspecialchars($title);
- $navigationBarArray[] = "
{$title}";
- }
- $navigationBar = "
".implode(' | ', $navigationBarArray)."
";
-
- // build up each section to create the body of the report
- $body = '';
- foreach ($keys as $key) {
- $title = $titles[$key];
- if (empty($title))
- $title = $key;
- $title = htmlspecialchars($title);
- $content = htmlspecialchars($postedData[$key]);
- $body .= "\n
\n
{$title}:
\n
\n{$content}
\n
\n
\n{$navigationBar}\n";
- }
-
- return $body;
-}
-
-
-function endOfReport()
-{
- return "
\n\n";
-}
-
-
-// an ounce of prevention...
-function cleanerString($input)
-{
- if (empty($input))
- return '';
-
- $badStuph = array('to:', 'cc:', 'bcc:', 'from:', 'return-path:', 'content-type:', 'mime-version:', 'multipart-mixed:', 'content-transfer-encoding:');
-
- // if any bad things are found don't use the input at all (as there may be other unknown bad things)
- foreach ($badStuph as $badThing)
- if (stripos($input, $badThing) !== false)
- return 'Found bad things';
-
- // these aren't technically bad things by themselves, but clean them up for good measure
- $input = str_replace(array("\r", "\n", "%0a", "%0d"), ' ', $input);
- return trim($input);
-}
-
-
-function createTitle($appName, $type, $fromAddress)
-{
- $type = $type;
- $title = 'Crash Report';
-
- if ($type == 'feedback') {
- $title = 'Feedback Report';
- } elseif ($type == 'exception') {
- $title = 'Exception Report';
- }
-
- $fromAddress = cleanerString($fromAddress);
- if (empty($fromAddress)) {
- $fromAddress = 'Anonymous';
- }
-
- $title .= " from {$fromAddress} for {$appName}";
-
- return $title;
-}
-
-
-// Don't put user submitted email addresses in the From or Return-Path headers,
-// if your mail server is down it will bounce back to that address.
-// A malicious person could send spam that way.
-// Better to use an account at a seperate email provider so you won't miss a report.
-function sendReport($subject, $message)
-{
- $to = 'your.main.report.address@your.domain';
- $from = 'backup.address@some.other.domain';
- $headers = "From: {$from}\r\n";
- $headers .= "Return-Path: {$from}\r\n";
- $headers .= "MIME-Version: 1.0\r\n";
- $headers .= "Content-Type: text/html; charset=\"utf-8\"\r\n";
-
- if (empty($message))
- $message = 'There is no message';
-
- $subject = cleanerString($subject);
- if (empty($subject))
- $subject = 'There is no subject';
-
- return mail($to, $subject, $message, $headers);
-}
-
-
-
-// START
-
-// I'm ignoring the $_GET data, instead I post a custom key called 'application' from the app
-if (($_SERVER['REQUEST_METHOD'] == 'POST') && isSupportedAgent($_SERVER['HTTP_USER_AGENT']) && isSupportedApp($_POST['application'])) {
- $title = createTitle($_POST['application'], $_POST['type'], $_POST['email']);
- $report = beginningOfReportWithTitle($title).bodyOfReport($_POST).endOfReport();
- if (!(sendReport($title, $report))) {
- // don't send detailed error reports on the production server
- // echo 'error with sendReport';
- sendReport('Failed sending crash report', 'sendReport() failed');
- }
- // this is to cause the app to not close the feedback report window (good for testing, make sure to comment this out when copying to the production server)
- // echo 'Testing';
-} else {
- // not a proper feedback request
- // always send a message of some sort so you can see what a bot is up to
- if (count($_REQUEST)) {
- foreach($_REQUEST as $key=>$value)
- $keyValues[] = "{$key} = {$value}";
- $message = implode(' | ', $keyValues);
- sendReport('Failed crash report attempt', cleanerString($message));
- } else {
- sendReport('Failed crash report attempt', 'Someone just visiting or a bot fishing');
- }
-
- // send them somewhere usefull
- header('Location: http://your.domain');
-}
-
-?>
\ No newline at end of file
diff --git a/OdessaMacGUIApp/tcurdt-feedbackreporter/Server/php/mantis/README.txt b/OdessaMacGUIApp/tcurdt-feedbackreporter/Server/php/mantis/README.txt
deleted file mode 100644
index 4ef3769..0000000
--- a/OdessaMacGUIApp/tcurdt-feedbackreporter/Server/php/mantis/README.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-Hi,
-
-this is a simple script that enable you to integrate FeedbackReporter and Mantis.
-
-You'll need to change a couple of values in config.php
-
-If you need to contact me, you can do it via my website:
-
- http://tellini.info/
-
-Other useful links...
-
-FeedbackReporter Framework:
-
- http://github.com/tcurdt/feedbackreporter
-
-Mantis:
-
- http://www.mantisbt.org/
-
-Have fun,
- Simone
\ No newline at end of file
diff --git a/OdessaMacGUIApp/tcurdt-feedbackreporter/Server/php/mantis/config.php b/OdessaMacGUIApp/tcurdt-feedbackreporter/Server/php/mantis/config.php
deleted file mode 100644
index 3267dc3..0000000
--- a/OdessaMacGUIApp/tcurdt-feedbackreporter/Server/php/mantis/config.php
+++ /dev/null
@@ -1,19 +0,0 @@
-
\ No newline at end of file
diff --git a/OdessaMacGUIApp/tcurdt-feedbackreporter/Server/php/mantis/mantis.php b/OdessaMacGUIApp/tcurdt-feedbackreporter/Server/php/mantis/mantis.php
deleted file mode 100644
index 609ea26..0000000
--- a/OdessaMacGUIApp/tcurdt-feedbackreporter/Server/php/mantis/mantis.php
+++ /dev/null
@@ -1,158 +0,0 @@
-userID = auth_get_current_user_id();
-
- } else
- $this->client = new SoapClient( MANTIS_WSDL );
- }
-
- public function getProject( $proj )
- {
- if( MANTIS_LOCAL ) {
-
- $ret = new StdClass;
- $ret->id = project_get_id_by_name( $proj );
-
- } else {
-
- $projects = $this->client->mc_projects_get_user_accessible( MANTIS_USER, MANTIS_PWD );
-
- foreach( $projects as $p )
- if( $p->name == $proj )
- $ret = $p;
- }
-
- return( $ret );
- }
-
- public function hasVersion( $projID, $version )
- {
- if( MANTIS_LOCAL )
- $ret = version_get_id( $version, $projID ) !== false;
- else {
-
- $vers = $this->client->mc_project_get_versions( MANTIS_USER, MANTIS_PWD, $projID );
- $ret = false;
-
- foreach( $vers as $v )
- if( $v->name == $version ) {
- $ret = true;
- break;
- }
- }
-
- return( $ret );
- }
-
- public function addVersion( $projID, $version )
- {
- if( MANTIS_LOCAL ) {
-
- if( version_add( $projID, $version, true, $version )) {
-
- $t_version_id = version_get_id( $version, $projID );
-
- if ( !is_blank( $v_date_order )) {
-
- $t_version = version_get( $t_version_id );
- $t_version->date_order = date( "Y-m-d H:i:s", strtotime( $v_date_order ));
-
- version_update( $t_version );
- }
- }
-
- } else {
-
- $this->client->mc_project_version_add( MANTIS_USER, MANTIS_PWD,
- array(
- 'name' => $version,
- 'project_id' => $projID,
- 'description' => $version,
- 'released' => true
- ));
- }
- }
-
- public function addIssue( $issue )
- {
- if( MANTIS_LOCAL ) {
-
- $t_bug_data = new BugData;
- $t_bug_data->project_id = $issue->project->id;
- $t_bug_data->reporter_id = $this->userID;
- $t_bug_data->priority = $issue->priority[ 'id' ];
- $t_bug_data->severity = $issue->severity[ 'id' ];
- $t_bug_data->reproducibility = $issue->reproducibility[ 'id' ];
- $t_bug_data->status = $issue->status[ 'id' ];
- $t_bug_data->resolution = $issue->resolution[ 'id' ];
- $t_bug_data->projection = $issue->projection[ 'id' ];
- $t_bug_data->category = $issue->category;
- $t_bug_data->eta = $issue->eta[ 'id' ];
- $t_bug_data->version = $issue->version;
- $t_bug_data->view_state = $issue->view_state[ 'id' ];
- $t_bug_data->summary = $issue->summary;
-
- # extended info
- $t_bug_data->description = $issue->description;
- $t_bug_data->additional_information = $issue->additional_information;
-
- # submit the issue
- $ret = bug_create( $t_bug_data );
-
- email_new_bug( $ret );
-
- } else
- $ret = $this->client->mc_issue_add( MANTIS_USER, MANTIS_PWD, $issue );
-
- return( $ret );
- }
-
- public function addAttachment( $bugID, $name, $str )
- {
- if( MANTIS_LOCAL ) {
-
- $tmpFile = tempnam( sys_get_temp_dir(), 'feedback' );
-
- file_put_contents( $tmpFile, $str );
-
- file_add( $bugID, $tmpFile, $name, 'text/plain' );
-
- unlink( $tmpFile );
-
- } else
- /*$this->client->mc_issue_attachment_add( MANTIS_USER, MANTIS_PWD, $bugID,
- $name, 'text/plain', $str ); */
- $this->client->mc_issue_attachment_add( MANTIS_USER, MANTIS_PWD, $bugID,
- $name, 'text/plain', base64_encode($str) );
-
- }
-}
-?>
\ No newline at end of file
diff --git a/OdessaMacGUIApp/tcurdt-feedbackreporter/Server/php/mantis/submit.php b/OdessaMacGUIApp/tcurdt-feedbackreporter/Server/php/mantis/submit.php
deleted file mode 100644
index 18122e6..0000000
--- a/OdessaMacGUIApp/tcurdt-feedbackreporter/Server/php/mantis/submit.php
+++ /dev/null
@@ -1,64 +0,0 @@
-summary = BUG_SUMMARY;
- $issue->severity = array( 'id' => 70 );
- $issue->category = BUG_CATEGORY;
- $issue->description = 'From: ' . $_POST[ 'email' ] . "\n\n" . $_POST[ 'comment' ];
- $issue->additional_information = $crashlog[ 0 ];
- $issue->priority = array( 'id' => 10 );
- $issue->status = array( 'id' => 10 );
- $issue->reproducibility = array( 'id' => 70 );
- $issue->resolution = array( 'id' => 10 );
- $issue->projection = array( 'id' => 10 );
- $issue->eta = array( 'id' => 10 );
- $issue->view_state = array( 'id' => 50 );
- $issue->version = $_POST[ 'version' ];
-
- if( empty( $issue->description ))
- $issue->description = 'Crashed.';
-
- $attachments = array( 'crashes', 'console', 'preferences', 'exception', 'shell', 'system' );
-
- try {
- $mantis = new Mantis();
-
- $issue->project = $mantis->getProject( $_REQUEST[ 'project' ] );
-
- if( !$mantis->hasVersion( $issue->project->id, $issue->version ))
- $mantis->addVersion( $issue->project->id, $issue->version );
-
- $id = $mantis->addIssue( $issue );
-
- foreach( $attachments as $f ) {
-
- $str = $_POST[ $f ];
-
- if( !empty( $str ))
- $mantis->addAttachment( $id, $f . '.txt', $str );
- }
- }
- catch( SoapFault $e ) {
- print( 'ERR An error occurred while storing the report' );
- }
-?>
\ No newline at end of file
diff --git a/OdessaMacGUIApp/tcurdt-feedbackreporter/Server/php/store-and-email/config.php b/OdessaMacGUIApp/tcurdt-feedbackreporter/Server/php/store-and-email/config.php
deleted file mode 100644
index 0ebd295..0000000
--- a/OdessaMacGUIApp/tcurdt-feedbackreporter/Server/php/store-and-email/config.php
+++ /dev/null
@@ -1,28 +0,0 @@
-
diff --git a/OdessaMacGUIApp/tcurdt-feedbackreporter/Server/php/store-and-email/errorlog.php b/OdessaMacGUIApp/tcurdt-feedbackreporter/Server/php/store-and-email/errorlog.php
deleted file mode 100644
index 87f80da..0000000
--- a/OdessaMacGUIApp/tcurdt-feedbackreporter/Server/php/store-and-email/errorlog.php
+++ /dev/null
@@ -1,13 +0,0 @@
- $type: $info FILE: $file - Row $row\r\n" );
- @fclose($handle);
- }
-}
-
-set_error_handler("errorlog");
-?>
\ No newline at end of file
diff --git a/OdessaMacGUIApp/tcurdt-feedbackreporter/Server/php/store-and-email/feedback.sh b/OdessaMacGUIApp/tcurdt-feedbackreporter/Server/php/store-and-email/feedback.sh
deleted file mode 100644
index 5ff462f..0000000
--- a/OdessaMacGUIApp/tcurdt-feedbackreporter/Server/php/store-and-email/feedback.sh
+++ /dev/null
@@ -1,108 +0,0 @@
-#!/bin/bash
-# email handling based on http://grimthing.com/archives/2004/09/18/bash-email-script-with-attachment/
-# requires the sharutils (uuencode) to be installed
-
-DIR=/home/tcurdt/feedback
-EMAIL_FROM=noreply@vafer.org
-EMAIL_TO=tcurdt@vafer.org
-EMAIL_SUBJECT="[FeedbackReporter] TYPE for PROJECT"
-SHOW_URL=http://vafer.org/feedback/show.php
-
-# do not touch below
-
-function email
-{
- from="$1"
- to="$2"
- replyto="$3"
- subject="$4"
- content="$5"
- attachment="$6"
-
- msgdate=`date +"%a, %e %Y %T %z"`
- boundary=GvXjxJ+pjyke8COw
- archdate=`date +%F`
- attachmentbase=`basename "$attachment"`
- archattachment="${archdate}-${attachmentbase}"
- mimetype=`file -i $attachment | awk '{ print $2 }'`
-
- daemail=$(cat </dev/null
- cd - 1>/dev/null
-
- PROJECT=`dirname $S`
- PROJECT=`basename $PROJECT`
-
- SIZE=`ls -la $ARCHIVE | awk '{ print $5 }'`
-
- TYPE=`cat $S/type 2>/dev/null`
-
- SUBJECT=$EMAIL_SUBJECT
- SUBJECT=`echo "$SUBJECT" | sed s/PROJECT/$PROJECT/`
- SUBJECT=`echo "$SUBJECT" | sed s/SIZE/$SIZE/`
- SUBJECT=`echo "$SUBJECT" | sed s/TYPE/$TYPE/`
-
- REPLYTO=`cat $S/email`
-
- CONTENT="Feedback at ${SHOW_URL}?project=${PROJECT}&submission=${SUBMISSION}"
-
- (
- email "$EMAIL_FROM" "$EMAIL_TO" "$REPLYTO" "$SUBJECT" "$CONTENT" "$ARCHIVE"
- ) | sendmail -t
-
- rm $ARCHIVE
-
-done
-
-touch $TIMESTAMP
diff --git a/OdessaMacGUIApp/tcurdt-feedbackreporter/Server/php/store-and-email/show.php b/OdessaMacGUIApp/tcurdt-feedbackreporter/Server/php/store-and-email/show.php
deleted file mode 100644
index e2b4ae6..0000000
--- a/OdessaMacGUIApp/tcurdt-feedbackreporter/Server/php/store-and-email/show.php
+++ /dev/null
@@ -1,98 +0,0 @@
-HTTP 404 - Not Found