-
Notifications
You must be signed in to change notification settings - Fork 62
Add CustomSMS a generic provider #473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…eway Signed-off-by: Daif Alazmi <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you fix the conflict?
if(!filter_var($url, FILTER_VALIDATE_URL)) | ||
{ | ||
$output->writeln('Invalid URL '.$url); | ||
goto ReTypeUrl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
goto
isn't good, maybe will be good use methods to do this using recursion.
Using specific method also will make more easy implement unit tests to this command;
$methodQuestion = new Question('Please enter the web service method (GET or POST): '); | ||
$method = (string)$helper->ask($input, $output, $methodQuestion); | ||
|
||
if(strtolower($method) != 'get' && strtolower($method) != 'post') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is a good practice use !==
than !=
|
||
## CustomSMS | ||
URL: any endpoint | ||
Stability: Experimental |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that will be good implement examples of supported API payload with GET and POST.
For example:
Provider with GET:
Need accept URL on this format: <base_url_provider>?<mobile_number_parameter>=<number> ....
Provider with POST:
...
Mandatory parameters:
base_url_provider | the base url of provider |
---|---|
mobile_number_parameter | phone number parameter, get from provider, by example: phone, number, num, etc |
Apply lint pattern with php-cs Run the command |
* Small fixes and improvements. * Replace goto statements with while-loop. * Automatic changes from: composer cs:fix Signed-off-by: Christian Schrötter <[email protected]>
@daif Take a look at this branch… https://github.com/froonix/twofactor_gateway/tree/pr-473 I've cherry-picked your commit on top of the current master branch and fixed all conflicts. Feel free to use it at your PR. @daif @vitormattos I've proposed some changes for the goto-issue and commited as 5d20f4d. What do you think about this alternative approach? I've not tested these code changes or PR, but I really like the idea of a generic custom provider. Feel free to use something (or nothing) from my branch |
@killerbees19 this PR is very old. I suggest to you to send a new PR using your branch and solving the last reviews comments if @daif don't return to work in this PR. |
Good idea. I'll wait some days/weeks for @daif to react on his original PR. If there's no new activity, I'll test the feature and open a new PR with my changes. (Feel free to ping me with @killerbees19 if there's no activity after some time. Chances are high that I'll forget it 😁) |
I already did a ping February. |
Good point 😆 Anyways, I've no time at the moment. Maybe next weekend... |
Hi all, Has there been any progress on this front? We would love to use the custom SMS feature to send 2FA texts through our own little gateway (Teltonika TRB140).
I am not familiar enough with the codebase to figure out why this happens. Best regards, |
/rebase |
@daif: Have you progressed on it with Nextcloud team? |
Thank you for your contribution and the time you put into this PR. Since then, I’ve taken over as maintainer of this app, and it has gone through a major refactor that changed much of the internal architecture and file structure. Because of that, this PR can’t be merged in its current form. If you’re still interested in this contribution, please feel free to rebase or open a new PR against the current main branch. Your effort is very valuable, even if we can’t merge this directly, it helps us move the app forward. Thanks again! |
Add CustomSMS a generic provider to send SMS using any webservice gateway