summaryrefslogtreecommitdiff
path: root/libopie2
Side-by-side diff
Diffstat (limited to 'libopie2') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiesecurity/multiauthcommon.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/libopie2/opiesecurity/multiauthcommon.cpp b/libopie2/opiesecurity/multiauthcommon.cpp
index d8e26d5..9de62d2 100644
--- a/libopie2/opiesecurity/multiauthcommon.cpp
+++ b/libopie2/opiesecurity/multiauthcommon.cpp
@@ -52,48 +52,57 @@ bool SecOwnerDlg::eventFilter(QObject *o, QEvent *e)
return QWidget::eventFilter(o, e);
}
void SecOwnerDlg::mousePressEvent( QMouseEvent * ) { accept(); }
namespace Internal {
/// run plugins until we reach nbSuccessMin successes
int runPlugins() {
SecOwnerDlg *oi = 0;
// see if there is contact information.
QString vfilename = Global::applicationFileName("addressbook",
"businesscard.vcf");
if (QFile::exists(vfilename)) {
Contact c;
c = Contact::readVCard( vfilename )[0];
oi = new SecOwnerDlg(0, 0, c, TRUE, TRUE);
}
Config config("Security");
config.setGroup("Plugins");
QStringList plugins = config.readListEntry("IncludePlugins", ',');
+ /* if there are no configured plugins, we simply return 0 to
+ * let the user in:
+ */
+ if (plugins.isEmpty() == true) {
+ owarn << "No authentication plugin has been configured yet!" << oendl;
+ odebug << "Letting the user in..." << oendl;
+ if(oi) delete oi;
+ return 0;
+ }
config.setGroup("Misc");
int nbSuccessMin = config.readNumEntry("nbSuccessMin", 1);
int nbSuccess = 0;
/* tries to launch successively each plugin in $OPIEDIR/plugins/security
* directory which file name is in Security.conf / [Misc] / IncludePlugins
*/
QString path = QPEApplication::qpeDir() + "/plugins/security";
QStringList::Iterator libIt;
for ( libIt = plugins.begin(); libIt != plugins.end(); ++libIt ) {
QInterfacePtr<MultiauthPluginInterface> iface;
QLibrary *lib = new QLibrary( path + "/" + *libIt );
if ( lib->queryInterface(
IID_MultiauthPluginInterface,
(QUnknownInterface**)&iface ) == QS_OK )
{
// the plugin is a true Multiauth plugin
odebug << "Accepted plugin: " << QString( path + "/" + *libIt ) << oendl;
odebug << "Plugin name: " << iface->plugin()->pluginName() << oendl;
int resultCode;
int tries = 0;