HI!!! Cocoa, Obj-C. With the help of this procedure I check whether the password has been entered correctly. But the code works only for the user with admins rights. How do I check the password being a standard user?
Cod: -(BOOL) authenticatePassword:(NSString *)password :(NSString *)userName { AuthorizationRef authorization; OSStatus status,status1; AuthorizationFlags Flags; AuthorizationItem envItems[2]; return YES; envItems[0].name = kAuthorizationEnvironmentPassword; envItems[0].value = [password cStringUsingEncoding:NSUTF8StringEncoding]; envItems[0].valueLength = strlen([password cStringUsingEncoding:NSUTF8StringEncoding]); envItems[0].flags = 0; envItems[1].name = kAuthorizationEnvironmentUsername; envItems[1].value = [userName cStringUsingEncoding:NSUTF8StringEncoding]; envItems[1].valueLength = strlen([userName cStringUsingEncoding:NSUTF8StringEncoding]); envItems[1].flags = 0; AuthorizationItemSet env = { 2, envItems }; status = AuthorizationCreate(NULL, &env, kAuthorizationFlagDefaults, &authorization); if (status != errAuthorizationSuccess) { NSLog(@"AuthorizationCreate NOT Success"); return NO; }else{ NSLog(@"AuthorizationCreate Success"); } AuthorizationRights myRights = {2, &envItems}; AuthorizationEnvironment kEnvironment = { 2, envItems }; Flags = kAuthorizationFlagDefaults | kAuthorizationFlagExtendRights; status1 = AuthorizationCopyRights (authorization,&myRights, &kEnvironment, Flags, NULL ); if (status1 != errAuthorizationSuccess) { NSLog(@"AuthorizationCopyRights NOT Success"); return NO; }else{ NSLog(@"AuthorizationCopyRights Success"); return YES; } return NO; } ________________________________________________________ Вы уже с Yahoo!? Испытайте обновленную и улучшенную. Yahoo! Почту! http://ru.mail.yahoo.com _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]