diff options
Diffstat (limited to 'h-source/Application')
-rw-r--r-- | h-source/Application/Include/languages.php | 8 | ||||
-rw-r--r-- | h-source/Application/Include/params.php | 38 |
2 files changed, 33 insertions, 13 deletions
diff --git a/h-source/Application/Include/languages.php b/h-source/Application/Include/languages.php index 8652b55..965a814 100644 --- a/h-source/Application/Include/languages.php +++ b/h-source/Application/Include/languages.php @@ -397,7 +397,13 @@ class Lang /*0337*/"Example" => "Esempio", /*0338*/"free boot firmware?" => "firmware per boot libero?", /*0339*/"can be installed" => "può essere installato", - /*0340*/"does it have free boot firmware (BIOS,UEFI,...) ?" => "ha un firmware per il boot (BIOS, UEFI,..) libero?" + /*0340*/"does it have free boot firmware (BIOS,UEFI,...) ?" => "ha un firmware per il boot (BIOS, UEFI,..) libero?", + /*0341*/"Hello,\n\nyou have registered an account at"=>"Ciao,\n\nhai richiesto l'attivazione di un account al sito", + /*0342*/"with the following data:\nusername: " => "con i seguenti dati:\nusername: ", + /*0343*/"in order to confirm the registration of the new account please follow the link below" => "per confermare la registrazione per favore segui il link sottostante", + /*0343*/"If you don't want to confirm the account registration\nthen wait one hour and your username and e-mail will be deleted from the database" => "Se non vuoi confermare la registrazione dell'account\naspetta un ora e il tuo username e la tua e-mail verranno cancellati dal nostro database", + /*0344*/"If you received this e-mail for error, please simply disregard this message" => "Se hai ricevuto questa e-mail per errore, per favore cancellala", + /*0345*/"account registration" => "registrazione account", ), 'es' => array ( diff --git a/h-source/Application/Include/params.php b/h-source/Application/Include/params.php index b972739..fa2aef2 100644 --- a/h-source/Application/Include/params.php +++ b/h-source/Application/Include/params.php @@ -35,6 +35,8 @@ class Website static public $allowAnonymousSubmission = "yes"; static public $statusnetGroupText = ""; + + static public $useSMTP = true; } class Account @@ -42,6 +44,18 @@ class Account static public $confirmTime = 3600; + public static function getTransport() + { + if (Website::$useSMTP) + { + return Swift_SmtpTransport::newInstance(Website::$mailServer, 25)->setUsername(Website::$generalMail)->setPassword(Website::$mailPassword); + } + else + { + return Swift_MailTransport::newInstance(); + } + } + static public function confirm($username,$e_mail,$id_user,$token) { require_once (ROOT.'/External/swiftmailer/lib/swift_required.php'); @@ -53,13 +67,13 @@ class Account $siteName = Website::$generalName; $siteMail = Website::$generalMail; - $mess = "Hello,\n\nyou have registered an account at $siteName with the following data:\nusername: ".$clean['username']."\n\nin order to confirm the registration of the new account follow the link below\nhttp://".DOMAIN_NAME."/users/confirm/".Lang::$current."/".$clean['id_user']."/".$clean['token']."\n\nIf you don't want to confirm the account registration\nthen wait one hour and your username and e-mail will be deleted from the database\n\nIf you received this e-mail for error, please simply disregard this message"; + $mess = gtext("Hello,\n\nyou have registered an account at")." $siteName ".gtext("with the following data:\nusername: ").$clean['username']."\n\n".gtext("in order to confirm the registration of the new account please follow the link below")."\nhttp://".DOMAIN_NAME."/users/confirm/".Lang::$current."/".$clean['id_user']."/".$clean['token']."\n\n".gtext("If you don't want to confirm the account registration\nthen wait one hour and your username and e-mail will be deleted from the database")."\n\n".gtext("If you received this e-mail for error, please simply disregard this message"); - $message = Swift_Message::newInstance()->setSubject('account registration to '.$siteName)->setFrom(array($siteMail => $siteName))->setTo(array($e_mail))->setBody($mess); + $message = Swift_Message::newInstance()->setSubject('['.Website::$projectName.'] '.gtext("account registration"))->setFrom(array($siteMail => $siteName))->setTo(array($e_mail))->setBody($mess); //Create the Transport - $transport = Swift_SmtpTransport::newInstance(Website::$mailServer, 25)->setUsername(Website::$generalMail)->setPassword(Website::$mailPassword); - + $transport = self::getTransport(); + //Create the Mailer using your created Transport $mailer = Swift_Mailer::newInstance($transport); @@ -90,10 +104,10 @@ class Account $mess = "Hello,\n\nyou have requested a new password for your account at $siteName.\nYour username is:\n".$clean['username']."\n\nin order to obtain a new password for your account follow the link below\nhttp://".DOMAIN_NAME."/users/change/".Lang::$current."/".$clean['id_user']."/".$clean['token']."\n\nIf you don't want to change the password then disregard this mail\n"; - $message = Swift_Message::newInstance()->setSubject('request a new password at '.$siteName)->setFrom(array($siteMail => $siteName))->setTo(array($e_mail))->setBody($mess); + $message = Swift_Message::newInstance()->setSubject('['.Website::$projectName.'] request a new password')->setFrom(array($siteMail => $siteName))->setTo(array($e_mail))->setBody($mess); //Create the Transport - $transport = Swift_SmtpTransport::newInstance(Website::$mailServer, 25)->setUsername(Website::$generalMail)->setPassword(Website::$mailPassword); + $transport = self::getTransport(); //Create the Mailer using your created Transport $mailer = Swift_Mailer::newInstance($transport); @@ -124,10 +138,10 @@ class Account $mess = "Hello,\n\nyou have requested a new password for your account to $siteName.\nYour username is:\n".$clean['username']."\n\nYour new password is:\n".$clean['password']."\n"; - $message = Swift_Message::newInstance()->setSubject('get your new h-node.com account password ')->setFrom(array($siteMail => $siteName))->setTo(array($e_mail))->setBody($mess); + $message = Swift_Message::newInstance()->setSubject('['.Website::$projectName.'] get your new password ')->setFrom(array($siteMail => $siteName))->setTo(array($e_mail))->setBody($mess); //Create the Transport - $transport = Swift_SmtpTransport::newInstance(Website::$mailServer, 25)->setUsername(Website::$generalMail)->setPassword(Website::$mailPassword); + $transport = self::getTransport(); //Create the Mailer using your created Transport $mailer = Swift_Mailer::newInstance($transport); @@ -160,10 +174,10 @@ class Account $mess = "$who has added a message to the talk page of a device you have contributed to maintain at $siteName\n\nThe whole conversation is here:\n\n".$urls['urlTalk']."\n\nThe device page is here:\n\n".$urls['urlView']."\n\nBest regards\nthe ".Website::$projectName." team\n\nP.S: you can disable the mail notifications in the profile page of your control panel"; - $message = Swift_Message::newInstance()->setSubject("$who sent a notice to your attention")->setFrom(array($siteMail => $siteName))->setTo($e_mails)->setBody($mess); + $message = Swift_Message::newInstance()->setSubject("[".Website::$projectName."] $who sent a notice to your attention")->setFrom(array($siteMail => $siteName))->setTo($e_mails)->setBody($mess); //Create the Transport - $transport = Swift_SmtpTransport::newInstance(Website::$mailServer, 25)->setUsername(Website::$generalMail)->setPassword(Website::$mailPassword); + $transport = self::getTransport(); //Create the Mailer using your created Transport $mailer = Swift_Mailer::newInstance($transport); @@ -189,10 +203,10 @@ class Account $mess = "$who has added a message to the talk page of a wiki page you have contributed to maintain at $siteName\n\nThe whole conversation is here:\n\n".$talkUrl."\n\nThe wiki page is here:\n\n".$pageUrl."\n\nBest regards\nthe ".Website::$projectName." team\n\nP.S: you can disable the mail notifications in the profile page of your control panel"; - $message = Swift_Message::newInstance()->setSubject("$who sent a notice to your attention")->setFrom(array($siteMail => $siteName))->setTo($e_mails)->setBody($mess); + $message = Swift_Message::newInstance()->setSubject("[".Website::$projectName."] $who sent a notice to your attention")->setFrom(array($siteMail => $siteName))->setTo($e_mails)->setBody($mess); //Create the Transport - $transport = Swift_SmtpTransport::newInstance(Website::$mailServer, 25)->setUsername(Website::$generalMail)->setPassword(Website::$mailPassword); + $transport = self::getTransport(); //Create the Mailer using your created Transport $mailer = Swift_Mailer::newInstance($transport); |