|
@@ 45-57 (lines=13) @@
|
| 42 |
|
$this->form_validation->set_rules('manga[title]', 'Manga [Title]', 'required'); |
| 43 |
|
$this->form_validation->set_rules('manga[chapter]', 'Manga [Chapter]', 'required'); |
| 44 |
|
|
| 45 |
|
if($this->form_validation->run() === TRUE) { |
| 46 |
|
$manga = $this->input->post('manga'); |
| 47 |
|
|
| 48 |
|
$success = $this->Tracker->updateTracker($this->userID, $manga['site'], $manga['title'], $manga['chapter']); |
| 49 |
|
if($success) { |
| 50 |
|
$this->output->set_status_header('200'); //Success! |
| 51 |
|
} else { |
| 52 |
|
//TODO: We should probably try and have more verbose errors here. Return via JSON or something. |
| 53 |
|
$this->output->set_status_header('400', 'Unable to update?'); |
| 54 |
|
} |
| 55 |
|
} else { |
| 56 |
|
$this->output->set_status_header('400', 'Missing/invalid parameters.'); |
| 57 |
|
} |
| 58 |
|
} |
| 59 |
|
} |
| 60 |
|
|
|
@@ 74-86 (lines=13) @@
|
| 71 |
|
$this->form_validation->set_rules('bug[url]', 'Bug [URL]', 'required'); |
| 72 |
|
$this->form_validation->set_rules('bug[text]', 'Bug [Text]', 'required'); |
| 73 |
|
|
| 74 |
|
if($this->form_validation->run() === TRUE) { |
| 75 |
|
$bug = $this->input->post('bug'); |
| 76 |
|
|
| 77 |
|
//Preferably, I'd like to validate this in some way, but it's a bit too easy to bypass |
| 78 |
|
$success = $this->Tracker->reportBug($bug['text'], NULL, $bug['url']); |
| 79 |
|
if($success) { |
| 80 |
|
$this->output->set_status_header('200'); //Success! |
| 81 |
|
} else { |
| 82 |
|
$this->output->set_status_header('400', 'Unable to report bug?'); |
| 83 |
|
} |
| 84 |
|
} else { |
| 85 |
|
$this->output->set_status_header('400', 'Missing/invalid parameters.'); |
| 86 |
|
} |
| 87 |
|
} |
| 88 |
|
|
| 89 |
|
/** |