So I have a few issues I'm trying to hammer out.

1. I would like to be able to create pages that can only be access to authenticated users. This includes books. I read somewhere on here that it isn't possible, but would be interested to see if anyone had any thoughts on this.

Example: I have a few books that require you be a member in order to read. Right now, anyone can get straight to the pages of the book with the URL. I would like to limit this to only the people logged in.

2. I would like the ability to create a page only accessible once logged in, and be able to customize the content of that page based on user. Like how you can call certain fields when you customize a user profile.

Example: I have a page with reports. These reports are in password protected folders that are named the same as a filed defined in a user profile. I would like to limit access to this page to only users who are logged in, and display the information as I would in a custom profile page.

Does that make sense? I'm not the best developer, that's for sure. But I can play with it and poke around with some good direction.

Comments

awolfey’s picture

1. Create new content type only viewable by auth. users. Check out TAC lite or taxonomy access control modules.

2. Not exactly sure what you're going for, but maybe modules above combined with Views module, or just views alone might do it.

seofactor’s picture

Got number 1 figured out. Thanks a ton.

For the second, I guess the problem I'm having is calling information in the same way I would on a custom profile page.

So let's say I call the name of a user on their profile page with the following:

Name: <?php print ($account->profile_name);?>

I do not seem to be able to do the same on, let's say a block I put on the sidebar. The syntax to call profile information seems to only work on the profile page itself. How do I fix that?

awolfey’s picture

There may be some answers for you here: http://drupal.org/node/46200

WorldFallz’s picture

Blocks behave somewhat differently. Blocks have no context of what page they are being displayed on. You can provide that to a block manually with php (in the case of views blocks, argument handling code).

For example, if you want to put your code above in a block you could do something like:

<?php
if (arg(0) == 'user' && isnumeric(arg(1))) {
  $user = user_load(arg(1));
  $account = profile_load_profile($user);
  print 'Name: ' . $account->profile_name;
}
?>

that's untested but you get the idea.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz