[PC-BSD Commits] r17998 - pcbsd/current/src-qt4/pc-adsldap

svn at pcbsd.org svn at pcbsd.org
Mon Jul 30 12:17:12 PDT 2012


Author: kris
Date: 2012-07-30 19:17:12 +0000 (Mon, 30 Jul 2012)
New Revision: 17998

Modified:
   pcbsd/current/src-qt4/pc-adsldap/adsldap.cpp
Log:

Fix the logic in how we save AD config, and when to stop the service



Modified: pcbsd/current/src-qt4/pc-adsldap/adsldap.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-adsldap/adsldap.cpp	2012-07-30 19:05:45 UTC (rev 17997)
+++ pcbsd/current/src-qt4/pc-adsldap/adsldap.cpp	2012-07-30 19:17:12 UTC (rev 17998)
@@ -53,8 +53,6 @@
    settings.setValue("AdminName", lineADSAdminName->text());
    settings.setValue("AdminPW", lineADSAdminPW->text());
 
-
-
    QSettings settings2("PCBSD", "LDAP");
    settings2.setValue("Enabled", groupLDAP->isChecked());
    settings2.setValue("AnonBinding", checkLDAnonBinding->isChecked());
@@ -132,14 +130,9 @@
   Utils::setConfFileValue(ADCONF, "ad_netbiosname =", "ad_netbiosname = " + lineADSNetBIOS->text().toUpper(), -1);
   
   // Restart AD service if enabled   
-  if ( groupADS->isChecked() ) {
-     Utils::setConfFileValue("/etc/rc.conf", "activedirectory_enable=", "activedirectory_enable=\"YES\"", -1);
-     Utils::runShellCommand("/usr/local/etc/rc.d/pc-adctl start");
-  } else {
-     Utils::runShellCommand("/usr/local/etc/rc.d/pc-adctl stop");
-     Utils::setConfFileValue("/etc/rc.conf", "activedirectory_enable=", "activedirectory_enable=\"NO\"", -1);
-  }
-
+  qDebug() << "Enabling AD";
+  Utils::setConfFileValue("/etc/rc.conf", "activedirectory_enable=", "activedirectory_enable=\"YES\"", -1);
+  Utils::runShellCommand("/usr/local/etc/rc.d/pc-adctl start");
 }
 
 void pcADSLDAP::exportLDAP()
@@ -150,8 +143,14 @@
 void pcADSLDAP::exportSettings()
 {
   // Start adding AD.conf values
-  if ( groupADS->isChecked() )
+  if ( groupADS->isChecked() ) {
     exportAD();
+  } else {
+     qDebug() << "Disabling AD";
+     Utils::runShellCommand("/usr/local/etc/rc.d/pc-adctl stop");
+     Utils::setConfFileValue("/etc/rc.conf", "activedirectory_enable=", "activedirectory_enable=\"NO\"", -1);
+  }
+
   if ( groupLDAP->isChecked() )
     exportLDAP();
 }



More information about the Commits mailing list