Licensing MenuTunes under the GNU General Public License version 2.
[MenuTunes.git] / NetworkObject.m
index 4473970..7c5a018 100755 (executable)
@@ -1,20 +1,3 @@
-/*
- *  MenuTunes
- *  NetworkObject
- *    Remote network object that is vended
- *
- *  Original Author : Kent Sutherland <ksutherland@ithinksw.com>
- *   Responsibility : Kent Sutherland <ksutherland@ithinksw.com>
- *
- *  Copyright (c) 2002 - 2003 iThink Software.
- *  All Rights Reserved
- *
- *     This header defines the Objective-C protocol which all MenuTunes Remote
- *  plugins must implement.  To build a remote, create a subclass of this
- *  object, and implement each method in the @protocol below.
- *
- */
-
 #import "NetworkObject.h"
 #import "MainController.h"
 #import <ITMTRemote/ITMTRemote.h>
@@ -24,6 +7,7 @@
 - (id)init
 {
     if ( (self = [super init]) ) {
+        _valid = YES;
         if (![self requiresPassword]) {
             _authenticated = YES;
         } else {
@@ -35,7 +19,7 @@
 
 - (ITMTRemote *)remote
 {
-    if (_authenticated) {
+    if (_authenticated && _valid) {
         return [[MainController sharedController] currentRemote];
     } else {
         return nil;
@@ -52,7 +36,7 @@
 
 - (BOOL)requiresPassword
 {
-    return [[NSUserDefaults standardUserDefaults] boolForKey:@"enableSharingPassword"];
+    return ([[[NSUserDefaults standardUserDefaults] dataForKey:@"sharedPlayerPassword"] length] > 0);
 }
 
 - (BOOL)sendPassword:(NSData *)password
     }
 }
 
+- (void)invalidate
+{
+    _valid = NO;
+}
+
+- (void)makeValid
+{
+    _valid = YES;
+}
+
+- (BOOL)isValid
+{
+    return _valid;
+}
+
 @end