• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

Solution to trigger email when user authenticates to Captive Portal

Scheduled Pinned Locked Moved Captive Portal
3 Posts 2 Posters 250 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T
    thedanhealy
    last edited by May 1, 2024, 5:29 AM

    Use Case: I'm using a Captive Portal at my home for guests. I'd like to be notified via email when a guest authenticates through the Captive Portal. This will help me identify when an unexpected guest is authenticating and needs action/blocking.

    I don't see this functionality in the product. However, we're a creative bunch :) How would anyone suggest going about achieving this functionality?

    G 1 Reply Last reply May 1, 2024, 8:10 AM Reply Quote 0
    • G
      Gertjan @thedanhealy
      last edited by May 1, 2024, 8:10 AM

      @thedanhealy

      Unexpected guest ?
      He will find the login page where you can indicate : "call me, I give you a login code/password or voucher" ?
      Does this unexpected guest really tries out guess an access code ?

      This will help me identify when an unexpected guest is authenticating and needs action/blocking.

      Some one who hasn't access, doesn't have the code, will hit the wall.
      You will see this in the portal log :

      cb162853-5cf2-4911-96c3-b5cfcf88d719-image.png

      he can try all day long, to the end of time.

      You are creative ? Then two lines of PHP won't scare you.
      Here is a suggestion.
      Edit /usr/local/captiveportal/index.php

      Find this at the end :

      3117d9e8-1f67-42f1-9cb7-300734d80bcc-image.png

      Add these two lines :

      		$msg = "No access : {$cpzone}, {$user}, {$clientmac}, {$clientip}";
      		notify_all_remote($msg);
      

      Like this :

      54092853-218c-4b24-a8fa-af8bf9a48a44-image.png

      From now on, when the portal login fails, you get a notification.

      Why isn't this implemented by default ? For reasons that can become obvious to you : you'll get bombarded with notifications if you have a "unexpected guest" who refuses to use his brain, and starts a dictionary attack on your portal.

      No "help me" PM's please. Use the forum, the community will thank you.
      Edit : and where are the logs ??

      T 1 Reply Last reply May 1, 2024, 5:26 PM Reply Quote 2
      • T
        thedanhealy @Gertjan
        last edited by May 1, 2024, 5:26 PM

        @Gertjan - This is the solution! Thank you very much.

        1 Reply Last reply Reply Quote 0
        1 out of 3
        • First post
          1/3
          Last post
        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
          This community forum collects and processes your personal information.
          consent.not_received