Categories > TinyButStrong general >

access level

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Michaelsen
Date: 2005-07-15
Time: 17:49

access level


Hi there,

Is this a correct approach?

if(isset($_SESSION["subscriber"])) {

include "subscriber.php";
$TBS->LoadTemplate("subscriber.html");

} else {

include "public.php";
$TBS->LoadTemplate("public.html");

}

What I mean more exactly if it is ok to use this kind of behavior, I'm aware I can split premium and public content inside the template.

Cheers!

- Michaelsen
By: Michaelsen
Date: 2005-07-16
Time: 22:23

Re: access level

Maybe this is a bad idea.

Cheers!

- Michaelsen
By: Skrol29
Date: 2005-07-18
Time: 01:47

Re: access level

I just don't get it.
By: Michaelsen
Date: 2005-07-18
Time: 13:26

Re: access level


Hi Skrol29,

I could have two completely different worlds when there is a registered session after a successful login attempt and another for public domain access.

My concern is more about security, since I'm too new to tbs I can't figure this out yet.

Cheers!

- Michaelsen
By: Skrol29
Date: 2005-07-19
Time: 13:10

Re: access level

If your "completely different worlds" are two different templates, then you can do:
if ($is_subscriber) {
  include('subscriber.php');
} else {
  include('public.php');
}
Each sub-script does its own TBS stuff.

What I often do for medium application is:
$TBS = new clsTinyButStrong;

// Subscriber screen
if ($is_subscriber) {
  $TBS->LoadTemplate('subscriber.html');
  $TBS->MergeBlock(...);
  $TBS->Show() // ends the script
}

// Public access
$TBS->LoadTemplate('public.html');
$TBS->MergeBlock(...);
$TBS->Show() // ends the script