File tree Expand file tree Collapse file tree 2 files changed +29
-11
lines changed Expand file tree Collapse file tree 2 files changed +29
-11
lines changed Original file line number Diff line number Diff line change @@ -135,6 +135,15 @@ protected function processDeleteRequest()
135
135
$ this ->context ->language ->id
136
136
);
137
137
138
+ if ($ address ->id_customer != $ this ->context ->customer ->id ) {
139
+ $ this ->ajaxRender (json_encode ([
140
+ 'success ' => true ,
141
+ 'code ' => 301 ,
142
+ 'message ' => "There is not such address "
143
+ ]));
144
+ die;
145
+ }
146
+
138
147
if ($ address ->id ) {
139
148
if (!$ address ->deleted ){
140
149
$ address ->deleted = true ;
Original file line number Diff line number Diff line change @@ -34,24 +34,33 @@ protected function processGetRequest()
34
34
35
35
//there is a duplication of code but a prevention of new object creation too
36
36
$ order = new Order ($ id_order , $ this ->context ->language ->id );
37
- $ order_to_display = (new OrderPresenter ())->present ($ order );
37
+ if (Validate::isLoadedObject ($ order ) && $ order ->id_customer == $ this ->context ->customer ->id ){
38
+ $ order_to_display = (new OrderPresenter ())->present ($ order );
38
39
39
- if (Tools::isEmpty ($ id_order ) or !Validate::isLoadedObject ($ order )) {
40
+ if (Tools::isEmpty ($ id_order ) or !Validate::isLoadedObject ($ order )) {
40
41
42
+ $ this ->ajaxRender (json_encode ([
43
+ 'success ' => true ,
44
+ 'code ' => 404 ,
45
+ 'message ' => 'order not found '
46
+ ]));
47
+ die;
48
+ } else {
49
+
50
+ $ this ->ajaxRender (json_encode ([
51
+ 'success ' => true ,
52
+ 'code ' => 200 ,
53
+ 'psdata ' => $ order_to_display
54
+ ]));
55
+ die;
56
+ }
57
+ }else {
41
58
$ this ->ajaxRender (json_encode ([
42
- 'success ' => true ,
59
+ 'success ' => false ,
43
60
'code ' => 404 ,
44
61
'message ' => 'order not found '
45
62
]));
46
63
die;
47
- } else {
48
-
49
- $ this ->ajaxRender (json_encode ([
50
- 'success ' => true ,
51
- 'code ' => 200 ,
52
- 'psdata ' => $ order_to_display
53
- ]));
54
- die;
55
64
}
56
65
}
57
66
You can’t perform that action at this time.
0 commit comments