Created
July 27, 2016 09:54
-
-
Save azhurb/ea3af7f6f3d81ec85beafd9909eaaaf6 to your computer and use it in GitHub Desktop.
fix_tos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Index: admin/resources/views/ApplicationCatalog_tos.twig | |
| IDEA additional info: | |
| Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | |
| <+>UTF-8 | |
| =================================================================== | |
| --- admin/resources/views/ApplicationCatalog_tos.twig (revision df0e87a5249add9b1e78f66d4b628e767cbfd02e) | |
| +++ admin/resources/views/ApplicationCatalog_tos.twig (revision d72588c6b810a10eda156008adda91e6a828ff48) | |
| @@ -14,7 +14,7 @@ | |
| </div> | |
| <div class="col-xs-12 col-sm-12"> | |
| <form class="form-horizontal" role="form" method="POST" action="{{app.workHost}}server/adm/{{app.controller_alias}}/accept-tos"> | |
| - <input type="hidden" name="tos_id" value="{% if attribute(app, 'tos_id') is defined %}{{ app.tos_id }}{% endif %}"> | |
| + <input type="hidden" name="tos_alias" value="{% if attribute(app, 'tos_alias') is defined %}{{ app.tos_alias }}{% endif %}"> | |
| <div class="box"> | |
| <div class="box-content"> | |
| <div class="form-group"> | |
| \ No newline at end of file | |
| Index: admin/src/Controller/ApplicationCatalogController.php | |
| IDEA additional info: | |
| Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | |
| <+>UTF-8 | |
| =================================================================== | |
| --- admin/src/Controller/ApplicationCatalogController.php (revision df0e87a5249add9b1e78f66d4b628e767cbfd02e) | |
| +++ admin/src/Controller/ApplicationCatalogController.php (revision d72588c6b810a10eda156008adda91e6a828ff48) | |
| @@ -35,12 +35,12 @@ | |
| return $no_auth; | |
| } | |
| - $tos = $this->db->getTOS(1); | |
| + $tos = $this->db->getTOS('stalker_apps'); | |
| if (empty($tos)) { | |
| return $this->app['twig']->render('ApplicationCatalog_index.twig'); | |
| } elseif (empty($tos[0]['accepted'])) { | |
| $this->app['tos'] = $tos[0]; | |
| - $this->app['tos_id'] = 1; | |
| + $this->app['tos_alias'] = 'stalker_apps'; | |
| return $this->app['twig']->render('ApplicationCatalog_tos.twig'); | |
| } | |
| @@ -57,12 +57,12 @@ | |
| return $no_auth; | |
| } | |
| - $tos = $this->db->getTOS(2); | |
| + $tos = $this->db->getTOS('launcher_apps'); | |
| if (empty($tos)) { | |
| return $this->app['twig']->render('ApplicationCatalog_index.twig'); | |
| } elseif (empty($tos[0]['accepted'])) { | |
| $this->app['tos'] = $tos[0]; | |
| - $this->app['tos_id'] = 2; | |
| + $this->app['tos_alias'] = 'launcher_apps'; | |
| return $this->app['twig']->render('ApplicationCatalog_tos.twig'); | |
| } | |
| @@ -107,12 +107,12 @@ | |
| return $no_auth; | |
| } | |
| - if ($this->app['userlogin'] === 'admin' && !empty($this->postData['accepted']) && !empty($this->postData['tos_id'])){ | |
| - $this->db->setAcceptedTOS((int)$this->postData['tos_id']); | |
| + if ($this->app['userlogin'] === 'admin' && !empty($this->postData['accepted']) && !empty($this->postData['tos_alias'])){ | |
| + $this->db->setAcceptedTOS($this->postData['tos_alias']); | |
| } | |
| - if (!empty($this->postData['tos_id'])) { | |
| - $redirect_path = "/application-catalog" . (((int)$this->postData['tos_id']) == 2 ? '/smart-application-list': '/application-list'); | |
| + if (!empty($this->postData['tos_alias'])) { | |
| + $redirect_path = "/application-catalog" . (($this->postData['tos_alias']) == 'launcher_apps' ? '/smart-application-list': '/application-list'); | |
| } else { | |
| $redirect_path = "/"; | |
| } | |
| Index: admin/src/Model/ApplicationCatalogModel.php | |
| IDEA additional info: | |
| Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | |
| <+>UTF-8 | |
| =================================================================== | |
| --- admin/src/Model/ApplicationCatalogModel.php (revision df0e87a5249add9b1e78f66d4b628e767cbfd02e) | |
| +++ admin/src/Model/ApplicationCatalogModel.php (revision d72588c6b810a10eda156008adda91e6a828ff48) | |
| @@ -8,12 +8,12 @@ | |
| parent::__construct(); | |
| } | |
| - public function getTOS($id){ | |
| - return $this->mysqlInstance->from('apps_tos')->where(array('id' => $id))->get()->all(); | |
| + public function getTOS($alias){ | |
| + return $this->mysqlInstance->from('apps_tos')->where(array('alias' => $alias))->get()->all(); | |
| } | |
| - public function setAcceptedTOS($id){ | |
| - return $this->mysqlInstance->update('apps_tos', array('accepted'=>1), array('id' => $id)); | |
| + public function setAcceptedTOS($alias){ | |
| + return $this->mysqlInstance->update('apps_tos', array('accepted'=>1), array('alias' => $alias)); | |
| } | |
| public function getApplication($where){ | |
| \ No newline at end of file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment