Ignore:
Timestamp:
Apr 12, 2013 8:40:12 AM (12 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, 9.1-release, 9.2-release, releng/10.0, releng/10.0.1
Children:
bb72d33
Parents:
afd00d6
Message:

Add all the changes for related using of split pcbsd-utils libs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/pc-adsldap/adsldap.cpp

    r1f0939e r0cfe72f  
    7777{ 
    7878  QSettings settings("PCBSD", "ADS"); 
    79   QString tmp = Utils::getConfFileValue("/etc/rc.conf", "pc_activedirectory_enable=", 1) ; 
     79  QString tmp = pcbsd::Utils::getConfFileValue("/etc/rc.conf", "pc_activedirectory_enable=", 1) ; 
    8080  if ( tmp == "YES" )  
    8181    groupADS->setChecked(true); 
     
    124124 
    125125  // Now write ADCONF values 
    126   Utils::setConfFileValue(ADCONF, "ad_domainname =", "ad_domainname = " + lineADSDomainName->text(), -1); 
    127   Utils::setConfFileValue(ADCONF, "ad_adminname =", "ad_adminname = " + lineADSAdminName->text(), -1); 
    128   Utils::setConfFileValue(ADCONF, "ad_adminpw =", "ad_adminpw = " + lineADSAdminPW->text(), -1); 
    129   Utils::setConfFileValue(ADCONF, "ad_workgroup =", "ad_workgroup = " + lineADSWorkgroup->text().toUpper(), -1); 
    130   Utils::setConfFileValue(ADCONF, "ad_netbiosname =", "ad_netbiosname = " + lineADSNetBIOS->text().toUpper(), -1); 
     126  pcbsd::Utils::setConfFileValue(ADCONF, "ad_domainname =", "ad_domainname = " + lineADSDomainName->text(), -1); 
     127  pcbsd::Utils::setConfFileValue(ADCONF, "ad_adminname =", "ad_adminname = " + lineADSAdminName->text(), -1); 
     128  pcbsd::Utils::setConfFileValue(ADCONF, "ad_adminpw =", "ad_adminpw = " + lineADSAdminPW->text(), -1); 
     129  pcbsd::Utils::setConfFileValue(ADCONF, "ad_workgroup =", "ad_workgroup = " + lineADSWorkgroup->text().toUpper(), -1); 
     130  pcbsd::Utils::setConfFileValue(ADCONF, "ad_netbiosname =", "ad_netbiosname = " + lineADSNetBIOS->text().toUpper(), -1); 
    131131   
    132132  if ( checkADSTrustedDomains->isChecked() ) 
    133     Utils::setConfFileValue(ADCONF, "ad_allow_trusted_doms =", "ad_allow_trusted_doms = yes", -1); 
     133    pcbsd::Utils::setConfFileValue(ADCONF, "ad_allow_trusted_doms =", "ad_allow_trusted_doms = yes", -1); 
    134134  else 
    135     Utils::setConfFileValue(ADCONF, "ad_allow_trusted_doms =", "ad_allow_trusted_doms = no", -1); 
     135    pcbsd::Utils::setConfFileValue(ADCONF, "ad_allow_trusted_doms =", "ad_allow_trusted_doms = no", -1); 
    136136 
    137137} 
     
    139139void pcADSLDAP::exportLDAP() 
    140140{ 
    141   Utils::setConfFileValue(LDCONF, "ldap_hostname =", "ldap_hostname = " + lineLDHostname->text(), -1); 
    142   Utils::setConfFileValue(LDCONF, "ldap_basedn =", "ldap_basedn = " + lineLDBaseDN->text(), -1); 
     141  pcbsd::Utils::setConfFileValue(LDCONF, "ldap_hostname =", "ldap_hostname = " + lineLDHostname->text(), -1); 
     142  pcbsd::Utils::setConfFileValue(LDCONF, "ldap_basedn =", "ldap_basedn = " + lineLDBaseDN->text(), -1); 
    143143  if ( checkLDAnonBinding->isChecked() ) 
    144      Utils::setConfFileValue(LDCONF, "ldap_anonbind =", "ldap_anonbind = yes", -1); 
     144     pcbsd::Utils::setConfFileValue(LDCONF, "ldap_anonbind =", "ldap_anonbind = yes", -1); 
    145145  else 
    146      Utils::setConfFileValue(LDCONF, "ldap_anonbind =", "ldap_anonbind = no", -1); 
    147   Utils::setConfFileValue(LDCONF, "ldap_rootbasedn =", "ldap_rootbasedn = " + lineLDRootBindDN->text(), -1); 
    148   Utils::setConfFileValue(LDCONF, "ldap_rootbindpw =", "ldap_rootbindpw = " + lineLDRootBindPW->text(), -1); 
    149   Utils::setConfFileValue(LDCONF, "ldap_rootbindpw =", "ldap_rootbindpw = " + lineLDRootBindPW->text(), -1); 
    150   Utils::setConfFileValue(LDCONF, "ldap_pwencryption =", "ldap_pwencryption = " + comboLDPWEnc->currentText(), -1); 
    151   Utils::setConfFileValue(LDCONF, "ldap_usersuffix =", "ldap_usersuffix = " + lineLDUserSuffix->text(), -1); 
    152   Utils::setConfFileValue(LDCONF, "ldap_groupsuffix =", "ldap_groupsuffix = " + lineLDGroupSuffix->text(), -1); 
    153   Utils::setConfFileValue(LDCONF, "ldap_passwordstuff =", "ldap_passwordstuff = " + lineLDPWSuffix->text(), -1); 
    154   Utils::setConfFileValue(LDCONF, "ldap_machinesuffix =", "ldap_machinesuffix = " + lineLDMachineSuffix->text(), -1); 
    155   Utils::setConfFileValue(LDCONF, "ldap_encryption_mode =", "ldap_encryption_mode = " + comboLDEncMode->currentText().toLower(), -1); 
    156   Utils::setConfFileValue(LDCONF, "ldap_tls_cacertfile =", "ldap_tls_cacertfile = " + lineLDSelfSignedCert->text(), -1); 
     146     pcbsd::Utils::setConfFileValue(LDCONF, "ldap_anonbind =", "ldap_anonbind = no", -1); 
     147  pcbsd::Utils::setConfFileValue(LDCONF, "ldap_rootbasedn =", "ldap_rootbasedn = " + lineLDRootBindDN->text(), -1); 
     148  pcbsd::Utils::setConfFileValue(LDCONF, "ldap_rootbindpw =", "ldap_rootbindpw = " + lineLDRootBindPW->text(), -1); 
     149  pcbsd::Utils::setConfFileValue(LDCONF, "ldap_rootbindpw =", "ldap_rootbindpw = " + lineLDRootBindPW->text(), -1); 
     150  pcbsd::Utils::setConfFileValue(LDCONF, "ldap_pwencryption =", "ldap_pwencryption = " + comboLDPWEnc->currentText(), -1); 
     151  pcbsd::Utils::setConfFileValue(LDCONF, "ldap_usersuffix =", "ldap_usersuffix = " + lineLDUserSuffix->text(), -1); 
     152  pcbsd::Utils::setConfFileValue(LDCONF, "ldap_groupsuffix =", "ldap_groupsuffix = " + lineLDGroupSuffix->text(), -1); 
     153  pcbsd::Utils::setConfFileValue(LDCONF, "ldap_passwordstuff =", "ldap_passwordstuff = " + lineLDPWSuffix->text(), -1); 
     154  pcbsd::Utils::setConfFileValue(LDCONF, "ldap_machinesuffix =", "ldap_machinesuffix = " + lineLDMachineSuffix->text(), -1); 
     155  pcbsd::Utils::setConfFileValue(LDCONF, "ldap_encryption_mode =", "ldap_encryption_mode = " + comboLDEncMode->currentText().toLower(), -1); 
     156  pcbsd::Utils::setConfFileValue(LDCONF, "ldap_tls_cacertfile =", "ldap_tls_cacertfile = " + lineLDSelfSignedCert->text(), -1); 
    157157 
    158158  // Remove old opts 
    159159  QString optName, optVal; 
    160   Utils::setConfFileValue(LDCONF, "opt_", "", -1); 
     160  pcbsd::Utils::setConfFileValue(LDCONF, "opt_", "", -1); 
    161161  for ( int i = 0; i < textLDAux->document()->lineCount(); ++i) 
    162162  {  
     
    175175 
    176176     // Save the config 
    177      Utils::setConfFileValue(LDCONF, optName + " =", optName + " = " + optVal, -1); 
     177     pcbsd::Utils::setConfFileValue(LDCONF, optName + " =", optName + " = " + optVal, -1); 
    178178  } 
    179179} 
     
    186186    // Restart AD service if enabled    
    187187    qDebug() << "Enabling AD"; 
    188     Utils::setConfFileValue("/etc/rc.conf", "pc_activedirectory_enable=", "pc_activedirectory_enable=\"YES\"", -1); 
    189     Utils::runShellCommand("/usr/local/bin/pc-adctl start"); 
     188    pcbsd::Utils::setConfFileValue("/etc/rc.conf", "pc_activedirectory_enable=", "pc_activedirectory_enable=\"YES\"", -1); 
     189    pcbsd::Utils::runShellCommand("/usr/local/bin/pc-adctl start"); 
    190190  } else { 
    191191     qDebug() << "Disabling AD"; 
    192      Utils::runShellCommand("/usr/local/bin/pc-adctl stop"); 
    193      Utils::setConfFileValue("/etc/rc.conf", "pc_activedirectory_enable=", "pc_activedirectory_enable=\"NO\"", -1); 
     192     pcbsd::Utils::runShellCommand("/usr/local/bin/pc-adctl stop"); 
     193     pcbsd::Utils::setConfFileValue("/etc/rc.conf", "pc_activedirectory_enable=", "pc_activedirectory_enable=\"NO\"", -1); 
    194194  } 
    195195   
     
    197197  if ( groupLDAP->isChecked() ) { 
    198198    exportLDAP(); 
    199      Utils::setConfFileValue("/etc/rc.conf", "pc_ldap_enable=", "pc_ldap_enable=\"YES\"", -1); 
    200      Utils::runShellCommand("/usr/local/bin/pc-ldapctl start"); 
     199     pcbsd::Utils::setConfFileValue("/etc/rc.conf", "pc_ldap_enable=", "pc_ldap_enable=\"YES\"", -1); 
     200     pcbsd::Utils::runShellCommand("/usr/local/bin/pc-ldapctl start"); 
    201201  } else { 
    202202     qDebug() << "Disabling LDAP"; 
    203      Utils::runShellCommand("/usr/local/bin/pc-ldapctl stop"); 
    204      Utils::setConfFileValue("/etc/rc.conf", "pc_ldap_enable=", "pc_ldap_enable=\"NO\"", -1); 
    205   } 
    206 } 
     203     pcbsd::Utils::runShellCommand("/usr/local/bin/pc-ldapctl stop"); 
     204     pcbsd::Utils::setConfFileValue("/etc/rc.conf", "pc_ldap_enable=", "pc_ldap_enable=\"NO\"", -1); 
     205  } 
     206} 
Note: See TracChangeset for help on using the changeset viewer.