TIPS How to hide the top menu in FreePBX gui

paulnye

Guru
Joined
Apr 17, 2011
Messages
208
Reaction score
2
I need to give someone access to the CDR reports module in FreePBX 2.11 but I dont want them to see the top menu (admin, applications, connectivity etc)
Is there a way I can give them a link just to the CDR reports module frame?
 

billsimon

Well-Known Member
Joined
Jan 2, 2011
Messages
1,540
Reaction score
729
You can make a custom page in the /var/www/html/admin with some bare minimum initialization of FreePBX and loading of the cdr module, like this:

Code:
<?php
 
// Bypass auth.
$bootstrap_settings['freepbx_auth']    = false;
 
// Initialize
if (!@include_once(getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.conf')) {
        include_once('/etc/asterisk/freepbx.conf');
}
 
// Print the header/CSS
include('views/header.php');
 
// Print CDR CSS
$module_name = 'cdr';
echo framework_include_css();
 
// fix margins
echo "<style type=text/css>body { margin-left:20px; margin-right:20px; }</style>";
// the page
include('modules/cdr/page.cdr.php');
 
?>

Beware! Caution! :yikes: Notice the "bypass auth" comment in the code. This simple loader for the cdr module basically bypasses any and all safeties that FreePBX has in place. Also, I don't know that every part of the page will work perfectly, so fixing up anything that doesn't work is up to you. But the basic search and display works for me:

cdrtest.png
 

billsimon

Well-Known Member
Joined
Jan 2, 2011
Messages
1,540
Reaction score
729
PS: If you want your customer to get to this page but don't want to give them the BasicAuth user/password used to access your entire server, you can either make this page unauthenticated by Apache (another :yikes: maybe) or add an Apache directive and specific user for just this page.
 

paulnye

Guru
Joined
Apr 17, 2011
Messages
208
Reaction score
2
Thanks billsimon
For CDR it worked perfectly. I would like to also give them 'menuless' access to Asternic CDR also, which is an alternative FreePBX CDR module. So I copied your code and modified the 2 places that had the string 'cdr' and replaced with 'asternic_cdr'. It loads the Asternic CDR page without menus however the page formatting is missing, and the buttons dont work. Is it something simple or a big deal to get this one working do you think?
 

billsimon

Well-Known Member
Joined
Jan 2, 2011
Messages
1,540
Reaction score
729
If the formatting is not right, then some CSS is not being loaded. For the buttons, they might be JavaScript so you'll have to see where that source is and pull it in to the loader as well. I haven't used Asternic CDR and can't say whether these steps will be trivial or challenging.
 

james

Guru
Joined
Oct 18, 2007
Messages
374
Reaction score
38
THERE BE DRAGONS!!

This is NOT the way to go about this.

Admin> Administrators>Add Administrator
Fill in the access permissions as you see fit.

There in no need to be "hacky" when there are proper facilities in place. There is no need to go all "Koolaid Man" through the wall when you can simply use the door and lock it behind you.
 

paulnye

Guru
Joined
Apr 17, 2011
Messages
208
Reaction score
2
Thanks for pointing out Admin> Administrators>Add Administrator
So I added a user called 'cdr' and gave only permission to the Asternic CDR module, thats it.. but when I open FreePBX in my browser I enter the un+pwd for 'cdr' it fails. I even tried the direct URL - /admin/config.php?display=asternic_cdr
 

james

Guru
Joined
Oct 18, 2007
Messages
374
Reaction score
38
blog-kool-aid.png
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,210
Reaction score
5,239
I understand this is being addressed directly in FreePBX 12.
 

paulnye

Guru
Joined
Apr 17, 2011
Messages
208
Reaction score
2
Asternic CDR works great but never found a way to hide the top menu
 

Members online

Forum statistics

Threads
25,839
Messages
167,933
Members
19,264
Latest member
baata
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top