Fixes for php3 and ldapimport/export

This commit is contained in:
Miles Lott 2001-06-28 08:59:39 +00:00
parent 4bd07b53e2
commit 43d0b504ae
2 changed files with 18 additions and 9 deletions

View File

@ -294,8 +294,12 @@
} }
} }
function isin_array($needle,$haystack=array()) function isin_array($needle,$haystack='')
{ {
if(gettype($haystack) != 'array')
{
return False;
}
for($i=0;$i<count($haystack) && $haystack[$i] !=$needle;$i++); for($i=0;$i<count($haystack) && $haystack[$i] !=$needle;$i++);
return ($i!=count($haystack)); return ($i!=count($haystack));
} }
@ -489,7 +493,7 @@
} }
$ds = $phpgw->common->ldapConnect(); $ds = $phpgw->common->ldapConnect();
$acct_type = $this->acct_type; $acct_type = $this->get_type($account_id);
if ($acct_type == 'g' && $phpgw_info['server']['ldap_group_context']) if ($acct_type == 'g' && $phpgw_info['server']['ldap_group_context'])
{ {
@ -537,16 +541,16 @@
$this->acct_type = $account_type; $this->acct_type = $account_type;
/* echo '<br>in create for account_lid: "'.$account_lid.'"'; */ /* echo '<br>in create for account_lid: "'.$account_lid.'"'; */
if (empty($account_info['id']) || !$account_info['id']) if (empty($account_info['account_id']) || !$account_info['account_id'])
{ {
$account_id = $this->get_nextid($account_info['account_type']); $account_id = $this->get_nextid($account_info['account_type']);
/* echo '<br>using'.$account_id;exit; */ /* echo '<br>using'.$account_id;exit; */
} }
else
{
$account_id = $account_info['account_id'];
}
$entry['userpassword'] = $account_info['account_passwd']; $entry['userpassword'] = $account_info['account_passwd'];
// $entry['phpgwaccountlastlogin'] = $account_info['lastlogin'];
// $entry['phpgwaccountlastloginfrom'] = $account_info['lastloginfrom'];
// $entry['phpgwlastpasswdchange'] = $account_info['lastpasswd_change'];
// $entry['phpgwaccountstatus'] = $account_info['account_status'];
$entry['phpgwaccounttype'] = $account_info['account_type']; $entry['phpgwaccounttype'] = $account_info['account_type'];
$entry['phpgwaccountexpires'] = $account_info['account_expires']; $entry['phpgwaccountexpires'] = $account_info['account_expires'];
@ -673,6 +677,11 @@
$entry['objectclass'][5] = 'shadowAccount'; $entry['objectclass'][5] = 'shadowAccount';
$entry['objectclass'][5] = 'phpgwAccount'; $entry['objectclass'][5] = 'phpgwAccount';
} }
/*
echo '<pre>';
var_dump($entry);
echo '</pre>';
*/
ldap_add($ds, $dn, $entry); ldap_add($ds, $dn, $entry);
} }

View File

@ -254,7 +254,7 @@
function create($account_info) function create($account_info)
{ {
if (empty($account_info['id']) || !$account_info['id']) if (empty($account_info['account_id']) || !$account_info['account_id'])
{ {
$account_id = $this->get_nextid($account_info['account_type']); $account_id = $this->get_nextid($account_info['account_type']);
/* echo '<br>using'.$account_id;exit; */ /* echo '<br>using'.$account_id;exit; */