diff --git a/inc/lib_base.php b/inc/lib_base.php
index 2516361d4d3..2da7713db6c 100755
--- a/inc/lib_base.php
+++ b/inc/lib_base.php
@@ -69,7 +69,7 @@ require_once('lib_log.php');
require_once('lib_config.php');
// load plugins
-$CONFIG_LOADPLUGINS='';
+$CONFIG_LOADPLUGINS='music';
$plugins=explode(' ',$CONFIG_LOADPLUGINS);
if(isset($plugins[0]['url'])) foreach($plugins as $plugin) require_once('plugins/'.$plugin.'/lib_'.$plugin.'.php');
@@ -185,12 +185,13 @@ class OC_UTIL {
*/
public static function shownavigation(){
global $WEBROOT;
+ global $SERVERROOT;
echo('
');
echo('| '.$_SESSION['username'].' | ');
if($_SERVER['SCRIPT_NAME']==$WEBROOT.'/index.php') echo('Files | '); else echo('Files | ');
foreach(OC_UTIL::$NAVIGATION as $NAVI) {
- if($_SERVER['SCRIPT_NAME']==$SERVERROOT.$WEBROOT.$NAVI['url']) echo(''.$NAVI['name'].' | '); else echo(''.$NAVI['name'].' | ');
+ if(dirname($_SERVER['SCRIPT_NAME'])==$WEBROOT.$NAVI['url']) echo(''.$NAVI['name'].' | '); else echo(''.$NAVI['name'].' | ');
}
if($_SERVER['SCRIPT_NAME']==$WEBROOT.'/log/index.php') echo('Log | '); else echo('Log | ');
diff --git a/inc/lib_config.php b/inc/lib_config.php
index 9a1c56d7e78..e31dcea7f83 100644
--- a/inc/lib_config.php
+++ b/inc/lib_config.php
@@ -28,15 +28,22 @@ class OC_CONFIG{
global $CONFIG_DBNAME;
global $CONFIG_DBUSER;
global $CONFIG_DBPASSWORD;
-
+ global $CONFIG_ADMINLOGIN;
+ global $CONFIG_ADMINPASSWORD;
if(isset($_POST['set_config'])){
//checkdata
$error='';
-
+ $FIRSTRUN=empty($CONFIG_ADMINLOGIN);
+ if(!$FIRSTRUN){
+ if($_POST['currentpassword']!=$CONFIG_ADMINPASSWORD){
+ $error.='wrong password';
+ }
+ }
+
if(!isset($_POST['adminlogin']) or empty($_POST['adminlogin'])) $error.='admin login not set
';
- if(!isset($_POST['adminpassword']) or empty($_POST['adminpassword'])) $error.='admin password not set
';
- if(!isset($_POST['adminpassword2']) or empty($_POST['adminpassword2'])) $error.='retype admin password not set
';
+ if(!isset($_POST['adminpassword']) or empty($_POST['adminpassword']) and $FIRSTRUN) $error.='admin password not set
';
+ if(!isset($_POST['adminpassword2']) or empty($_POST['adminpassword2']) and $FIRSTRUN) $error.='retype admin password not set
';
if(!isset($_POST['datadirectory']) or empty($_POST['datadirectory'])) $error.='data directory not set
';
if(!isset($_POST['dateformat']) or empty($_POST['dateformat'])) $error.='dteformat not set
';
if(!isset($_POST['dbhost']) or empty($_POST['dbhost'])) $error.='database host not set
';
@@ -46,7 +53,10 @@ class OC_CONFIG{
if(!isset($_POST['dbpassword2']) or empty($_POST['dbpassword2'])) $error.='retype database password not set
';
if($_POST['dbpassword']<>$_POST['dbpassword2'] ) $error.='database passwords are not the same
';
if($_POST['adminpassword']<>$_POST['adminpassword2'] ) $error.='admin passwords are not the same
';
-
+
+ if(!isset($_POST['adminpassword']) or empty($_POST['adminpassword']) and !$FIRSTRUN){
+ $_POST['adminpassword']=$CONFIG_ADMINPASSWORD;
+ }
if(empty($error)) {
//create/fill database
diff --git a/inc/templates/configform.php b/inc/templates/configform.php
index f981eae1c25..c78006c375c 100755
--- a/inc/templates/configform.php
+++ b/inc/templates/configform.php
@@ -1,6 +1,5 @@
@@ -13,9 +12,15 @@ document.getElementById('dbAdminPwd').style.display=(show)?'table-row':'none';
\ No newline at end of file
diff --git a/inc/templates/header.php b/inc/templates/header.php
index b5b7538f8af..57e45e708a9 100755
--- a/inc/templates/header.php
+++ b/inc/templates/header.php
@@ -12,7 +12,9 @@ echo('ownCloud
// check if already configured. otherwise start configuration wizard
$error=OC_CONFIG::writeconfiglisener();
+ echo $error;
if(empty($CONFIG_ADMINLOGIN)) {
+ $FIRSTRUN=true;
echo('');
echo('
'.$error.'
');
echo('
First Run Wizard
');
diff --git a/settings/index.php b/settings/index.php
index a34a551e922..7cdb993e45e 100755
--- a/settings/index.php
+++ b/settings/index.php
@@ -24,11 +24,10 @@
require_once('../inc/lib_base.php');
+
OC_UTIL::showheader();
-//uncheck the create and fill db options on default.
-$createDB=false;
-$fillDB=false;
+$FIRSTRUN=false;
echo('
');
OC_CONFIG::showconfigform();