summaryrefslogtreecommitdiffstats
path: root/inc
diff options
context:
space:
mode:
authorRobin <robin@Amaya.(none)>2010-04-23 18:27:36 +0200
committerRobin <robin@Amaya.(none)>2010-04-23 18:27:36 +0200
commit9be88c0080263b3ac4106b277520705415d74e3f (patch)
treecbfd2df83e2d306fd8b9c2d4755774bba94195ca /inc
parent4fcc717d534f0d049addb363adc5d51e3b5a03f8 (diff)
downloadnextcloud-server-9be88c0080263b3ac4106b277520705415d74e3f.tar.gz
nextcloud-server-9be88c0080263b3ac4106b277520705415d74e3f.zip
bug fix first run wizzard take 3
Diffstat (limited to 'inc')
-rwxr-xr-xinc/lib_config.php28
1 files changed, 19 insertions, 9 deletions
diff --git a/inc/lib_config.php b/inc/lib_config.php
index bf9dd5fd3d8..70de1b96d7e 100755
--- a/inc/lib_config.php
+++ b/inc/lib_config.php
@@ -26,24 +26,34 @@ class OC_CONFIG{
global $CONFIG_DATEFORMAT;
global $CONFIG_DBNAME;
global $CONFIG_INSTALLED;
- if(OC_USER::ingroup($_SESSION['username'],'admin') or $CONFIG_INSTALLED==false){
+ $allow=false;
+ if(!$CONFIG_INSTALLED){
+ $allow=true;
+ }elseif(OC_USER::isLoggedIn()){
+ if(OC_USER::ingroup($_SESSION['username'],'admin')){
+ $allow=true;
+ }
+ }
+ if($allow){
require('templates/adminform.php');
}
}
public static function createuserlisener(){
- if(OC_USER::ingroup($_SESSION['username'],'admin')){
- if(isset($_POST['new_username']) and isset($_POST['new_password'])){
- if(OC_USER::createuser($_POST['new_username'],$_POST['new_password'])){
- return 'user successfully created';
+ if(OC_USER::isLoggedIn()){
+ if(OC_USER::ingroup($_SESSION['username'],'admin')){
+ if(isset($_POST['new_username']) and isset($_POST['new_password'])){
+ if(OC_USER::createuser($_POST['new_username'],$_POST['new_password'])){
+ return 'user successfully created';
+ }else{
+ return 'error while trying to create user';
+ }
}else{
- return 'error while trying to create user';
+ return false;
}
}else{
return false;
}
- }else{
- return false;
}
}
@@ -107,7 +117,7 @@ class OC_CONFIG{
public static function writeadminlisener(){
global $CONFIG_INSTALLED;
$allow=false;
- if($CONFIG_INSTALLED==false){
+ if(!$CONFIG_INSTALLED){
$allow=true;
}elseif(OC_USER::isLoggedIn()){
if(OC_USER::ingroup($_SESSION['username'],'admin')){