mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-27 02:14:45 +01:00
Add csv type and check for it
This commit is contained in:
parent
b6b282ab36
commit
e6cea5377d
@ -93,7 +93,7 @@
|
||||
$buffer = $o->import_end_record($buffer,$private);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
} elseif ($o->type == 'ldif') {
|
||||
while ($data = fgets($fp,8000)) {
|
||||
list($name,$value,$url) = split(':', $data);
|
||||
if (substr($name,0,2) == 'dn') {
|
||||
@ -117,15 +117,25 @@
|
||||
$buffer = $o->import_end_record($buffer,$private);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$buffer = $o->import_start_record($buffer);
|
||||
while ($data = fgets($fp,8000)) {
|
||||
list($name,$value) = split(':', $data);
|
||||
if ($o->import[$name] != "" && $value != "") {
|
||||
$buffer = $o->import_new_attrib($buffer, $o->import[$name],$value);
|
||||
}
|
||||
}
|
||||
$buffer = $o->import_end_record($buffer,$private);
|
||||
}
|
||||
|
||||
fclose($fp);
|
||||
|
||||
$buffer = $o->import_end_file($buffer);
|
||||
|
||||
if ($download == "") {
|
||||
if($conv_type=="Debug LDAP" || $conv_type=="Debug SQL" ) {
|
||||
header("Content-disposition: attachment; filename=\"conversion.txt\"");
|
||||
header("Content-type: application/octetstream");
|
||||
header("Content-length: ".strlen($buffer));
|
||||
header("Pragma: no-cache");
|
||||
header("Expires: 0");
|
||||
echo $buffer;
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
class import_conv
|
||||
{
|
||||
var $type = '';
|
||||
var $type = 'csv';
|
||||
var $basedn;
|
||||
var $contactsdn;
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
class import_conv
|
||||
{
|
||||
var $type = '';
|
||||
var $type = 'csv';
|
||||
var $currentrecord; //used for buffering to allow uid lines to go first
|
||||
|
||||
var $import = array(
|
||||
|
@ -83,17 +83,13 @@
|
||||
global $phpgw,$phpgw_info;
|
||||
|
||||
$contacts = CreateObject("phpgwapi.contacts");
|
||||
//echo '<br>';
|
||||
echo '<br>';
|
||||
for ($i=1;$i<=count($buffer);$i++) {
|
||||
while ( list($name,$value) = @each($buffer[$i]) ) {
|
||||
echo '<br>'.$i.': '.$name.' => '.$value;
|
||||
$entry[$i][$name] = $value;
|
||||
}
|
||||
$entry[$i]['email_type'] = 'INTERNET';
|
||||
$entry[$i]['email_home_type'] = 'INTERNET';
|
||||
$entry[$i]['adr_one_type'] = 'intl';
|
||||
$entry[$i]['adr_two_type'] = 'intl';
|
||||
//echo '<br>';
|
||||
echo '<br>';
|
||||
//$contacts->add($phpgw_info["user"]["account_id"],$entry[$i]);
|
||||
}
|
||||
$num = $i - 1;
|
||||
|
Loading…
Reference in New Issue
Block a user