Inheritance diagram for USERINFO_COMNG:

Public Methods | |
| USERINFO_COMNG (DICTIONARY&_dict) | |
| int | deluser (PRIVILEGE *) |
| int | save (PRIVILEGE *priv) |
| void | setupdia (DIALOG&dia) |
| int | validate (DIALOG&, int &nof) |
| ~USERINFO_COMNG (void) | |
Private Attributes | |
| LDAPOBJECT | ldap |
| CONFDB | ldapdb |
| FIELD_DEFS | userconf_ldapform |
| char* | comng_enabled |
| const char* | domain_profile |
|
|
Definition at line 27 of file ldap_comng.cc. 00029 : USERACCT_COMNG (_dict)
00030 {
00031 // Lookup domain profile
00032 const char *domain = dict.get_str("domain");
00033 char fpath[PATH_MAX];
00034 sprintf(fpath,"%s/%s",PROFILE_DIR,domain);
00035
00036 if (!strcmp(domain,"/")) { // Maindomain profile
00037 domain_profile = "userinfo";
00038 D(debugf(4,"ldap_comng: main domain: %s\n",domain));
00039 }
00040 else if (fopen(fpath,"r")){ // Virtual domain profile
00041 domain_profile = domain;
00042 D(debugf(4,"ldap_comng: virtual domain: %s\n",domain));
00043 }
00044 else { // No profile
00045 comng_enabled = 0;
00046 return;
00047 }
00048
00049 ldap.load_profile(domain_profile);
00050 if (!ldap.c_profile->getvalnum("profile","userconf_comng",0)) { // If profile comng is disabled
00051 comng_enabled = 0;
00052 return;
00053 }
00054
00055 userconf_ldapform.c_form = ldap.form;
00056 userconf_ldapform.read();
00057 if (!dict.get_bool ("is_new")){
00058 ldap.filter.setfromf("uid=%s",dict.get_str("name"));
00059 ldap.search();
00060 ldap.export_confdb(&ldapdb);
00061 userconf_ldapform.loadval (&ldapdb,dict.get_str("name"));
00062 }
00063 }
|
|
|
Definition at line 65 of file ldap_comng.cc. 00066 {
00067 }
|
|
|
Definition at line 124 of file ldap_comng.cc. 00126 {
00127 int ret = 0;
00128
00129 if (!comng_enabled) return 0;
00130
00131 if (!dict.get_bool("is_new")){
00132 const char *user;
00133 user = dict.get_str("name");
00134 char buf[256];
00135 sprintf(buf,"uid=%s,%s,%s",user,ldap.dn_prefix.get(),ldap.base.get());
00136 ldap.dn.setfrom(buf);
00137 ret = ldap.del();
00138 }
00139 return ret;
00140 }
|
|
|
Definition at line 79 of file ldap_comng.cc. 00081 {
00082 if (!comng_enabled) return 0;
00083 const char *user;
00084 user = dict.get_str("name");
00085 char buf[256];
00086 char is_new;
00087 int n;
00088 /* Check if this entry exist */
00089 sprintf(buf,"uid=%s",user);
00090 ldap.filter.setfrom(buf);
00091 n = ldap.search();
00092 if ( n ) { is_new = 0; }
00093 else { is_new = 1; }
00094
00095 /* Add DN */
00096 sprintf(buf,"uid=%s,%s,%s",user,ldap.dn_prefix.get(),ldap.base.get());
00097 ldap.dn.setfrom(buf);
00098
00099 /* Create a new entry */
00100 if (is_new){
00101 ldap.at_set("uid",user);
00102 ldap.at_set("cn",user); // For Netscape search
00103 ldap.oc_add("top");
00104 ldap.oc_add("account");
00105 ldap.oc_add("posixAccount");
00106 ldap.add();
00107 }
00108
00109 /* Update the ldapobject to the ldap database */
00110 userconf_ldapform.saveval (&ldapdb,user);
00111 ldap.import_confdb(&ldapdb);
00112 return ldap.modify();
00113 }
|
|
|
Definition at line 69 of file ldap_comng.cc. 00071 {
00072 if (comng_enabled) {
00073 dia.newf_title (MSG_U(T_EXTRA,"LDAP"),1
00074 ,"",MSG_R(T_EXTRA));
00075 userconf_ldapform.setupdia(dia);
00076 }
00077 }
|
|
|
Definition at line 115 of file ldap_comng.cc. 00118 {
00119 int ret = 0;
00120 if (!comng_enabled) return 0;
00121 return ret;
00122 }
|
|
|
Definition at line 10 of file ldap_comng.cc. |
|
|
Definition at line 11 of file ldap_comng.cc. |
|
|
Definition at line 12 of file ldap_comng.cc. |
|
|
Definition at line 13 of file ldap_comng.cc. |
|
|
Definition at line 14 of file ldap_comng.cc. |
1.2.1 written by Dimitri van Heesch,
© 1997-2000