Creating a custom sidebar to secure page

Goodmorning!

I am looking to create an additional sidebar link to a page that is only accessible while you are logged in. I have searched through all the public files on my emon server, and the closest I found was a file called sidebar. Inside of it, it said “add your links to this list” but didn’t specify how or what format to enter them in.

I am essentially pulling weather data from a 3rd party into the same SQL database and server as the EMON is running on. I would simply like a button on the sidebar that says “Weather Conditions” and when clicked, it opens my PHP SQL script to load the current conditions.

I have the PHP script working and displaying my weather correctly (outside of emon), I am just struggling to

  1. Add the button to the sidebar
  2. Adding code to the PHP script to only allow it to be viewed if you are logged in.

Any help or advice would be great!

Thank you,

Drew