From 07f5140771388c9e0c8a99b0dd2e5d950bdb173b Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 14 Oct 2021 15:16:42 +1100 Subject: moving h-source subdir out. --- admin/Application/Include/distributions.php | 88 ++++++++ admin/Application/Include/hardware.php | 216 +++++++++++++++++++ admin/Application/Include/languages.php | 192 +++++++++++++++++ admin/Application/Include/myFunctions.php | 318 ++++++++++++++++++++++++++++ admin/Application/Include/params.php | 145 +++++++++++++ 5 files changed, 959 insertions(+) create mode 100644 admin/Application/Include/distributions.php create mode 100644 admin/Application/Include/hardware.php create mode 100644 admin/Application/Include/languages.php create mode 100644 admin/Application/Include/myFunctions.php create mode 100644 admin/Application/Include/params.php (limited to 'admin/Application/Include') diff --git a/admin/Application/Include/distributions.php b/admin/Application/Include/distributions.php new file mode 100644 index 0000000..294eac6 --- /dev/null +++ b/admin/Application/Include/distributions.php @@ -0,0 +1,88 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class Distributions +{ + + public static $allowed = array( + 'blag_90001' => 'BLAG 90001', + 'blag_120000' => 'BLAG 120000', + 'dragora_1_1' => 'Dragora 1.1', + 'dynebolic_2_5_2' => 'Dynebolic 2.5.2 DHORUBA', + 'gnewsense_2_3' => 'gNewSense 2.3 Deltah', + 'gnewsense_3_0' => 'gNewSense 3.0 Metad', + 'musix_2_0' => 'Musix GNU+Linux 2.0 R0', + 'trisquel_3_5' => 'Trisquel 3.5 Awen', + 'trisquel_4_0' => 'Trisquel 4.0 Taranis', + 'ututo_xs_2009' => 'UTUTO XS 2009', + 'ututo_xs_2010' => 'UTUTO XS 2010', + 'venenux_0_8' => 'VENENUX 0.8', + ); + + public static function getName($distList = '') + { + $returnString = null; + $returnArray = array(); + $distArray = explode(',',$distList); + foreach ($distArray as $dist) + { + $dist = trim($dist); + if (array_key_exists($dist,self::$allowed)) + { + $returnArray[] = self::$allowed[$dist]; + } + } + return implode("
",$returnArray); + } + + public static function check($distString) + { + $distArray = explode(',',$distString); + + $allowedArray = array_keys(self::$allowed); + + foreach ($distArray as $dist) + { + $dist = trim($dist); + if (!in_array($dist,$allowedArray)) return false; + } + + return true; + } + + public static function getFormHtml() + { + $str = "
"; + $str .= "
"; + foreach (self::$allowed as $value => $label) + { + $str .= "
$label
"; + } + $str .= "
"; + $str .= ""; + $str .= ""; + $str .= "
"; + + return $str; + } + +} \ No newline at end of file diff --git a/admin/Application/Include/hardware.php b/admin/Application/Include/hardware.php new file mode 100644 index 0000000..62dfa37 --- /dev/null +++ b/admin/Application/Include/hardware.php @@ -0,0 +1,216 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + + +class Hardware +{ + + public static $controllers = array('notebooks','wifi','videocards','printers','scanners'); //used by UsersController::login() + + public static $commYear = 'not-specified,2010,2009,2008,2007,2006,2005,2004,2003,2002,2001,2000,1999,1998,1997,1996,1995,1994,1993,1992'; + +} + +class Printer extends hardware +{ + public static $vendors = array( + "brother" => "brother", + "Canon" => "Canon", + "EPSON" => "EPSON", + "Lexmark" => "Lexmark", + "KONICA-MINOLTA" => "KONICA-MINOLTA", + "Hewlett-Packard" => "Hewlett-Packard", + "Panasonic" => "Panasonic", + "RICOH" => "RICOH", + "SAMSUNG" => "SAMSUNG", + "SHARP" => "SHARP", + "TOSHIBA" => "TOSHIBA", + "XEROX" => "XEROX", + ); + + public static $compatibility = array( + "A Full" => "A-Full", + "B Partial" => "B-Partial", + "C None" => "C-None", + ); + + public static $interface = "not-specified,USB,Serial,Parallel,Firewire,SCSI,Ethernet"; + + public static function vendorsList() + { + return implode(',',array_values(self::$vendors)); + } + + public static function compatibilityList() + { + return implode(',',array_values(self::$compatibility)); + } + +} + +class Wifi extends hardware +{ + public static $vendors = array( + "A-LINK" => "A-LINK", + "Airlink101" => "Airlink101", + "Belkin" => "Belkin", + "Broadcom" => "Broadcom", + "CANYON" => "CANYON", + "D-Link" => "D-Link", + "Hawking" => "Hawking", + "LevelOne" => "LevelOne", + "Linksys" => "Linksys", + "NEC" => "NEC", + "Netgear" => "Netgear", + "Ralink" => "Ralink", + "TOSHIBA" => "TOSHIBA", + "TP-LINK" => "TP-LINK", + ); + + public static $interface = "not-specified,USB,PCI,PCI-E,mini-PCI,mini-PCI-E,ExpressCard,PC-Card"; + + public static $wifiSelect = 'yes,no'; + + public static function vendorsList() + { + return implode(',',array_values(self::$vendors)); + } +} + +class Videocard extends hardware +{ + public static $vendors = array( + "ATI" => "ATI", + "NVIDIA" => "NVIDIA", + "Intel" => "Intel", + ); + + public static $videoSelect = array( + "works with 3D acceleration" => "works_with_3D", + "works, but without 3D acceleration" => "works_without_3D", + ); + + public static $videoReverse = array( + "works_with_3D" => "works with 3D acceleration", + "works_without_3D" => "works, but without 3D acceleration", + ); + + public static $interface = "not-specified,PCI,AGP,PCI-E,ISA"; + + public static function vendorsList() + { + return implode(',',array_values(self::$vendors)); + } + + public static function videoList() + { + return implode(',',array_values(self::$videoSelect)); + } +} + + +class Notebooks extends Hardware +{ + + public static $vendors = array( + "Acer" => "Acer", + "Apple" => "Apple", + "Asus" => "Asus", + "Compal Electronics" => "Compal-Electronics", + "COMPAQ" => "COMPAQ", + "Dell" => "Dell", + "emachines" => "emachines", + "FUJITSU" => "FUJITSU", + "Gateway" => "Gateway", + "Hewlett Packard" => "Hewlett-Packard", + "IBM" => "IBM", + "Lenovo" => "Lenovo", + "LG" => "LG", + "Philips" => "Philips", + "Panasonic" => "Panasonic", + "Sony" => "Sony", + "SAMSUNG" => "SAMSUNG", + "Thomson" => "Thomson", + "TOSHIBA" => "TOSHIBA", + ); + + public static $compatibility = array( + "A Platinum" => "A-platinum", + "B Gold" => "B-gold", + "C Silver" => "C-silver", + "D Bronze" => "D-bronze", + "E Garbage" => "E-garbage" + ); + + public static $subtypeSelect = 'notebook,netbook,not-specified'; + + public static $videoSelect = array( + "not specified" => 'not-specified', + "yes, with 3D acceleration" => "yes_with_3D", + "yes, but without 3D acceleration" => "yes_without_3D", + "it does not work" => "no", + ); + + public static $videoReverse = array( + "yes_with_3D" => "works with 3D acceleration", + "yes_without_3D" => "works but without 3D acceleration", + "no" => "it does not work", + 'not-specified' => "not specified how it works", + "" => "" + ); + + public static $wifiSelect = array( + "not specified" => 'not-specified', + 'yes' => 'yes', + 'no' => 'no', + 'there is no wifi card' => 'no-wifi-card', + ); + + public static $wifiReverse = array( + "yes" => "it works", + "no" => "it does not work", + 'not-specified' => "not specified how it works", + 'no-wifi-card' => 'there is no wifi card', + "" => "" + ); + + public static function videoList() + { + return implode(',',array_values(self::$videoSelect)); + } + + public static function wifiList() + { + return implode(',',array_values(self::$wifiSelect)); + } + + public static function vendorsList() + { + return implode(',',array_values(self::$vendors)); + } + + public static function compatibilityList() + { + return implode(',',array_values(self::$compatibility)); + } + +} \ No newline at end of file diff --git a/admin/Application/Include/languages.php b/admin/Application/Include/languages.php new file mode 100644 index 0000000..6262c3e --- /dev/null +++ b/admin/Application/Include/languages.php @@ -0,0 +1,192 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class Lang +{ + public static $allowed = array('en','es','it'); + public static $current = 'en'; + + public static $complete = array( + 'en' => 'gb.png,English', + 'es' => 'es.png,Spanish', + 'it' => 'it.png,Italian', + ); + + public static function sanitize($lang = 'en') + { + return (in_array($lang,self::$allowed)) ? sanitizeAll($lang) : 'en'; + } +} + +class MyStrings +{ + + public static $view = array( + + 'en' => array( + + 'notebooks' => array( + + 'element' => 'notebook' + + ), + + 'wifi' => array( + + 'element' => 'wifi card' + + ), + + 'videocards'=> array( + + 'element' => 'video card' + + ), + + 'printers'=> array( + + 'element' => 'printer' + + ), + + 'scanners'=> array( + + 'element' => 'scanner' + + ), + ), + + 'fr' => array( + + 'notebooks' => array( + + 'element' => 'notebook' + + ), + + 'wifi' => array( + + 'element' => 'wifi card' + + ), + + 'videocards'=> array( + + 'element' => 'video card' + + ), + + 'printers'=> array( + + 'element' => 'printer' + + ), + + 'scanners'=> array( + + 'element' => 'scanner' + + ), + ), + + 'it' => array( + + 'notebooks' => array( + + 'element' => 'notebook' + + ), + + 'wifi' => array( + + 'element' => 'wifi card' + + ), + + 'videocards'=> array( + + 'element' => 'video card' + + ), + + 'printers'=> array( + + 'element' => 'printer' + + ), + + 'scanners'=> array( + + 'element' => 'scanner' + + ), + ), + + 'es' => array( + + 'notebooks' => array( + + 'element' => 'notebook' + + ), + + 'wifi' => array( + + 'element' => 'wifi card' + + ), + + 'videocards'=> array( + + 'element' => 'video card' + + ), + + 'printers'=> array( + + 'element' => 'printer' + + ), + + 'scanners'=> array( + + 'element' => 'scanner' + + ), + ), + ); + + //type => controller + public static $reverse = array( + 'notebook' => 'notebooks', + 'wifi' => 'wifi', + 'videocard' => 'videocards', + 'printer' => 'printers', + 'scanner' => 'scanners', + ); + + public static function getTypes() + { + return implode(',',array_keys(self::$reverse)); + } + +} \ No newline at end of file diff --git a/admin/Application/Include/myFunctions.php b/admin/Application/Include/myFunctions.php new file mode 100644 index 0000000..355c181 --- /dev/null +++ b/admin/Application/Include/myFunctions.php @@ -0,0 +1,318 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +function encodeUrl($url) +{ + $url = str_replace(' ','-',$url); + $url = urlencode($url); +// $url = html_entity_decode($url, ENT_QUOTES); +// $url = xml_encode($url); + return $url; +} + + +function smartDate($uglyDate = null, $lang = 'en') +{ + switch ($lang) + { + case 'en': + $smDate = date('H:i, d F Y',strtotime($uglyDate)); + break; + default: + $smDate = date('H:i, d F Y',strtotime($uglyDate)); + } + return $smDate; +} + +function sanitizeString($string) +{ + $string = preg_match('/^[a-zA-Z0-9\-\_\.\+\s]+$/',$string) ? sanitizeAll($string) : 'undef'; + return $string; +} + +function sanitizeAlphanum($string) +{ + $string = ctype_alnum($string) ? sanitizeAll($string) : 'undef'; + return $string; +} + + +function getOrderByClause($string) +{ + switch ($string) + { + case 'last-inserted': + $orderBy = 'hardware.id_hard desc'; + break; + case 'alphabetically': + $orderBy = 'model'; + break; + case 'alphabetically-desc': + $orderBy = 'model desc'; + break; + case 'compatibility': + $orderBy = 'compatibility'; + break; + case 'undef': + $orderBy = 'hardware.id_hard desc'; + break; + default: + $orderBy = 'hardware.id_hard desc'; + } + + return $orderBy; +} + + +// function isEqual($str1, $str2) +// { +// // $str1 = str_replace("\n",'',$str1); +// // $str1 = str_replace("\r",null,$str1); +// // $str2 = str_replace("\n",'',$str1); +// // $str2 = str_replace("\r",null,$str1); +// +// return (strcmp($str1,$str2) === 0) ? true : false; +// } +// +// function getNewKeys($array,$ovalue) +// { +// $res = array(); +// for ($i = 0; $i < count($array); $i++) +// { +// if (isEqual($array[$i],$ovalue)) $res[] = $i; +// // if (strcmp($keys[$i],$ovalue) === 0) $res[] = $i; +// } +// return $res; +// } + +function diff($old, $new){ + $maxlen = 0; + foreach($old as $oindex => $ovalue){ +// $nkeys = getNewKeys($new,$ovalue); + $nkeys = array_keys($new, $ovalue); + foreach($nkeys as $nindex){ + $matrix[$oindex][$nindex] = isset($matrix[$oindex - 1][$nindex - 1]) ? + $matrix[$oindex - 1][$nindex - 1] + 1 : 1; + if($matrix[$oindex][$nindex] > $maxlen){ + $maxlen = $matrix[$oindex][$nindex]; + $omax = $oindex + 1 - $maxlen; + $nmax = $nindex + 1 - $maxlen; + } + } + } + if($maxlen == 0) return array(array('d'=>$old, 'i'=>$new)); + return array_merge( + diff(array_slice($old, 0, $omax), array_slice($new, 0, $nmax)), + array_slice($new, $nmax, $maxlen), + diff(array_slice($old, $omax + $maxlen), array_slice($new, $nmax + $maxlen))); +} + +function htmlDiff($old, $new){ + $old = str_replace("\r\n"," \r\n ",$old); + $new = str_replace("\r\n"," \r\n ",$new); + + $ret = null; + $diff = diff(explode(' ', $old), explode(' ', $new)); + foreach($diff as $k){ + if(is_array($k)) + $ret .= (!empty($k['d'])?"".implode(' ',$k['d'])." ":''). + (!empty($k['i'])?"".implode(' ',$k['i'])." ":''); + else $ret .= $k . ' '; + } + return $ret; +} + + +//a cosa serve? +function applyBreaks($values,$fields) +{ + $fieldsArray = explode(',',$fields); + + foreach ($fieldsArray as $field) + { + if (array_key_exists($field,$values)) + { + $values[$field] = nl2br($values[$field]); + } + } + return $values; +} + + +function getLinkToUser($user) +{ + if (strstr($user,'__')) + { + return str_replace('__',null,$user); + } + else + { + return "$user"; + } +} + + + +//decode the text of the wiki +function decodeWikiText($string) +{ + + $string = preg_replace('/(\[hr\])/', '
',$string); + + $string = preg_replace_callback('/(\[a\])(.*?)(\[\/a\])/', 'linkTo',$string); + + $string = preg_replace_callback('/(\[a\])(.*?)\|(.*?)(\[\/a\])/', 'linkToWithText',$string); + + $string = preg_replace_callback('/(\[notebook\])([0-9]*?)(\[\/notebook\])/s', 'linkToNotebook',$string); + + $string = preg_replace_callback('/(\[wifi\])([0-9]*?)(\[\/wifi\])/s', 'linkToWifi',$string); + + $string = preg_replace_callback('/(\[videocard\])([0-9]*?)(\[\/videocard\])/s', 'linkToVideocard',$string); + + $string = preg_replace('/(\[b\])(.*?)(\[\/b\])/s', '${2}',$string); + + $string = preg_replace('/(\[u\])(.*?)(\[\/u\])/s', '${2}',$string); + + $string = preg_replace('/(\[i\])(.*?)(\[\/i\])/s', '${2}',$string); + + $string = preg_replace('/(\[del\])(.*?)(\[\/del\])/s', '${2}',$string); + + $string = preg_replace('/(\[\*\])(.*?)(\[\/\*\])/s', '
  • ${2}
  • ',$string); + + $string = preg_replace('/(\[list\])(.*?)(\[\/list\])/s', '',$string); + + $string = preg_replace('/(\[enum\])(.*?)(\[\/enum\])/s', '
      ${2}
    ',$string); + + $string = preg_replace('/(\[code\])(.*?)(\[\/code\])/s', '
    ${2}
    ',$string); + + $string = preg_replace('/(\[p\])(.*?)(\[\/p\])/s', '

    ${2}

    ',$string); + + $string = preg_replace('/(\[h1\])(.*?)(\[\/h1\])/s', '
    ${2}
    ',$string); + + $string = preg_replace('/(\[h2\])(.*?)(\[\/h2\])/s', '
    ${2}
    ',$string); + + $string = preg_replace('/(\[h3\])(.*?)(\[\/h3\])/s', '
    ${2}
    ',$string); + + return $string; +} + +function checkUrl($url) +{ +// $match = '/^http\:\/\/(www\.)?[a-zA-Z0-9\-\_]+(\.[a-zA-Z0-9\-\_]+)?\.(com|net|it|info|org|eu|uk)((\/[a-zA-Z0-9\_\-\+]+)+[\/]?)?(\?([a-zA-Z0-9\_\-\+\s]+\=[a-zA-Z0-9\_\-\s\+\&]+)+)?(#[a-zA-Z0-9\_\-\+\s]+)?([\s]*)?$/'; + + $match = '/^http\:\/\/(www\.)?[a-zA-Z0-9\-\_]+(\.[a-zA-Z0-9\-\_]+)?\.(com|net|it|info|org|eu|uk|ca)((\/[a-zA-Z0-9\_\-\+]+)*(\/([a-zA-Z0-9\_\-\.\+]+\.(php|html|htm|asp|aspx|jsp|cgi))?)?)?(\?([a-zA-Z0-9\_\-\+\s]+\=[a-zA-Z0-9\_\-\s\+\&]+)+)?(#[a-zA-Z0-9\_\-\+\s]+)?([\s]*)?$/'; + + if (preg_match($match,$url)) + { + return true; + } + else + { + return false; + } +} + +function vitalizeUrl($string) +{ + if (checkUrl($string)) + { + return "".$string.""; + } + return $string; +} + +function linkTo($match) +{ + if (checkUrl($match[2])) + { + return "".$match[2].""; + } + else + { + return $match[0]; + } +} + +function linkToWithText($match) +{ + if (checkUrl($match[2])) + { + + return "".$match[3].""; + } + else + { + return $match[0]; + } +} + +//create the link to the wiki page of the notebook +function linkToNotebook($match) +{ + $hardware = new HardwareModel(); + $clean['id_hard'] = (int)$match[2]; + $name = encodeUrl($hardware->getTheModelName($clean['id_hard'])); + $href = "/notebooks/view/".Lang::$current."/".$clean['id_hard']."/$name"; + return (strcmp($name,'') !== 0) ? "".$name."" : $match[0]; +} + +//create the link to the wiki page of the wifi +function linkToWifi($match) +{ + $hardware = new HardwareModel(); + $clean['id_hard'] = (int)$match[2]; + $name = encodeUrl($hardware->getTheModelName($clean['id_hard'])); + $href = "/wifi/view/".Lang::$current."/".$clean['id_hard']."/$name"; + return (strcmp($name,'') !== 0) ? "".$name."" : $match[0]; +} + +//create the link to the wiki page of the videocard +function linkToVideocard($match) +{ + $hardware = new HardwareModel(); + $clean['id_hard'] = (int)$match[2]; + $name = encodeUrl($hardware->getTheModelName($clean['id_hard'])); + $href = "/videocards/view/".Lang::$current."/".$clean['id_hard']."/$name"; + return (strcmp($name,'') !== 0) ? "".$name."" : $match[0]; +} + +function getUserName($id_user = 0) +{ + $clean['id_user'] = (int)$id_user; + $u = new UsersModel(); + return $u->getUser($clean['id_user']); +} + +function getMotivation($row,$controller) +{ + if (strcmp($row['deletion']['object'],'duplication') === 0) + { + $clean['id_hard'] = (int)$row['deletion']['id_duplicate']; + $hardware = new HardwareModel(); + $name = encodeUrl($hardware->getTheModelName($clean['id_hard'])); + return "duplication of the model having id ".$clean['id_hard'].""; + } + else + { + return "".$row['deletion']['object'].""; + } +} diff --git a/admin/Application/Include/params.php b/admin/Application/Include/params.php new file mode 100644 index 0000000..43181bf --- /dev/null +++ b/admin/Application/Include/params.php @@ -0,0 +1,145 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class Website +{ + static public $generalMail = ""; + + static public $generalName = "h-admin"; + + static public $projectName = "h-admin"; + + static public $mailServer = ""; + + static public $mailPassword = ""; +} + +class Account +{ + + static public $confirmTime = 3600; + + static public function confirm($username,$e_mail,$id_user,$token) + { + require_once (ROOT.'/External/swiftmailer/lib/swift_required.php'); + + $clean['username'] = sanitizeAll($username); + $clean['id_user'] = (int)$id_user; + $clean['token'] = sanitizeAll($token); + + $siteName = Website::$generalName; + $siteMail = Website::$generalMail; + + $mess = "Hello,\n\nyou have registered an account to $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"; + + $message = Swift_Message::newInstance()->setSubject('account registration to '.$siteName)->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); + + //Create the Mailer using your created Transport + $mailer = Swift_Mailer::newInstance($transport); + + //Send the message + $result = $mailer->send($message); + + if ($result) + { + return true; + } + else + { + return false; + } + + } + + static public function sendnew($username,$e_mail,$id_user,$token) + { + require_once (ROOT.'/External/swiftmailer/lib/swift_required.php'); + + $clean['username'] = sanitizeAll($username); + $clean['id_user'] = (int)$id_user; + $clean['token'] = sanitizeAll($token); + + $siteName = Website::$generalName; + $siteMail = Website::$generalMail; + + $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); + + //Create the Transport + $transport = Swift_SmtpTransport::newInstance(Website::$mailServer, 25)->setUsername(Website::$generalMail)->setPassword(Website::$mailPassword); + + //Create the Mailer using your created Transport + $mailer = Swift_Mailer::newInstance($transport); + + //Send the message + $result = $mailer->send($message); + + if ($result) + { + return true; + } + else + { + return false; + } + + } + + static public function sendpassword($username,$e_mail,$password) + { + require_once (ROOT.'/External/swiftmailer/lib/swift_required.php'); + + $clean['username'] = sanitizeAll($username); + $clean['password'] = sanitizeAll($password); + + $siteName = Website::$generalName; + $siteMail = Website::$generalMail; + + $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); + + //Create the Transport + $transport = Swift_SmtpTransport::newInstance(Website::$mailServer, 25)->setUsername(Website::$generalMail)->setPassword(Website::$mailPassword); + + //Create the Mailer using your created Transport + $mailer = Swift_Mailer::newInstance($transport); + + //Send the message + $result = $mailer->send($message); + + if ($result) + { + return true; + } + else + { + return false; + } + + } + +} \ No newline at end of file -- cgit v1.2.3