27
27
class ManageController extends AbstractActionController
28
28
{
29
29
30
- public function onDispatch (\Zend \Mvc \MvcEvent $ e )
30
+ public function onDispatch (\Zend \Mvc \MvcEvent $ e )
31
31
{
32
32
$ routeMatch = $ e ->getRouteMatch ();
33
33
$ action = $ this ->params ()->fromQuery ('action ' );
@@ -100,10 +100,16 @@ public function indexAction()
100
100
101
101
public function detailAction (){
102
102
103
+ $ nav = $ this ->getServiceLocator ()->get ('main_navigation ' );
104
+ $ page = $ nav ->findByRoute ('lang/applications ' );
105
+ $ page ->setActive ();
106
+
103
107
$ application = $ this ->getServiceLocator ()
104
108
->get ('repositories ' )
105
109
->get ('application ' )->find ($ this ->params ('id ' ), 'EAGER ' );
106
110
111
+ $ this ->acl ($ application , 'read ' );
112
+
107
113
$ jsonFormat = 'json ' == $ this ->params ()->fromQuery ('format ' );
108
114
if ($ jsonFormat ) {
109
115
$ viewModel = new JsonModel ();
@@ -116,41 +122,11 @@ public function detailAction(){
116
122
return $ viewModel ;
117
123
}
118
124
119
- $ nav = $ this ->getServiceLocator ()->get ('main_navigation ' );
120
- $ page = $ nav ->findByRoute ('lang/applications ' );
121
- $ page ->setActive ();
125
+
122
126
123
127
return array ('application ' => $ application );
124
128
}
125
129
126
- public function restAction () {
127
- $ method = $ this ->params ('method ' );
128
- $ value = $ this ->params ()->fromPost ('value ' ,'' );
129
- $ key = $ this ->params ('key ' );
130
- $ user = $ this ->auth ()->getUser ();
131
- $ result = array ();
132
- if (strcasecmp ($ key , 'mailtext ' ) == 0 ) {
133
- $ settingsJobAuth = $ this ->settings ('auth ' , $ user );
134
- if (strcasecmp ($ method , 'get ' ) == 0 ) {
135
- $ mailtext = $ settingsJobAuth ->getMailText ();
136
- $ result = array ('result ' => isset ($ mailtext )?$ mailtext :'' );
137
- }
138
- if (strcasecmp ($ method , 'set ' ) == 0 ) {
139
- $ settingsJobAuth ->setAccessWrite (True );
140
- $ settingsJobAuth ->setMailText ($ value );
141
- $ result = array ('result ' => $ settingsJobAuth ->getMailText ());
142
- //$result['old'] = $value;
143
- //$result['post'] = $_POST;
144
- //$result['get'] = $_GET;
145
- //$result['server'] = $_SERVER;
146
- //$result['request'] = $_REQUEST;
147
- }
148
- }
149
- $ viewModel = new JsonModel ();
150
- $ viewModel ->setVariables ($ result );
151
- return $ viewModel ;
152
- }
153
-
154
130
public function statusAction ()
155
131
{
156
132
$ applicationId = $ this ->params ('id ' );
@@ -252,6 +228,8 @@ public function forwardAction()
252
228
$ application = $ services ->get ('repositories ' )->get ('application ' )
253
229
->find ($ this ->params ('id ' ), 'EAGER ' );
254
230
231
+ $ this ->acl ($ application , 'forward ' );
232
+
255
233
$ translator = $ services ->get ('translator ' );
256
234
257
235
if (!$ emailAddress ) {
0 commit comments