@@ -79,7 +79,8 @@ public function profile(Request $request)
79
79
$ current_package = $ subscription ->getCurrentPackage ($ subscriber ->id );
80
80
}
81
81
82
- $ data = [
82
+ $ result = [
83
+ 'mac ' => $ data ['mac ' ] ?? '' ,
83
84
'return_url ' => base64_encode (url (route ('isp_access_thankyou ' ))),
84
85
'profile_return_url ' => base64_encode (url (route ('isp_profile ' ))),
85
86
'subscriber ' => $ subscriber ,
@@ -93,14 +94,23 @@ public function profile(Request $request)
93
94
];
94
95
95
96
$ currency = new Currency ();
96
- $ data ['currency ' ] = $ currency ->getDefaultCurrency ();
97
+ $ result ['currency ' ] = $ currency ->getDefaultCurrency ();
98
+
99
+ if (isset ($ data ['mac ' ]) && $ data ['mac ' ] != '' && count ($ user_packages ) > 0 ) {
100
+ return redirect ()
101
+ ->route ('isp_access_mikrotik_login ' )
102
+ ->header ('pragma ' , 'no-cache ' )
103
+ ->header ('Cache-Control ' , 'no-store,no-cache, must-revalidate, post-check=0, pre-check=0 ' );
104
+ } else {
105
+ return response ()
106
+ ->view ('isp::access-dashboard ' , $ result )
107
+ ->header ('pragma ' , 'no-cache ' )
108
+ ->header ('Cache-Control ' , 'no-store,no-cache, must-revalidate, post-check=0, pre-check=0 ' );
109
+
110
+ }
97
111
98
- return response ()
99
- ->view ('isp::access-dashboard ' , $ data )
100
- ->header ('pragma ' , 'no-cache ' )
101
- ->header ('Cache-Control ' , 'no-store,no-cache, must-revalidate, post-check=0, pre-check=0 ' );
102
112
}
103
-
113
+
104
114
public function autosubscribe (Request $ request )
105
115
{
106
116
@@ -133,6 +143,7 @@ public function buyPackage(Request $request, $id)
133
143
$ data ['currency ' ] = $ currency ->getDefaultCurrency ();
134
144
135
145
$ subscriber = $ subscription ->getSubscriber ($ data );
146
+
136
147
$ invoice = $ subscription ->buyPackage ($ id , $ subscriber ->id );
137
148
138
149
if ($ invoice ->status == 'paid ' ) {
@@ -363,13 +374,13 @@ public function mikrotiklogin(Request $request)
363
374
$ subscriber = $ subscription ->getSubscriber ($ data );
364
375
$ subscriber_login = SubscriberLogin::where ('mac ' , $ data ['mac ' ])->first ();
365
376
366
- $ data = [
377
+ $ result = [
367
378
'subscriber ' => $ subscriber ,
368
379
'subscriber_login ' => $ subscriber_login ,
369
380
];
370
381
371
382
return response ()
372
- ->view ('isp::access-mikrotik-login ' , $ data , 200 )
383
+ ->view ('isp::access-mikrotik-login ' , $ result , 200 )
373
384
->header ('pragma ' , 'no-cache ' )
374
385
->header ('Cache-Control ' , 'no-store,no-cache, must-revalidate, post-check=0, pre-check=0 ' );
375
386
}
0 commit comments