-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'pu/cw/fixAdminSms' into '2024.11'
fix(Admin): cound not send sms See merge request tine20/tine20!6662
- Loading branch information
Showing
4 changed files
with
42 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php declare(strict_types=1); | ||
/** | ||
* Tine 2.0 | ||
* | ||
* @package Tinebase | ||
* @subpackage Model | ||
* @license http://www.gnu.org/licenses/agpl.html AGPL Version 3 | ||
* @copyright Copyright (c) 2024 Metaways Infosystems GmbH (http://www.metaways.de) | ||
* @author Paul Mehrer <[email protected]> | ||
*/ | ||
|
||
/** | ||
* SMS Generic HTTP Adapter Model | ||
* | ||
* @package Tinebase | ||
* @subpackage Model | ||
*/ | ||
class Tinebase_Model_Sms_MockAdapter extends Tinebase_Model_Sms_GenericHttpAdapter | ||
{ | ||
const MODEL_NAME_PART = 'Sms_MockAdapter'; | ||
|
||
public function send(Tinebase_Model_Sms_SendConfig $config): bool | ||
{ | ||
// @TODO make me working | ||
$this->setHttpClientConfig([ | ||
'adapter' => ($client = new Tinebase_ZendHttpClientAdapter()) | ||
]); | ||
|
||
$client->writeBodyCallBack = function($body) { | ||
$colorGreen = "\033[43m"; | ||
$colorReset = "\033[0m"; | ||
Tinebase_Core::getLogger()->warn($colorGreen . __METHOD__ . '::' . __LINE__ . ' sms request body: ' . $body . $colorReset . PHP_EOL); | ||
}; | ||
$client->setResponse(new Zend_Http_Response(200, [])); | ||
|
||
return true; | ||
} | ||
} |