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
Rename users folder - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: Miscellaneous (https://userspice.com/forums/forumdisplay.php?fid=28)
+--- Forum: Off-topic Discussions (https://userspice.com/forums/forumdisplay.php?fid=10)
+--- Thread: Rename users folder (/showthread.php?tid=720)



Rename users folder - shoropio - 09-05-2017

Hi guys, what would be the least painful way to rename the "users" folder.


Rename users folder - Brandin - 09-05-2017

Not doing it...

You will run into issues with upgrades (you will always have to do manual upgrades) and I'm pretty sure it could possibly screw up items related to emails, init and z_us_root.

Although @mudmin might be able to provide more exact details on what will happen - I am strongly discouraging it


Rename users folder - shoropio - 09-06-2017

Thanks Brandin, in these lines I have:
<pre>
Code:
$token = Input::get('csrf');
if(Input::exists()){
    if(!Token::check($token)){
        die('Token doesn\'t match!');
    }
}
</pre>


Change them by:
<pre>
Code:
$token = Input::get('csrf');
if(Input::exists()){
    if(!Token::check($token)){
        Redirect::to($us_url_root.'users/accion-no-permitida.php'); <!-- here -->
    }
}
</pre>


It works as a redirect to a page that explains what happened, the question is: Is it the best option?


Rename users folder - karsen - 09-06-2017

That is what I do as well. I prefer to give the user a reason why a form didn't work as expected, rather than just killing a page because they refreshed when they had POST data already.


Rename users folder - mudmin - 09-06-2017

I agree. I was looking at that the other day. I think we need a more descriptive post. Maybe we can put a hook in usersc that people can grab onto so they can change the message at will.


Rename users folder - mudmin - 09-06-2017

I think it would be pretty painful to rename that folder. Overall, we've worked really hard to give people a clean place to build their project and get as much of the "userspice" out of the way, but that one's pretty difficult.

It's either going to require a big find/replace every time you do an upgrade
OR
There might be a way to redirect people using a .htaccess file.

What about just moving login, join, account.php and profile.php to a different folder? That's what your end users see. It's clunky, but the cleanest thing to do would be to create those filenames in usersc and do

Code:
<?php require_once '../users/init.php';
Code:
Redirect::to("https://mydomain.com/login.php"); ?>