File manager - Edit - /home/opticamezl/www/newok/sms_gateways.tar
Back
clickatell.php 0000604 00000003730 15174072272 0007372 0 ustar 00 <?php /** * Clickatell SMS gateway class * * @package Joomla.Plugin * @subpackage Fabrik.form.sms * @copyright Copyright (C) 2005-2016 Media A-Team, Inc. - All rights reserved. * @license GNU/GPL http://www.gnu.org/copyleft/gpl.html */ // No direct access defined('_JEXEC') or die('Restricted access'); use Clickatell\Api\ClickatellRest; use Fabrik\Helpers\ArrayHelper; /** * Clickatell SMS gateway class * * @package Joomla.Plugin * @subpackage Fabrik.form.sms * @since 3.0 */ class Clickatell extends JObject { /** * Send SMS * * @param string $message sms message * @param array $opts options * * @return void */ public function process($message = '', $opts) { // Clickatell only uses token, no SID, use whichever param isn't empty $sid = ArrayHelper::getValue($opts, 'sms-username'); $token = ArrayHelper::getValue($opts, 'sms-password'); if (empty($token) && !empty($sid)) { $token = $sid; } // no sms-from setting for Clickatell, just set up 'to' array $smsto = ArrayHelper::getValue($opts, 'sms-to'); $smstos = empty($smsto) ? array() : explode(",", $smsto); // Clickatell is picky about numbers, no spaces or dashes foreach ($smstos as &$smsto) { $smsto = preg_replace("/[^0-9]/","", $smsto); } $client = new ClickatellRest($token); // Clickatell API doesn't throw exceptions, but something else might try { $response = $client->sendMessage( $smstos, $message ); } catch (\Exception $e) { JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error'); return false; } // check the response array foreach ($response as $item) { if ($item->error !== false) { // @TODO add language for this JFactory::getApplication()->enqueueMessage('SMS failed with error code: ' . $item->errorCode, 'error'); return false; } } return true; } } twilio.php 0000604 00000002756 15174072272 0006601 0 ustar 00 <?php /** * Twilio SMS gateway class * * @package Joomla.Plugin * @subpackage Fabrik.form.sms * @copyright Copyright (C) 2005-2016 Media A-Team, Inc. - All rights reserved. * @license GNU/GPL http://www.gnu.org/copyleft/gpl.html */ // No direct access defined('_JEXEC') or die('Restricted access'); use Fabrik\Helpers\ArrayHelper; use Twilio\Rest\Client; use Twilio\Exceptions\TwilioException; /** * Twilio SMS gateway class * * @package Joomla.Plugin * @subpackage Fabrik.form.sms * @since 3.0 */ class Twilio extends JObject { /** * Send SMS * * @param string $message sms message * @param array $opts options * * @return void */ public function process($message = '', $opts) { $sid = ArrayHelper::getValue($opts, 'sms-username'); $token = ArrayHelper::getValue($opts, 'sms-password'); $smsto = ArrayHelper::getValue($opts, 'sms-to'); // From a valid Twilio number $smsfrom = ArrayHelper::getValue($opts, 'sms-from'); $smstos = empty($smsto) ? array() : explode(",", $smsto); $client = new Twilio\Rest\Client($sid, $token); foreach ($smstos as $smsto) { try { $client->messages->create( trim($smsto), array( 'from' => $smsfrom, 'body' => $message ) ); } catch (TwilioException $e) { JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error'); return false; } } return true; } } kapow.php 0000604 00000002501 15174072272 0006377 0 ustar 00 <?php /** * Send an SMS via the kapow sms gateway * * @package Joomla.Plugin * @subpackage Fabrik.form.sms * @copyright Copyright (C) 2005-2016 Media A-Team, Inc. - All rights reserved. * @license GNU/GPL http://www.gnu.org/copyleft/gpl.html */ // No direct access defined('_JEXEC') or die('Restricted access'); use Fabrik\Helpers\ArrayHelper; use Fabrik\Helpers\Sms; /** * Kapow SMS gateway class * * @package Joomla.Plugin * @subpackage Fabrik.form.sms * @since 3.0 */ class Kapow extends JObject { /** * URL To Post SMS to * * @var string */ protected $url = 'http://www.kapow.co.uk/scripts/sendsms.php?username=%s&password=%s&mobile=%s&sms=%s'; /** * Send SMS * * @param string $message sms message * @param array $opts Options * * @return void */ public function process($message, $opts) { $username = ArrayHelper::getValue($opts, 'sms-username'); $password = ArrayHelper::getValue($opts, 'sms-password'); $smsfrom = ArrayHelper::getValue($opts, 'sms-from'); $smsto = ArrayHelper::getValue($opts, 'sms-to'); $smstos = explode(',', $smsto); foreach ($smstos as $smsto) { $url = sprintf($this->url, $username, $password, $smsto, $message); Sms::doRequest('GET', $url, ''); } } } itagg.php 0000604 00000004517 15174072272 0006362 0 ustar 00 <?php /** * Itagg SMS gateway class * * @package Joomla.Plugin * @subpackage Fabrik.form.sms * @copyright Copyright (C) 2005-2016 Media A-Team, Inc. - All rights reserved. * @license GNU/GPL http://www.gnu.org/copyleft/gpl.html */ // No direct access defined('_JEXEC') or die('Restricted access'); use Fabrik\Helpers\ArrayHelper; use Fabrik\Helpers\Sms; use Fabrik\Helpers\StringHelper; /** * Itagg SMS gateway class * * @package Joomla.Plugin * @subpackage Fabrik.form.sms * @since 3.0 */ class Itagg extends JObject { /** * URL To Post SMS to * * @var string */ protected $url = 'https://secure.itagg.com/smsg/sms.mes'; /** * Send SMS * * @param string $message sms message * @param array $opts Options * * @return void */ public function process($message, $opts) { $username = ArrayHelper::getValue($opts, 'sms-username'); $password = ArrayHelper::getValue($opts, 'sms-password'); $smsfrom = ArrayHelper::getValue($opts, 'sms-from'); $smsto = ArrayHelper::getValue($opts, 'sms-to'); $smstos = explode(",", $smsto); $message = urlencode($message); foreach ($smstos as $smsto) { if (substr($smsto, 0, 1) == '+' && StringHelper::substr($smsto, 1, 2) != '44') { // Global sms $route = 8; } else { // UK (itagg) $route = 7; } $smsto = urlencode($smsto); $url = $this->url; $vars = 'usr=' . $username . '&pwd=' . $password . '&from=rob&to=' . $smsto . '&type=text&route=' . $route . '&txt=' . $message; $itaggapi = "https://secure.itagg.com/smsg/sms.mes"; /* $params="usr=XXX&pwd=YYY&from=steve&to=07712345678,447912345678,3912345678&type=text&rout e=7&txt=hello+via+POST"; */ $ch = curl_init(); if (!$ch) { throw new RuntimeException("cant ini curl session", 500); exit; } curl_setopt($ch, CURLOPT_URL, $itaggapi); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $vars); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); $returned = curl_exec($ch); curl_close($ch); // This will be the OK / error message if ($returned === true) { echo "sent ok"; } $res = Sms::doRequest('POST', $url, $vars); } } } smssza.php 0000604 00000002510 15174072272 0006576 0 ustar 00 <?php /** * Send an SMS via the SMSS (ZA) gateway * * @package Joomla.Plugin * @subpackage Fabrik.form.sms * @copyright Copyright (C) 2005-2016 Media A-Team, Inc. - All rights reserved. * @license GNU/GPL http://www.gnu.org/copyleft/gpl.html */ // No direct access defined('_JEXEC') or die('Restricted access'); use Fabrik\Helpers\ArrayHelper; use Fabrik\Helpers\Sms; /** * SMSS (ZA) SMS gateway class * * @package Joomla.Plugin * @subpackage Fabrik.form.sms * @since 3.0 */ class Smssza extends JObject { /** * URL To Post SMS to * * @var string */ protected $url = 'http://148.251.196.36/app/smsapi/index.php?key=%s&type=text&contacts=%s&senderid=%s&msg=%s&time='; /** * Send SMS * * @param string $message sms message * @param array $opts Options * * @return void */ public function process($message, $opts) { $username = ArrayHelper::getValue($opts, 'sms-username'); $password = ArrayHelper::getValue($opts, 'sms-password'); $smsfrom = ArrayHelper::getValue($opts, 'sms-from'); $smsto = ArrayHelper::getValue($opts, 'sms-to'); $url = sprintf($this->url, $username, $smsto, $smsfrom, urlencode($message)); $response = Sms::doRequest('GET', $url, ''); return strstr($response, 'api_') !== false; } } textopoly.php 0000604 00000002516 15174072272 0007333 0 ustar 00 <?php /** * Textopoly SMS gateway class * * @package Joomla.Plugin * @subpackage Fabrik.form.sms * @copyright Copyright (C) 2005-2016 Media A-Team, Inc. - All rights reserved. * @license GNU/GPL http://www.gnu.org/copyleft/gpl.html */ // No direct access defined('_JEXEC') or die('Restricted access'); use Fabrik\Helpers\ArrayHelper; use Fabrik\Helpers\Sms; /** * Textopoly SMS gateway class * * @package Joomla.Plugin * @subpackage Fabrik.form.sms * @since 3.0 */ class Textopoly extends JObject { /** * URL To Post SMS to * * @var string */ protected $url = 'http://sms.mxtelecom.com/SMSSend?user=%s&pass=%s&smsfrom=%s&smsto=%s&smsmsg=%s'; /** * Send SMS * * @param string $message sms message * @param array $opts Options * * @return void */ public function process($message, $opts) { $username = ArrayHelper::getValue($opts, 'sms-username'); $password = ArrayHelper::getValue($opts, 'sms-password'); $smsfrom = ArrayHelper::getValue($opts, 'sms-from'); $smsto = ArrayHelper::getValue($opts, 'sms-to'); $smstos = explode(',', $smsto); foreach ($smstos as $smsto) { $url = sprintf($this->url, $username, $password, $smsfrom, $smsto, $message); $response = Sms::doRequest('GET', $url, ''); } } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.23 | Generation time: 0 |
proxy
|
phpinfo
|
Settings