Title: underscore's Replies | WordPress.org

---

# underscore

  [  ](https://wordpress.org/support/users/underscore/)

 *   [Profile](https://wordpress.org/support/users/underscore/)
 *   [Topics Started](https://wordpress.org/support/users/underscore/topics/)
 *   [Replies Created](https://wordpress.org/support/users/underscore/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/underscore/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/underscore/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/underscore/engagements/)
 *   [Favorites](https://wordpress.org/support/users/underscore/favorites/)

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [My Crack at a Client Login Section/Customer Portal](https://wordpress.org/support/topic/my-crack-at-a-client-login-sectioncustomer-portal/)
 *  [underscore](https://wordpress.org/support/users/underscore/)
 * (@underscore)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/my-crack-at-a-client-login-sectioncustomer-portal/#post-900984)
 * Lovin the work here JTWilcox and others.
 * J3design I am also using sub pages and they work fine, however I have a main 
   client page (for each client) and that has its own template. Inside that template
   I generate navigation for all the sub pages so the client can navigate to project
   1, project 2 etc.
 * The only problem that I had was client a, could potentially see client b’s pages.
 * So in my client template I added, it checks to see if the username is the same
   as the url, if so it allows the client to view, otherwise it re-directs them 
   back to the login page. Stops one client snooping on another.
 *     ```
       ?php 
   
       $username = ( $userdata->user_login ); 
   
       ?>
   
           <?php
       $url =  $_SERVER['REQUEST_URI'];
       $urlItemsArr = explode( '/', $url );
   
       /*
       print ('client-area/'.$userdata->user_nicename);
       print '<br />';
       print ($urlItemsArr[1].'/'.$urlItemsArr[2] );
       print '<br />';
       */
   
       if ( strcmp( 'client-area/'.$userdata->user_nicename, $urlItemsArr[1].'/'.$urlItemsArr[2] ) == 0) {
       	 print 'Allowed';
       } else {
       	header('Location:http://www.yourdomain.com/wp-admin/') ;
       }
   
       ?>
       ```
   

Viewing 1 replies (of 1 total)