2011-10-09 19:12:16 +04:00
|
|
|
<?php
|
2011-10-09 19:24:18 +04:00
|
|
|
$appInfoDir = __DIR__;
|
|
|
|
$thisAppDir = dirname($appInfoDir);
|
2011-10-09 19:12:16 +04:00
|
|
|
$appsDir = dirname($thisAppDir);
|
|
|
|
$ownCloudDir = dirname($appsDir);
|
2012-03-28 18:07:50 +04:00
|
|
|
$docRoot = $_SERVER['DOCUMENT_ROOT'];
|
|
|
|
if(file_exists($docRoot . '/.well-known/host-meta')) {
|
2012-03-28 18:12:34 +04:00
|
|
|
OC_Log::write(
|
|
|
|
'user_webfinger',
|
|
|
|
$docRoot . "/.well-known already exists; installation aborted",
|
|
|
|
OC_Log::ERROR
|
|
|
|
);
|
2012-03-28 18:07:50 +04:00
|
|
|
} else {
|
2012-03-28 18:12:34 +04:00
|
|
|
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
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2012-03-28 18:07:50 +04:00
|
|
|
}
|
|
|
|
?>
|