The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (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
Modify acccount.php
#1
I wanted to modify the account.php file and therefore moved it to the usersc folder. However when I login I get an error message. Is there something I am not doing correct or missing?

Thanks.
  Reply
#2
I think you have to re-point to the init file. I'm going to confirm with @Brian on this. He wrote that feature. I need to document it better.
  Reply
#3
Yes, but remember not to MOVE, but to copy the account.php. If you move it to the usersc/ folder, then your new path to the init should be ../users/init.php (i.e. move back one path level, then navigate to /users/init.php).
  Reply
#4
Ahhh. Great point!
  Reply
#5
Thanks for that. I did that and it works fine now. I also figured that out soon after posting the initial post. I did copy/paste the account.php file as opposed to move.

One other thing, in userspice version 3.x I would use the function if(!isUserLoggedIn()) { header("Location: ../my_signin.php"); die(); } to check if user is logged in if not redirect to my own signin page.

How can I do that in version 4.1?

Thanks


  Reply
#6
When a user is logged in, they're automatically assigned the variable $user. So in UserSpice 4, you can do...
Code:
if($user->isLoggedIn()){
Code:
//your code here
Code:
}
  Reply
#7
Thanks mudmin the function worked like a charm.
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)