]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add protection for non-authorized char in installation form
authorBrice Maron <brice@bmaron.net>
Mon, 7 May 2012 22:12:30 +0000 (22:12 +0000)
committerBrice Maron <brice@bmaron.net>
Mon, 7 May 2012 22:12:30 +0000 (22:12 +0000)
lib/setup.php

index 24d055923777996751c1e8b69c7417d6c0716fb0..59e4bf0dee2b553af59e701ae47b10cb1c4d719e 100644 (file)
@@ -221,12 +221,18 @@ class OC_Setup {
                                OC_DB::createDbFromStructure('db_structure.xml');
                        }
 
+                       //create the user and group
+                       try {
+                               OC_User::createUser($username, $password);
+                       }
+                       catch(Exception $exception) {
+                               $error[] = $exception->getMessage();
+                       }
+
                        if(count($error) == 0) {
                                OC_Appconfig::setValue('core', 'installedat',microtime(true));
                                OC_Appconfig::setValue('core', 'lastupdatedat',microtime(true));
 
-                               //create the user and group
-                               OC_User::createUser($username, $password);
                                OC_Group::createGroup('admin');
                                OC_Group::addToGroup($username, 'admin');
                                OC_User::login($username, $password);