|
|
|
@ -176,7 +176,7 @@ void KUserLDAP::data( KIO::Job *, const TQByteArray& data )
|
|
|
|
|
else if ( name == "shadowflag" )
|
|
|
|
|
mUser->setFlag( val.toLong() );
|
|
|
|
|
else if ( name == "sambaacctflags" ) {
|
|
|
|
|
if ( !val.tqcontains( 'D' ) ) mUser->setDisabled( false );
|
|
|
|
|
if ( !val.contains( 'D' ) ) mUser->setDisabled( false );
|
|
|
|
|
} else if ( name == "sambasid" )
|
|
|
|
|
mUser->setSID( val );
|
|
|
|
|
else if ( name == "sambaprimarygroupsid" )
|
|
|
|
@ -399,7 +399,7 @@ void KUserLDAP::getLDIF( KU::KUser *user, bool mod )
|
|
|
|
|
ldif += "dn: " + getRDN( user ).utf8() + "," + mUrl.dn().utf8() + "\n";
|
|
|
|
|
if ( mod ) {
|
|
|
|
|
ldif += "changetype: modify\n";
|
|
|
|
|
ldif += "tqreplace: objectClass\n";
|
|
|
|
|
ldif += "replace: objectClass\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( caps & Cap_InetOrg )
|
|
|
|
@ -416,7 +416,7 @@ void KUserLDAP::getLDIF( KU::KUser *user, bool mod )
|
|
|
|
|
if ( ( caps & Cap_Samba ) && ( user->getCaps() & KU::KUser::Cap_Samba ) ) {
|
|
|
|
|
ldif += "objectClass: sambaSamAccount\n";
|
|
|
|
|
}
|
|
|
|
|
if ( mod && mObjectClasses.tqcontains( mUser ) ) {
|
|
|
|
|
if ( mod && mObjectClasses.contains( mUser ) ) {
|
|
|
|
|
TQStringList ocs = mObjectClasses[ mUser ];
|
|
|
|
|
kdDebug() << user->getName() << " has additional objectclasses: " << ocs.join(",") << endl;
|
|
|
|
|
TQValueListIterator<TQString> it;
|
|
|
|
@ -427,61 +427,61 @@ void KUserLDAP::getLDIF( KU::KUser *user, bool mod )
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( mod ) ldif += "-\ntqreplace: cn\n";
|
|
|
|
|
if ( mod ) ldif += "-\nreplace: cn\n";
|
|
|
|
|
ldif += KABC::LDIF::assembleLine( "cn", cn )+"\n";
|
|
|
|
|
if ( caps & Cap_InetOrg ) {
|
|
|
|
|
if ( mod ) ldif += "-\ntqreplace: uid\n";
|
|
|
|
|
if ( mod ) ldif += "-\nreplace: uid\n";
|
|
|
|
|
ldif += KABC::LDIF::assembleLine( "uid", user->getName() ) + "\n";
|
|
|
|
|
} else {
|
|
|
|
|
if ( mod ) ldif += "-\ntqreplace: userid\n";
|
|
|
|
|
if ( mod ) ldif += "-\nreplace: userid\n";
|
|
|
|
|
ldif += KABC::LDIF::assembleLine( "userid", user->getName() ) + "\n";
|
|
|
|
|
}
|
|
|
|
|
if ( mod ) ldif += "-\n";
|
|
|
|
|
|
|
|
|
|
if ( ( user->getCaps() & KU::KUser::Cap_POSIX ) || ( caps & Cap_InetOrg ) ) {
|
|
|
|
|
if ( mod ) ldif += "tqreplace: userpassword\n";
|
|
|
|
|
if ( mod ) ldif += "replace: userpassword\n";
|
|
|
|
|
ldif += KABC::LDIF::assembleLine( "userpassword", pwd )+"\n";
|
|
|
|
|
if ( mod ) ldif += "-\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( user->getCaps() & KU::KUser::Cap_POSIX ) {
|
|
|
|
|
if ( mod ) ldif += "tqreplace: uidnumber\n";
|
|
|
|
|
if ( mod ) ldif += "replace: uidnumber\n";
|
|
|
|
|
ldif += KABC::LDIF::assembleLine( "uidnumber",
|
|
|
|
|
TQString::number( user->getUID() ) )+"\n";
|
|
|
|
|
if ( mod ) ldif += "-\ntqreplace: gidnumber\n";
|
|
|
|
|
if ( mod ) ldif += "-\nreplace: gidnumber\n";
|
|
|
|
|
ldif += KABC::LDIF::assembleLine( "gidnumber",
|
|
|
|
|
TQString::number( user->getGID() ) )+"\n";
|
|
|
|
|
if ( mod ) ldif += "-\ntqreplace: gecos\n";
|
|
|
|
|
if ( mod ) ldif += "-\nreplace: gecos\n";
|
|
|
|
|
ldif += KABC::LDIF::assembleLine( "gecos", !mCfg->ldapgecos() ? TQCString() :
|
|
|
|
|
TQCString( gecos.latin1() ) )+"\n";
|
|
|
|
|
if ( mod ) ldif += "-\ntqreplace: homedirectory\n";
|
|
|
|
|
if ( mod ) ldif += "-\nreplace: homedirectory\n";
|
|
|
|
|
ldif += KABC::LDIF::assembleLine( "homedirectory",
|
|
|
|
|
user->getHomeDir() )+"\n";
|
|
|
|
|
if ( mod ) ldif += "-\ntqreplace: loginshell\n";
|
|
|
|
|
if ( mod ) ldif += "-\nreplace: loginshell\n";
|
|
|
|
|
ldif += KABC::LDIF::assembleLine( "loginshell",
|
|
|
|
|
user->getShell() )+"\n";
|
|
|
|
|
if ( mod ) ldif += "-\n";
|
|
|
|
|
} else {
|
|
|
|
|
if ( mod ) {
|
|
|
|
|
ldif += "tqreplace: uidnumber\n";
|
|
|
|
|
ldif += "-\ntqreplace: gidnumber\n";
|
|
|
|
|
ldif += "-\ntqreplace: homedirectory\n";
|
|
|
|
|
ldif += "-\ntqreplace: loginshell\n";
|
|
|
|
|
ldif += "-\ntqreplace: gecos\n";
|
|
|
|
|
ldif += "replace: uidnumber\n";
|
|
|
|
|
ldif += "-\nreplace: gidnumber\n";
|
|
|
|
|
ldif += "-\nreplace: homedirectory\n";
|
|
|
|
|
ldif += "-\nreplace: loginshell\n";
|
|
|
|
|
ldif += "-\nreplace: gecos\n";
|
|
|
|
|
ldif += "-\n";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( caps & Cap_InetOrg ) {
|
|
|
|
|
if ( mod ) ldif += "tqreplace: sn\n";
|
|
|
|
|
if ( mod ) ldif += "replace: sn\n";
|
|
|
|
|
ldif += KABC::LDIF::assembleLine( "sn", user->getSurname() ) + "\n";
|
|
|
|
|
if ( mod ) ldif += "-\ntqreplace: mail\n";
|
|
|
|
|
if ( mod ) ldif += "-\nreplace: mail\n";
|
|
|
|
|
ldif += KABC::LDIF::assembleLine( "mail", user->getEmail() ) + "\n";
|
|
|
|
|
if ( mod ) ldif += "-\ntqreplace: displayName\n";
|
|
|
|
|
if ( mod ) ldif += "-\nreplace: displayName\n";
|
|
|
|
|
ldif += KABC::LDIF::assembleLine( "displayname", user->getFullName() ) + "\n";
|
|
|
|
|
if ( mod ) ldif += "-\ntqreplace: postaladdress\n";
|
|
|
|
|
if ( mod ) ldif += "-\nreplace: postaladdress\n";
|
|
|
|
|
ldif += KABC::LDIF::assembleLine( "postaladdress", user->getAddress() ) + "\n";
|
|
|
|
|
if ( mod ) ldif += "-\ntqreplace: telephoneNumber\n";
|
|
|
|
|
if ( mod ) ldif += "-\nreplace: telephoneNumber\n";
|
|
|
|
|
ldif += KABC::LDIF::assembleLine( "telephoneNumber", user->getOffice1() ) + "\n";
|
|
|
|
|
ldif += KABC::LDIF::assembleLine( "telephoneNumber", user->getOffice2() ) + "\n";
|
|
|
|
|
if ( mod ) ldif += "-\n";
|
|
|
|
@ -489,63 +489,63 @@ void KUserLDAP::getLDIF( KU::KUser *user, bool mod )
|
|
|
|
|
|
|
|
|
|
if ( caps & Cap_Samba ) {
|
|
|
|
|
if ( user->getCaps() & KU::KUser::Cap_Samba ) {
|
|
|
|
|
if ( mod ) ldif += "tqreplace: sambadomainname\n";
|
|
|
|
|
if ( mod ) ldif += "replace: sambadomainname\n";
|
|
|
|
|
ldif += KABC::LDIF::assembleLine( "sambadomainname", user->getDomain() ) + "\n";
|
|
|
|
|
if ( mod ) ldif += "-\ntqreplace: sambauserworkstations\n";
|
|
|
|
|
if ( mod ) ldif += "-\nreplace: sambauserworkstations\n";
|
|
|
|
|
ldif += KABC::LDIF::assembleLine( "sambauserworkstations", user->getWorkstations() ) + "\n";
|
|
|
|
|
if ( mod ) ldif += "-\ntqreplace: sambahomepath\n";
|
|
|
|
|
if ( mod ) ldif += "-\nreplace: sambahomepath\n";
|
|
|
|
|
ldif += KABC::LDIF::assembleLine( "sambahomepath", user->getHomePath() ) + "\n";
|
|
|
|
|
if ( mod ) ldif += "-\ntqreplace: sambahomedrive\n";
|
|
|
|
|
if ( mod ) ldif += "-\nreplace: sambahomedrive\n";
|
|
|
|
|
ldif += KABC::LDIF::assembleLine( "sambahomedrive", user->getHomeDrive() ) + "\n";
|
|
|
|
|
if ( mod ) ldif += "-\ntqreplace: sambalogonscript\n";
|
|
|
|
|
if ( mod ) ldif += "-\nreplace: sambalogonscript\n";
|
|
|
|
|
ldif += KABC::LDIF::assembleLine( "sambalogonscript", user->getLoginScript() ) + "\n";
|
|
|
|
|
if ( mod ) ldif += "-\ntqreplace: sambaprofilepath\n";
|
|
|
|
|
if ( mod ) ldif += "-\nreplace: sambaprofilepath\n";
|
|
|
|
|
ldif += KABC::LDIF::assembleLine( "sambaprofilepath", user->getProfilePath() ) + "\n";
|
|
|
|
|
if ( mod ) ldif += "-\ntqreplace: sambalmpassword\n";
|
|
|
|
|
if ( mod ) ldif += "-\nreplace: sambalmpassword\n";
|
|
|
|
|
ldif += KABC::LDIF::assembleLine( "sambalmpassword", user->getLMPwd() ) + "\n";
|
|
|
|
|
if ( mod ) ldif += "-\ntqreplace: sambantpassword\n";
|
|
|
|
|
if ( mod ) ldif += "-\nreplace: sambantpassword\n";
|
|
|
|
|
ldif += KABC::LDIF::assembleLine( "sambantpassword", user->getNTPwd() ) + "\n";
|
|
|
|
|
if ( mod ) ldif += "-\ntqreplace: sambasid\n";
|
|
|
|
|
if ( mod ) ldif += "-\nreplace: sambasid\n";
|
|
|
|
|
ldif += KABC::LDIF::assembleLine( "sambasid", user->getSID().getSID() ) + "\n";
|
|
|
|
|
if ( mod ) ldif += "-\ntqreplace: sambaacctflags\n";
|
|
|
|
|
if ( mod ) ldif += "-\nreplace: sambaacctflags\n";
|
|
|
|
|
ldif += KABC::LDIF::assembleLine( "sambaacctflags", samflags ) + "\n";
|
|
|
|
|
if ( mod ) ldif += "-\ntqreplace: sambaprimarygroupsid\n";
|
|
|
|
|
if ( mod ) ldif += "-\nreplace: sambaprimarygroupsid\n";
|
|
|
|
|
ldif += KABC::LDIF::assembleLine( "sambaprimarygroupsid",
|
|
|
|
|
user->getPGSID().getSID() ) + "\n";
|
|
|
|
|
if ( mod ) ldif += "-\ntqreplace: sambapwdlastset\n";
|
|
|
|
|
if ( mod ) ldif += "-\nreplace: sambapwdlastset\n";
|
|
|
|
|
ldif += KABC::LDIF::assembleLine( "sambapwdlastset",
|
|
|
|
|
TQString::number( user->getLastChange() ) ) + "\n";
|
|
|
|
|
if ( mod ) ldif += "-\ntqreplace: sambakickofftime\n";
|
|
|
|
|
if ( mod ) ldif += "-\nreplace: sambakickofftime\n";
|
|
|
|
|
if ( user->getExpire() != -1 ) ldif +=
|
|
|
|
|
KABC::LDIF::assembleLine( "sambakickofftime",
|
|
|
|
|
TQString::number( user->getExpire() ) ) + "\n";
|
|
|
|
|
if ( mod ) ldif += "-\n";
|
|
|
|
|
} else {
|
|
|
|
|
if ( mod ) {
|
|
|
|
|
ldif += "tqreplace: sambahomepath\n";
|
|
|
|
|
ldif += "-\ntqreplace: sambahomedrive\n";
|
|
|
|
|
ldif += "-\ntqreplace: sambalogonscript\n";
|
|
|
|
|
ldif += "-\ntqreplace: sambaprofilepath\n";
|
|
|
|
|
ldif += "-\ntqreplace: sambalmpassword\n";
|
|
|
|
|
ldif += "-\ntqreplace: sambantpassword\n";
|
|
|
|
|
ldif += "-\ntqreplace: sambasid\n";
|
|
|
|
|
ldif += "-\ntqreplace: sambaacctflags\n";
|
|
|
|
|
ldif += "-\ntqreplace: sambaprimarygroupsid\n";
|
|
|
|
|
ldif += "-\ntqreplace: sambapwdlastset\n";
|
|
|
|
|
ldif += "-\ntqreplace: sambakickofftime\n";
|
|
|
|
|
ldif += "-\ntqreplace: sambalogontime\n";
|
|
|
|
|
ldif += "-\ntqreplace: sambalogofftime\n";
|
|
|
|
|
ldif += "-\ntqreplace: sambapwdcanchange\n";
|
|
|
|
|
ldif += "-\ntqreplace: sambapwdmustchange\n";
|
|
|
|
|
ldif += "-\ntqreplace: sambauserworkstations\n";
|
|
|
|
|
ldif += "-\ntqreplace: sambadomainname\n";
|
|
|
|
|
ldif += "-\ntqreplace: sambamungeddial\n";
|
|
|
|
|
ldif += "-\ntqreplace: sambabadpasswordcount\n";
|
|
|
|
|
ldif += "-\ntqreplace: sambabadpasswordtime\n";
|
|
|
|
|
ldif += "-\ntqreplace: sambadomainname\n";
|
|
|
|
|
ldif += "replace: sambahomepath\n";
|
|
|
|
|
ldif += "-\nreplace: sambahomedrive\n";
|
|
|
|
|
ldif += "-\nreplace: sambalogonscript\n";
|
|
|
|
|
ldif += "-\nreplace: sambaprofilepath\n";
|
|
|
|
|
ldif += "-\nreplace: sambalmpassword\n";
|
|
|
|
|
ldif += "-\nreplace: sambantpassword\n";
|
|
|
|
|
ldif += "-\nreplace: sambasid\n";
|
|
|
|
|
ldif += "-\nreplace: sambaacctflags\n";
|
|
|
|
|
ldif += "-\nreplace: sambaprimarygroupsid\n";
|
|
|
|
|
ldif += "-\nreplace: sambapwdlastset\n";
|
|
|
|
|
ldif += "-\nreplace: sambakickofftime\n";
|
|
|
|
|
ldif += "-\nreplace: sambalogontime\n";
|
|
|
|
|
ldif += "-\nreplace: sambalogofftime\n";
|
|
|
|
|
ldif += "-\nreplace: sambapwdcanchange\n";
|
|
|
|
|
ldif += "-\nreplace: sambapwdmustchange\n";
|
|
|
|
|
ldif += "-\nreplace: sambauserworkstations\n";
|
|
|
|
|
ldif += "-\nreplace: sambadomainname\n";
|
|
|
|
|
ldif += "-\nreplace: sambamungeddial\n";
|
|
|
|
|
ldif += "-\nreplace: sambabadpasswordcount\n";
|
|
|
|
|
ldif += "-\nreplace: sambabadpasswordtime\n";
|
|
|
|
|
ldif += "-\nreplace: sambadomainname\n";
|
|
|
|
|
if ( schemaversion > 0 ) {
|
|
|
|
|
ldif += "-\ntqreplace: sambapasswordhistory\n";
|
|
|
|
|
ldif += "-\ntqreplace: sambalogonhours\n";
|
|
|
|
|
ldif += "-\nreplace: sambapasswordhistory\n";
|
|
|
|
|
ldif += "-\nreplace: sambalogonhours\n";
|
|
|
|
|
}
|
|
|
|
|
ldif += "-\n";
|
|
|
|
|
}
|
|
|
|
@ -554,37 +554,37 @@ void KUserLDAP::getLDIF( KU::KUser *user, bool mod )
|
|
|
|
|
|
|
|
|
|
if ( caps & Cap_Shadow ) {
|
|
|
|
|
if ( user->getCaps() & KU::KUser::Cap_POSIX ) {
|
|
|
|
|
if ( mod ) ldif += "tqreplace: shadowlastchange\n"; //sambapwdlastset
|
|
|
|
|
if ( mod ) ldif += "replace: shadowlastchange\n"; //sambapwdlastset
|
|
|
|
|
ldif += KABC::LDIF::assembleLine( "shadowlastchange",
|
|
|
|
|
TQString::number( timeToDays( user->getLastChange() ) ) ) + "\n";
|
|
|
|
|
if ( mod ) ldif += "-\ntqreplace: shadowmin\n"; //sambaPwdCanChange
|
|
|
|
|
if ( mod ) ldif += "-\nreplace: shadowmin\n"; //sambaPwdCanChange
|
|
|
|
|
ldif += KABC::LDIF::assembleLine( "shadowmin",
|
|
|
|
|
TQString::number( user->getMin() ) ) + "\n";
|
|
|
|
|
if ( mod ) ldif += "-\ntqreplace: shadowmax\n"; //sambaPwdMustChange
|
|
|
|
|
if ( mod ) ldif += "-\nreplace: shadowmax\n"; //sambaPwdMustChange
|
|
|
|
|
ldif += KABC::LDIF::assembleLine( "shadowmax",
|
|
|
|
|
TQString::number( user->getMax() ) ) + "\n";
|
|
|
|
|
if ( mod ) ldif += "-\ntqreplace: shadowwarning\n";
|
|
|
|
|
if ( mod ) ldif += "-\nreplace: shadowwarning\n";
|
|
|
|
|
ldif += KABC::LDIF::assembleLine( "shadowwarning",
|
|
|
|
|
TQString::number( user->getWarn() ) ) + "\n";
|
|
|
|
|
if ( mod ) ldif += "-\ntqreplace: shadowinactive\n";
|
|
|
|
|
if ( mod ) ldif += "-\nreplace: shadowinactive\n";
|
|
|
|
|
ldif += KABC::LDIF::assembleLine( "shadowinactive",
|
|
|
|
|
TQString::number( user->getInactive() ) ) + "\n";
|
|
|
|
|
if ( mod ) ldif += "-\ntqreplace: shadowexpire\n"; //sambaKickoffTime
|
|
|
|
|
if ( mod ) ldif += "-\nreplace: shadowexpire\n"; //sambaKickoffTime
|
|
|
|
|
ldif += KABC::LDIF::assembleLine( "shadowexpire",
|
|
|
|
|
TQString::number( timeToDays( user->getExpire() ) ) ) + "\n";
|
|
|
|
|
if ( mod ) ldif += "-\ntqreplace: shadowflag\n";
|
|
|
|
|
if ( mod ) ldif += "-\nreplace: shadowflag\n";
|
|
|
|
|
ldif += KABC::LDIF::assembleLine( "shadowflag",
|
|
|
|
|
TQString::number( user->getFlag() ) ) + "\n";
|
|
|
|
|
if ( mod ) ldif += "-\n";
|
|
|
|
|
} else {
|
|
|
|
|
if ( mod ) {
|
|
|
|
|
ldif += "tqreplace: shadowlastchange\n";
|
|
|
|
|
ldif += "-\ntqreplace: shadowmin\n";
|
|
|
|
|
ldif += "-\ntqreplace: shadowmax\n";
|
|
|
|
|
ldif += "-\ntqreplace: shadowwarning\n";
|
|
|
|
|
ldif += "-\ntqreplace: shadowinactive\n";
|
|
|
|
|
ldif += "-\ntqreplace: shadowexpire\n";
|
|
|
|
|
ldif += "-\ntqreplace: shadowflag\n";
|
|
|
|
|
ldif += "replace: shadowlastchange\n";
|
|
|
|
|
ldif += "-\nreplace: shadowmin\n";
|
|
|
|
|
ldif += "-\nreplace: shadowmax\n";
|
|
|
|
|
ldif += "-\nreplace: shadowwarning\n";
|
|
|
|
|
ldif += "-\nreplace: shadowinactive\n";
|
|
|
|
|
ldif += "-\nreplace: shadowexpire\n";
|
|
|
|
|
ldif += "-\nreplace: shadowflag\n";
|
|
|
|
|
ldif += "-\n";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -630,7 +630,7 @@ void KUserLDAP::putData( KIO::Job *, TQByteArray& data )
|
|
|
|
|
if ( mDelUser ) {
|
|
|
|
|
kdDebug() << "delete ok for: " << mDelUser->getName() << endl;
|
|
|
|
|
mDelSucc.append( mDelUser );
|
|
|
|
|
if ( mObjectClasses.tqcontains( mDelUser ) ) {
|
|
|
|
|
if ( mObjectClasses.contains( mDelUser ) ) {
|
|
|
|
|
kdDebug() << "deleting additonal objectclasses!" << endl;
|
|
|
|
|
mObjectClasses.remove( mDelUser );
|
|
|
|
|
}
|
|
|
|
|