Changeset 5346 for trunk/expressoMail1_2/inc
- Timestamp:
- 01/10/12 14:54:53 (12 years ago)
- Location:
- trunk/expressoMail1_2/inc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/inc/class.db_functions.inc.php
r5316 r5346 354 354 355 355 function import_vcard($params){ 356 357 include_once('class.imap_functions.inc.php'); 358 $objImap = new imap_functions(); 359 $msg_number = $params['msg_number']; 360 $idx_file = $params['idx_file']; 361 $msg_part = $params['msg_part']; 362 $msg_folder = $params['msg_folder']; 356 include_once('class.imap_functions.inc.php'); 357 $objImap = new imap_functions(); 358 $msg_number = $params['msg_number']; 359 $idx_file = $params['idx_file']; 360 $msg_part = $params['msg_part']; 361 $msg_folder = $params['msg_folder']; 363 362 $from_ajax = $params['from_ajax']; 364 365 363 $encoding = strtolower($params['encoding']); 364 $fileContent = ""; 366 365 $cirus_delimiter = $params['cirus_delimiter']; 367 366 $expFolder = explode($cirus_delimiter, $msg_folder); … … 369 368 if($msg_number != null && $msg_part != null && $msg_folder != null && (intval($idx_file == '0' ? '1' : $idx_file))) 370 369 { 371 require_once dirname(__FILE__).'/class.attachment.inc.php';370 require_once PHPGW_INCLUDE_ROOT.'/expressoMail1_2/inc/class.attachment.inc.php'; 372 371 $attachmentObj = new attachment(); 373 372 $attachmentObj->setStructureFromMail($msg_folder,$msg_number); … … 375 374 $info = $attachmentObj->getAttachmentInfo($msg_part); 376 375 $filename = $info['name']; 377 378 379 380 381 // It's necessary to access calendar method. 376 } 377 else 378 $filename = $idx_file; 379 380 // It's necessary to access calendar method. 382 381 $GLOBALS['phpgw_info']['flags']['noappheader'] = True; 383 382 $GLOBALS['phpgw_info']['flags']['noappfooter'] = True; 384 383 $GLOBALS['phpgw_info']['flags']['currentapp'] = 'calendar'; 385 include_once(PHPGW_INCLUDE_ROOT.'/header.inc.php'); 386 $uiicalendar = CreateObject("calendar.uiicalendar"); 387 384 include_once(PHPGW_INCLUDE_ROOT.'/header.inc.php'); 385 $uiicalendar = CreateObject("calendar.uiicalendar"); 386 if($params['selected'] || $params['readable']){ 387 ob_start(); 388 print_r( "=== LOG BEGIN ===" . "\n" ); 389 print_r( var_export($fileContent) . "\n" ); 390 print_r( "=== LOG END ===" . "\n" ); 391 $output2 = ob_get_clean(); 392 file_put_contents( '/tmp/log-gustavo2.txt', file_get_contents( '/tmp/log-gustavo2.txt' ) . $output2 ); 393 $_REQUEST['data'] = $fileContent; 394 $_REQUEST['type'] = 'iCal'; 395 $_REQUEST['params']['calendar'] = $params['selected']; 396 $_REQUEST['readable'] = $params['readable'] ? true : false; 397 $_REQUEST['params']['status'] = $params['status']; 398 $_REQUEST['params']['owner'] = $_SESSION['phpgw_info']['expressomail']['user']['account_id']; 399 ob_start(); 400 include_once(PHPGW_INCLUDE_ROOT.'/prototype/converter.php'); 401 $output = ob_get_clean(); 402 $valid = json_decode($output, true); 403 404 ob_start(); 405 print_r( "=== LOG BEGIN ===" . "\n" ); 406 print_r( var_export($output) . "\n" ); 407 print_r( var_export($valid) . "\n" ); 408 print_r( "=== LOG END ===" . "\n" ); 409 $output2 = ob_get_clean(); 410 file_put_contents( '/tmp/log-gustavo2.txt', file_get_contents( '/tmp/log-gustavo2.txt' ) . $output2 ); 411 412 if($_REQUEST['readable']){ 413 if(!$valid) 414 { 415 $return = false; 416 $output = unserialize($output); 417 foreach($output[0] as $key => $value){ 418 if(array_key_exists("id",$output[0][$key])) 419 $return = true; 420 } 421 return $return; 422 } 423 return false; 424 } 425 426 if(empty($valid)) 427 return "error"; 428 return "ok"; 429 } 388 430 if(strtoupper($expFolder[0]) == 'USER' && $expFolder[1]) // IF se a conta o ical estiver em uma conta compartilhada 389 431 { -
trunk/expressoMail1_2/inc/class.imap_functions.inc.php
r5318 r5346 2592 2592 if ( $deny ) 2593 2593 return "The server denied your request to send a mail, you cannot use this mail address."; 2594 } 2595 $toaddress = implode(',',$db->getAddrs(explode(',',$params['input_to']))); 2596 $ccaddress = implode(',',$db->getAddrs(explode(',',$params['input_cc']))); 2597 $ccoaddress = implode(',',$db->getAddrs(explode(',',$params['input_cco']))); 2594 } 2595 2596 $toaddress = $db->getAddrs(explode(',',$params['input_to']));//implode(',',); 2597 $ccaddress = $db->getAddrs(explode(',',$params['input_cc']));//implode(',',); 2598 $ccoaddress = $db->getAddrs(explode(',',$params['input_cco']));//implode(',',); 2599 2600 if($toaddress["False"] || $ccaddress["False"] || $ccoaddress["False"]){ 2601 return $this->parse_error("Invalid Mail:", ($toaddress["False"] ? $toaddress["False"] : ($ccaddress["False"] ? $ccaddress["False"] : $ccoaddress["False"]))); 2602 } 2603 2604 $toaddress = implode(',', $toaddress); 2605 $ccaddress = implode(',', $ccaddress); 2606 $ccoaddress = implode(',', $ccoaddress); 2607 2608 if($toaddress == "" && $ccaddress == "" && $ccoaddress == ""){ 2609 return $this->parse_error("Invalid Mail:", ($params['input_to'] ? $params['input_to'] :($params['input_cc'] ? $params['input_cc'] : $params['input_cco'])) ); 2610 } 2598 2611 2599 2612 $toaddress = preg_replace('/<\s+/', '<', $toaddress);
Note: See TracChangeset
for help on using the changeset viewer.