giumar /
fortunecookies
This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include, or for example
via PHP's auto-loading mechanism.
| 1 | <?php |
||
|
0 ignored issues
–
show
Coding Style
introduced
by
Loading history...
|
|||
| 2 | namespace App\Controller; |
||
|
0 ignored issues
–
show
|
|||
| 3 | |||
| 4 | use App\Controller\AppController; |
||
|
0 ignored issues
–
show
|
|||
| 5 | |||
| 6 | /** |
||
| 7 | * OptionsSystems Controller |
||
| 8 | * |
||
| 9 | * @property \App\Model\Table\OptionsSystemsTable $OptionsSystems |
||
| 10 | * |
||
| 11 | * @method \App\Model\Entity\OptionsSystem[]|\Cake\Datasource\ResultSetInterface paginate($object = null, array $settings = []) |
||
| 12 | */ |
||
|
0 ignored issues
–
show
|
|||
| 13 | class OptionsSystemsController extends AppController |
||
| 14 | { |
||
|
0 ignored issues
–
show
|
|||
| 15 | |||
| 16 | /** |
||
| 17 | * Index method |
||
| 18 | * |
||
| 19 | * @return \Cake\Http\Response|void |
||
|
0 ignored issues
–
show
|
|||
| 20 | */ |
||
| 21 | public function index() |
||
| 22 | { |
||
|
0 ignored issues
–
show
|
|||
| 23 | $optionsSystems = $this->paginate($this->OptionsSystems); |
||
| 24 | |||
| 25 | $this->set(compact('optionsSystems')); |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * View method |
||
| 30 | * |
||
| 31 | * @param string|null $id Options System id. |
||
|
0 ignored issues
–
show
|
|||
| 32 | * @return \Cake\Http\Response|void |
||
|
0 ignored issues
–
show
|
|||
| 33 | * @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found. |
||
|
0 ignored issues
–
show
|
|||
| 34 | */ |
||
| 35 | public function view($id = null) |
||
| 36 | { |
||
|
0 ignored issues
–
show
|
|||
| 37 | $optionsSystem = $this->OptionsSystems->get($id, [ |
||
| 38 | 'contain' => [] |
||
|
0 ignored issues
–
show
|
|||
| 39 | ]); |
||
| 40 | |||
| 41 | $this->set('optionsSystem', $optionsSystem); |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * Add method |
||
| 46 | * |
||
| 47 | * @return \Cake\Http\Response|null Redirects on successful add, renders view otherwise. |
||
| 48 | */ |
||
| 49 | public function add() |
||
| 50 | { |
||
|
0 ignored issues
–
show
|
|||
| 51 | $optionsSystem = $this->OptionsSystems->newEntity(); |
||
| 52 | if ($this->request->is('post')) { |
||
| 53 | $optionsSystem = $this->OptionsSystems->patchEntity($optionsSystem, $this->request->getData()); |
||
| 54 | if ($this->OptionsSystems->save($optionsSystem)) { |
||
| 55 | $this->Flash->success(__('The options system has been saved.')); |
||
| 56 | |||
| 57 | return $this->redirect(['action' => 'index']); |
||
| 58 | } |
||
|
0 ignored issues
–
show
|
|||
| 59 | $this->Flash->error(__('The options system could not be saved. Please, try again.')); |
||
| 60 | } |
||
|
0 ignored issues
–
show
|
|||
| 61 | $this->set(compact('optionsSystem')); |
||
| 62 | } |
||
| 63 | |||
| 64 | /** |
||
| 65 | * Edit method |
||
| 66 | * |
||
| 67 | * @param string|null $id Options System id. |
||
|
0 ignored issues
–
show
|
|||
| 68 | * @return \Cake\Http\Response|null Redirects on successful edit, renders view otherwise. |
||
|
0 ignored issues
–
show
|
|||
| 69 | * @throws \Cake\Network\Exception\NotFoundException When record not found. |
||
|
0 ignored issues
–
show
|
|||
| 70 | */ |
||
| 71 | public function edit($id = null) |
||
| 72 | { |
||
|
0 ignored issues
–
show
|
|||
| 73 | $optionsSystem = $this->OptionsSystems->get($id, [ |
||
| 74 | 'contain' => [] |
||
|
0 ignored issues
–
show
|
|||
| 75 | ]); |
||
| 76 | if ($this->request->is(['patch', 'post', 'put'])) { |
||
| 77 | $optionsSystem = $this->OptionsSystems->patchEntity($optionsSystem, $this->request->getData()); |
||
| 78 | if ($this->OptionsSystems->save($optionsSystem)) { |
||
| 79 | $this->Flash->success(__('The options system has been saved.')); |
||
| 80 | |||
| 81 | return $this->redirect(['action' => 'index']); |
||
| 82 | } |
||
|
0 ignored issues
–
show
|
|||
| 83 | $this->Flash->error(__('The options system could not be saved. Please, try again.')); |
||
| 84 | } |
||
|
0 ignored issues
–
show
|
|||
| 85 | $this->set(compact('optionsSystem')); |
||
| 86 | } |
||
| 87 | |||
| 88 | /** |
||
| 89 | * Delete method |
||
| 90 | * |
||
| 91 | * @param string|null $id Options System id. |
||
|
0 ignored issues
–
show
|
|||
| 92 | * @return \Cake\Http\Response|null Redirects to index. |
||
|
0 ignored issues
–
show
|
|||
| 93 | * @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found. |
||
|
0 ignored issues
–
show
|
|||
| 94 | */ |
||
| 95 | public function delete($id = null) |
||
| 96 | { |
||
|
0 ignored issues
–
show
|
|||
| 97 | $this->request->allowMethod(['post', 'delete']); |
||
| 98 | $optionsSystem = $this->OptionsSystems->get($id); |
||
| 99 | if ($this->OptionsSystems->delete($optionsSystem)) { |
||
| 100 | $this->Flash->success(__('The options system has been deleted.')); |
||
| 101 | } else { |
||
|
0 ignored issues
–
show
|
|||
| 102 | $this->Flash->error(__('The options system could not be deleted. Please, try again.')); |
||
| 103 | } |
||
| 104 | |||
| 105 | return $this->redirect(['action' => 'index']); |
||
| 106 | } |
||
|
0 ignored issues
–
show
|
|||
| 107 | } |
||
| 108 |