Index: class.accounts.inc.php
===================================================================
RCS file: /var/cvs/phpgroupware/phpgwapi/inc/class.accounts.inc.php,v
retrieving revision 1.10.4.11
diff -u -r1.10.4.11 class.accounts.inc.php
--- class.accounts.inc.php	10 Feb 2004 13:51:17 -0000	1.10.4.11
+++ class.accounts.inc.php	2 Jun 2004 11:45:38 -0000
@@ -154,29 +154,29 @@
 			$type = $contacts->search_contact_type('Persons');
 
 			$comms=(is_array($userData['extra_contact']['comms'])) ? $userData['extra_contact']['comms'] : false;
-                        $principal=(is_array($userData['extra_contact']['principal'])) ? $userData['extra_contact']['principal'] : false;
-                        $locations=(is_array($userData['extra_contact']['locations'])) ? $userData['extra_contact']['locations'] : false;
-                        $categories=(is_array($userData['extra_contact']['categories'])) ? $userData['extra_contact']['categories'] : false;
-                        $others=(is_array($userData['extra_contact']['others'])) ? $userData['extra_contact']['others'] : false;
-                        $notes=(is_array($userData['extra_contact']['notes'])) ? $userData['extra_contact']['notes'] : false;
-                        $relationship=(is_array($userData['extra_contact']['relationship'])) ? $userData['extra_contact']['relationship'] : false;
+			$principal=(is_array($userData['extra_contact']['principal'])) ? $userData['extra_contact']['principal'] : false;
+			$locations=(is_array($userData['extra_contact']['locations'])) ? $userData['extra_contact']['locations'] : false;
+			$categories=(is_array($userData['extra_contact']['categories'])) ? $userData['extra_contact']['categories'] : false;
+			$others=(is_array($userData['extra_contact']['others'])) ? $userData['extra_contact']['others'] : false;
+			$notes=(is_array($userData['extra_contact']['notes'])) ? $userData['extra_contact']['notes'] : false;
+			$relationship=(is_array($userData['extra_contact']['relationship'])) ? $userData['extra_contact']['relationship'] : false;
 
 			$principal['owner'] = $owner;
-                        $principal['access']= 'public';
-                        $principal['per_prefix'] = $userData['account_lid'];
-                        $principal['per_first_name'] = $userData['account_firstname'];
-                        $principal['per_last_name'] = $userData['account_lastname'];
+			$principal['access']= 'public';
+			$principal['per_prefix'] = $userData['account_lid'];
+			$principal['per_first_name'] = $userData['account_firstname'];
+			$principal['per_last_name'] = $userData['account_lastname'];
 			
 			if(isset($userData['domain']))
-                        {
-                                $domain=$userData['domain'];
-                        }
-                        else
-                        {
-                                $domain=$GLOBALS['phpgw_info']['server']['mail_server'];
-                        }
-                        if($domain)//Attempts to grab domain succeded
-                        {
+			{
+				$domain=$userData['domain'];
+			}
+			else
+			{
+				$domain=$GLOBALS['phpgw_info']['server']['mail_server'];
+			}
+			if($domain)//Attempts to grab domain succeded
+			{
                                 $comm['comm_descr']=$contacts->search_comm_descr('work email');
                                 $comm['comm_data']=$userData['account_lid'].'@'.$domain;
                                 $comm['comm_preferred']='Y';
@@ -725,5 +725,30 @@
 		function delete_account4Group($groupID)
 		{
 		}
+		
+		/**
+		*Specified in childs
+		*
+		*/
+		function get_list($_type='both', $start = -1,$sort = '', $order = '', $query = '', $offset = -1)
+		{
+		}
+		
+		/**
+		*Specified in childs
+		*
+		*/
+		function get_account_with_contact()
+		{
+		}
+
+		/**
+		*Specified in childs
+		*
+		*/
+		function get_account_without_contact()
+		{
+		}
+		
 	}
 ?>
Index: class.accounts_ldap.inc.php
===================================================================
RCS file: /var/cvs/phpgroupware/phpgwapi/inc/class.accounts_ldap.inc.php,v
retrieving revision 1.101.2.13.2.29
diff -u -r1.101.2.13.2.29 class.accounts_ldap.inc.php
--- class.accounts_ldap.inc.php	1 May 2004 09:50:43 -0000	1.101.2.13.2.29
+++ class.accounts_ldap.inc.php	2 Jun 2004 11:45:38 -0000
@@ -116,9 +116,6 @@
 			}
 			else
 			{
-				/* this line is not working
-				$this->data['person_id'] = $this->save_contact_for_account($this->data);
-				*/
 				return $this->create_account($this->data, '');			
 			}
 		}
@@ -560,7 +557,7 @@
 		* @param string $dn LDAP distinguised name
 		* @return array|boolean Array with 'dn' infos or false
 		*/
-		function account_exists($id, $dn = '')
+		function account_exists($id, $dn = null)
 		{
 			if ($id)
 			{
@@ -570,10 +567,10 @@
 				{
 					return $allValues[0];
 				}
-				else
-				{
-					return $this->dn_exists($dn);
-				}
+			}
+			if($dn)
+			{
+				return $this->dn_exists($dn);
 			}
 			return false;
 		}
@@ -733,9 +730,17 @@
 			{
 				$entry['phpgwlastpasswordchange'] = $account_info['lastpasswd_change'];
 			}
-				
+			if((int) $account_info['person_id'])  //alters the structural objectclass in LDAP
+			{
+				$entry['objectclass'][] = 'phpgwContact'; // shouldn't be structural
+				$entry['phpgwcontactid'] = (int)$account_info['person_id'];
+			}
+			else
+			{
+				$entry['objectclass'][]       = 'account';
+			}				
+			
 			// additional attributes from the phpgw for groups
-			$entry['objectclass'][]       = 'account';
 			$entry['objectclass'][]       = 'posixAccount';
 			$entry['cn']                  = utf8_encode($this->get_fullname($account_info['account_firstname'], $account_info['account_lastname']));
 			$entry['uidnumber']           = $account_info['account_id'];
@@ -749,6 +754,10 @@
 			{
 				$entry['sn'] = utf8_encode($account_info['account_lastname']);
 			}
+			else
+			{
+				$entry['sn'] = ' ';
+			}
 			if ($account_info['account_passwd'])
 			{
 				$entry['userpassword'] = $GLOBALS['phpgw']->common->encrypt_password($account_info['account_passwd']);
@@ -759,7 +768,6 @@
 			// In fact the loginshell is not Required (Must) it's only optional (May) in posixAccount (Caeies), so don't need it now
 			//$entry['loginshell']          = $this->get_loginshell($account_info['loginshell']);
 
-				
 			// special gidnumber handling
 			if ($GLOBALS['phpgw_info']['server']['ldap_group_id'])
 			{
@@ -767,7 +775,7 @@
 			}
 			else
 			{
-				$entry['gidnumber']           = $account_info['account_id'];
+				$entry['gidnumber'] = $account_info['account_id'];
 			}
 
 			$oldEntry = $this->account_exists($account_info['account_id'], $dn);
@@ -798,7 +806,7 @@
 										$oldEntry['dn'] = $this->rename_LDAP_entry($oldEntry['dn'], $dn, $this->user_context);
 										if (!$oldEntry)
 										{
-                                                                                      die('ldap_rename FAILED: [' . ldap_errno($this->ds) . '] ' . ldap_error($this->ds));
+											die('ldap_rename FAILED: [' . ldap_errno($this->ds) . '] ' . ldap_error($this->ds));
 										}											
 									}
 									break;
@@ -840,12 +848,13 @@
 						} 
 					}
 					$this->modify_LDAP_Entry($oldEntry['dn'], $entry);
+					$dn = $oldEntry['dn'];
 				}
 			}
 			else // entry not yet in LDAP
 			{
 				$this->add_LDAP_Entry($dn, $entry);
-			}				
+			}
 		}
 		
 		/**
@@ -867,7 +876,7 @@
 			// additional attributes from the phpgw for groups
 			$entry['objectclass'][]  = 'posixGroup';
 			$entry['cn']             = $account_info['account_lid'];
-			$entry['description']    = utf8_encode(str_replace('*', '', lang('phpgw-created group')));
+			$entry['description']    = utf8_encode(lang('phpgw-created group'));
 			$entry['memberuid']      = $this->get_memberUIDs($account_info['account_id']);
 			if (!$entry['memberuid'])
 			{
@@ -1193,33 +1202,16 @@
 
 		function get_account_with_contact()
 		{
-			$sri = ldap_search($this->ds, $this->user_context, "(&(phpgwaccounttype=u)(phpgwpersonid=*))", array('uidnumber', 'phpgwpersonid'));
-			$allValues = ldap_get_entries($this->ds, $sri);
-			if(is_array($allValues))
-			{
-				$count = intval($allValues['count']);
-				for($i=0;$i<$count; $i++)
-				{
-					$value = &$allValue[$i];
-					$accounts[$value['uidnumber'][0]] = $value['phpgwpersonid'][0];
-				}
-			}
-			
-			return $accounts;
+			// this method is used to sync accounts with contacts with isn't really
+			// doing something usefull - so I better return null here (fips)
+			return null;
 		}
 
 		function get_account_without_contact()
 		{
-			$sri = ldap_search($this->ds, $this->user_context, "(&(phpgwaccounttype=u)(!(phpgwpersonid=*)))", array('uidnumber'));
-			$allValues = ldap_get_entries($this->ds, $sri);
-			if(is_array($allValues))
-			{
-				foreach($allValues as $value)
-				{
-					$accounts[] = $value['uidnumber'][0];
-				}
-			}
-			return $accounts;
+			// this method is used to sync accounts with contacts with isn't really
+			// doing something usefull - so I better return null here (fips)
+			return null;
 		}
 		
 		/**
@@ -1427,5 +1419,6 @@
 			}
 			return false;
 		}
+		
 	}
 ?>
Index: class.accounts_sql.inc.php
===================================================================
RCS file: /var/cvs/phpgroupware/phpgwapi/inc/class.accounts_sql.inc.php,v
retrieving revision 1.80.2.8.2.32
diff -u -r1.80.2.8.2.32 class.accounts_sql.inc.php
--- class.accounts_sql.inc.php	11 Mar 2004 15:08:12 -0000	1.80.2.8.2.32
+++ class.accounts_sql.inc.php	2 Jun 2004 11:45:38 -0000
@@ -360,10 +360,6 @@
 
 		function create($account_info,$default_prefs=True)
 		{
-			if($this->account_type=='u')
-			{
-				$account_info['person_id'] = $this->save_contact_for_account($account_info);
-			}
 			if(!isset($account_info['person_id']) || $account_info['person_id']=='')
 			{
 				$account_info['person_id']='NULL';
