Adicion de traducciones a la clase SMTP

This commit is contained in:
Brayan Osmar Pereyra Suxo
2014-02-12 12:17:42 -04:00
parent c375bde24d
commit 6c49835d75

View File

@@ -162,7 +162,7 @@ class SMTP {
// make sure we are __not__ connected // make sure we are __not__ connected
if($this->connected()) { if($this->connected()) {
// already connected, generate error // already connected, generate error
$this->error = array("error" => "Already connected to a server"); $this->error = array("error" => G::LoadTranslation( 'ID_SMTP_ALREADY_CONNECTED' ));
return false; return false;
} }
@@ -178,7 +178,7 @@ class SMTP {
$tval); // give up after ? secs $tval); // give up after ? secs
// verify we connected properly // verify we connected properly
if(empty($this->smtp_conn)) { if(empty($this->smtp_conn)) {
$this->error = array("error" => "Failed to connect to server", $this->error = array("error" => G::LoadTranslation( 'ID_SMTP_FAILED_CONNECT_SERVER' ),
"errno" => $errno, "errno" => $errno,
"errstr" => $errstr); "errstr" => $errstr);
if($this->do_debug >= 1) { if($this->do_debug >= 1) {
@@ -220,7 +220,7 @@ class SMTP {
$this->error = null; # to avoid confusion $this->error = null; # to avoid confusion
if(!$this->connected()) { if(!$this->connected()) {
$this->error = array("error" => "Called StartTLS() without being connected"); $this->error = array("error" => G::LoadTranslation( 'ID_SMTP_ERROR_START_TLS' ));
return false; return false;
} }
@@ -235,7 +235,7 @@ class SMTP {
if($code != 220) { if($code != 220) {
$this->error = $this->error =
array("error" => "STARTTLS not accepted from server", array("error" => G::LoadTranslation( 'ID_SMTP_ERROR_START_TLS_NOT_ACCEPTED' ),
"smtp_code" => $code, "smtp_code" => $code,
"smtp_msg" => substr($rply,4)); "smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) { if($this->do_debug >= 1) {
@@ -278,7 +278,7 @@ class SMTP {
if($code != 334) { if($code != 334) {
$this->error = $this->error =
array("error" => "AUTH not accepted from server", array("error" => G::LoadTranslation( 'ID_SMTP_ERROR_AUTH_NOT_ACCEPTED' ),
"smtp_code" => $code, "smtp_code" => $code,
"smtp_msg" => substr($rply,4)); "smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) { if($this->do_debug >= 1) {
@@ -294,7 +294,7 @@ class SMTP {
if($code != 235) { if($code != 235) {
$this->error = $this->error =
array("error" => "Authentication not accepted from server", array("error" => G::LoadTranslation( 'ID_SMTP_ERROR_AUTH_NOT_ACCEPTED' ),
"smtp_code" => $code, "smtp_code" => $code,
"smtp_msg" => substr($rply,4)); "smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) { if($this->do_debug >= 1) {
@@ -312,7 +312,7 @@ class SMTP {
if($code != 334) { if($code != 334) {
$this->error = $this->error =
array("error" => "AUTH not accepted from server", array("error" => G::LoadTranslation( 'ID_SMTP_ERROR_AUTH_NOT_ACCEPTED' ),
"smtp_code" => $code, "smtp_code" => $code,
"smtp_msg" => substr($rply,4)); "smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) { if($this->do_debug >= 1) {
@@ -329,7 +329,7 @@ class SMTP {
if($code != 334) { if($code != 334) {
$this->error = $this->error =
array("error" => "Username not accepted from server", array("error" => G::LoadTranslation( 'ID_SMTP_ERROR_USERNAME_NOT_ACCEPTED' ),
"smtp_code" => $code, "smtp_code" => $code,
"smtp_msg" => substr($rply,4)); "smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) { if($this->do_debug >= 1) {
@@ -346,7 +346,7 @@ class SMTP {
if($code != 235) { if($code != 235) {
$this->error = $this->error =
array("error" => "Password not accepted from server", array("error" => G::LoadTranslation( 'ID_SMTP_ERROR_PASSWORD_NOT_ACCEPTED' ),
"smtp_code" => $code, "smtp_code" => $code,
"smtp_msg" => substr($rply,4)); "smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) { if($this->do_debug >= 1) {
@@ -369,7 +369,7 @@ class SMTP {
if(! $ntlm_client->Initialize($temp)){//let's test if every function its available if(! $ntlm_client->Initialize($temp)){//let's test if every function its available
$this->error = array("error" => $temp->error); $this->error = array("error" => $temp->error);
if($this->do_debug >= 1) { if($this->do_debug >= 1) {
$this->edebug("You need to enable some modules in your php.ini file: " . $this->error["error"] . $this->CRLF); $this->edebug(G::LoadTranslation( 'ID_SMTP_ERROR_ENABLE_PHPINI' ) . ": " . $this->error["error"] . $this->CRLF);
} }
return false; return false;
} }
@@ -383,7 +383,7 @@ class SMTP {
if($code != 334) { if($code != 334) {
$this->error = $this->error =
array("error" => "AUTH not accepted from server", array("error" => G::LoadTranslation( 'ID_SMTP_ERROR_AUTH_NOT_ACCEPTED' ),
"smtp_code" => $code, "smtp_code" => $code,
"smtp_msg" => substr($rply,4)); "smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) { if($this->do_debug >= 1) {
@@ -404,7 +404,7 @@ class SMTP {
if($code != 235) { if($code != 235) {
$this->error = $this->error =
array("error" => "Could not authenticate", array("error" => G::LoadTranslation( 'ID_SMTP_ERROR_COULD_NOT_AUTH' ),
"smtp_code" => $code, "smtp_code" => $code,
"smtp_msg" => substr($rply,4)); "smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) { if($this->do_debug >= 1) {
@@ -428,7 +428,7 @@ class SMTP {
if($sock_status["eof"]) { if($sock_status["eof"]) {
// the socket is valid but we are not connected // the socket is valid but we are not connected
if($this->do_debug >= 1) { if($this->do_debug >= 1) {
$this->edebug("SMTP -> NOTICE:" . $this->CRLF . "EOF caught while checking if connected"); $this->edebug("SMTP -> NOTICE:" . $this->CRLF . G::LoadTranslation( 'ID_SMTP_ERROR_EOF_CAUGHT' ));
} }
$this->Close(); $this->Close();
return false; return false;
@@ -484,7 +484,7 @@ class SMTP {
if(!$this->connected()) { if(!$this->connected()) {
$this->error = array( $this->error = array(
"error" => "Called Data() without being connected"); "error" => G::LoadTranslation( 'ID_SMTP_ERROR_CALLED_DATA_WITHOUT' ));
return false; return false;
} }
@@ -499,7 +499,7 @@ class SMTP {
if($code != 354) { if($code != 354) {
$this->error = $this->error =
array("error" => "DATA command not accepted from server", array("error" => G::LoadTranslation( 'ID_SMTP_ERROR_DATA_COM_NOT_ACCEPTED' ),
"smtp_code" => $code, "smtp_code" => $code,
"smtp_msg" => substr($rply,4)); "smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) { if($this->do_debug >= 1) {
@@ -593,7 +593,7 @@ class SMTP {
if($code != 250) { if($code != 250) {
$this->error = $this->error =
array("error" => "DATA not accepted from server", array("error" => G::LoadTranslation( 'ID_SMTP_ERROR_DATA_NOT_ACCEPTED' ),
"smtp_code" => $code, "smtp_code" => $code,
"smtp_msg" => substr($rply,4)); "smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) { if($this->do_debug >= 1) {
@@ -622,7 +622,7 @@ class SMTP {
if(!$this->connected()) { if(!$this->connected()) {
$this->error = array( $this->error = array(
"error" => "Called Hello() without being connected"); "error" => G::LoadTranslation( 'ID_SMTP_ERROR_CALLED_HELLO_WITHOUT' ));
return false; return false;
} }
@@ -661,7 +661,7 @@ class SMTP {
if($code != 250) { if($code != 250) {
$this->error = $this->error =
array("error" => $hello . " not accepted from server", array("error" => $hello . ' ' . G::LoadTranslation( 'ID_SMTP_ERROR_NOT_ACCEPTED' ),
"smtp_code" => $code, "smtp_code" => $code,
"smtp_msg" => substr($rply,4)); "smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) { if($this->do_debug >= 1) {
@@ -695,7 +695,7 @@ class SMTP {
if(!$this->connected()) { if(!$this->connected()) {
$this->error = array( $this->error = array(
"error" => "Called Mail() without being connected"); "error" => G::LoadTranslation( 'ID_SMTP_ERROR_CALLED_MAIL_WITHOUT' ));
return false; return false;
} }
@@ -711,7 +711,7 @@ class SMTP {
if($code != 250) { if($code != 250) {
$this->error = $this->error =
array("error" => "MAIL not accepted from server", array("error" => G::LoadTranslation( 'ID_SMTP_ERROR_MAIL_NOT_ACCEPTED' ),
"smtp_code" => $code, "smtp_code" => $code,
"smtp_msg" => substr($rply,4)); "smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) { if($this->do_debug >= 1) {
@@ -739,7 +739,7 @@ class SMTP {
if(!$this->connected()) { if(!$this->connected()) {
$this->error = array( $this->error = array(
"error" => "Called Quit() without being connected"); "error" => G::LoadTranslation( 'ID_SMTP_ERROR_CALLED_QUIT_WITHOUT' ));
return false; return false;
} }
@@ -759,7 +759,7 @@ class SMTP {
$code = substr($byemsg,0,3); $code = substr($byemsg,0,3);
if($code != 221) { if($code != 221) {
// use e as a tmp var cause Close will overwrite $this->error // use e as a tmp var cause Close will overwrite $this->error
$e = array("error" => "SMTP server rejected quit command", $e = array("error" => G::LoadTranslation( 'ID_SMTP_ERROR_SERVER_REJECTED' ),
"smtp_code" => $code, "smtp_code" => $code,
"smtp_rply" => substr($byemsg,4)); "smtp_rply" => substr($byemsg,4));
$rval = false; $rval = false;
@@ -793,7 +793,7 @@ class SMTP {
if(!$this->connected()) { if(!$this->connected()) {
$this->error = array( $this->error = array(
"error" => "Called Recipient() without being connected"); "error" => G::LoadTranslation( 'ID_SMTP_ERROR_CALLED_RECIPIENT_WITHOUT' ));
return false; return false;
} }
@@ -808,7 +808,7 @@ class SMTP {
if($code != 250 && $code != 251) { if($code != 250 && $code != 251) {
$this->error = $this->error =
array("error" => "RCPT not accepted from server", array("error" => G::LoadTranslation( 'ID_SMTP_ERROR_RCPT_NOT_ACCEPTED' ),
"smtp_code" => $code, "smtp_code" => $code,
"smtp_msg" => substr($rply,4)); "smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) { if($this->do_debug >= 1) {
@@ -836,7 +836,7 @@ class SMTP {
if(!$this->connected()) { if(!$this->connected()) {
$this->error = array( $this->error = array(
"error" => "Called Reset() without being connected"); "error" => G::LoadTranslation( 'ID_SMTP_ERROR_CALLED_RESET_WITHOUT' ));
return false; return false;
} }
@@ -851,7 +851,7 @@ class SMTP {
if($code != 250) { if($code != 250) {
$this->error = $this->error =
array("error" => "RSET failed", array("error" => G::LoadTranslation( 'ID_SMTP_ERROR_RSET_FAILED' ),
"smtp_code" => $code, "smtp_code" => $code,
"smtp_msg" => substr($rply,4)); "smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) { if($this->do_debug >= 1) {
@@ -885,7 +885,7 @@ class SMTP {
if(!$this->connected()) { if(!$this->connected()) {
$this->error = array( $this->error = array(
"error" => "Called SendAndMail() without being connected"); "error" => G::LoadTranslation( 'ID_SMTP_ERROR_CALLED_SENDANDMAIL_WITHOUT' ));
return false; return false;
} }
@@ -900,7 +900,7 @@ class SMTP {
if($code != 250) { if($code != 250) {
$this->error = $this->error =
array("error" => "SAML not accepted from server", array("error" => G::LoadTranslation( 'ID_SMTP_ERROR_SAML_NOT_ACCEPTED' ),
"smtp_code" => $code, "smtp_code" => $code,
"smtp_msg" => substr($rply,4)); "smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) { if($this->do_debug >= 1) {
@@ -925,8 +925,7 @@ class SMTP {
* @return bool * @return bool
*/ */
public function Turn() { public function Turn() {
$this->error = array("error" => "This method, TURN, of the SMTP ". $this->error = array("error" => G::LoadTranslation( 'ID_SMTP_ERROR_MET_TURN_SMTP_NOT_IMPLEMENTED' ));
"is not implemented");
if($this->do_debug >= 1) { if($this->do_debug >= 1) {
$this->edebug("SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF . '<br />'); $this->edebug("SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF . '<br />');
} }