[GH-ISSUE #414] PlaySMS configuration is not working #88

Open
opened 2026-02-26 05:33:02 +03:00 by kerem · 3 comments
Owner

Originally created by @EasyNetDev on GitHub (Jan 19, 2021).
Original GitHub issue: https://github.com/nextcloud/twofactor_gateway/issues/414

Hi,

I've tried this app for NextCloud 20.0.5, but after selecting playsms as SMS provider and adding URL, user and pass I go an error:

sudo -u www-data php /var/www/nextcloud/occ twofactorauth:gateway:configure sms
Please choose a SMS provider (websms, playsms, clockworksms, puzzelsms, ecallsms, voipms, huawei_e3531, spryng, sms77io, ovh, clickatellcentral, clicksend): playsms
Please enter your PlaySMS URL: https://playsms.MyDomain.com
Please enter your PlaySMS username: YYYYYYYYY
Please enter your PlaySMS password: XXXXXXXXXXXXXXXXXXX
An unhandled exception has been thrown:
TypeError: Return value of "OCA\TwoFactorGateway\Command\Configure::execute()" must be of the type int, "null" returned. in /var/www/nextcloud/apps/mail/vendor/symfony/console/Command/Command.php:261
Stack trace:
#0 /var/www/nextcloud/apps/mail/vendor/symfony/console/Application.php(920): Symfony\Component\Console\Command\Command->run()
#1 /var/www/nextcloud/apps/mail/vendor/symfony/console/Application.php(266): Symfony\Component\Console\Application->doRunCommand()
#2 /var/www/nextcloud/apps/mail/vendor/symfony/console/Application.php(142): Symfony\Component\Console\Application->doRun()
#3 /var/www/nextcloud/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run()
#4 /var/www/nextcloud/console.php(100): OC\Console\Application->run()
#5 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')
#6 {main}root@NextCloud-01:/var/www/nextcloud# mcedit /var/www/nextcloud/apps/mail/vendor/symfony/console/Command/Command.php

Also for PlaySMS I know that is necessary a hash to access the platform.

Originally created by @EasyNetDev on GitHub (Jan 19, 2021). Original GitHub issue: https://github.com/nextcloud/twofactor_gateway/issues/414 Hi, I've tried this app for NextCloud 20.0.5, but after selecting playsms as SMS provider and adding URL, user and pass I go an error: ``` sudo -u www-data php /var/www/nextcloud/occ twofactorauth:gateway:configure sms Please choose a SMS provider (websms, playsms, clockworksms, puzzelsms, ecallsms, voipms, huawei_e3531, spryng, sms77io, ovh, clickatellcentral, clicksend): playsms Please enter your PlaySMS URL: https://playsms.MyDomain.com Please enter your PlaySMS username: YYYYYYYYY Please enter your PlaySMS password: XXXXXXXXXXXXXXXXXXX An unhandled exception has been thrown: TypeError: Return value of "OCA\TwoFactorGateway\Command\Configure::execute()" must be of the type int, "null" returned. in /var/www/nextcloud/apps/mail/vendor/symfony/console/Command/Command.php:261 Stack trace: #0 /var/www/nextcloud/apps/mail/vendor/symfony/console/Application.php(920): Symfony\Component\Console\Command\Command->run() #1 /var/www/nextcloud/apps/mail/vendor/symfony/console/Application.php(266): Symfony\Component\Console\Application->doRunCommand() #2 /var/www/nextcloud/apps/mail/vendor/symfony/console/Application.php(142): Symfony\Component\Console\Application->doRun() #3 /var/www/nextcloud/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run() #4 /var/www/nextcloud/console.php(100): OC\Console\Application->run() #5 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...') #6 {main}root@NextCloud-01:/var/www/nextcloud# mcedit /var/www/nextcloud/apps/mail/vendor/symfony/console/Command/Command.php ``` Also for PlaySMS I know that is necessary a hash to access the platform.
Author
Owner

@ChristophWurst commented on GitHub (Jan 19, 2021):

The Configure command has to return an int from all paths.

<!-- gh-comment-id:762774927 --> @ChristophWurst commented on GitHub (Jan 19, 2021): The `Configure` command has to return an `int` from all paths.
Author
Owner

@EasyNetDev commented on GitHub (Jan 19, 2021):

Hi,

Checking the code I'm noticing this:

    /**
     * Executes the current command.
     *
     * This method is not abstract because you can use this class
     * as a concrete class. In this case, instead of defining the
     * execute() method, you set the code to execute by passing
     * a Closure to the setCode() method.
     *
     * @return int 0 if everything went fine, or an exit code
     *
     * @throws LogicException When this abstract method is not implemented
     *
     * @see setCode()
     */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        throw new LogicException('You must override the execute() method in the concrete command class.');
    }

This function is extremely simple function and it doesn't return anything.

<!-- gh-comment-id:762794829 --> @EasyNetDev commented on GitHub (Jan 19, 2021): Hi, Checking the code I'm noticing this: ``` /** * Executes the current command. * * This method is not abstract because you can use this class * as a concrete class. In this case, instead of defining the * execute() method, you set the code to execute by passing * a Closure to the setCode() method. * * @return int 0 if everything went fine, or an exit code * * @throws LogicException When this abstract method is not implemented * * @see setCode() */ protected function execute(InputInterface $input, OutputInterface $output) { throw new LogicException('You must override the execute() method in the concrete command class.'); } ``` This function is extremely simple function and it doesn't return anything.
Author
Owner

@ChristophWurst commented on GitHub (Jan 27, 2021):

@return int 0 if everything went fine, or an exit code

Here you go. This is documented behavior in Symfony 4.4 if you don't trust me.

<!-- gh-comment-id:768473009 --> @ChristophWurst commented on GitHub (Jan 27, 2021): > @return int 0 if everything went fine, or an exit code Here you go. This is documented behavior in Symfony 4.4 if you don't trust me.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/twofactor_gateway-nextcloud#88
No description provided.