mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-17 10:27:13 -05:00
Added support for Auto-login
- added checkbox in start dialog including warning (autologin not safe) - added check box in gen setting to disable autologin on shutdown git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2689 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
f38c060fb6
commit
6b8f62d8f0
@ -210,7 +210,9 @@ void GenCertDialog::genPerson()
|
||||
std::cerr << " generating sslPasswd." << std::endl;
|
||||
qsrand(time(NULL));
|
||||
std::string sslPasswd = "";
|
||||
for( int i = 0 ; i < 6 ; ++i )
|
||||
const int PWD_LEN = RsInit::getSslPwdLen();
|
||||
|
||||
for( int i = 0 ; i < PWD_LEN ; ++i )
|
||||
{
|
||||
int iNumber;
|
||||
iNumber = qrand()%25 + 65;
|
||||
|
@ -55,7 +55,9 @@ StartDialog::StartDialog(QWidget *parent, Qt::WFlags flags)
|
||||
|
||||
ui.loadButton->setFocus();
|
||||
|
||||
|
||||
connect(ui.loadButton, SIGNAL(clicked()), this, SLOT(loadPerson()));
|
||||
connect(ui.autologin_checkbox, SIGNAL(clicked()), this, SLOT(notSecureWarning()));
|
||||
|
||||
/* load the Certificate File name */
|
||||
std::string userName;
|
||||
@ -154,7 +156,8 @@ void StartDialog::loadPerson()
|
||||
void StartDialog::loadCertificates()
|
||||
{
|
||||
/* Final stage of loading */
|
||||
if (RsInit::LoadCertificates(false))
|
||||
|
||||
if (RsInit::LoadCertificates(ui.autologin_checkbox->isChecked()))
|
||||
{
|
||||
close();
|
||||
}
|
||||
@ -168,13 +171,15 @@ void StartDialog::loadCertificates()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void StartDialog::on_labelProfile_linkActivated(QString link)
|
||||
{
|
||||
//static GenCertDialog *gencertdialog = new GenCertDialog();
|
||||
//gencertdialog->show();
|
||||
|
||||
QMessageBox::StandardButton sb = QMessageBox::question ( NULL,
|
||||
tr("Create a New Profil"),
|
||||
tr("Create a New Profile"),
|
||||
tr("This will generate a new Profile\n Are you sure you want to continue"),
|
||||
(QMessageBox::Ok | QMessageBox::No));
|
||||
|
||||
@ -200,3 +205,15 @@ LogoBar & StartDialog::getLogoBar() const {
|
||||
return *_rsLogoBar;
|
||||
}
|
||||
|
||||
void StartDialog::notSecureWarning() {
|
||||
|
||||
/* some error msg */
|
||||
if(ui.autologin_checkbox->isChecked()){
|
||||
QMessageBox::StandardButton sb = QMessageBox::warning ( NULL,
|
||||
tr("Insecure"),
|
||||
tr("Auto Login is not Secure: Password stored on disk"),
|
||||
QMessageBox::Ok);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -60,6 +60,11 @@ private slots:
|
||||
|
||||
void closeinfodlg();
|
||||
void loadPerson();
|
||||
|
||||
/**
|
||||
* Warns the user that autologin is not secure
|
||||
*/
|
||||
void notSecureWarning();
|
||||
|
||||
void on_labelProfile_linkActivated(QString link);
|
||||
void on_labelInfo_linkActivated(QString link);
|
||||
|
@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>291</width>
|
||||
<height>403</height>
|
||||
<height>433</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="palette">
|
||||
@ -435,7 +435,7 @@
|
||||
<string>RetroShare</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="images.qrc">
|
||||
<iconset resource="../../../../retroshare-v0.5.0/retroshare-gui/src/gui/images.qrc">
|
||||
<normaloff>:/images/rstray3.png</normaloff>:/images/rstray3.png</iconset>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
@ -498,7 +498,7 @@ border-image: url(:/images/avatar_background.png);
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="images.qrc">
|
||||
<iconset resource="../../../../retroshare-v0.5.0/retroshare-gui/src/gui/images.qrc">
|
||||
<normaloff>:/images/user/personal64.png</normaloff>:/images/user/personal64.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
@ -581,6 +581,44 @@ p, li { white-space: pre-wrap; }
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="7" column="0" colspan="4">
|
||||
<widget class="QFrame" name="callBarFrame">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>65</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="2">
|
||||
<widget class="QLabel" name="labelInfo">
|
||||
<property name="text">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="Info"><span style=" font-size:8pt; text-decoration: underline; color:#0000ff;">Info...</span></a></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QLabel" name="labelProfile">
|
||||
<property name="text">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="Create new Profile..."><span style=" text-decoration: underline; color:#0000ff;">Create new Profile...</span></a></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="4">
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<property name="topMargin">
|
||||
@ -630,86 +668,47 @@ p, li { white-space: pre-wrap; }
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="7" column="0" colspan="4">
|
||||
<widget class="QFrame" name="callBarFrame">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>65</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QLabel" name="labelProfile">
|
||||
<property name="text">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="Create new Profile..."><span style=" text-decoration: underline; color:#0000ff;">Create new Profile...</span></a></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="2">
|
||||
<widget class="QLabel" name="labelInfo">
|
||||
<property name="text">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="Info"><span style=" font-size:8pt; text-decoration: underline; color:#0000ff;">Info...</span></a></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="2">
|
||||
<item row="3" column="1" rowspan="2" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QComboBox" name="loadName"/>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Name (GPG Id) - location:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="loadName"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="autologin_checkbox">
|
||||
<property name="text">
|
||||
<string>Remember Password</string>
|
||||
</property>
|
||||
<property name="tristate">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>loadName</tabstop>
|
||||
<tabstop>loadButton</tabstop>
|
||||
<tabstop>toolButton</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="images.qrc"/>
|
||||
<include location="../../../../retroshare-v0.5.0/retroshare-gui/src/gui/images.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
@ -19,7 +19,9 @@
|
||||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
|
||||
#include "rshare.h"
|
||||
#include <iostream>
|
||||
#include <rshare.h>
|
||||
#include <rsiface/rsinit.h>
|
||||
#include "GeneralPage.h"
|
||||
#include <util/stringutil.h>
|
||||
#include <QSystemTrayIcon>
|
||||
@ -34,12 +36,16 @@ GeneralPage::GeneralPage(QWidget * parent, Qt::WFlags flags)
|
||||
/* Create RshareSettings object */
|
||||
_settings = new RshareSettings();
|
||||
|
||||
connect(ui.autoLogin, SIGNAL(clicked()), this, SLOT(setAutoLogin()));
|
||||
|
||||
/* Hide platform specific features */
|
||||
#ifndef Q_WS_WIN
|
||||
ui.chkRunRetroshareAtSystemStartup->setVisible(false);
|
||||
|
||||
#endif
|
||||
|
||||
ui.autoLogin->setChecked(RsInit::getAutoLogin());
|
||||
|
||||
}
|
||||
|
||||
/** Destructor */
|
||||
@ -103,3 +109,7 @@ GeneralPage::toggleShowOnStartup(bool checked)
|
||||
//RshareSettings _settings;
|
||||
_settings->setShowMainWindowAtStart(checked);
|
||||
}
|
||||
|
||||
void GeneralPage::setAutoLogin(){
|
||||
RsInit::setAutoLogin(ui.autoLogin->isChecked());
|
||||
}
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include <QLineEdit>
|
||||
|
||||
#include "rsharesettings.h"
|
||||
#include "rsiface/rsiface.h"
|
||||
|
||||
#include "configpage.h"
|
||||
#include "ui_GeneralPage.h"
|
||||
@ -57,6 +58,11 @@ private slots:
|
||||
/** Called when the "show on startup" checkbox is toggled. */
|
||||
void toggleShowOnStartup(bool checked);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
void setAutoLogin();
|
||||
|
||||
private:
|
||||
/** A RetroShare Settings object used for saving/loading settings */
|
||||
RshareSettings *_settings;
|
||||
|
@ -555,6 +555,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QCheckBox" name="autoLogin">
|
||||
<property name="text">
|
||||
<string>Auto Login</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -116,8 +116,8 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else
|
||||
{
|
||||
/* don't save auto login details */
|
||||
RsInit::LoadCertificates(false);
|
||||
// true: note auto-login is active
|
||||
RsInit::LoadCertificates(true);
|
||||
}
|
||||
|
||||
rsicontrol->StartupRetroShare();
|
||||
|
Loading…
Reference in New Issue
Block a user