ushahidi / Ushahidi_Web

Ushahidi v2. A platform that allows information collection, visualization and interactive mapping, allowing anyone to submit information through text messaging using a mobile phone, email or web form.
http://www.ushahidi.com
Other
899 stars 624 forks source link

incident.user_id field not populated on csv import #1094

Open lbell opened 11 years ago

lbell commented 11 years ago

Importing CSV reports fills the user_id as '0' in incident table. Shouldn't this be populated with the user who uploaded the reports?

Scenario: reporter/user is out in the field, marking GPS points of events. Can then dump those points to GPS, fill out the specifics, and upload at once.

lbell commented 11 years ago

Fix:

Line 234 of Application/Libraries/CSVImporter.php

From: $incident->user_id = 0; To: $incident->user_id = isset($_SESSION['auth_user']->id) ? $_SESSION['auth_user']->id : 0;

(Better would be a check to see if the CSV includes user email's that exist in the USER table, and sets the ID against those accordingly... but this gets part way: logged in user uploads their own reports only... I'll work on the other later.)