The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Allowing dynamic pages
#1
Good day

I am quite new to userspice. I would like to be able to allow all dynamically generated pages without having to add them to the database after identifying them.

I am using the CodeIgniter framework, which creates new "pages" for each item in a dynamic list. For example /users/1, /users/2, /users/3 will represent a different user that is being viewed. The list of users can be infinitely long, therefore I do not want to add all the possible options to the database. I would only like to allow everything "under" /users. Something like /users/*

Any help would be appreciated.

Kind regards
Jakes
  Reply
#2
So is the gist that you want to only allow people to visit their own pages?
  Reply
#3
Not entirely, the system generates new "links/pages" for dynamic content being generated and I would like to enable users to visit the pages as they are created, without having to add the links to the new "pages" in the database.

The framework doesn't really create pages, but when one opens a link to display a view about some content, the link changes and userspice then blocks the new "page".
  Reply
#4
So in that situation, you can just remove the securePage line at the top of those generated pages and that will go away. Those pages don't need to be in the database at all. Maybe just a link that if there is someone who is not logged in tries to view that page, it redirects them to the login page.
  Reply
#5
Ah that works! Thank you so much. I am now making use of the hasPerm funtion to ensure that only logged in users can access the pages.

Thanks again for the help.

Kind regards
Jakes
  Reply
#6
Great! Glad it's working!
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)