Handle not stored password correctly.

This commit is contained in:
Klaas Freitag 2013-02-11 14:21:53 +01:00
parent 8d9336f9f4
commit 6d984b505d
4 changed files with 22 additions and 1 deletions

View file

@ -462,10 +462,12 @@ void MirallConfigFile::acceptCustomConfig()
QString url = ownCloudUrl();
QString user = ownCloudUser();
QString pwd = ownCloudPasswd();
bool allow = passwordStorageAllowed();
if( pwd.isEmpty() ) {
qDebug() << "Password is empty, skipping to write cred store.";
} else {
CredentialStore::instance()->setCredentials(url, user, pwd);
CredentialStore::instance()->setCredentials(url, user, pwd, allow);
CredentialStore::instance()->saveCredentials();
}
}

View file

@ -366,6 +366,10 @@ void OwncloudSetupWizard::startWizard(bool intro)
if( !user.isEmpty() ) {
_ocWizard->setOCUser( user );
}
bool doStore = cfgFile.passwordStorageAllowed();
_ocWizard->setAllowPasswordStorage( doStore );
if (intro)
_ocWizard->setStartId(OwncloudWizard::Page_oCWelcome);
else

View file

@ -117,6 +117,11 @@ void OwncloudSetupPage::setOCUser( const QString & user )
}
}
void OwncloudSetupPage::setAllowPasswordStorage( bool allow )
{
_ui.cbNoPasswordStore->setChecked( ! allow );
}
void OwncloudSetupPage::setOCUrl( const QString& newUrl )
{
QString url( newUrl );
@ -605,7 +610,15 @@ void OwncloudWizard::setOCUser( const QString& user )
#else
OwncloudWizardSelectTypePage *p = static_cast<OwncloudWizardSelectTypePage*>(page( Page_SelectType ));
#endif
}
void OwncloudWizard::setAllowPasswordStorage( bool allow )
{
#ifdef OWNCLOUD_CLIENT
OwncloudSetupPage *p = static_cast<OwncloudSetupPage*>(page(Page_oCSetup));
if( p )
p->setAllowPasswordStorage( allow );
#endif
}
} // end namespace

View file

@ -42,6 +42,7 @@ public:
virtual int nextId() const;
void setOCUrl( const QString& );
void setOCUser( const QString& );
void setAllowPasswordStorage( bool );
protected slots:
void slotPwdStoreChanged( int );
@ -76,6 +77,7 @@ public:
void setOCUrl( const QString& );
void setOCUser( const QString& );
void setAllowPasswordStorage( bool );
void setupCustomMedia( QVariant, QLabel* );
QString ocUrl() const;