Changeset 12590
- Timestamp:
- 09/30/07 01:46:01 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midcom/com.magnettechnologies.contactgrabber/lib/gmail/libgmailer.php
r12001 r12590 8 8 * Credits: Janak Prajapati, Pravin Shukla, Tapan Moharana 9 9 * Copyright (C) 2007 10 10 * 11 11 * This program is free software; you can redistribute it and/or 12 12 * modify it under the terms of the GNU General Public License 13 13 * as published by the Free Software Foundation; either version 2 14 14 * of the License, or (at your option) any later version. 15 15 * 16 16 * This program is distributed in the hope that it will be useful, 17 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 19 * GNU General Public License for more details. 20 20 * 21 21 * You should have received a copy of the GNU General Public License 22 22 * along with this program; if not, write to the Free Software … … 41 41 * @var bool 42 42 */ 43 define("GM_USE_LIB_AS_MODULE", false); // Normal operation43 define("GM_USE_LIB_AS_MODULE", true); // Normal operation 44 44 45 45 /**#@+ … … 324 324 "action" => "constructing GMailer object", 325 325 "status" => "failed", 326 "message" => " libgmailer:Using a multithread server. Ensure php_curl.dll has been enabled (uncommented) in your php.ini."326 "message" => "Using a multithread server. Ensure php_curl.dll has been enabled (uncommented) in your php.ini." 327 327 ); 328 328 array_unshift($this->return_status, $a); … … 334 334 "action" => "constructing GMailer object", 335 335 "status" => "failed", 336 "message" => " libgmailer:unable to load curl extension."336 "message" => "unable to load curl extension." 337 337 ); 338 338 array_unshift($this->return_status, $a); … … 345 345 "action" => "constructing GMailer object", 346 346 "status" => "failed", 347 "message" => " libgmailer: No curl."347 "message" => "No curl found." 348 348 ); 349 349 array_unshift($this->return_status, $a); … … 361 361 "action" => "constructing GMailer object", 362 362 "status" => "success", 363 "message" => " libgmailer:Constructing completed."363 "message" => "Constructing completed." 364 364 ); 365 365 array_unshift($this->return_status, $a); … … 384 384 "action" => "set login info", 385 385 "status" => "success", 386 "message" => " libgmailer:LoginInfo set."386 "message" => "LoginInfo set." 387 387 ); 388 388 array_unshift($this->return_status, $a); … … 401 401 $a = array( 402 402 "action" => "set hosted domain info", 403 "status" => "suc ess",404 "message" => " libgmailer:Using the default gmail/googlemail domain."403 "status" => "success", 404 "message" => "Using the default gmail/googlemail domain." 405 405 ); 406 406 array_unshift($this->return_status, $a); … … 412 412 "action" => "set hosted domain info", 413 413 "status" => "failed", 414 "message" => " libgmailer:cannot use \"$my_domain\" as a hosted domain. The default gmail.com or googlemail.com will be used."414 "message" => "cannot use \"$my_domain\" as a hosted domain. The default gmail.com or googlemail.com will be used." 415 415 ); 416 416 array_unshift($this->return_status, $a); … … 432 432 "action" => "set hosted domain info", 433 433 "status" => "success", 434 "message" => " libgmailer:Domain set."434 "message" => "Domain set." 435 435 ); 436 436 array_unshift($this->return_status, $a); … … 465 465 "action" => "set proxy", 466 466 "status" => "success", 467 "message" => " libgmailer:Proxy set."467 "message" => "Proxy set." 468 468 ); 469 469 array_unshift($this->return_status, $a); … … 472 472 "action" => "set proxy", 473 473 "status" => "failed", 474 "message" => " libgmailer:no hostname supplied."474 "message" => "no hostname supplied." 475 475 ); 476 476 array_unshift($this->return_status, $a); … … 622 622 $postdata .= "&service=mail"; 623 623 $postdata .= "&rm=false"; 624 $postdata .= "<mpl=yj_blanco";624 // $postdata .= "<mpl=yj_blanco"; 625 625 $postdata .= "&hl=en"; 626 626 $postdata .= "&Email=".urlencode($this->login); … … 732 732 /* Debugger::say("first phase: ".print_r($this->gmail_data,true)); */ 733 733 /* exit; */ 734 734 // var_dump($this, 1); 735 // die('connect'); 735 736 $a = array( 736 737 "action" => "connecting to Gmail (without cookie)", … … 770 771 "action" => "sign in", 771 772 "status" => "failed", 772 "message" => "Username and password do not match. (Did you mean ".$suggest." ?)",773 "message" => "Username and password do not match. (Did you mean ".$suggest."?)", 773 774 "login_error" => "userpass_suggest", 774 775 "login_suggest" => $suggest … … 840 841 "action" => "sign in", 841 842 "status" => "failed", 842 "message" => "Gmail: Invalid request. ( libgmailer:Gmail seems to have changed the URL again.)",843 "message" => "Gmail: Invalid request. (Gmail seems to have changed the URL again.)", 843 844 "login_error" => "URL" 844 845 ); … … 854 855 "action" => "sign in", 855 856 "status" => "failed", 856 "message" => " libgmailer:Phase one cookie not obtained. Gmail may be down.",857 "message" => "Phase one cookie not obtained. Gmail may be down.", 857 858 "login_error" => "cookie" 858 859 ); … … 992 993 "message" => "Cookie: ".$data 993 994 ); 994 array_unshift($this->return_status, $a); 995 array_unshift($this->return_status, $a); 995 996 996 997 return true; … … 1653 1654 "action" => "message action", 1654 1655 "status" => "failed", 1655 "message" => " libgmailer:not connected"1656 "message" => "not connected" 1656 1657 ); 1657 1658 array_unshift($this->return_status, $a); … … 1947 1948 "action" => "invite", 1948 1949 "status" => "failed", 1949 "message" => " libgmailer:feature not available for hosted domains"1950 "message" => "feature not available for hosted domains" 1950 1951 ); 1951 1952 array_unshift($this->return_status, $a); … … 1982 1983 "action" => "invite", 1983 1984 "status" => "failed", 1984 "message" => " libgmailer:not connected"1985 "message" => "not connected" 1985 1986 ); 1986 1987 array_unshift($this->return_status, $a); … … 2092 2093 else 2093 2094 { 2094 die("Fail to connect because: ".$this->lastActionStatus()); 2095 debug_push_class(__CLASS__, __FUNCTION__); 2096 debug_add('Fail to connect because: ' . $this->lastActionStatus(), MIDCOM_ERRCRIT); 2097 debug_pop(); 2098 $_MIDCOM->uimessages->add( 2099 $_MIDCOM->i18n->get_string('com.magnettechnologies.contactgrabber', 'com.magnettechnologies.contactgrabber'), 2100 sprintf($_MIDCOM->i18n->get_string('Fail to connect! Reason: %s', 'com.magnettechnologies.contactgrabber'), $this->lastActionStatus()) 2101 ); 2102 return false; 2095 2103 } 2096 2104 } 2097 2105 else 2098 2106 { 2099 die("Failed to create GMailer because: ".$this->lastActionStatus()); 2107 debug_push_class(__CLASS__, __FUNCTION__); 2108 debug_add('Failed to create GMailer because: ' . $this->lastActionStatus(), MIDCOM_ERRCRIT); 2109 debug_pop(); 2110 $_MIDCOM->uimessages->add( 2111 $_MIDCOM->i18n->get_string('com.magnettechnologies.contactgrabber', 'com.magnettechnologies.contactgrabber'), 2112 sprintf($_MIDCOM->i18n->get_string('Fail to init GMailer library! Reason: %s', 'com.magnettechnologies.contactgrabber'), $this->lastActionStatus()) 2113 ); 2114 return false; 2100 2115 } 2101 2116 return $result; … … 3304 3319 // debugging cURL 3305 3320 if (GM_DEBUG_CURL) { 3306 $fd = fopen("debug_curl.txt", "a+"); 3321 debug_push_class(__CLASS__, __FUNCTION__); 3322 debug_add('Saved cURL debug log to /tmp/debug_curl.txt'); 3323 debug_pop(); 3324 3325 $fd = @fopen("/tmp/debug_curl.txt", "a+"); 3307 3326 curl_setopt($c, CURLOPT_VERBOSE, 1); 3308 3327 curl_setopt($c, CURLOPT_STDERR, $fd); trunk/midcom/com.magnettechnologies.contactgrabber/locale/default.en.txt
r12589 r12590 2 2 ---VERSION 2.1.0 3 3 ---LANGUAGE en 4 5 ---STRING com.magnettechnologies.contactgrabber 6 Contact grabber 7 ---STRINGEND 4 8 5 9 ---STRING enter login details to fetch your contacts
