Use Nextcloud credentials for private site/app

I am currently writing a simple PHP script which I want only my Nextcloud users to be able to run. I am wondering if there is some easy way for my PHP script to check if a visitor is logged onto my Nextcloud server?

I couldn’t find an existing app that allows users to run custom PHP scripts, but if there is one please let me know.

Otherwise I need to know the simplest way of confirming that someone browsing to the PHP page is logged on to Nextcloud. The PHP script will be on the same server as Nextcloud (and I can put it in /var/www/nextcloud if needed). Ideally, I will then add it as a menu option using the External Sites app.


one way is to create your own app for this; put the php-code in a class and call it from a javascript ajax call.
…quite some overhead I guess :slight_smile:

1 Like