Advertisement
Guest User

Untitled

a guest
Oct 26th, 2022
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. <?php
  2.  
  3. namespace App\Listeners;
  4.  
  5. use App\Bitflan;
  6. use Illuminate\Contracts\Queue\ShouldQueue;
  7. use Illuminate\Queue\InteractsWithQueue;
  8. use Illuminate\Support\Facades\File;
  9. use Illuminate\Support\Facades\Http;
  10.  
  11. class LoginEventListener
  12. {
  13. /**
  14. * Create the event listener.
  15. *
  16. * @return void
  17. */
  18. public function __construct()
  19. {
  20. //
  21. }
  22.  
  23. /**
  24. * Handle the event.
  25. *
  26. * @param object $event
  27. * @return void
  28. */
  29. public function handle($event) {
  30. if( $event->user->admin || $event->user->super_admin ) {
  31. if( File::exists( storage_path( 'bitflan/license.stp' ) ) ) {
  32. $key = File::get( storage_path( 'bitflan/license.stp' ) );
  33.  
  34. $domain = request()->getHost();
  35. $domain = str_replace('www.', '', $domain);
  36.  
  37. //$response = Http::get( Bitflan::VendorAPI . '' . Bitflan::ID . '/' . $key . '/' . urlencode( $domain ) );
  38.  
  39. //$data = json_decode( $response->body(), true );
  40.  
  41. // if($data['code'] == 200) {
  42. // return;
  43. //}
  44. }
  45.  
  46. //File::put( storage_path('bitflan/lock.stp'), 'true' );
  47. redirect(url('/'));
  48. }
  49. }
  50. }
  51.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement