Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Tips/Tricks/Mods

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 6th May 2008, 18:32
jonwatson jonwatson is offline
Senior Member
 
Join Date: Feb 2007
Posts: 176
Thanks: 15
Thanked 3 Times in 3 Posts
Default Added Custom Page - Now Need Authentication Assistance

Hello,

At the request of a client I have written a little app that sends an email to all users with the administrator bit set. Simple script, but I need some help in securing it. I would like 2 things:

1. Only the admin user to be able to see the link in the menu. I see that is done in navi.inc.php, but I can't quite sort out the exact way to do it, and

2. I want any attempts to call this page directly to be either authenticated as a logged in admin user or redirected to the login page as all the other pages do.

Can someone point me in the right direction?

Thanks

Jon
Reply With Quote
Sponsored Links
  #2  
Old 7th May 2008, 16:58
jonwatson jonwatson is offline
Senior Member
 
Join Date: Feb 2007
Posts: 176
Thanks: 15
Thanked 3 Times in 3 Posts
Default

It seems that I might be able to make this easier. I only want the single admin user to be able to use this link. Therefore, it's probably not necessary to introduce the full blown ISPConfig authentication routine. All I need to do is see if the admin user is logged in.

I know that the $go_info["user"]["user_id"] contains the user id of the logged on user, but it is not available on my new page so I assume there is some include or function I need to call first in order to load this array.

Any assistance?

Thanks

Jon
Reply With Quote
  #3  
Old 8th May 2008, 00:20
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,745 Times in 2,578 Posts
Default

So you need the $go_info["user"]["user_id"] on a normal web page?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #4  
Old 8th May 2008, 00:24
jonwatson jonwatson is offline
Senior Member
 
Join Date: Feb 2007
Posts: 176
Thanks: 15
Thanked 3 Times in 3 Posts
Default

In two places, actually.

I need it in nav.inc.php in order to only show the link to the new page to the admin user, and then I need it in the new page itself (newpage.php, let's call it) so that it can't be called directly.

In the second instance, I guess I would be happy with anything that stops the page from being displayed outside of the ISPConfig frame. It could even just direct everyone that tries to access it to the ISPConfig login and then if it is the legitimate admin that wants it, he can can log in and then access it via the menu item.

Does that make sense?

Thanks

Jon
Reply With Quote
  #5  
Old 9th May 2008, 14:28
jonwatson jonwatson is offline
Senior Member
 
Join Date: Feb 2007
Posts: 176
Thanks: 15
Thanked 3 Times in 3 Posts
Default

Hi

Anyone have any ideas for me?

Thanks

Jon
Reply With Quote
  #6  
Old 10th May 2008, 17:38
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,745 Times in 2,578 Posts
Default

Not really...
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 10th May 2008, 18:11
jonwatson jonwatson is offline
Senior Member
 
Join Date: Feb 2007
Posts: 176
Thanks: 15
Thanked 3 Times in 3 Posts
Default

Really?

Let me simplify, then.

All I want is for my new menu link to only show up for the admin user.

Jon
Reply With Quote
  #8  
Old 12th May 2008, 17:21
jonwatson jonwatson is offline
Senior Member
 
Join Date: Feb 2007
Posts: 176
Thanks: 15
Thanked 3 Times in 3 Posts
 
Default

Is there no way to do this?

Honestly, I just need to know if this is even possible at this point.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix - Relay access denied gotting Server Operation 3 23rd April 2008 15:06
network issues now it says "401 The web site is blocked by administrator" Check General 3 26th February 2008 15:22
Mail server attack princebenin Server Operation 1 19th November 2007 15:02
Apache2 Freezes celtic Server Operation 31 28th May 2007 18:18
php script injections Grizzly General 21 18th July 2006 09:55


All times are GMT +2. The time now is 06:25.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.