views:

62

answers:

1

Hello, I'm making an application for someone, and theres some things I'd like to monitor. I have NSLogs all set in place for each action, but I want to be able to send those to a console or something. Is there anyway of doing this? Also I don't want the user to know about it, I'm monitoring this because I gave the user a password for an account he has to manage, and I want to see what he's doing to make sure he's not breaking any rules.

+2  A: 
EnOpenUK
This person is doing a job for me, but has the accessibility to change passwords, and publish things that SHOULD NOT BE PUBLISHED. This is why I would like to monitor his actions. He would be on a computer nowhere near me.
Daniel Ricany
Does he require the functionality then? If he has access to those then I can see your concern - that's a giant security problem.I may be wrong, but I'd create a simple PHP script to send an email. Pass it a string(s) in the URL, (script.php?event="password-change" etc) then have the PHP Script called by [NSString setStringWithContentsOfURL] - with the URL as an argument, then just check the NSString to ensure it went correctly. You could even make a wrapper function for it.There maybe nicer options, but IMO this will get the job done. Of course, the functionality shouldn't even be there.
EnOpenUK
But its not on my website, its on another company's website.
Daniel Ricany
Edited to explain solution; note; the PHP script can be on anyone's server - as long as its accessible.
EnOpenUK
Ah, this is why I love knowing Objective-C *and* web-programming languages. :) Thanks for this!
esqew
Daniel Ricany
Let me just check this - you developed this application yourself? I did say I hadn't tested that code and it was just an explanation for how such a solution could be implemented. That code is a PHP script you would place on your own server. The Objective-C method would take an NSString as an argument, this is what you'd want emailed to you. The Objective-C method then loads the PHP script (located where I have put "xxxxxxxx") - which will email you. Encoding is an argument of "stringWithContentsOfURL" method of NSString.
EnOpenUK
I made the application for another site, I did not create the site. I have no control of what he does once he has the password, but he needs the password for the job. Understand now?
Daniel Ricany
It still isn't working...I can't figure out what's going wrong. I've made a new webpage, I edited the .html file so that its just the PHP script, and I just can't figure out whats going wrong. Can you tell me if I'm doing this right, and be detailed when explaining? Thank you.
Daniel Ricany
-(BOOL) userRuleBreak:(NSString *)incident{ NSURL *alert = [NSURL URLWithString:[NSString stringWithFormat:@"http://www.applehack23.com/AppleHack23/Server.html/perm.php?incident=%s NSString *status = [NSString stringWithContentsOfURL:[alert encoding:NSASCIIStringEncoding]]; if( [[SpecialCodeTextField stringValue] isEqualToString:@"abc"] ){ return YES; } else { return NO; }}
Daniel Ricany