How to register a page and allow unauthenticated users to access it?

Bryan Adams Posted in Technical Support 6 years ago

So currently, to add a new page in a component, you do it like this

function some_component_init() {
  ossn_extend_view("profile/pages/profile", "js/somejs");

  ossn_register_page("new-page", "ossn_new_page");
}

ossn_register_callback("ossn", "init", "some_component_init");

This works but to access the page http://yourwebsite.com/new-page you need to be authenticated.

Is there a method that allows anonymous/unauthenticated users to access this page?

Any help would be much appreciated.

Replies
ph Bryan Adams Replied 6 years ago

Update:

Adding require_once('system/start.php'); fixed it. Though it would be nice to have a registered unauthenticated page component.

ph Bryan Adams Replied 6 years ago

@Bansh33 because if I do that, I don't have access to things like ossn_user_by_email('[email protected]');. I get 500 error ( Call to undefined function ossn_user_by_email()). Or is there a way to access functions like this in an unauthenticated page?

gb Rishi B Replied 6 years ago

why do you need/want to do it through a component if you don't care whether or not the user is unauthed? Why not just make a new directory called 'new-page' in your public_html directory?