1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/rainloop_ynh.git synced 2024-09-03 20:16:18 +02:00

Merge pull request #28 from scith/master

Fix root install + Update
This commit is contained in:
Jeff 2017-04-08 19:42:50 +02:00 committed by GitHub
commit 5a51ef3c53
5 changed files with 21 additions and 46 deletions

View file

@ -112,7 +112,12 @@ CHECK_DOMAINPATH
# install SSO - at the moment the index is the SSO and rainloop is installed in /app # install SSO - at the moment the index is the SSO and rainloop is installed in /app
sudo cp ../sources/sso/sso.php $final_path/index.php sudo cp ../sources/sso/sso.php $final_path/index.php
sudo sed -i "s@domain.tld@$domain@g" $final_path/index.php sudo sed -i "s@domain.tld@$domain@g" $final_path/index.php
sudo sed -i "s@PATHTOCHANGE@$path@g" $final_path/index.php sudo sed -i "s@ALIASTOCHANGE@$final_path@g" $final_path/index.php
if [ $path = "/" ]; then
sudo sed -i "s@ROOTTOCHANGE@@g" $final_path/index.php
else
sudo sed -i "s@ROOTTOCHANGE@$path@g" $final_path/index.php
fi
# Install PGPback by chtixof to allow users to backup/restore their PGP private keys on the server # Install PGPback by chtixof to allow users to backup/restore their PGP private keys on the server
sudo cp -rf ../sources/pgpback $final_path/. sudo cp -rf ../sources/pgpback $final_path/.

View file

@ -65,7 +65,12 @@ CHECK_PATH
# update SSO # update SSO
sudo cp ../sources/sso/sso.php $final_path/index.php sudo cp ../sources/sso/sso.php $final_path/index.php
sudo sed -i "s@domain.tld@$domain@g" $final_path/index.php sudo sed -i "s@domain.tld@$domain@g" $final_path/index.php
sudo sed -i "s@PATHTOCHANGE@$path@g" $final_path/index.php sudo sed -i "s@ALIASTOCHANGE@$final_path@g" $final_path/index.php
if [ $path = "/" ]; then
sudo sed -i "s@ROOTTOCHANGE@@g" $final_path/index.php
else
sudo sed -i "s@ROOTTOCHANGE@$path@g" $final_path/index.php
fi
# Install PGPback by chtixof to allow users to backup/restore their PGP private keys on the server # Install PGPback by chtixof to allow users to backup/restore their PGP private keys on the server
sudo cp -rf ../sources/pgpback $final_path/. sudo cp -rf ../sources/pgpback $final_path/.

View file

@ -1 +1 @@
1.10.5.192 1.11.0.203

View file

@ -1,35 +0,0 @@
<?php
if (!defined('APP_VERSION')) {
$version = file_get_contents('data/VERSION');
if ($version) {
define('APP_VERSION', $version);
define('APP_INDEX_ROOT_FILE', __FILE__);
define('APP_INDEX_ROOT_PATH', str_replace('\\', '/', rtrim(dirname(__FILE__), '\\/').'/'));
}
}
if(isset($_GET["auto_log"])) {
$_ENV['RAINLOOP_INCLUDE_AS_API'] = true;
}
if (file_exists(APP_INDEX_ROOT_PATH.'rainloop/v/'.APP_VERSION.'/include.php')) {
include APP_INDEX_ROOT_PATH.'rainloop/v/'.APP_VERSION.'/include.php';
} else {
echo '[105] Missing version directory';
exit(105);
}
if(isset($_GET["auto_log"])) {
if (isset($_SERVER['HTTP_EMAIL']) && isset($_SERVER['PHP_AUTH_PW'])) {
$email = $_SERVER['HTTP_EMAIL'];
$password = $_SERVER['PHP_AUTH_PW'];
$ssoHash = \RainLoop\Api::GetUserSsoHash($email, $password);
// redirect to webmail sso url
\header('Location: https://domain.tldPATHTOCHANGE/index.php?sso&hash='.$ssoHash);
}
exit();
}
?>

View file

@ -2,7 +2,7 @@
// Enable RainLoop Api and include index file // Enable RainLoop Api and include index file
$_ENV['RAINLOOP_INCLUDE_AS_API'] = true; $_ENV['RAINLOOP_INCLUDE_AS_API'] = true;
include '/var/www/rainloop/app/index.php'; include 'ALIASTOCHANGE/app/index.php';
// Retrieve email and password // Retrieve email and password
if (isset($_SERVER['HTTP_EMAIL']) && isset($_SERVER['PHP_AUTH_PW'])) { if (isset($_SERVER['HTTP_EMAIL']) && isset($_SERVER['PHP_AUTH_PW'])) {
@ -11,8 +11,8 @@ if (isset($_SERVER['HTTP_EMAIL']) && isset($_SERVER['PHP_AUTH_PW'])) {
$ssoHash = \RainLoop\Api::GetUserSsoHash($email, $password); $ssoHash = \RainLoop\Api::GetUserSsoHash($email, $password);
// redirect to webmail sso url // redirect to webmail sso url
\header('Location: https://domain.tldPATHTOCHANGE/app/index.php?sso&hash='.$ssoHash); \header('Location: https://domain.tldROOTTOCHANGE/app/index.php?sso&hash='.$ssoHash);
} }
else { else {
\header('Location: https://domain.tldPATHTOCHANGE/app/index.php'); \header('Location: https://domain.tldROOTTOCHANGE/app/index.php');
} }