Hello,

I tried out owncloud in my home network. Because my Server is running php-fcgid, I had to patch owncloud.php . After successful work I found a bug while trying to relogin, so I thought that I could provide a patch for this.

I added all files as attachment to this mail:

* loginform-login_after_logout.patch
Because it was not possible to relogin after pressing logout button, I removed "loginbutton=1" from REQUEST_URI
  for login form
* owncloud-webdav-fcgid.patch & htaccess
This files are necessary to run owncloud with a separate user with php5-fcgid. The patch as provided allows to run
  owncloud with fcgid enabled or not.

Hope this is helpful for someone.

Regards, schnere


<IfModule mod_fcgid.c>
  <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
  </IfModule> 
</IfModule>
--- /home/schnere/owncloud/inc/templates/loginform.php	2010-07-08 00:18:00.938685606 +0200
+++ /var/www/owncloud/htdocs/inc/templates/loginform.php	2010-07-12 15:45:20.000000000 +0200
@@ -1,7 +1,8 @@
 <?php
 if(isset($loginresult) and $loginresult=='error') echo('<p class="errortext">login failed</p>');
+$sRequestUri = preg_replace("/logoutbutton=1/","",$_SERVER['REQUEST_URI']);
 ?>
-<form method="post" enctype="multipart/form-data" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
+<form method="post" enctype="multipart/form-data" action="<?=$sRequestUri?>">
 <table cellpadding="5" cellspacing="5" border="0" class="loginform">
 <tr><td>login:</td><td><input type="text" name="login" size="30" class="formstyle"></input></td></tr>
 <tr><td>password:</td><td><input type="password" name="password" size="30" class="formstyle"></input></td></tr>
--- /home/schnere/owncloud/webdav/owncloud.php	2010-07-08 00:18:00.951187608 +0200
+++ /var/www/owncloud/htdocs/webdav/owncloud.php	2010-07-12 15:48:43.000000000 +0200
@@ -30,6 +30,9 @@
 #ini_set('error_reporting', '');
 ob_clean();
 
+if(empty($_SERVER['PHP_AUTH_USER']))
+  list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':' , base64_decode(substr($_SERVER['AUTHORIZATION'], 6))); 
+
 if(empty($_SERVER['PHP_AUTH_USER']) && empty($_SERVER['REDIRECT_REMOTE_USER'])) {
   header('WWW-Authenticate: Basic realm="ownCloud"');
   header('HTTP/1.0 401 Unauthorized');
_______________________________________________
Owncloud mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/owncloud

Reply via email to