diff options
author | Florian Hülsmann <fh@cbix.de> | 2012-03-28 16:07:50 +0200 |
---|---|---|
committer | Florian Hülsmann <fh@cbix.de> | 2012-03-28 16:07:50 +0200 |
commit | bcda46eda3b3b9208609bc5a9497632aa0dabfa9 (patch) | |
tree | f9fcfe8f36356b140513851c38f79c995bb4fe1d /apps/user_webfinger/appinfo | |
parent | cb2dd97509ffd039fbd321aea4a8d631e3effcc7 (diff) | |
download | nextcloud-server-bcda46eda3b3b9208609bc5a9497632aa0dabfa9.tar.gz nextcloud-server-bcda46eda3b3b9208609bc5a9497632aa0dabfa9.zip |
webfinger installation creates symlink in document root
Diffstat (limited to 'apps/user_webfinger/appinfo')
-rw-r--r-- | apps/user_webfinger/appinfo/install.php | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/apps/user_webfinger/appinfo/install.php b/apps/user_webfinger/appinfo/install.php index f570a3a249b..9ba953a4e60 100644 --- a/apps/user_webfinger/appinfo/install.php +++ b/apps/user_webfinger/appinfo/install.php @@ -3,4 +3,34 @@ $appInfoDir = __DIR__; $thisAppDir = dirname($appInfoDir); $appsDir = dirname($thisAppDir); $ownCloudDir = dirname($appsDir); -@symlink($thisAppDir, $ownCloudDir.'/.well-known'); +$docRoot = $_SERVER['DOCUMENT_ROOT']; +if(file_exists($docRoot . '/.well-known/host-meta')) { + OC_Log::write( + 'user_webfinger', + $docRoot . "/.well-known already exists; installation aborted", + OC_Log::ERROR + ); +} else { + if(@symlink($thisAppDir, $docRoot . '/.well-known')) { + OC_Log::write( + 'user_webfinger', + "Webfinger symlink created at " . $docRoot . "/.well-known", + OC_Log::INFO + ); + } else { + if(@symlink($thisAppDir, $ownCloudDir . '/.well-known')) { + OC_Log::write( + 'user_webfinger', + "Couldn't create webfinger symlink in document root, linked to " . $ownCloudDir . "/.well-known instead", + OC_Log::WARN + ); + } else { + OC_Log::write( + 'user_webfinger', + "Couldn't create webfinger symlink, either check write permissions or create the link manually!", + OC_Log::ERROR + ); + } + } +} +?> |