Index: profile_enforcer.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/profile_enforcer/profile_enforcer.module,v
retrieving revision 1.2
diff -u -r1.2 profile_enforcer.module
--- profile_enforcer.module	30 May 2007 02:26:14 -0000	1.2
+++ profile_enforcer.module	7 Jun 2007 01:18:19 -0000
@@ -109,40 +109,40 @@
 			if ( !isset($user) ) {
 				global $user;
 			}
-			if ( variable_get('profile_enforcer_debugger') ) {
+			if ( variable_get('profile_enforcer_debugger','0') ) {
 				$block['subject'] = t('PROFILE ENFORCER (DEBUGGING)');
 			}
 
 			// did they finish their profile?
-			if ( variable_get('profile_enforcer_profile') && module_exists('profile') && !profile_complete() ) {
-				if ( variable_get('profile_enforcer_debugger') ) {
+			if ( variable_get('profile_enforcer_profile','0') && module_exists('profile') && !profile_complete() ) {
+				if ( variable_get('profile_enforcer_debugger','0') ) {
 					$items[] = 'PROFILE IS BOUncING YOU';
 				}
-				prbouncer('profile', preg_replace('/%uid/',$user->uid,variable_get('profile_enforcer_profile_url')) );
+				prbouncer('profile', preg_replace('/%uid/',$user->uid,variable_get('profile_enforcer_profile_url','0')) );
 			}
 			// did they put in a location?
-			elseif ( variable_get('profile_enforcer_location') && module_exists('location') && !location_complete() ) {
-				if ( variable_get('profile_enforcer_debugger') ) {
+			elseif ( variable_get('profile_enforcer_location','0') && module_exists('location') && !location_complete() ) {
+				if ( variable_get('profile_enforcer_debugger','0') ) {
 					$items[] = 'Location is bouncing you ';
 				}
 				//$items[] = "<PRE>" . sprint_r( location_load_locations( 'user',$user ) ) . "</pre>";
-				prbouncer('location information', preg_replace('/%uid/',$user->uid,variable_get('profile_enforcer_location_url')) );
+				prbouncer('location information', preg_replace('/%uid/',$user->uid,variable_get('profile_enforcer_location_url','0')) );
 			}
 
 
 
 			// debugging output only
-			if ( variable_get('profile_enforcer_debugger') ) {
+			if ( variable_get('profile_enforcer_debugger','0') ) {
 				$items[] = 'PROFILE IS COMPLETE!';
 			}
-			if ( variable_get('profile_enforcer_debugger') ) {
+			if ( variable_get('profile_enforcer_debugger','0') ) {
 				$items[] = 'LOCATION INFO IS COMPLETE!';
 			}
 
 
 			// are there any other fields?
-			if ( variable_get('profile_enforcer_other_fields') != '' ) {
-				$fields = preg_split('/,/', variable_get('profile_enforcer_other_fields'));
+			if ( variable_get('profile_enforcer_other_fields','0') != '' ) {
+				$fields = preg_split('/,/', variable_get('profile_enforcer_other_fields','0'));
 				foreach ($fields as $a_field) {
 					list($field,$url) = preg_split('/\|/', $a_field);
 					list($tab,$fld) = preg_split('/\./', $field);
@@ -150,19 +150,19 @@
 					$sth = mysql_query( $statement ) or die('SQL ERROR: $statement<HR>' . mysql_error());
 					list($thecount) = mysql_fetch_row($sth);
 					if ( $thecount ) {
-						if ( variable_get('profile_enforcer_debugger') ) {
+						if ( variable_get('profile_enforcer_debugger','0') ) {
 							$items[] = "TEST PASSED FOR $tab.$fld";
 						}
 					}
 					else {
-						if ( variable_get('profile_enforcer_debugger') ) {
+						if ( variable_get('profile_enforcer_debugger','0') ) {
 							$items[] = "Required field is empty: $tab.$fld<BR>$statement<BR>C=$thecount";
 						}
 						prbouncer("$tab.$fld",$url);
 					}
 				}
 			}
-			if ( variable_get('profile_enforcer_debugger') ) {
+			if ( variable_get('profile_enforcer_debugger','0') ) {
 				$block['content'] = theme('item_list',$items);
 			}
 			return $block;
@@ -226,15 +226,15 @@
 	// bounce them if they're not on an edit page.
 	$current_url = preg_replace('/^\//','',$_SERVER['REQUEST_URI']);
 	if ( $dest_url == $current_url ) {
-		drupal_set_message( variable_get('profile_enforcer_profile_message') ,'error');
+		drupal_set_message( variable_get('profile_enforcer_profile_message','') ,'error');
 	}
 	// if they're on ANY user page leave'em alone
 	elseif ( preg_match('/user/',$current_url) ) {
-		drupal_set_message( variable_get('profile_enforcer_profile_message') ,'error');
+		drupal_set_message( variable_get('profile_enforcer_profile_message','') ,'error');
 	}
 	else {
 		global $user;
-		if ( variable_get('profile_enforcer_debugger') ) {
+		if ( variable_get('profile_enforcer_debugger','0') ) {
 			drupal_set_message("Profile Enforcer Debuggin: Requried information ($req_info) is not complete.  Redir would go to $dest_url (but we're in debugging mode). You are here: $current_url",'error');
 		}
 		else {
