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
/printthread.php 16 require_once



UserSpice
Modify acccount.php - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: General (https://userspice.com/forums/forumdisplay.php?fid=20)
+--- Forum: New to UserSpice? (https://userspice.com/forums/forumdisplay.php?fid=22)
+--- Thread: Modify acccount.php (/showthread.php?tid=163)



Modify acccount.php - dannyboy - 06-15-2016

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.



Modify acccount.php - mudmin - 06-15-2016

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.


Modify acccount.php - brian - 06-15-2016

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).


Modify acccount.php - mudmin - 06-16-2016

Ahhh. Great point!


Modify acccount.php - dannyboy - 06-16-2016

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





Modify acccount.php - mudmin - 06-16-2016

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:
}



Modify acccount.php - dannyboy - 06-16-2016

Thanks mudmin the function worked like a charm.