Help to determine admin page

Hi,

I need to include my file specially for administration page, but when I include it in /inc/admin.inc.php it includes for the user front-end also. How can I detect if it's admin page or user front-end?

http://boonexpert.com
Quote · 8 Jul 2011

Without knowing a little more about what your doing it would be difficult to tell you exactly what to do.

But i can provide a couple of common practices used in dolphin.

For pages located in the administration folder the common method used would be this.

$logged['admin'] = member_auth( 1, true, true );

That placed at the top of the php file after the includes would force a login for admin if admin is not logged in. Used most often in pages like http://www.yoursite.com/administration/admin_tools.php for example.

For the administration section of modules this method is commonly used.

            if( !isAdmin() ) {
                header('location: ' . BX_DOL_URL_ROOT);
                exit;
            }

That placed at the top of the actionAdministration() function in a module will redirect standard members to the sites homepage if they try to load the modules admin page directly.

Unfortunately you have me confused as to what your doing. Your stating administration page yet your referencing admin.inc.php which tells me your adding a function and not a page, so i not getting a clear picture of what your trying to do.

https://www.deanbassett.com
Quote · 8 Jul 2011

Thank you for reply.

I found my problem, it was in my own code, but everything else works good.

Thank you for help!

http://boonexpert.com
Quote · 8 Jul 2011
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.