[Home] [Help]
2871: );
2872: END IF;
2873:
2874: -- log file
2875: fnd_file.put_line (fnd_file.LOG, ' ');
2876: fnd_file.put_line
2877: (fnd_file.LOG,
2878: '---------------------------------------------------------- ');
2879: fnd_file.put_line (fnd_file.LOG, 'Entered create_sso_user');
2872: END IF;
2873:
2874: -- log file
2875: fnd_file.put_line (fnd_file.LOG, ' ');
2876: fnd_file.put_line
2877: (fnd_file.LOG,
2878: '---------------------------------------------------------- ');
2879: fnd_file.put_line (fnd_file.LOG, 'Entered create_sso_user');
2880: fnd_file.put_line (fnd_file.LOG, 'Parameters ');
2873:
2874: -- log file
2875: fnd_file.put_line (fnd_file.LOG, ' ');
2876: fnd_file.put_line
2877: (fnd_file.LOG,
2878: '---------------------------------------------------------- ');
2879: fnd_file.put_line (fnd_file.LOG, 'Entered create_sso_user');
2880: fnd_file.put_line (fnd_file.LOG, 'Parameters ');
2881: fnd_file.put_line (fnd_file.LOG, 'p_user_name : ' ||
2875: fnd_file.put_line (fnd_file.LOG, ' ');
2876: fnd_file.put_line
2877: (fnd_file.LOG,
2878: '---------------------------------------------------------- ');
2879: fnd_file.put_line (fnd_file.LOG, 'Entered create_sso_user');
2880: fnd_file.put_line (fnd_file.LOG, 'Parameters ');
2881: fnd_file.put_line (fnd_file.LOG, 'p_user_name : ' ||
2882: p_user_name);
2883: fnd_file.put_line (fnd_file.LOG, 'p_contract_id : ' ||
2876: fnd_file.put_line
2877: (fnd_file.LOG,
2878: '---------------------------------------------------------- ');
2879: fnd_file.put_line (fnd_file.LOG, 'Entered create_sso_user');
2880: fnd_file.put_line (fnd_file.LOG, 'Parameters ');
2881: fnd_file.put_line (fnd_file.LOG, 'p_user_name : ' ||
2882: p_user_name);
2883: fnd_file.put_line (fnd_file.LOG, 'p_contract_id : ' ||
2884: p_contract_id);
2877: (fnd_file.LOG,
2878: '---------------------------------------------------------- ');
2879: fnd_file.put_line (fnd_file.LOG, 'Entered create_sso_user');
2880: fnd_file.put_line (fnd_file.LOG, 'Parameters ');
2881: fnd_file.put_line (fnd_file.LOG, 'p_user_name : ' ||
2882: p_user_name);
2883: fnd_file.put_line (fnd_file.LOG, 'p_contract_id : ' ||
2884: p_contract_id);
2885: fnd_file.put_line
2879: fnd_file.put_line (fnd_file.LOG, 'Entered create_sso_user');
2880: fnd_file.put_line (fnd_file.LOG, 'Parameters ');
2881: fnd_file.put_line (fnd_file.LOG, 'p_user_name : ' ||
2882: p_user_name);
2883: fnd_file.put_line (fnd_file.LOG, 'p_contract_id : ' ||
2884: p_contract_id);
2885: fnd_file.put_line
2886: (fnd_file.LOG,
2887: '---------------------------------------------------------- ');
2881: fnd_file.put_line (fnd_file.LOG, 'p_user_name : ' ||
2882: p_user_name);
2883: fnd_file.put_line (fnd_file.LOG, 'p_contract_id : ' ||
2884: p_contract_id);
2885: fnd_file.put_line
2886: (fnd_file.LOG,
2887: '---------------------------------------------------------- ');
2888: fnd_file.put_line (fnd_file.LOG, ' ');
2889: -- Initialize API return status to success
2882: p_user_name);
2883: fnd_file.put_line (fnd_file.LOG, 'p_contract_id : ' ||
2884: p_contract_id);
2885: fnd_file.put_line
2886: (fnd_file.LOG,
2887: '---------------------------------------------------------- ');
2888: fnd_file.put_line (fnd_file.LOG, ' ');
2889: -- Initialize API return status to success
2890: x_return_status := fnd_api.g_ret_sts_success;
2884: p_contract_id);
2885: fnd_file.put_line
2886: (fnd_file.LOG,
2887: '---------------------------------------------------------- ');
2888: fnd_file.put_line (fnd_file.LOG, ' ');
2889: -- Initialize API return status to success
2890: x_return_status := fnd_api.g_ret_sts_success;
2891:
2892: -- Get the Person Party Id and quote_to_contact_id from oks_k_headers_b
2915: );
2916: END IF;
2917:
2918: -- log file
2919: fnd_file.put_line (fnd_file.LOG,
2920: 'OKS l_person_party_id : ' ||
2921: l_person_party_id);
2922: fnd_file.put_line (fnd_file.LOG,
2923: 'OKS l_quote_to_contact_id : ' ||
2918: -- log file
2919: fnd_file.put_line (fnd_file.LOG,
2920: 'OKS l_person_party_id : ' ||
2921: l_person_party_id);
2922: fnd_file.put_line (fnd_file.LOG,
2923: 'OKS l_quote_to_contact_id : ' ||
2924: l_quote_to_contact_id);
2925:
2926: -- if the person_party_id is NULL then get person_party_id for quote_to_contact_id
2946: );
2947: END IF;
2948:
2949: -- log file
2950: fnd_file.put_line (fnd_file.LOG,
2951: 'HZ l_person_party_id : ' ||
2952: l_person_party_id);
2953:
2954: -- update the oks_k_headers_b with the person_party_id
3006: );
3007: END IF;
3008:
3009: -- log file
3010: fnd_file.put_line (fnd_file.LOG,
3011: 'Check FND User record for person_party_id : ' ||
3012: l_person_party_id);
3013: fnd_file.put_line (fnd_file.LOG, 'l_user_id : ' ||
3014: l_user_id);
3009: -- log file
3010: fnd_file.put_line (fnd_file.LOG,
3011: 'Check FND User record for person_party_id : ' ||
3012: l_person_party_id);
3013: fnd_file.put_line (fnd_file.LOG, 'l_user_id : ' ||
3014: l_user_id);
3015: fnd_file.put_line (fnd_file.LOG, 'x_user_name : ' ||
3016: x_user_name);
3017:
3011: 'Check FND User record for person_party_id : ' ||
3012: l_person_party_id);
3013: fnd_file.put_line (fnd_file.LOG, 'l_user_id : ' ||
3014: l_user_id);
3015: fnd_file.put_line (fnd_file.LOG, 'x_user_name : ' ||
3016: x_user_name);
3017:
3018: -- Check if valid fnd_user found
3019: IF x_user_name IS NOT NULL
3019: IF x_user_name IS NOT NULL
3020: THEN
3021: x_password := '******';
3022: -- log file
3023: fnd_file.put_line (fnd_file.LOG,
3024: 'Found FND User record for person_party_id : ' ||
3025: l_person_party_id);
3026: -- Bug 4650639
3027: -- FND USER found, check if this user has the responsibility G_ERN_WEB_RESPONSIBILITY
3024: 'Found FND User record for person_party_id : ' ||
3025: l_person_party_id);
3026: -- Bug 4650639
3027: -- FND USER found, check if this user has the responsibility G_ERN_WEB_RESPONSIBILITY
3028: fnd_file.put_line (fnd_file.LOG,
3029: 'Check if the user has ERN responsibility');
3030:
3031: OPEN l_resp_csr (p_resp_key => g_ern_web_responsibility);
3032:
3048: l_security_grp_id
3049: )
3050: THEN
3051: -- user has the ERN responsibility
3052: fnd_file.put_line (fnd_file.LOG,
3053: 'user : ' ||
3054: x_user_name ||
3055: ' has ERN responsibility');
3056: RETURN;
3056: RETURN;
3057: ELSE
3058: -- add responsibility and return
3059: -- log file
3060: fnd_file.put_line (fnd_file.LOG,
3061: 'user : ' ||
3062: x_user_name ||
3063: ' DOES NOT HAVE ERN responsibility');
3064: fnd_file.put_line (fnd_file.LOG,
3060: fnd_file.put_line (fnd_file.LOG,
3061: 'user : ' ||
3062: x_user_name ||
3063: ' DOES NOT HAVE ERN responsibility');
3064: fnd_file.put_line (fnd_file.LOG,
3065: 'assign responsibility to user created');
3066: fnd_file.put_line (fnd_file.LOG,
3067: 'l_responsibility_id : ' ||
3068: l_responsibility_id);
3062: x_user_name ||
3063: ' DOES NOT HAVE ERN responsibility');
3064: fnd_file.put_line (fnd_file.LOG,
3065: 'assign responsibility to user created');
3066: fnd_file.put_line (fnd_file.LOG,
3067: 'l_responsibility_id : ' ||
3068: l_responsibility_id);
3069: fnd_file.put_line (fnd_file.LOG,
3070: 'l_security_grp_id : ' ||
3065: 'assign responsibility to user created');
3066: fnd_file.put_line (fnd_file.LOG,
3067: 'l_responsibility_id : ' ||
3068: l_responsibility_id);
3069: fnd_file.put_line (fnd_file.LOG,
3070: 'l_security_grp_id : ' ||
3071: l_security_grp_id);
3072: fnd_user_resp_groups_api.insert_assignment
3073: (user_id => l_user_id,
3104: );
3105: END IF;
3106:
3107: -- log file
3108: fnd_file.put_line (fnd_file.LOG, 'error in fnd_profile.save ');
3109: fnd_file.put_line (fnd_file.LOG, SQLERRM);
3110: RAISE fnd_api.g_exc_error;
3111: END IF; -- l_return_value
3112: END IF; -- assignment_exists
3105: END IF;
3106:
3107: -- log file
3108: fnd_file.put_line (fnd_file.LOG, 'error in fnd_profile.save ');
3109: fnd_file.put_line (fnd_file.LOG, SQLERRM);
3110: RAISE fnd_api.g_exc_error;
3111: END IF; -- l_return_value
3112: END IF; -- assignment_exists
3113: END IF; -- x_user_name IS NOT NULL THEN
3152: );
3153: END IF;
3154:
3155: -- log file
3156: fnd_file.put_line (fnd_file.LOG,
3157: 'Check FND User record for user name : ' ||
3158: p_user_name);
3159: fnd_file.put_line (fnd_file.LOG,
3160: 'l_fnd_person_party_id : ' ||
3155: -- log file
3156: fnd_file.put_line (fnd_file.LOG,
3157: 'Check FND User record for user name : ' ||
3158: p_user_name);
3159: fnd_file.put_line (fnd_file.LOG,
3160: 'l_fnd_person_party_id : ' ||
3161: l_fnd_person_party_id);
3162: fnd_file.put_line (fnd_file.LOG, 'l_start_date : ' ||
3163: l_start_date);
3158: p_user_name);
3159: fnd_file.put_line (fnd_file.LOG,
3160: 'l_fnd_person_party_id : ' ||
3161: l_fnd_person_party_id);
3162: fnd_file.put_line (fnd_file.LOG, 'l_start_date : ' ||
3163: l_start_date);
3164: fnd_file.put_line (fnd_file.LOG, 'l_end_date : ' ||
3165: l_end_date);
3166:
3160: 'l_fnd_person_party_id : ' ||
3161: l_fnd_person_party_id);
3162: fnd_file.put_line (fnd_file.LOG, 'l_start_date : ' ||
3163: l_start_date);
3164: fnd_file.put_line (fnd_file.LOG, 'l_end_date : ' ||
3165: l_end_date);
3166:
3167: IF csr_chk_qtc_fnd_user%NOTFOUND
3168: THEN
3175: --@ USER_SYNCHED constant pls_integer := 3;
3176: --@ USER_EXISTS_NO_LINK_ALLOWED constant pls_integer := 4;
3177:
3178: -- log file
3179: fnd_file.put_line
3180: (fnd_file.LOG,
3181: 'Getting Suggested username, calling UMX_PUB.get_suggested_username');
3182:
3183: -- Call API UMX_PUB.get_suggested_username to get the suggested user name
3176: --@ USER_EXISTS_NO_LINK_ALLOWED constant pls_integer := 4;
3177:
3178: -- log file
3179: fnd_file.put_line
3180: (fnd_file.LOG,
3181: 'Getting Suggested username, calling UMX_PUB.get_suggested_username');
3182:
3183: -- Call API UMX_PUB.get_suggested_username to get the suggested user name
3184: UMX_PUB.get_suggested_username(p_person_party_id => l_person_party_id,
3184: UMX_PUB.get_suggested_username(p_person_party_id => l_person_party_id,
3185: x_suggested_username => l_suggested_user_name);
3186:
3187: -- log file
3188: fnd_file.put_line
3189: (fnd_file.LOG,
3190: 'Suggested username : '||l_suggested_user_name);
3191:
3192: -- debug log
3185: x_suggested_username => l_suggested_user_name);
3186:
3187: -- log file
3188: fnd_file.put_line
3189: (fnd_file.LOG,
3190: 'Suggested username : '||l_suggested_user_name);
3191:
3192: -- debug log
3193: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)
3216: );
3217: END IF;
3218:
3219: -- log file
3220: fnd_file.put_line
3221: (fnd_file.LOG,
3222: 'Creating New user, calling FND_USER_PKG.TestUserName for username :'||l_suggested_user_name);
3223: l_test_user :=
3224: fnd_user_pkg.testusername
3217: END IF;
3218:
3219: -- log file
3220: fnd_file.put_line
3221: (fnd_file.LOG,
3222: 'Creating New user, calling FND_USER_PKG.TestUserName for username :'||l_suggested_user_name);
3223: l_test_user :=
3224: fnd_user_pkg.testusername
3225: (x_user_name => l_suggested_user_name);
3235: );
3236: END IF;
3237:
3238: -- log file
3239: fnd_file.put_line
3240: (fnd_file.LOG,
3241: 'After calling FND_USER_PKG.TestUserName l_test_user : ' ||
3242: l_test_user);
3243:
3236: END IF;
3237:
3238: -- log file
3239: fnd_file.put_line
3240: (fnd_file.LOG,
3241: 'After calling FND_USER_PKG.TestUserName l_test_user : ' ||
3242: l_test_user);
3243:
3244: IF l_test_user IN (0, 3)
3251: round(dbms_random.value(100,999));
3252: */
3253:
3254: -- log file
3255: fnd_file.put_line
3256: (fnd_file.LOG,
3257: 'ok to create a new user, calling FND_CRYPTO.randombytes');
3258: x_password :=
3259: fnd_crypto.randomstring
3252: */
3253:
3254: -- log file
3255: fnd_file.put_line
3256: (fnd_file.LOG,
3257: 'ok to create a new user, calling FND_CRYPTO.randombytes');
3258: x_password :=
3259: fnd_crypto.randomstring
3260: (NVL (fnd_profile.VALUE ('SIGNON_PASSWORD_LENGTH'),
3274: fnd_crypto.randomstring
3275: (NVL (fnd_profile.VALUE ('SIGNON_PASSWORD_LENGTH'),
3276: 4));
3277:
3278: fnd_file.put_line
3279: (fnd_file.LOG,
3280: 'validating password, calling FND_WEB_SEC.validate_password');
3281:
3282: l_result := FND_WEB_SEC.validate_password (l_suggested_user_name, x_password);
3275: (NVL (fnd_profile.VALUE ('SIGNON_PASSWORD_LENGTH'),
3276: 4));
3277:
3278: fnd_file.put_line
3279: (fnd_file.LOG,
3280: 'validating password, calling FND_WEB_SEC.validate_password');
3281:
3282: l_result := FND_WEB_SEC.validate_password (l_suggested_user_name, x_password);
3283:
3284: IF ( v_counter = 100 ) THEN
3285: IF ( l_result <> 'Y' ) THEN
3286: -- Throw exception as even though generated password 100 times, but
3287: -- cannot pass validation criteria
3288: fnd_file.put_line(fnd_file.LOG,
3289: 'password validation failed, raised user defined exception');
3290: raise_application_error (-20000,'Could not generated password automatically which satisfies validation requirements.');
3291: END IF;
3292: END IF;
3306: x_person_party_id => l_person_party_id
3307: );
3308: x_user_name := l_suggested_user_name;
3309: -- log file
3310: fnd_file.put_line
3311: (fnd_file.LOG,
3312: 'FND_USER_PKG.CreateUserIdParty l_user_id : ' ||
3313: l_user_id);
3314: ELSE -- l_test_user = 3
3307: );
3308: x_user_name := l_suggested_user_name;
3309: -- log file
3310: fnd_file.put_line
3311: (fnd_file.LOG,
3312: 'FND_USER_PKG.CreateUserIdParty l_user_id : ' ||
3313: l_user_id);
3314: ELSE -- l_test_user = 3
3315: -- USER_SYNCHED constant pls_integer := 3;
3316: -- Call the FND_USER_PKG.CreateUserIdParty WITHOUT password as password exists in OID
3317: -- in Notification, put the password as '******'
3318:
3319: -- log file
3320: fnd_file.put_line
3321: (fnd_file.LOG,
3322: 'USER_SYNCHED , calling FND_USER_PKG.CreateUserIdParty');
3323: l_user_id :=
3324: fnd_user_pkg.createuseridparty
3317: -- in Notification, put the password as '******'
3318:
3319: -- log file
3320: fnd_file.put_line
3321: (fnd_file.LOG,
3322: 'USER_SYNCHED , calling FND_USER_PKG.CreateUserIdParty');
3323: l_user_id :=
3324: fnd_user_pkg.createuseridparty
3325: (x_user_name => l_suggested_user_name,
3332: );
3333: x_user_name := l_suggested_user_name;
3334: x_password := '******';
3335: -- log file
3336: fnd_file.put_line
3337: (fnd_file.LOG,
3338: 'FND_USER_PKG.CreateUserIdParty l_user_id : ' ||
3339: l_user_id);
3340: END IF; -- l_test_user = 0 or 3
3333: x_user_name := l_suggested_user_name;
3334: x_password := '******';
3335: -- log file
3336: fnd_file.put_line
3337: (fnd_file.LOG,
3338: 'FND_USER_PKG.CreateUserIdParty l_user_id : ' ||
3339: l_user_id);
3340: END IF; -- l_test_user = 0 or 3
3341:
3362: );
3363: END IF;
3364:
3365: -- log file
3366: fnd_file.put_line (fnd_file.LOG, 'l_user_id : ' ||
3367: l_user_id);
3368: fnd_file.put_line (fnd_file.LOG, 'x_user_name : ' ||
3369: x_user_name);
3370:
3364:
3365: -- log file
3366: fnd_file.put_line (fnd_file.LOG, 'l_user_id : ' ||
3367: l_user_id);
3368: fnd_file.put_line (fnd_file.LOG, 'x_user_name : ' ||
3369: x_user_name);
3370:
3371: IF l_user_id IS NOT NULL
3372: THEN
3403: );
3404: END IF;
3405:
3406: -- log file
3407: fnd_file.put_line (fnd_file.LOG,
3408: 'assign responsibility to user created');
3409: fnd_file.put_line (fnd_file.LOG,
3410: 'l_responsibility_id : ' ||
3411: l_responsibility_id);
3405:
3406: -- log file
3407: fnd_file.put_line (fnd_file.LOG,
3408: 'assign responsibility to user created');
3409: fnd_file.put_line (fnd_file.LOG,
3410: 'l_responsibility_id : ' ||
3411: l_responsibility_id);
3412: fnd_file.put_line (fnd_file.LOG,
3413: 'l_security_grp_id : ' ||
3408: 'assign responsibility to user created');
3409: fnd_file.put_line (fnd_file.LOG,
3410: 'l_responsibility_id : ' ||
3411: l_responsibility_id);
3412: fnd_file.put_line (fnd_file.LOG,
3413: 'l_security_grp_id : ' ||
3414: l_security_grp_id);
3415: fnd_user_resp_groups_api.insert_assignment
3416: (user_id => l_user_id,
3447: );
3448: END IF;
3449:
3450: -- log file
3451: fnd_file.put_line (fnd_file.LOG,
3452: 'error in fnd_profile.save ');
3453: fnd_file.put_line (fnd_file.LOG, SQLERRM);
3454: RAISE fnd_api.g_exc_error;
3455: END IF;
3449:
3450: -- log file
3451: fnd_file.put_line (fnd_file.LOG,
3452: 'error in fnd_profile.save ');
3453: fnd_file.put_line (fnd_file.LOG, SQLERRM);
3454: RAISE fnd_api.g_exc_error;
3455: END IF;
3456: ELSE
3457: -- l_user_id is null, raise exception
3466: );
3467: END IF;
3468:
3469: -- log file
3470: fnd_file.put_line (fnd_file.LOG,
3471: 'l_user_id is null, raise exception ');
3472: fnd_file.put_line (fnd_file.LOG, SQLERRM);
3473: RAISE fnd_api.g_exc_error;
3474: END IF; -- l_user_id is not null
3468:
3469: -- log file
3470: fnd_file.put_line (fnd_file.LOG,
3471: 'l_user_id is null, raise exception ');
3472: fnd_file.put_line (fnd_file.LOG, SQLERRM);
3473: RAISE fnd_api.g_exc_error;
3474: END IF; -- l_user_id is not null
3475: ELSE -- l_test_user <> 0 ,3
3476: -- error, raise exception
3477: fnd_message.set_name ('OKS', 'OKS_SSO_TEST_USER_ERROR');
3478: fnd_message.set_token ('RETURN_VAL', l_test_user);
3479: fnd_msg_pub.ADD;
3480: -- log file
3481: fnd_file.put_line (fnd_file.LOG, 'OKS_SSO_TEST_USER_ERROR');
3482: fnd_file.put_line (fnd_file.LOG, 'l_test_user: ' ||
3483: l_test_user);
3484: RAISE fnd_api.g_exc_error;
3485: END IF; -- l_test_user check
3478: fnd_message.set_token ('RETURN_VAL', l_test_user);
3479: fnd_msg_pub.ADD;
3480: -- log file
3481: fnd_file.put_line (fnd_file.LOG, 'OKS_SSO_TEST_USER_ERROR');
3482: fnd_file.put_line (fnd_file.LOG, 'l_test_user: ' ||
3483: l_test_user);
3484: RAISE fnd_api.g_exc_error;
3485: END IF; -- l_test_user check
3486: ELSE -- csr_chk_qtc_fnd_user%FOUND
3490: THEN
3491: -- fnd user is valid
3492:
3493: -- log file
3494: fnd_file.put_line
3495: (fnd_file.LOG,
3496: 'chk_qtc_fnd_user%FOUND, check if the above fnd_user is valid');
3497: fnd_file.put_line (fnd_file.LOG,
3498: 'l_fnd_person_party_id : ' ||
3491: -- fnd user is valid
3492:
3493: -- log file
3494: fnd_file.put_line
3495: (fnd_file.LOG,
3496: 'chk_qtc_fnd_user%FOUND, check if the above fnd_user is valid');
3497: fnd_file.put_line (fnd_file.LOG,
3498: 'l_fnd_person_party_id : ' ||
3499: l_fnd_person_party_id);
3493: -- log file
3494: fnd_file.put_line
3495: (fnd_file.LOG,
3496: 'chk_qtc_fnd_user%FOUND, check if the above fnd_user is valid');
3497: fnd_file.put_line (fnd_file.LOG,
3498: 'l_fnd_person_party_id : ' ||
3499: l_fnd_person_party_id);
3500: fnd_file.put_line (fnd_file.LOG,
3501: 'l_person_party_id : ' ||
3496: 'chk_qtc_fnd_user%FOUND, check if the above fnd_user is valid');
3497: fnd_file.put_line (fnd_file.LOG,
3498: 'l_fnd_person_party_id : ' ||
3499: l_fnd_person_party_id);
3500: fnd_file.put_line (fnd_file.LOG,
3501: 'l_person_party_id : ' ||
3502: l_person_party_id);
3503:
3504: -- Check the person_party_id of the fnd_user
3514: --check the value of the profile option oks_override_sso and update
3515: --oks_k_headers_b table accordingly.
3516: IF NVL(FND_PROFILE.VALUE('OKS_OVERRIDE_SSO'),'N') <>'N'
3517: THEN
3518: fnd_file.put_line (fnd_file.LOG,'Overriding SSO behavior');
3519: --update oks_k_headers_b with fnd_profile value.
3520: UPDATE oks_k_headers_b
3521: SET person_party_id =l_fnd_person_party_id
3522: WHERE chr_id=p_contract_id;
3519: --update oks_k_headers_b with fnd_profile value.
3520: UPDATE oks_k_headers_b
3521: SET person_party_id =l_fnd_person_party_id
3522: WHERE chr_id=p_contract_id;
3523: fnd_file.put_line (fnd_file.LOG,'OKS Person Party ID updated to:'||l_fnd_person_party_id);
3524: ELSE
3525:
3526: fnd_file.put_line (fnd_file.LOG,'Using SSO behavior');
3527: -- fnd_user.person_party_id does NOT match oks_person_party_id
3522: WHERE chr_id=p_contract_id;
3523: fnd_file.put_line (fnd_file.LOG,'OKS Person Party ID updated to:'||l_fnd_person_party_id);
3524: ELSE
3525:
3526: fnd_file.put_line (fnd_file.LOG,'Using SSO behavior');
3527: -- fnd_user.person_party_id does NOT match oks_person_party_id
3528: -- get the party names from hz_parties and raise error
3529: -- oks person party name
3530: OPEN csr_get_per_party_name (p_party_id => l_person_party_id);
3530: OPEN csr_get_per_party_name (p_party_id => l_person_party_id);
3531: FETCH csr_get_per_party_name INTO l_oks_per_party_name;
3532: CLOSE csr_get_per_party_name;
3533: -- log file
3534: fnd_file.put_line (fnd_file.LOG,'OKS Person Party Name: '||l_oks_per_party_name);
3535:
3536: -- fnd person party name
3537: OPEN csr_get_per_party_name (p_party_id => l_fnd_person_party_id);
3538: FETCH csr_get_per_party_name INTO l_fnd_per_party_name;
3537: OPEN csr_get_per_party_name (p_party_id => l_fnd_person_party_id);
3538: FETCH csr_get_per_party_name INTO l_fnd_per_party_name;
3539: CLOSE csr_get_per_party_name;
3540: -- log file
3541: fnd_file.put_line (fnd_file.LOG,'FND Person Party Name: '||l_fnd_per_party_name);
3542:
3543: -- get the party name (organization name) for oks person
3544: OPEN csr_get_party_name (p_party_id => l_person_party_id);
3545: FETCH csr_get_party_name INTO l_oks_party_name, l_oks_party_id;
3544: OPEN csr_get_party_name (p_party_id => l_person_party_id);
3545: FETCH csr_get_party_name INTO l_oks_party_name, l_oks_party_id;
3546: CLOSE csr_get_party_name;
3547: -- log file
3548: fnd_file.put_line (fnd_file.LOG,'OKS Party Name: '||l_oks_party_name);
3549: fnd_file.put_line (fnd_file.LOG,'OKS Party ID: '||l_oks_party_id);
3550:
3551: -- get the party name (organization name) for FND person
3552: OPEN csr_get_party_name (p_party_id => l_fnd_person_party_id);
3545: FETCH csr_get_party_name INTO l_oks_party_name, l_oks_party_id;
3546: CLOSE csr_get_party_name;
3547: -- log file
3548: fnd_file.put_line (fnd_file.LOG,'OKS Party Name: '||l_oks_party_name);
3549: fnd_file.put_line (fnd_file.LOG,'OKS Party ID: '||l_oks_party_id);
3550:
3551: -- get the party name (organization name) for FND person
3552: OPEN csr_get_party_name (p_party_id => l_fnd_person_party_id);
3553: FETCH csr_get_party_name INTO l_fnd_party_name, l_fnd_party_id;
3552: OPEN csr_get_party_name (p_party_id => l_fnd_person_party_id);
3553: FETCH csr_get_party_name INTO l_fnd_party_name, l_fnd_party_id;
3554: CLOSE csr_get_party_name;
3555: -- log file
3556: fnd_file.put_line (fnd_file.LOG,'FND Party Name: '||l_fnd_party_name);
3557: fnd_file.put_line (fnd_file.LOG,'FND Party ID: '||l_fnd_party_id);
3558:
3559: -- set error message
3560: fnd_message.set_name ('OKS', 'OKS_SSO_PERSON_PARTY_ERROR');
3553: FETCH csr_get_party_name INTO l_fnd_party_name, l_fnd_party_id;
3554: CLOSE csr_get_party_name;
3555: -- log file
3556: fnd_file.put_line (fnd_file.LOG,'FND Party Name: '||l_fnd_party_name);
3557: fnd_file.put_line (fnd_file.LOG,'FND Party ID: '||l_fnd_party_id);
3558:
3559: -- set error message
3560: fnd_message.set_name ('OKS', 'OKS_SSO_PERSON_PARTY_ERROR');
3561: fnd_message.set_token ('OKS_USER_NAME', p_user_name);
3569: fnd_message.set_token ('FND_PERSON_PARTY_NAME', l_fnd_per_party_name); -- bug 6338286
3570: fnd_msg_pub.ADD;
3571:
3572: -- log file
3573: fnd_file.put_line (fnd_file.LOG, 'OKS_SSO_PERSON_PARTY_ERROR');
3574: RAISE fnd_api.g_exc_error;
3575: END IF; --profile value check
3576:
3577: END IF; -- person_party_id check
3587: fnd_message.set_name ('OKS', 'OKS_SSO_USER_EXPIRED');
3588: fnd_message.set_token ('USER_NAME', UPPER (TRIM (p_user_name)));
3589: fnd_msg_pub.ADD;
3590: -- log file
3591: fnd_file.put_line (fnd_file.LOG, 'OKS_SSO_USER_EXPIRED ');
3592: RAISE fnd_api.g_exc_error;
3593: END IF;
3594: END IF;
3595:
3595:
3596: CLOSE csr_chk_qtc_fnd_user;
3597:
3598: -- log file
3599: fnd_file.put_line (fnd_file.LOG, ' ');
3600: fnd_file.put_line
3601: (fnd_file.LOG,
3602: '---------------------------------------------------------- ');
3603: fnd_file.put_line (fnd_file.LOG, 'Leaving create_sso_user');
3596: CLOSE csr_chk_qtc_fnd_user;
3597:
3598: -- log file
3599: fnd_file.put_line (fnd_file.LOG, ' ');
3600: fnd_file.put_line
3601: (fnd_file.LOG,
3602: '---------------------------------------------------------- ');
3603: fnd_file.put_line (fnd_file.LOG, 'Leaving create_sso_user');
3604: fnd_file.put_line
3597:
3598: -- log file
3599: fnd_file.put_line (fnd_file.LOG, ' ');
3600: fnd_file.put_line
3601: (fnd_file.LOG,
3602: '---------------------------------------------------------- ');
3603: fnd_file.put_line (fnd_file.LOG, 'Leaving create_sso_user');
3604: fnd_file.put_line
3605: (fnd_file.LOG,
3599: fnd_file.put_line (fnd_file.LOG, ' ');
3600: fnd_file.put_line
3601: (fnd_file.LOG,
3602: '---------------------------------------------------------- ');
3603: fnd_file.put_line (fnd_file.LOG, 'Leaving create_sso_user');
3604: fnd_file.put_line
3605: (fnd_file.LOG,
3606: '---------------------------------------------------------- ');
3607: fnd_file.put_line (fnd_file.LOG, ' ');
3600: fnd_file.put_line
3601: (fnd_file.LOG,
3602: '---------------------------------------------------------- ');
3603: fnd_file.put_line (fnd_file.LOG, 'Leaving create_sso_user');
3604: fnd_file.put_line
3605: (fnd_file.LOG,
3606: '---------------------------------------------------------- ');
3607: fnd_file.put_line (fnd_file.LOG, ' ');
3608: -- Standard call to get message count and if count is 1, get message info.
3601: (fnd_file.LOG,
3602: '---------------------------------------------------------- ');
3603: fnd_file.put_line (fnd_file.LOG, 'Leaving create_sso_user');
3604: fnd_file.put_line
3605: (fnd_file.LOG,
3606: '---------------------------------------------------------- ');
3607: fnd_file.put_line (fnd_file.LOG, ' ');
3608: -- Standard call to get message count and if count is 1, get message info.
3609: fnd_msg_pub.count_and_get (p_encoded => 'F',
3603: fnd_file.put_line (fnd_file.LOG, 'Leaving create_sso_user');
3604: fnd_file.put_line
3605: (fnd_file.LOG,
3606: '---------------------------------------------------------- ');
3607: fnd_file.put_line (fnd_file.LOG, ' ');
3608: -- Standard call to get message count and if count is 1, get message info.
3609: fnd_msg_pub.count_and_get (p_encoded => 'F',
3610: p_count => x_msg_count,
3611: p_data => x_msg_data
3638: l_api_name
3639: );
3640: END IF;
3641:
3642: fnd_file.put_line (fnd_file.LOG, '2000: Leaving create_sso_user');
3643:
3644: x_return_status := g_ret_sts_error;
3645: fnd_msg_pub.count_and_get (p_encoded => 'F',
3646: p_count => x_msg_count,
3659: l_api_name
3660: );
3661: END IF;
3662:
3663: fnd_file.put_line (fnd_file.LOG, '3000: Leaving create_sso_user');
3664:
3665: x_return_status := g_ret_sts_unexp_error;
3666: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
3667: fnd_msg_pub.count_and_get (p_encoded => 'F',
3681: l_api_name
3682: );
3683: END IF;
3684:
3685: fnd_file.put_line (fnd_file.LOG, '4000: Leaving create_sso_user');
3686:
3687: x_return_status := g_ret_sts_error;
3688: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
3689: fnd_msg_pub.count_and_get (p_encoded => 'F',