diff options
author | Robin <robin@Amaya.(none)> | 2010-03-15 15:41:53 +0100 |
---|---|---|
committer | Robin <robin@Amaya.(none)> | 2010-03-15 15:41:53 +0100 |
commit | 35b9aabd0185b1e3dffac7a8138b3940cca64f72 (patch) | |
tree | 155e4e9aa843adcc68ba807df037f0072218b2a2 | |
parent | 6bb0022345cb36d510d57bcae6a52e1f5fb0174d (diff) | |
download | nextcloud-server-35b9aabd0185b1e3dffac7a8138b3940cca64f72.tar.gz nextcloud-server-35b9aabd0185b1e3dffac7a8138b3940cca64f72.zip |
do not asume owncloud is installed in the root of the webserver
-rwxr-xr-x | inc/lib_base.php | 23 | ||||
-rwxr-xr-x | inc/templates/loginform.php | 2 | ||||
-rwxr-xr-x | index.php | 6 |
3 files changed, 16 insertions, 15 deletions
diff --git a/inc/lib_base.php b/inc/lib_base.php index 20d7ef04cb6..227e616bcd1 100755 --- a/inc/lib_base.php +++ b/inc/lib_base.php @@ -57,7 +57,7 @@ class OC_USER { * check if the login button is pressed and logg the user in * */ - public static function loginlistener(){ + public static function loginlisener(){ global $CONFIG_ADMINLOGIN; global $CONFIG_ADMINPASSWORD; if(isset($_POST['loginbutton']) and isset($_POST['password']) and isset($_POST['login'])){ @@ -74,7 +74,7 @@ class OC_USER { * check if the logout button is pressed and logout the user * */ - public static function logoutlistener(){ + public static function logoutlisener(){ if(isset($_GET['logoutbutton'])){ OC_LOG::event($_SESSION['username'],2,''); if(isset($_SESSION['username'])) unset($_SESSION['username']); @@ -132,17 +132,18 @@ class OC_UTIL { * */ public static function shownavigation(){ + global $CONFIG_WEBROOT; echo('<table cellpadding="5" cellspacing="0" border="0"><tr>'); - echo('<td class="navigationitem1"><a href="/">'.$_SESSION['username'].'</a></td>'); - if($_SERVER['SCRIPT_NAME']=='/index.php') echo('<td class="navigationitemselected"><a href="/">Files</a></td>'); else echo('<td class="navigationitem"><a href="/">Files</a></td>'); + echo('<td class="navigationitem1"><a href="'.$CONFIG_WEBROOT.'/">'.$_SESSION['username'].'</a> <img src="/img/dots.png" border="0"></td>'); + if($_SERVER['SCRIPT_NAME']=='/index.php') echo('<td class="navigationitemselected"><a href="'.$CONFIG_WEBROOT.'/">Files</a></td>'); else echo('<td class="navigationitem"><a href="'.$CONFIG_WEBROOT.'/">Files</a></td>'); foreach(OC_UTIL::$NAVIGATION as $NAVI) { if($_SERVER['SCRIPT_NAME']==$NAVI['url']) echo('<td class="navigationitemselected"><a href="'.$NAVI['url'].'">'.$NAVI['name'].'</a></td>'); else echo('<td class="navigationitem"><a href="'.$NAVI['url'].'">'.$NAVI['name'].'</a></td>'); } - if($_SERVER['SCRIPT_NAME']=='/log/index.php') echo('<td class="navigationitemselected"><a href="/log">Log</a></td>'); else echo('<td class="navigationitem"><a href="/log">Log</a></td>'); - if($_SERVER['SCRIPT_NAME']=='/settings/index.php') echo('<td class="navigationitemselected"><a href="/settings">Settings</a></td>'); else echo('<td class="navigationitem"><a href="/settings">Settings</a></td>'); - echo('<td class="navigationitem"><a href="/?logoutbutton=1">Logout</a></td>'); + if($_SERVER['SCRIPT_NAME']=='/log/index.php') echo('<td class="navigationitemselected"><a href="'.$CONFIG_WEBROOT.'/log">Log</a></td>'); else echo('<td class="navigationitem"><a href="'.$CONFIG_WEBROOT.'/log">Log</a></td>'); + if($_SERVER['SCRIPT_NAME']=='/settings/index.php') echo('<td class="navigationitemselected"><a href="'.$CONFIG_WEBROOT.'/settings">Settings</a></td>'); else echo('<td class="navigationitem"><a href="'.$CONFIG_WEBROOT.'/settings">Settings</a></td>'); + echo('<td class="navigationitem"><a href="'.$CONFIG_WEBROOT.'?logoutbutton=1">Logout</a></td>'); echo('</tr></table>'); } @@ -152,7 +153,7 @@ class OC_UTIL { * */ public static function showloginform(){ - require('templates/loginform.php');; + require('templates/loginform.php'); } /** @@ -190,14 +191,14 @@ class OC_DB { $DBConnection = @new mysqli($CONFIG_DBHOST, $CONFIG_DBUSER, $CONFIG_DBPWD,$CONFIG_DBNAME); if (mysqli_connect_errno()) { @ob_end_clean(); - echo('<html><head></head><body class="error"><div class="center"><b>can not connect to database.</div></body></html>'); + echo('<html><head></head><body bgcolor="#F0F0F0"><br /><br /><center><b>can not connect to database.</center></body></html>'); exit(); } } $result = @$DBConnection->query($cmd); if (!$result) { - $entry='<p>DB Error: "'.$DBConnection->error.'"</p>'; - $entry.='<p>Offending command was: '.$cmd.'</p>'; + $entry='DB Error: "'.$DBConnection->error.'"<br />'; + $entry.='Offending command was: '.$cmd.'<br />'; echo($entry); } return $result; diff --git a/inc/templates/loginform.php b/inc/templates/loginform.php index da56f7e4e1b..d4543e25669 100755 --- a/inc/templates/loginform.php +++ b/inc/templates/loginform.php @@ -1,4 +1,4 @@ -<form method="post" enctype="multipart/form-data" action="/" > +<form method="post" enctype="multipart/form-data" action="<?php echo $GLOBALS['CONFIG_WEBROOT'] ?>/" > <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> diff --git a/index.php b/index.php index 438d2fef0df..75273f73cf9 100755 --- a/index.php +++ b/index.php @@ -32,14 +32,14 @@ if(isset($_GET['file'])) { }else{ - OC_USER::loginlistener(); - OC_USER::logoutlistener(); + OC_USER::loginlisener(); + OC_USER::logoutlisener(); OC_UTIL::showheader(); OC_FILES::showbrowser($CONFIG_DATADIRECTORY,$dir); - echo('<p class="hint">Hint: Mount it via webdav like this: <a href="webdav://'.$_SERVER["HTTP_HOST"].'/webdav/owncloud.php">webdav://'.$_SERVER["HTTP_HOST"].'/webdav/owncloud.php</a></p>'); + echo('<br /><br /><p class="hint">Hint: Mount it via webdav like this: <a href="webdav://'.$CONFIG_SITEROOT.'/webdav/owncloud.php">webdav://'.$CONFIG_SITEROOT.'/webdav/owncloud.php</a></p>'); OC_UTIL::showfooter(); |