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
Protect HTML files
#1
Hi, I've configured my server via htaccess to process .html in the same way as .php and want to ptotcet those files in same way, the current access pages doesn't pick up the HTML extension....in user cake I was able to change which file types were automatically picked up but can't find that in the code....could anyone please point me to where in user spice it pulls in the permissionable files?

Thanks in advance!
  Reply
#2
You have to rename your HTML files to PHP.
  Reply
#3
hi Dan, yep understand that would fix it but I'd really rather keep .html (massive project I'm upgrading to userspice from userckae)...do you know where in the code it identifies which files to include/exclude so I could add .html as an extension to include?

Cheers,

Matt
  Reply
#4
Even if you get the system to recognize the .html extension, you won't be able to run the required PHP code to die(); if the user doesn't have access or redirect them to whatever page.
  Reply
#5
It will, my server is configured to parse .html as if it's a .php so executes all the php functions it's covered here:

https://stackoverflow.com/questions/4687...-php-files
  Reply
#6
I'm not finding anything in init.php or admin_pages.php that is specific to only allowing .php files, so it must be something related to compatibility in the PHP functions...Look at
Code:
z_us_root.php
,
Code:
init.php
and
Code:
admin_pages.php
and see if you can figure out what function is causing the issue - but I am not so sure you will be successful in getting the html files recognized.
  Reply
#7
i would look in us_helpers.php and helpers.php where there are functions that look for php pages but i dont understand the logic in running html as php, when you consider any file with a php file extension will run html and jquery etc even with no php logic written in it, why not just change your file extensions which is much easier, if the reasoning is to pretify urls then that can be acheived easily in htaccess
  Reply
#8
It would be a royal pain.

If you want to though you could go to us_helpers.php and copy

getPathPhpFiles

function into usersc/custom_functions.php, rename the function and add your html files. Then you would have to call that function from admin_pages.php to get those pages into your db.
  Reply


Forum Jump:


Users browsing this thread: 8 Guest(s)