+ Post New Thread
Results 1 to 7 of 7
Web Development Thread, stop students accessing parts of intranet in Coding and Web Development; Hi Guys. we have a small php site which is our intranet. on our home page, I want have this ...
  1. #1
    Admiral208's Avatar
    Join Date
    Mar 2008
    Location
    Bridgwater
    Posts
    720
    Thank Post
    176
    Thanked 63 Times in 55 Posts
    Rep Power
    40

    stop students accessing parts of intranet

    Hi Guys.

    we have a small php site which is our intranet.

    on our home page, I want have this line <?php include 'support.php' ?> which is basically a page with a small pop up in the corner with a link to a web page.

    My question is how can I stop this loading when a student access the page? I only want staff to see the php include.

    The site is in IIS on server 2008r2.

    Thanks

    James

  2. #2
    Admiral208's Avatar
    Join Date
    Mar 2008
    Location
    Bridgwater
    Posts
    720
    Thank Post
    176
    Thanked 63 Times in 55 Posts
    Rep Power
    40
    Bump Anyone??

  3. #3
    SovietRussia's Avatar
    Join Date
    Mar 2013
    Location
    Powys, Wales
    Posts
    617
    Thank Post
    70
    Thanked 132 Times in 103 Posts
    Rep Power
    44
    Are you using Windows Authentication on IIS? If so, you can use a simple script like this one...

    PHP Code:
    <?php

    $username 
    $_SERVER['AUTH_USER'];
    $split explode("\\"$username); // Our domain format is STUDENT\User for our staff ones it STAFF\User
    $domain strtolower($split[0]);

    if(
    $domain == "staff"// Replace STAFF with whatever format your domain is in, ie STUDENT, STAFF.
    {   
     
    // Staff only stuff here
    }
    else
    {
        
    // Student here
    }
    ?>
    Sorry hurriedly written.

    EDIT:

    Limitations:


    • Must be using IE
    Last edited by SovietRussia; 21st May 2013 at 10:49 AM.

  4. #4
    Admiral208's Avatar
    Join Date
    Mar 2008
    Location
    Bridgwater
    Posts
    720
    Thank Post
    176
    Thanked 63 Times in 55 Posts
    Rep Power
    40
    I was looking at windows authentication yesterday. When I enabled it, it would ask me to log in when I navigate to the page but even if I entered my admin details, it would not allow me view the content. How do I automatically pass the username or security group to IIS to allow or disallow this part of the page.

    Would I include your script on the page that's being displayed or the page I am calling?

    not had much to do with php until now...

  5. #5
    SovietRussia's Avatar
    Join Date
    Mar 2013
    Location
    Powys, Wales
    Posts
    617
    Thank Post
    70
    Thanked 132 Times in 103 Posts
    Rep Power
    44
    Quote Originally Posted by Admiral208 View Post
    I was looking at windows authentication yesterday. When I enabled it, it would ask me to log in when I navigate to the page but even if I entered my admin details, it would not allow me view the content. How do I automatically pass the username or security group to IIS to allow or disallow this part of the page.

    Would I include your script on the page that's being displayed or the page I am calling?

    not had much to do with php until now...
    Yeah it will be asking you to login, if you are using IE on a domain PC, it should auto do it for you. You have to login with domain\username style

    Place this code where you currently include the file.

    PHP Code:
    <?php

    $username 
    $_SERVER['AUTH_USER'];
    $split explode("\\"$username); // Our domain format is STUDENT\User for our staff ones it STAFF\User
    $domain strtolower($split[0]);

    if(
    $domain == "staff"// Replace STAFF with whatever format your domain is in, ie STUDENT, STAFF.
    {   
     include 
    'support.php';
    }
    else
    {
        
    // Student here
    }
    ?>

  6. #6
    Admiral208's Avatar
    Join Date
    Mar 2008
    Location
    Bridgwater
    Posts
    720
    Thank Post
    176
    Thanked 63 Times in 55 Posts
    Rep Power
    40
    ok. And what happens if they want to use chrome/safari/firefox?

  7. #7
    SovietRussia's Avatar
    Join Date
    Mar 2013
    Location
    Powys, Wales
    Posts
    617
    Thank Post
    70
    Thanked 132 Times in 103 Posts
    Rep Power
    44
    Quote Originally Posted by Admiral208 View Post
    ok. And what happens if they want to use chrome/safari/firefox?
    You cannot use Windows Auth with those browsers, as far as I know - Never looked into it as we use IE here.

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 7
    Last Post: 17th February 2011, 03:37 PM
  2. Deny Student access to Staff intranet
    By kamikaze in forum Internet Related/Filtering/Firewall
    Replies: 6
    Last Post: 20th January 2010, 12:31 PM
  3. Stop students stealing mice
    By adamyoung in forum How do you do....it?
    Replies: 70
    Last Post: 21st February 2006, 08:49 PM
  4. Students accessing the Servers through Word
    By ninjabeaver in forum Windows
    Replies: 33
    Last Post: 3rd February 2006, 04:43 PM
  5. Stop internet access from address bar
    By adamyoung in forum How do you do....it?
    Replies: 13
    Last Post: 25th January 2006, 12:45 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •