[TASK] Installer: Ask for username during initial setup 82/22982/2
authorStefan Neufeind <typo3.neufeind@speedpartner.de>
Fri, 9 Aug 2013 06:55:01 +0000 (08:55 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Mon, 12 Aug 2013 16:38:23 +0000 (18:38 +0200)
Good security-practice is to choose a username different
than "admin".

Change-Id: Ib4a70b491f1f9a9112b8cd37db43664186d7192d
Resolves: #50949
Releases: 6.2
Reviewed-on: https://review.typo3.org/22982
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/install/Classes/Controller/Action/Step/DatabaseData.php
typo3/sysext/install/Resources/Private/Templates/Action/Step/DatabaseData.html

index 643ebe6..61000c9 100644 (file)
@@ -44,6 +44,8 @@ class DatabaseData extends Action\AbstractAction implements StepInterface {
 
                $postValues = $this->postValues['values'];
 
+               $username = strlen($postValues['username']) ? $postValues['username'] : 'admin';
+
                // Check password and return early if not good enough
                $password = $postValues['password'];
                if (strlen($password) < 8) {
@@ -68,7 +70,7 @@ class DatabaseData extends Action\AbstractAction implements StepInterface {
                // Password is simple md5 here for now, will be updated by saltedpasswords on first login
                // @TODO: Handle saltedpasswords in installer and store password salted in the first place
                $adminUserFields = array(
-                       'username' => 'admin',
+                       'username' => $username,
                        'password' => md5($password),
                        'admin' => 1,
                        'tstamp' => $GLOBALS['EXEC_TIME'],
index fde062d..bff0060 100644 (file)
@@ -8,7 +8,7 @@
 
        <p>
                Import basic database structure and create a backend administrator user.
-               The password can be used to log in to the install tool and to the TYPO3 CMS backend with username "admin".
+               The password can be used to log in to the install tool and to the TYPO3 CMS backend (default: with username "admin").
        </p>
 
        <p>
                <fieldset class="t3-install-form-label-width-7">
                        <ol>
                                <li>
+                                       <label for="password">Username</label>
+                                       <input
+                                               class="t3-install-form-input-text"
+                                               name="install[values][username]"
+                                               id="username"
+                                               placeholder="admin"
+                                       />
+                               </li>
+
+                               <li>
                                        <label for="password">Password</label>
                                        <input
                                                class="t3-install-form-input-text t3-install-form-password-strength"