Admidio / admidio

Admidio is a free open source user management system for websites of organizations and groups. The system has a flexible role model so that it’s possible to reflect the structure and permissions of your organization.
https://www.admidio.org
GNU General Public License v2.0
336 stars 131 forks source link

Uncaught exception if there are no rights in adm_my_files #712

Closed Fasse closed 6 years ago

Fasse commented 6 years ago

If you copy admidio at your webspace and open the browser and do not have set the permissions to adm_my_files than you got the following error:

Fatal error: Uncaught exception 'UnexpectedValueException' with message 'The stream or file "/volume1/web/admidio/adm_my_files/logs/admidio-2018-02-03.log" could not be opened: chmod(): Operation not permitted' in /volume1/web/admidio/adm_program/libs/monolog/src/Monolog/Handler/StreamHandler.php:107 Stack trace: #0 /volume1/web/admidio/adm_program/libs/monolog/src/Monolog/Handler/RotatingFileHandler.php(107): Monolog\Handler\StreamHandler->write(Array) #1 /volume1/web/admidio/adm_program/libs/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(37): Monolog\Handler\RotatingFileHandler->write(Array) #2 /volume1/web/admidio/adm_program/libs/monolog/src/Monolog/Logger.php(337): Monolog\Handler\AbstractProcessingHandler->handle(Array) #3 /volume1/web/admidio/adm_program/libs/monolog/src/Monolog/Logger.php(546): Monolog\Logger->addRecord(200, '###############...', Array) #4 /volume1/web/admidio/adm_program/system/logging.php(69): Monolog\Logger->info('###############...') #5 /volume1/web/admidio/adm_program/system/loggin in /volume1/web/admidio/adm_program/libs/monolog/src/Monolog/Handler/StreamHandler.php on line 107

We should add a handling that if the folder log doesn't exists and it's a fresh installation we should show the installation dialog. There the user will be informed about the permissions to that folder.

ximex commented 6 years ago

we could add a .gitkeep inside of the logs folder so that the folder gets tracked by git

ximex commented 6 years ago

@Fasse ?

Fasse commented 6 years ago

But this won`t fix the Problem with the missing rights to create the log file.

ximex commented 6 years ago

to create a file in a directory the dir needs the write and execute right. no more, no less. So if we change the dir rights to 775, all rights are available.

Fasse commented 6 years ago

but if I create the adm_my_files with ftp it get 755, so as I understand our script could not create any other dir.

ximex commented 6 years ago

But if we could checkin the logs folder into git with the .gitkeep the users would also upload the log folder. so no new logfolder has to be created by the php script. Maybe we should talk about this on skype ;-)

Fasse commented 6 years ago

ok, we should talk. In my opinion the uploaded log folder doesn't have the rights because ftp program will set these rights or the server himself will set the default rights for all folders.

Fasse commented 6 years ago

With the new FileSystemUtils no exception is thrown, only a log entry that there are no rights, so everything is ok.