Adding a Custom top Menu Item to Login Page of FreePBX

Tags: #<Tag:0x00007f70297c3f08> #<Tag:0x00007f70297c3b98>

(Rick McGill) #1

I have a need to add a new menu item on the top bar of the FreePBX login page.
This new menu item does not need to be a pop down but only a button with a hyperlink URL to our Internal IT Support Ticketing system.

I have found we can create a /etc/freepbx_menu.conf file if we want to add new menu items to the top bar but we do not know the proper syntax to add to the freepbx_menu.conf file to make the new menu items also appear on the Login page of FreePBX. Sort of like UCP does.
Also is it possible to make that button have a link to an external URL (http address)?

Can this be done? Is there an easier or better way to do this?

Regards, Rick


Perhaps advanced settings -> styling and logos is easier, Image and Link to suit. If /var/www/html/index_custom.php exists it will be preferred over the the standard login screen

(Rick McGill) #3

Thanks for the suggestion.
We are looking into that option also but it seems like much more scope/effort than to just add one menu button on the top bar of the existing login page.


(Simon Telephonics) #4

Copy views/login.php to /var/www/html/admin/customlogin.php or name of your choice. Edit to your liking.

Tell FreePBX about it: fwconsole setting VIEW_LOGIN customlogin.php

edit: Sorry, that’s for the big buttons on the login page, not the menubar buttons.

cat /var/www/html/index_custom.php 
        $basename = pathinfo($_SERVER['PHP_SELF'],PATHINFO_DIRNAME);
        $uri = (!empty($basename) && $basename != '/') ? $basename . '/mywebsite : '/mywebsite';
        header('Location: '.$uri);

Doesn’t take much effort

(Rick McGill) #6

Very Interesting! I did not know you could do that with fwconsole. Does that make the setting permanent to change login.php to customerlogin.php ?

(Simon Telephonics) #7

Yes, and custom files you put in /var/www/html/admin won’t be tracked by FreePBX and flagged as modified, which is why I suggested putting your custom file there rather than in the subfolder structure.

(Rick McGill) #8

I understand. Yeah we did this index_customer.php already just to see if we wanted to go this route.
Also just checking about if we can do the Login Page Menu item too.

(TheJames) #9

This is the file that does the menu



cat /var/www/html/index.php 
//      License for all code of this FreePBX module can be found in the license file inside the module directory
//      Copyright 2013 Schmooze Com Inc.
if (file_exists(dirname(__FILE__) . '/index_custom.php')) {
        include_once(dirname(__FILE__) . '/index_custom.php');
} else {
        $basename = pathinfo($_SERVER['PHP_SELF'],PATHINFO_DIRNAME);
        $uri = (!empty($basename) && $basename != '/') ? $basename . '/admin' : '/admin';
        header('Location: '.$uri);

as it is or you will get bitching , but your custom file can be anything you want

(Rick McGill) #11

I wonder where does this VIEW_LOGIN change get saved to? A file, in MySQL, or other location?

I confirmed this works and even a Module update to Framework and Core does not change it back.

(Simon Telephonics) #12

It is saved into the settings table in MySQL.

(Rick McGill) #13

Yes see that now.
so FWCONSOLE write it to the MySQL.
Man that is quick and convenient to change settings in MySQL!

Thanks for this TIP!