Adding a Custom top Menu Item to Login Page of FreePBX

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

1 Like

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.

Rick

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.

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

Doesn’t take much effort

1 Like

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 ?

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.

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.

This is the file that does the menu

Leave

cat /var/www/html/index.php 
<?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

1 Like

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.

It is saved into the settings table in MySQL.

1 Like

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!

Rick

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.