Browse Source

use our own serverHost call so that ownCloud works with reverse proxy servers

tags/v4.5.0beta1
Frank Karlitschek 12 years ago
parent
commit
d4ea853fcf

+ 2
- 2
apps/files_sharing/ajax/email.php View File

$subject = $user.' shared a '.$type.' with you'; $subject = $user.' shared a '.$type.' with you';
$link = $_POST['link']; $link = $_POST['link'];
$text = $user.' shared the '.$type.' '.$_POST['file'].' with you. It is available for download here: '.$link; $text = $user.' shared the '.$type.' '.$_POST['file'].' with you. It is available for download here: '.$link;
$fromaddress = OCP\Config::getUserValue($user, 'settings', 'email', 'sharing-noreply@'.$_SERVER['HTTP_HOST']);
$fromaddress = OCP\Config::getUserValue($user, 'settings', 'email', 'sharing-noreply@'.OCP\Util::getServerHost());
OC_Mail::send($_POST['toaddress'], $_POST['toaddress'], $subject, $text, $fromaddress, $user); OC_Mail::send($_POST['toaddress'], $_POST['toaddress'], $subject, $text, $fromaddress, $user);


?>
?>

+ 1
- 1
apps/user_openid/phpmyid.php View File

//Determine the requested URL - DO NOT OVERRIDE //Determine the requested URL - DO NOT OVERRIDE
$profile['req_url'] = sprintf("%s://%s%s", $profile['req_url'] = sprintf("%s://%s%s",
$proto, $proto,
$_SERVER['HTTP_HOST'],
OCP\Util::getServerHost(),
// $port,//host already includes the path // $port,//host already includes the path
$_SERVER["REQUEST_URI"]); $_SERVER["REQUEST_URI"]);



+ 2
- 2
apps/user_openid/user_openid.php View File

// Get identity from user and redirect browser to OpenID Server // Get identity from user and redirect browser to OpenID Server
$openid = new SimpleOpenID; $openid = new SimpleOpenID;
$openid->SetIdentity($uid); $openid->SetIdentity($uid);
$openid->SetTrustRoot('http://' . $_SERVER["HTTP_HOST"]);
$openid->SetTrustRoot('http://' . OCP\Util::getServerHost());
if ($openid->GetOpenIDServer()){ if ($openid->GetOpenIDServer()){
$openid->SetApprovedURL('http://' . $_SERVER["HTTP_HOST"] . OC::$WEBROOT); // Send Response from OpenID server to this script
$openid->SetApprovedURL('http://' . OCP\Util::getServerHost() . OC::$WEBROOT); // Send Response from OpenID server to this script
$openid->Redirect(); // This will redirect user to OpenID Server $openid->Redirect(); // This will redirect user to OpenID Server
exit; exit;
}else{ }else{

+ 1
- 1
core/lostpassword/index.php View File

$tmpl->assign('link', $link); $tmpl->assign('link', $link);
$msg = $tmpl->fetchPage(); $msg = $tmpl->fetchPage();
$l = OC_L10N::get('core'); $l = OC_L10N::get('core');
$from = 'lostpassword-noreply@' . $_SERVER['HTTP_HOST'];
$from = 'lostpassword-noreply@' . OCP\Util::getServerHost();
$r=mail($email, $l->t('Owncloud password reset'), $msg, 'From:' . $from); $r=mail($email, $l->t('Owncloud password reset'), $msg, 'From:' . $from);
OC_MAIL::send($email,$_POST['user'],$l->t('ownCloud password reset'),$msg,$from,'ownCloud'); OC_MAIL::send($email,$_POST['user'],$l->t('ownCloud password reset'),$msg,$from,'ownCloud');
echo('sent'); echo('sent');

+ 2
- 2
lib/ocs.php View File

*/ */
private static function apiConfig($format) { private static function apiConfig($format) {
$user=OC_OCS::checkpassword(false); $user=OC_OCS::checkpassword(false);
$url=substr($_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'],0,-11).'';
$url=substr(OCP\Util::getServerHost().$_SERVER['SCRIPT_NAME'],0,-11).'';


$xml['version']='1.5'; $xml['version']='1.5';
$xml['website']='ownCloud'; $xml['website']='ownCloud';
$xml['host']=$_SERVER['HTTP_HOST'];
$xml['host']=OCP\Util::getServerHost();
$xml['contact']=''; $xml['contact']='';
$xml['ssl']='false'; $xml['ssl']='false';
echo(OC_OCS::generatexml($format,'ok',100,'',$xml,'config','',1)); echo(OC_OCS::generatexml($format,'ok',100,'',$xml,'config','',1));

+ 1
- 1
ocs/providers.php View File



require_once('../lib/base.php'); require_once('../lib/base.php');


$url='http://'.substr($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'],0,-17).'ocs/v1.php/';
$url='http://'.substr(OCP\Util::getServerHost().$_SERVER['REQUEST_URI'],0,-17).'ocs/v1.php/';


echo(' echo('
<providers> <providers>

Loading…
Cancel
Save