36:
37: l_module_source := G_MODULE_SOURCE || 'import_user: ';
38: x_ret_status := G_FAILED;
39:
40: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
41: then
42: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
43: end if;
44:
38: x_ret_status := G_FAILED;
39:
40: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL)
41: then
42: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Begin');
43: end if;
44:
45: l_user_name := p_ldap_user.object_name;
46: l_description := p_ldap_user.description;
48: l_email_address := p_ldap_user.mail;
49: l_user_guid := p_ldap_user.orclGUID;
50:
51:
52: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL) then
53: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'user name = ' || l_user_name);
54: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'desc = ' || l_description);
55: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'fax = ' || l_fax);
56: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'email = ' || l_email_address);
49: l_user_guid := p_ldap_user.orclGUID;
50:
51:
52: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL) then
53: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'user name = ' || l_user_name);
54: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'desc = ' || l_description);
55: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'fax = ' || l_fax);
56: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'email = ' || l_email_address);
57: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'user guid = ' || l_user_guid);
50:
51:
52: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL) then
53: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'user name = ' || l_user_name);
54: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'desc = ' || l_description);
55: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'fax = ' || l_fax);
56: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'email = ' || l_email_address);
57: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'user guid = ' || l_user_guid);
58: end if;
51:
52: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL) then
53: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'user name = ' || l_user_name);
54: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'desc = ' || l_description);
55: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'fax = ' || l_fax);
56: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'email = ' || l_email_address);
57: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'user guid = ' || l_user_guid);
58: end if;
59:
52: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL) then
53: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'user name = ' || l_user_name);
54: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'desc = ' || l_description);
55: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'fax = ' || l_fax);
56: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'email = ' || l_email_address);
57: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'user guid = ' || l_user_guid);
58: end if;
59:
60: select count(user_name) into l_user_count
53: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'user name = ' || l_user_name);
54: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'desc = ' || l_description);
55: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'fax = ' || l_fax);
56: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'email = ' || l_email_address);
57: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'user guid = ' || l_user_guid);
58: end if;
59:
60: select count(user_name) into l_user_count
61: from fnd_user
60: select count(user_name) into l_user_count
61: from fnd_user
62: where user_name = l_user_name;
63:
64: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL) then
65: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'user count for ' || l_user_name || ' = ' || l_user_count);
66: end if;
67:
68: if (l_user_count = 0) then
61: from fnd_user
62: where user_name = l_user_name;
63:
64: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL) then
65: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'user count for ' || l_user_name || ' = ' || l_user_count);
66: end if;
67:
68: if (l_user_count = 0) then
69: fnd_user_pkg.CreateUser(x_user_name => l_user_name,
86:
87: /* fnd_oid_util.send_subscription_add_to_OID(p_orcl_guid=>l_user_guid); */
88: if(p_add_def_resp='N') then
89: /* Do nothing - log call*/
90: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL) then
91: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Not adding responsibility');
92: end if;
93: else
94:
87: /* fnd_oid_util.send_subscription_add_to_OID(p_orcl_guid=>l_user_guid); */
88: if(p_add_def_resp='N') then
89: /* Do nothing - log call*/
90: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL) then
91: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Not adding responsibility');
92: end if;
93: else
94:
95: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL) then
91: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Not adding responsibility');
92: end if;
93: else
94:
95: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL) then
96: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Flag defresp=Y adding responsibility');
97: end if;
98: /* add default responsibility*/
99: fnd_oid_subscriptions.assign_default_resp(p_user_name => l_user_name);
92: end if;
93: else
94:
95: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL) then
96: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'Flag defresp=Y adding responsibility');
97: end if;
98: /* add default responsibility*/
99: fnd_oid_subscriptions.assign_default_resp(p_user_name => l_user_name);
100: end if;
116: where user_name = l_user_name
117: and user_guid is not null;
118:
119: if (l_user_count = 0) then
120: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL) then
121: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'user guid for ' || l_user_name || ' is null');
122: end if;
123: if (p_duplicate = G_DUP_TRUE) then
124:
117: and user_guid is not null;
118:
119: if (l_user_count = 0) then
120: if (fnd_log.LEVEL_STATEMENT >= fnd_log.G_CURRENT_RUNTIME_LEVEL) then
121: fnd_log.string(fnd_log.LEVEL_STATEMENT, l_module_source, 'user guid for ' || l_user_name || ' is null');
122: end if;
123: if (p_duplicate = G_DUP_TRUE) then
124:
125: -- Updating the user_guid if the duplicate option is explicitly passed.
141: end if;
142:
143: end if;
144:
145: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL) then
146: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, 'x_ret_status =' || x_ret_status);
147: end if;
148:
149: end import_user;
142:
143: end if;
144:
145: if (fnd_log.LEVEL_ERROR >= fnd_log.G_CURRENT_RUNTIME_LEVEL) then
146: fnd_log.string(fnd_log.LEVEL_ERROR, l_module_source, 'x_ret_status =' || x_ret_status);
147: end if;
148:
149: end import_user;
150: --