Changeset 4000
- Timestamp:
- 04/13/11 10:07:27 (12 years ago)
- Location:
- contrib/z-push
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
contrib/z-push/backend/BackendCalendarExpresso.php
r3637 r4000 11 11 * Consult LICENSE file for details 12 12 ************************************************/ 13 include_once('diffbackend.php'); 14 include_once('include/z_RTF.php'); 15 include_once "include/dbconnect.php"; 13 require_once("diffbackend.php"); 14 require_once("include/z_RTF.php"); 15 require_once("include/dbconnect.php"); 16 require_once("include/authldap.php"); 16 17 17 18 class BackendCalendarExpresso extends BackendDiff { 18 var $_user;19 var $_devid;20 var $_protocolversion;21 19 var $db; 20 var $_uidnumber; 22 21 23 22 function __construct() … … 26 25 27 26 if (!$this->db) { 28 echo " A DB connect error occured.\n";27 echo "Erro de conexao com o banco.\n"; 29 28 exit; 30 29 } 30 } 31 32 function Logon($username, $domain, $password) { 33 $this->_uidnumber = $this->authUser($this->parseUser($username), $password); 34 if(! $this->_uidnumber) return false; 35 else return true; 31 36 } 32 37 … … 35 40 $this->_devid = $devid; 36 41 $this->_protocolversion = $protocolversion; 37 //TODO: Autenticar Usuario no LDAP38 39 42 return true; 40 43 } … … 49 52 50 53 function GetMessageList($folderid, $cutoffdate) { 51 $id_owner = $this->parseOwner($this->_user); 52 if ($id_owner == false) return false; 53 54 debugLog('CalendarExpresso::GetMessageList('.$id_owner.')'); 54 debugLog('CalendarExpresso::GetMessageList('.$this->_uidnumber.')'); 55 55 if ($folderid != "calendar") return false; 56 56 … … 59 59 $result = pg_query($this->db,"BEGIN;"); 60 60 if ($result == FALSE) throw new Exception(pg_last_error($this->db)); 61 if ($cutoffdate == 0) $result = pg_query($this->db, "select c.cal_id, c.last_update, c.datetime, c.cal_type from phpgw_cal c join phpgw_cal_user u on (c.cal_id = u.cal_id) where u.cal_login ='" . $ id_owner . "'and c.reference = 0;");62 else $result = pg_query($this->db, "select c.cal_id, c.last_update, c.datetime, c.cal_type from phpgw_cal c join phpgw_cal_user u on (c.cal_id = u.cal_id) where u.cal_login ='" . $ id_owner . "'and c.reference = 0 and c.edatetime > " . $cutoffdate . ";");61 if ($cutoffdate == 0) $result = pg_query($this->db, "select c.cal_id, c.last_update, c.datetime, c.cal_type from phpgw_cal c join phpgw_cal_user u on (c.cal_id = u.cal_id) where u.cal_login ='" . $this->_uidnumber . "'and c.reference = 0;"); 62 else $result = pg_query($this->db, "select c.cal_id, c.last_update, c.datetime, c.cal_type from phpgw_cal c join phpgw_cal_user u on (c.cal_id = u.cal_id) where u.cal_login ='" . $this->_uidnumber . "'and c.reference = 0 and c.edatetime > " . $cutoffdate . ";"); 63 63 if ($result == FALSE) throw new Exception(pg_last_error($this->db)); 64 64 while ($row = pg_fetch_row($result)) { … … 88 88 function GetFolderList() { 89 89 debugLog('CalendarExpresso::GetFolderList()'); 90 $calendars = array();91 90 $folder = $this->StatFolder("calendar"); 92 $calendars[] = $folder;93 //return $calendars;94 91 return $folder; 95 92 } … … 327 324 $message = $this->GetMessageDAO($id); 328 325 return $message; 329 330 //$message->????? //phpgw_cal.priority (1 - baixa, 2 - normal, 3 - alta) //Quando for criar um registro o valor será 2.331 //$message->????? //phpgw_cal.groups (Não vou atribuir nenhum valor)332 //$message->????? //phpgw_cal.cal_type (quando for criar um novo registro vou inserir R para Recursivo e E para não recursivo). Quando Alterar um registro entre de Recursivo para não Recursivo e vice-versa vou fazer o mesmo da inclusão. Quando alterar entre dois tipos não recursivos, não faço nada.333 //$message->????? //phpgw_cal.ex_participants334 //$message->????? //phpgw_cal_user.cal_status335 //$message->????? //phpgw_cal_user.cal_type336 //$message->????? //phpgw_cal_repeats.recur_interval337 //$message->????? //phpgw_cal_repeats.recur_data338 //$message->????? //phpgw_cal_repeats.recur_exception339 340 //$message->timezone //phpgw?????341 //$message->organizername //phpgw?????342 //$message->organizeremail //phpgw????343 //$message->attendees // phpgw???? (SyncAttendee array)344 345 //$syncAttendee = new SyncAttendee();346 //$syncAttendee->email //phpgw????347 //$syncAttendee->name //phpgw????348 326 } 349 327 … … 351 329 debugLog('CalendarExpresso::DeleteMessage('.$folderid.', '.$id.', ..)'); 352 330 if (!isset($id)) return false; 353 $id_owner = $this->parseOwner($this->_user);354 if ($id_owner == false) return false;355 331 $result = pg_query($this->db, "select owner from phpgw_cal where cal_id = " . $id . ";"); 356 332 if ($result == FALSE) throw new Exception(pg_last_error($this->db)); 357 if ($ id_owner != pg_fetch_result($result, 0, 0)) return false;333 if ($this->_uidnumber != pg_fetch_result($result, 0, 0)) return false; 358 334 try { 359 335 $result = pg_query($this->db,"BEGIN;"); … … 387 363 function ChangeMessageDAO($id, $message) { 388 364 debugLog('CalendarExpresso::ChangeMessageDAO('.$id.', ..)'); 389 $id_owner = $this->parseOwner($this->_user);390 if ($id_owner == false) return false;391 365 try { 392 366 $result = pg_query($this->db,"BEGIN;"); … … 396 370 $found_cal_repeats = false; 397 371 if ($id != false) { 398 $result = pg_query($this->db, "select cal_id, cal_type, owner from phpgw_cal where cal_id = " . $id . ";");372 $result = pg_query($this->db, "select cal_id, cal_type, owner, description from phpgw_cal where cal_id = " . $id . ";"); 399 373 if ($result == FALSE) throw new Exception(pg_last_error($this->db)); 400 374 // tenta localizar cal_id para fazer Update 401 375 while ($row = pg_fetch_row($result)) { 402 376 if(isset($row[0])) { 403 if ($ id_owner != $row[2]) return false; // Nao atualiza evento de outro proprietario377 if ($this->_uidnumber != $row[2]) return false; // Nao atualiza evento de outro proprietario 404 378 $cal_id = $row[0]; 405 379 $cal_type_from_DB = $row[1]; 380 $description_from_DB = $row[3]; 406 381 $found_cal_id = true; 407 382 } 408 383 } 409 384 // Verifica se ja existe o registro do evento na tabela phpgw_cal_user 410 $result = pg_query($this->db, "select cal_id, cal_login from phpgw_cal_user where cal_id = " . $cal_id . " and cal_login = '" . $ id_owner . "';");385 $result = pg_query($this->db, "select cal_id, cal_login from phpgw_cal_user where cal_id = " . $cal_id . " and cal_login = '" . $this->_uidnumber . "';"); 411 386 if ($result == FALSE) throw new Exception(pg_last_error($this->db)); 412 387 if ($row = pg_fetch_row($result)) { … … 430 405 } 431 406 if(isset($message->subject)) { 432 $arrayCal["title"] = $this->truncateString(utf8_decode($message->subject), 80);407 $arrayCal["title"] = $this->truncateString(utf8_decode($message->subject),299); 433 408 } 434 409 if(isset($message->location)) { … … 454 429 if ($result_loadrtf == true) $rtf_to_ascii->parse(); 455 430 $arrayCal["description"] = $rtf_to_ascii->out; 456 // } else {457 // $arrayCal["description"] = '';431 // } else { 432 // $arrayCal["description"] = ''; 458 433 } 459 434 $arrayCal["category"] = ''; … … 482 457 $cal_id = pg_fetch_result($result, 0, 0); 483 458 $arrayCal["cal_id"] = $cal_id; 484 $arrayCal["owner"] = $ id_owner;459 $arrayCal["owner"] = $this->_uidnumber; 485 460 if (isset($message->recurrence)) $arrayCal["cal_type"] = 'M'; 486 461 else $arrayCal["cal_type"] = 'E'; … … 500 475 if (!$found_cal_user){ 501 476 $arrayCalUser["cal_id"] = $cal_id; 502 $arrayCalUser["cal_login"] = $ id_owner;477 $arrayCalUser["cal_login"] = $this->_uidnumber; 503 478 //TODO: Tratar os outros valores de cal_status 504 479 $arrayCalUser["cal_status"] = 'A'; … … 506 481 if ($result == FALSE) throw new Exception(pg_last_error($this->db)); 507 482 } else { 508 $result = pg_update($this->db, 'phpgw_cal_user', $arrayCalUser, array('cal_id' => $cal_id, 'cal_login' => $ id_owner));483 $result = pg_update($this->db, 'phpgw_cal_user', $arrayCalUser, array('cal_id' => $cal_id, 'cal_login' => $this->_uidnumber)); 509 484 if ($result == FALSE) throw new Exception(pg_last_error($this->db)); 510 485 } … … 574 549 else $arrayRecur["recur_enddate"] = $message->recurrence->until; 575 550 date_default_timezone_set($tz); 576 /* //$arrayRecur["recur_enddate"] = $message->recurrence->until - $offsetTZ;551 /*$arrayRecur["recur_enddate"] = $message->recurrence->until - $offsetTZ; 577 552 $hour = date("G", $message->starttime - (($tz["bias"] - $tz["dstbias"]) * 60)); 578 553 $min = date("i", $message->starttime - (($tz["bias"] - $tz["dstbias"]) * 60)); … … 586 561 // Trata excecoes da recorrencia 587 562 if (isset($message->exceptions)){ 588 //if ($recur_exception_changed_starttimes != "") { 589 //Tem Excecoes de recorrencia do tipo Edicao 563 // Tem Excecoes de recorrencia do tipo Edicao 590 564 // Verifica se ja existe o registro do evento de excecao de recorrencia na tabela phpgw_cal 591 //foreach ($array_recur_exception_changed_starttime as $except_starttime) {592 565 $recur_exception_changed_ids = ""; 593 566 $recur_exception_deleted_starttimes = ""; … … 599 572 if (isset($except_cal_id)) unset($except_cal_id); 600 573 if (isset($except_cal_type_from_DB)) unset($except_cal_type_from_DB); 574 if (isset($except_description_from_DB)) unset($except_description_from_DB); 601 575 $found_except_cal_id = false; 602 576 $found_except_cal_user = false; 603 $result = pg_query($this->db, "select cal_id, cal_type from phpgw_cal where reference = " . $id . " and datetime = " . $recur_exception->exceptionstarttime . ";");577 $result = pg_query($this->db, "select cal_id, cal_type, description from phpgw_cal where reference = " . $id . " and datetime = " . $recur_exception->exceptionstarttime . ";"); 604 578 if ($result == FALSE) throw new Exception(pg_last_error($this->db)); 605 579 // tenta localizar cal_id para fazer Update … … 608 582 $except_cal_id = $row[0]; 609 583 $except_cal_type_from_DB = $row[1]; 584 $except_description_from_DB = $row[2]; 610 585 $found_except_cal_id = true; 611 586 } … … 613 588 // Verifica se ja existe o registro do evento de excecao de recorrencia na tabela phpgw_cal_user 614 589 if (isset($except_cal_id)) { 615 $result = pg_query($this->db, "select cal_id, cal_login from phpgw_cal_user where cal_id = " . $except_cal_id . " and cal_login = '" . $ id_owner . "';");590 $result = pg_query($this->db, "select cal_id, cal_login from phpgw_cal_user where cal_id = " . $except_cal_id . " and cal_login = '" . $this->_uidnumber . "';"); 616 591 if ($result == FALSE) throw new Exception(pg_last_error($this->db)); 617 592 if ($row = pg_fetch_row($result)) { … … 627 602 } 628 603 if(isset($recur_exception->subject)) { 629 $arrayExceptCal["title"] = $this->truncateString(utf8_decode($recur_exception->subject), 80);604 $arrayExceptCal["title"] = $this->truncateString(utf8_decode($recur_exception->subject),299); 630 605 } elseif(isset($message->subject)) { 631 $arrayExceptCal["title"] = $this->truncateString(utf8_decode($message->subject), 80);606 $arrayExceptCal["title"] = $this->truncateString(utf8_decode($message->subject),299); 632 607 } 633 608 if(isset($recur_exception->location)) { … … 658 633 $arrayExceptCal["is_public"] = 1; // 1 - Normal 659 634 }else $arrayExceptCal["is_public"] = 0; // 0 - Privado 660 if(isset($recur_exception->rtf) or isset($message->rtf)) { 661 $rtf_to_ascii = new rtf(); 662 $rtf_to_ascii->output("ascii"); 663 if(isset($recur_exception->rtf)) $result_loadrtf = $rtf_to_ascii->loadrtf(base64_decode($recur_exception->rtf)); 664 elseif(isset($message->rtf)) $result_loadrtf = $rtf_to_ascii->loadrtf(base64_decode($message->rtf)); 665 if ($result_loadrtf == true) $rtf_to_ascii->parse(); 666 $arrayExceptCal["description"] = $rtf_to_ascii->out; 667 // } else { 668 // $arrayExceptCal["description"] = ''; 635 if (isset($recur_exception->body)) { 636 $arrayExceptCal["description"] = utf8_decode($recur_exception->body); 637 } elseif (!isset($except_description_from_DB)) { 638 if (isset($message->rtf)) { 639 $rtf_to_ascii = new rtf(); 640 $rtf_to_ascii->output("ascii"); 641 $result_loadrtf = $rtf_to_ascii->loadrtf(base64_decode($message->rtf)); 642 if ($result_loadrtf == true) $rtf_to_ascii->parse(); 643 $arrayExceptCal["description"] = $rtf_to_ascii->out; 644 } elseif (isset($description_from_DB)) { 645 $arrayExceptCal["description"] = utf8_decode($description_from_DB); 646 } 669 647 } 670 648 $arrayExceptCal["category"] = ''; … … 701 679 $except_cal_id = pg_fetch_result($result, 0, 0); 702 680 $arrayExceptCal["cal_id"] = $except_cal_id; 703 $arrayExceptCal["owner"] = $ id_owner;681 $arrayExceptCal["owner"] = $this->_uidnumber; 704 682 $arrayExceptCal["cal_type"] = 'E'; 705 683 $result = pg_insert($this->db, 'phpgw_cal', $arrayExceptCal); … … 714 692 if (!$found_except_cal_user){ 715 693 $arrayExceptCalUser["cal_id"] = $except_cal_id; 716 $arrayExceptCalUser["cal_login"] = $ id_owner;694 $arrayExceptCalUser["cal_login"] = $this->_uidnumber; 717 695 //TODO: Tratar os outros valores de cal_status 718 696 $arrayExceptCalUser["cal_status"] = 'A'; … … 720 698 if ($result == FALSE) throw new Exception(pg_last_error($this->db)); 721 699 } else { 722 $result = pg_update($this->db, 'phpgw_cal_user', $arrayExceptCalUser, array('cal_id' => $except_cal_id, 'cal_login' => $ id_owner));700 $result = pg_update($this->db, 'phpgw_cal_user', $arrayExceptCalUser, array('cal_id' => $except_cal_id, 'cal_login' => $this->_uidnumber)); 723 701 if ($result == FALSE) throw new Exception(pg_last_error($this->db)); 724 702 } … … 805 783 function addCategory($category) { 806 784 $cat_id = false; 807 $id_owner = $this->parseOwner($this->_user);808 if ($id_owner == false) return false;809 785 try { 810 786 $result = pg_query($this->db,"BEGIN;"); … … 813 789 if ($result == FALSE) throw new Exception(pg_last_error($this->db)); 814 790 if (!($cat_id = pg_fetch_result($result, 0, 0))){ 815 $result = pg_query("SELECT cat_id from phpgw_categories WHERE cat_owner = " . $ id_owner . " AND cat_appname = 'calendar' AND LOWER(to_ASCII(cat_name)) = '" . trim(strtolower($this->removeAccents(utf8_decode($category)))) . "';");791 $result = pg_query("SELECT cat_id from phpgw_categories WHERE cat_owner = " . $this->_uidnumber . " AND cat_appname = 'calendar' AND LOWER(to_ASCII(cat_name)) = '" . trim(strtolower($this->removeAccents(utf8_decode($category)))) . "';"); 816 792 if ($result == FALSE) throw new Exception(pg_last_error($this->db)); 817 793 if (!($cat_id = pg_fetch_result($result, 0, 0))){ … … 820 796 $cat_id = pg_fetch_result($result, 0, 0); 821 797 $arrayCat["cat_id"] = $cat_id; 822 $arrayCat["cat_owner"] = $ id_owner;798 $arrayCat["cat_owner"] = $this->_uidnumber; 823 799 $arrayCat["cat_access"] = 'public'; 824 800 $arrayCat["cat_appname"] = 'calendar'; … … 851 827 $data = str_replace("\r", "\n", $data); 852 828 $data = str_replace(array('\\', ';', ',', "\n"), array('\\\\', '\\;', '\\,', '\\n'), $data); 853 //return u2wi($data);854 829 return $data; 855 830 } … … 871 846 } 872 847 873 function parse Owner($id_owner)848 function parseUser($id_user) 874 849 { 875 $pos = strripos($id_ owner, '\\');850 $pos = strripos($id_user, '\\'); 876 851 if ($pos === false) { 877 if (strlen($id_ owner) <= 2) return false;878 else return substr($id_owner, 0, strlen($id_owner)-2);852 if (strlen($id_user) < 1) return false; 853 else return $id_user; 879 854 } else { 880 if (strlen($id_ owner) <= $pos + 3) {855 if (strlen($id_user) <= $pos + 1) { 881 856 return false; 882 857 } else { 883 return substr(substr($id_ owner, $pos + 1), 0, strlen(substr($id_owner, $pos + 1))-2);858 return substr(substr($id_user, $pos + 1), 0, strlen(substr($id_user, $pos + 1))); 884 859 } 885 860 } … … 916 891 return $packed; 917 892 } 893 894 // Authenticate user and return UIDNumber attribute on success 895 function authUser($user, $pwd) { 896 $ldap = new AuthLDAP(); 897 $uid_number = ($ldap->bind($user,$pwd)); 898 $ldap->disconnect(); 899 unset($ldap); 900 if (! $uid_number) return false; 901 return $uid_number; 902 } 918 903 }; 919 904 ?> -
contrib/z-push/backend/BackendContactsExpresso.php
r3637 r4000 11 11 * Consult LICENSE file for details 12 12 ************************************************/ 13 include_once('diffbackend.php'); 14 include_once('include/z_RTF.php'); 15 include_once "include/dbconnect.php"; 13 require_once("diffbackend.php"); 14 require_once("include/z_RTF.php"); 15 require_once("include/dbconnect.php"); 16 require_once("include/authldap.php"); 16 17 17 18 class BackendContactsExpresso extends BackendDiff { 18 var $_user;19 var $_devid;20 var $_protocolversion;21 19 var $db; 20 var $_uidnumber; 22 21 23 22 function __construct() … … 26 25 27 26 if (!$this->db) { 28 echo " A DB connect error occured.\n";27 echo "Erro de conexao com o Banco.\n"; 29 28 exit; 30 29 } 30 } 31 32 function Logon($username, $domain, $password) { 33 $this->_uidnumber = $this->authUser($this->parseUser($username), $password); 34 if(! $this->_uidnumber) return false; 35 else return true; 31 36 } 32 37 … … 35 40 $this->_devid = $devid; 36 41 $this->_protocolversion = $protocolversion; 37 //TODO: Autenticar Usuario no LDAP38 42 39 43 return true; … … 49 53 50 54 function GetMessageList($folderid, $cutoffdate) { 51 $id_owner = $this->parseOwner($this->_user); 52 if ($id_owner == false) return false; 53 54 debugLog('ContactsExpresso::GetMessageList('.$id_owner.')'); 55 debugLog('ContactsExpresso::GetMessageList('.$this->_uidnumber.')'); 55 56 $messages = array(); 56 57 $ids = array(); … … 58 59 $result = pg_query($this->db,"BEGIN;"); 59 60 if ($result == FALSE) throw new Exception(pg_last_error($this->db)); 60 $result = pg_query($this->db, "select given_names, family_names, last_update, id_contact from phpgw_cc_contact where id_owner = " . $ id_owner . ";");61 $result = pg_query($this->db, "select given_names, family_names, last_update, id_contact from phpgw_cc_contact where id_owner = " . $this->_uidnumber . ";"); 61 62 if ($result == FALSE) throw new Exception(pg_last_error($this->db)); 62 63 while ($row = pg_fetch_row($result)) { … … 78 79 function GetFolderList() { 79 80 debugLog('ContactsExpresso::GetFolderList()'); 80 $contacts = array();81 81 $folder = $this->StatFolder("root"); 82 $contacts[] = $folder;83 82 return $folder; 84 //return $contacts;85 83 } 86 84 … … 117 115 debugLog('ContactsExpresso::StatMessage('.$folderid.', '.$id.')'); 118 116 if($folderid != "root") return false; 119 120 $id_owner = $this->parseOwner($this->_user);121 if ($id_owner == false) return false;122 117 123 118 try { … … 149 144 150 145 // Parse the database into object 151 $id_owner = $this->parseOwner($this->_user);152 if ($id_owner == false) return;153 154 146 $message = new SyncContact(); 155 147 try { … … 354 346 debugLog('ContactsExpresso::DeleteMessage('.$folderid.', '.$id.', ..)'); 355 347 356 $id_owner = $this->parseOwner($this->_user);357 if ($id_owner == false) return false;358 359 348 $result = pg_query($this->db,"BEGIN;"); 360 349 try { … … 416 405 debugLog('ContactsExpresso::ChangeMessage('.$folderid.', '.$id.', ..)'); 417 406 418 $id_owner = $this->parseOwner($this->_user);419 if ($id_owner == false) return false;420 407 try { 421 408 $result = pg_query($this->db,"BEGIN;"); … … 666 653 if (!$found_id_contact){ 667 654 $arrayContact["id_contact"] = $id_contact; 668 $arrayContact["id_owner"] = $ id_owner;655 $arrayContact["id_owner"] = $this->_uidnumber; 669 656 $result = pg_insert($this->db, 'phpgw_cc_contact', $arrayContact); 670 657 if ($result == FALSE) throw new Exception(pg_last_error($this->db)); … … 1032 1019 if ($result == FALSE) throw new Exception(pg_last_error($this->db)); 1033 1020 } 1034 1021 1035 1022 //TODO : Permitir mais de um número de telefone para Trabalho, Celular e Casa. O Expresso ainda não suporta isso :( 1036 1023 … … 1068 1055 $data = str_replace("\r", "\n", $data); 1069 1056 $data = str_replace(array('\\', ';', ',', "\n"), array('\\\\', '\\;', '\\,', '\\n'), $data); 1070 //return u2wi($data);1071 1057 return $data; 1072 1058 } … … 1088 1074 } 1089 1075 1090 function parse Owner($id_owner)1076 function parseUser($id_user) 1091 1077 { 1092 $pos = strripos($id_ owner, '\\');1078 $pos = strripos($id_user, '\\'); 1093 1079 if ($pos === false) { 1094 if (strlen($id_ owner) <= 2) return false;1095 else return substr($id_owner, 0, strlen($id_owner)-2);1080 if (strlen($id_user) < 1) return false; 1081 else return $id_user; 1096 1082 } else { 1097 if (strlen($id_ owner) <= $pos + 3) {1083 if (strlen($id_user) <= $pos + 1) { 1098 1084 return false; 1099 1085 } else { 1100 return substr(substr($id_ owner, $pos + 1), 0, strlen(substr($id_owner, $pos + 1))-2);1086 return substr(substr($id_user, $pos + 1), 0, strlen(substr($id_user, $pos + 1))); 1101 1087 } 1102 1088 } 1089 } 1090 1091 // Authenticate user and return UIDNumber attribute on success 1092 function authUser($user, $pwd) { 1093 $ldap = new AuthLDAP(); 1094 $uid_number = ($ldap->bind($user,$pwd)); 1095 $ldap->disconnect(); 1096 unset($ldap); 1097 if (! $uid_number) return false; 1098 return $uid_number; 1103 1099 } 1104 1100 }; -
contrib/z-push/backend/BackendProxy.php
r3754 r4000 11 11 * Consult LICENSE file for details 12 12 ************************************************/ 13 include_once('diffbackend.php');13 require_once("diffbackend.php"); 14 14 15 15 class BackendProxy extends BackendDiff { … … 28 28 29 29 function Logon($username, $domain, $password) { 30 global $BACKEND_EMAIL; 31 if (isset($BACKEND_EMAIL)) return $this->BackendEmail->Logon($username, $domain, $password); 32 else return true; 30 global $BACKEND_EMAIL, $BACKEND_CONTACTS, $BACKEND_CALENDAR; 31 if (isset($BACKEND_EMAIL) and (! $this->BackendEmail->Logon($username, $domain, $password))) return false; 32 if (isset($BACKEND_CONTACTS) and (! $this->BackendContacts->Logon($username, $domain, $password))) return false; 33 if (isset($BACKEND_CALENDAR) and (! $this->BackendCalendar->Logon($username, $domain, $password))) return false; 34 return true; 33 35 } 34 36 … … 42 44 debugLog('BackendProxy::Setup('.$user.','.$devid.','.$protocolversion.')'); 43 45 global $BACKEND_EMAIL, $BACKEND_CONTACTS, $BACKEND_CALENDAR; 44 $this->_user = $user;45 $this->_devid = $devid;46 $this->_protocolversion = $protocolversion;47 46 if (isset($BACKEND_EMAIL)) $this->BackendEmail->Setup($user, $devid, $protocolversion); 48 47 if (isset($BACKEND_CONTACTS)) $this->BackendContacts->Setup($user, $devid, $protocolversion); -
contrib/z-push/config.php
r3637 r4000 79 79 // 'domain' - the value of the "domain" field is used 80 80 // '@mydomain.com' - the username is used and the given string will be appended 81 define('IMAP_DEFAULTFROM', ' ');81 define('IMAP_DEFAULTFROM', 'domain'); 82 82 // copy outgoing mail to this folder. If not set z-push will try the default folders 83 83 define('IMAP_SENTFOLDER', 'INBOX/Sent'); … … 95 95 define('VCARDDIR_DIR', '/var/www/vcf'); 96 96 97 // **************************************************** 98 // LDAP Authentication settings 99 // **************************************************** 100 // Set USER and PASSWORD if you are not using anonymous bind 101 // Must have read access to DN, UID and UIDNUMBER of all users 102 define("ANONYMOUS_BIND", false); 103 define("LDAP_BIND_USER", "cn=admin,ou=expressolivre,ou=corp,dc=empresa,dc=gov,dc=br"); 104 define("LDAP_BIND_PASSWORD", "senha_do_admin"); 105 106 define("LDAP_HOST", "ldap://10.200.112.132/"); // Address of your LDAP server 107 define("LDAP_PORT", "389"); // Port of your LDAP server 108 109 // Search base & filter 110 define("LDAP_SEARCH_BASE", "dc=empresa,dc=gov,dc=br"); // Base path to search the filter. Example: dc=company,dc=com 111 define("LDAP_SEARCH_FILTER", "uid=SEARCHVALUE"); // The filter is the user login attribute. You can change only the "uid" by other attribute. The SEARCHVALUE string is replaced by the user login inside the backends. 112 113 // LDAP field mapping. 114 global $ldap_field_map; 115 $ldap_field_map = array( 116 DN => 'dn', // Change 'dn' only if you use other attribute name in your LDAP. 117 UID => 'uid', // Change 'uid' only if you use other attribute name in your LDAP. 118 UIDNUMBER => 'uidnumber', // Change 'uidnumber' only if you use other attribute name in your LDAP. 119 ); 97 120 ?>
Note: See TracChangeset
for help on using the changeset viewer.