Add setRootPassword option to the Users module.
If set to true, the user must set a root password. Otherwise, the user won't be asked and a root password will not be set.
This commit is contained in:
parent
d6441bbcb4
commit
46e90ccda2
@ -47,6 +47,7 @@ UsersPage::UsersPage( QWidget* parent )
|
||||
, m_readyHostname( false )
|
||||
, m_readyPassword( false )
|
||||
, m_readyRootPassword( false )
|
||||
, m_showRootPassword( true )
|
||||
{
|
||||
ui->setupUi( this );
|
||||
|
||||
@ -69,6 +70,8 @@ UsersPage::UsersPage( QWidget* parent )
|
||||
m_customUsername = false;
|
||||
m_customHostname = false;
|
||||
|
||||
setShowRootPassword( true );
|
||||
|
||||
CALAMARES_RETRANSLATE( ui->retranslateUi( this ); )
|
||||
}
|
||||
|
||||
@ -109,9 +112,12 @@ UsersPage::createJobs( const QString& defaultUserGroup, const QStringList& defau
|
||||
ui->textBoxUserPassword->text() );
|
||||
list.append( Calamares::job_ptr( j ) );
|
||||
|
||||
if ( m_showRootPassword )
|
||||
{
|
||||
j = new SetPasswordJob( "root",
|
||||
ui->textBoxRootPassword->text() );
|
||||
list.append( Calamares::job_ptr( j ) );
|
||||
}
|
||||
|
||||
j = new SetHostNameJob( ui->textBoxHostname->text() );
|
||||
list.append( Calamares::job_ptr( j ) );
|
||||
@ -134,6 +140,20 @@ UsersPage::onActivate()
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
UsersPage::setShowRootPassword( bool show )
|
||||
{
|
||||
ui->labelChooseRootPassword->setVisible( show );
|
||||
ui->labelExtraRootPassword->setVisible( show );
|
||||
ui->labelRootPassword->setVisible( show );
|
||||
ui->labelRootPasswordError->setVisible( show );
|
||||
ui->textBoxRootPassword->setVisible( show );
|
||||
ui->textBoxVerifiedRootPassword->setVisible( show );
|
||||
|
||||
m_showRootPassword = show;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
UsersPage::onFullNameTextEdited( const QString& textRef )
|
||||
{
|
||||
|
@ -45,6 +45,8 @@ public:
|
||||
|
||||
void onActivate();
|
||||
|
||||
void setShowRootPassword( bool show );
|
||||
|
||||
protected slots:
|
||||
void onFullNameTextEdited( const QString& );
|
||||
void fillSuggestions();
|
||||
@ -75,6 +77,7 @@ private:
|
||||
bool m_readyPassword;
|
||||
bool m_readyRootPassword;
|
||||
|
||||
bool m_showRootPassword;
|
||||
};
|
||||
|
||||
#endif // USERSPAGE_H
|
||||
|
@ -151,5 +151,13 @@ UsersViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
||||
Calamares::JobQueue::instance()->globalStorage()->insert( "sudoersGroup",
|
||||
configurationMap.value( "sudoersGroup" ).toString() );
|
||||
}
|
||||
|
||||
if ( configurationMap.contains( "setRootPassword" ) &&
|
||||
configurationMap.value( "setRootPassword" ).type() == QVariant::Bool )
|
||||
{
|
||||
Calamares::JobQueue::instance()->globalStorage()->insert( "setRootPassword",
|
||||
configurationMap.value( "setRootPassword" ).toBool() );
|
||||
m_widget->setShowRootPassword( configurationMap.value( "setRootPassword" ).toBool() );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -446,7 +446,7 @@
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="root_password_label_2">
|
||||
<widget class="QLabel" name="labelChooseRootPassword">
|
||||
<property name="text">
|
||||
<string>Choose a password for the administrator account.</string>
|
||||
</property>
|
||||
@ -548,7 +548,7 @@
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="password_extra_label_4">
|
||||
<widget class="QLabel" name="labelExtraRootPassword">
|
||||
<property name="styleSheet">
|
||||
<string>font-weight: normal</string>
|
||||
</property>
|
||||
@ -593,7 +593,7 @@
|
||||
<item row="0" column="1">
|
||||
<widget class="QRadioButton" name="checkBoxLoginAuto">
|
||||
<property name="text">
|
||||
<string>Log in automatically</string>
|
||||
<string>&Log in automatically</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
@ -603,7 +603,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QRadioButton" name="checkBoxLoginNormal">
|
||||
<property name="text">
|
||||
<string>Require my password to log in</string>
|
||||
<string>Require &my password to log in</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
|
@ -9,3 +9,4 @@ defaultGroups:
|
||||
- audio
|
||||
autologinGroup: autologin
|
||||
sudoersGroup: wheel
|
||||
setRootPassword: true
|
||||
|
Loading…
Reference in New Issue
Block a user