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

Bryan Adams Posted in Technical Support 1 month 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 2 weeks 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 2 weeks 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 ossnuserby_email()). Or is there a way to access functions like this in an unauthenticated page?

us Bansh33 - Replied 1 month 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?