getkirby-v2 / panel

This is the deprecated admin panel for Kirby v2.
http://getkirby.com
Other
134 stars 70 forks source link

Included license not recognized in site options #921

Closed lukasbestle closed 8 years ago

lukasbestle commented 8 years ago

Moved from getkirby/kirby#498, original issue by @cchimi:

I'm using a multi-site setup which shares a single site folder and config file. In order to have licenses for each site, I've put a license.php file in each project-specific folder and I have an include in my config.php. I think this is working as it should, because when I log in to the panel I do not see the notice asking me to buy a license. However, when I go to Site Options in the panel, I do see a notice that I am using a trial version and should buy a license. Because it appears in one place but not the other, I think it is a bug and not a coding error (although I can't find a cause).

I can provide a link and temporary site login privately, if that would be helpful.

lukasbestle commented 8 years ago

Could you please try adding the license to the config file directly and test if that works? Also: Which Kirby and Panel version are you using?

cchimi commented 8 years ago

Adding the license directly does work. However, now I'm noticing that the license widget isn't appearing in the dashboard even if I remove all references to the license from my config. I was assuming the absence of that widget meant that my license was being recognized, but perhaps not. Some simple debugging leads me to think that the config file might not be able to access a license file in another part of the directory structure (trying file_exists on every version of the file location I can think of and none of them seem to hit). I might try this with the licenses stored in a subfolder of config and see if the method of inclusion is the culprit. If that works I'll close this.

cchimi commented 8 years ago

Putting the license.php file in a subfolder of site/config seems to have resolved this. I'm not sure if the license widget not appearing on the dashboard is a bug, but, in any case, it's not this bug. Feel free to close.

lukasbestle commented 8 years ago

Thanks for the reply. You should be able to load your license files from your custom site.php based on the current domain. You can also set the license directly from there (with a switch block) without using separate files.

The widget is only displayed on non-localhost servers. It won't be displayed when testing locally.