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
Private Pages (Twig)
#3
Thanks for the quick reply, Brandin!

If I put that directly on the page (privatepage.php might be the page in my example), and I type in the path to access it directly, all of the UserSpice code works as it's intended.

But I have something like this set-up on my index page:

Code:
require_once 'users/init.php';

<pre>
Code:
$app->get('/privatepage', function ($request, $response, $args) {
        
    return $this->view->render($response, 'privatepage.php');
    
});
</pre>



Because it will render privatepage.php using Twig, I can't put the PHP code you provided in directly (or at least I don't know HOW to with the Twig syntax, which might also be the problem). So, I was trying to execute it prior to the return, but I can't seem to figure out how to get that to work (or if it's possible) so that:

If user logged in, return ...->render, etc.
but If not logged in, redirect to log in.
  Reply


Messages In This Thread
Private Pages (Twig) - by whatwilldo - 10-28-2017, 05:29 PM
Private Pages (Twig) - by Brandin - 10-28-2017, 05:47 PM
Private Pages (Twig) - by whatwilldo - 10-28-2017, 05:58 PM
Private Pages (Twig) - by Brandin - 10-28-2017, 06:03 PM
Private Pages (Twig) - by whatwilldo - 10-28-2017, 06:23 PM
Private Pages (Twig) - by Brandin - 10-28-2017, 06:28 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)