[support] block visibility based on role AND path (SOLUTION)

Nick Young nick_young at ncsu.edu
Fri Oct 10 18:52:03 UTC 2008


FYI: Here is the solution:

<?php
// look for particular paths in the URL
$termslist = array("path-element-1","path-element-2");
$elements = explode("/", $_SERVER['REQUEST_URI'], 10);
global $user;
$userlist = array('user-account-name');
foreach ($termslist as $term) {   
    if (in_array($term, $elements) && in_array($user->name, $userlist)) {
        return true;
    }
}
return false;
?>


........................................................................
Nick Young
Outreach, Communications & Consulting
Office of Information Technology
North Carolina State University
Box 7109, Raleigh 27695
Ph. 919.513.2716 | E-Mail: nick_young at ncsu.edu <mailto:nick_young at ncsu.edu>
........................................................................






More information about the support mailing list