Plugin Directory

Changeset 3374816


Ignore:
Timestamp:
10/08/2025 06:22:02 AM (6 months ago)
Author:
moceanapiplugin
Message:

add token as new authentication method

Location:
otp-easy-login-with-mocean/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • otp-easy-login-with-mocean/trunk/admin/includes/options/services-options.php

    r2326240 r3374816  
    2121        'section'       => 'twilio-section',
    2222        'option_name'   => $option_name,
     23        'id'            => 'mocean-api-token',
     24        'title'         => 'API token',
     25        'desc'          => 'API token is prioritized over API key and secret',
     26    ),
     27
     28    array(
     29        'type'          => 'setting',
     30        'callback'      => 'text',
     31        'section'       => 'twilio-section',
     32        'option_name'   => $option_name,
    2333        'id'            => 'mocean-account-sid',
    2434        'title'         => 'API key',
     35        'desc'          => 'API key can be left empty if an API token is used',
    2536    ),
    2637
     
    3344        'id'            => 'mocean-auth-token',
    3445        'title'         => 'API Secret',
     46        'desc'          => 'API secret can be left empty if an API token is used',
    3547    ),
    3648
  • otp-easy-login-with-mocean/trunk/admin/templates/oelm-balance-info.php

    r2326240 r3374816  
    1111$account_sid = $settings['mocean-account-sid'];
    1212$auth_token = $settings['mocean-auth-token'];
     13$api_token = $settings['mocean-api-token'];
    1314
    1415
    1516
    1617    $mocean = new \Mocean\Client(
    17         new \Mocean\Client\Credentials\Basic($account_sid, $auth_token)
     18        new \Mocean\Client\Credentials\Basic(["apiKey" => $account_sid, "apiSecret" => $auth_token, "apiToken" => $api_token]
    1819    );
    1920   
    20     if ($account_sid == "" || $auth_token == ""){
     21    if ($api_token == "" && ($account_sid == "" || $auth_token == "")){
    2122        $result = "<span style='font-size:1rem;'>API Security Details missing! please enter your Mocean api security details in the services tab</span>";
    2223    }else{
  • otp-easy-login-with-mocean/trunk/includes/oelm-functions.php

    r2911450 r3374816  
    239239    $operators = array(
    240240        'mocean' => array(
    241             'download'  => 'https://dl.dropboxusercontent.com/s/aw67ni7pwrciw9y/mocean.zip?dl=0',
    242             'doc'       => 'https://dl.dropboxusercontent.com/s/8lvgbtbcru7uf9a/otp%20easy%20login%20woocommerce%20step%20by%20step%20tutorial.docx?dl=0', // Remember to change this
     241            'download'  => 'https://www.dropbox.com/scl/fi/1woldgulq9z3cwbjxpura/mocean.zip?rlkey=cii2knt4amzl54a6tp06wud55&st=bmlyxl90&dl=1',
     242            'doc'       => 'https://www.dropbox.com/scl/fi/sa5etg89d2t55pm8392jr/otp-easy-login-woocommerce-step-by-step-tutorial.docx?rlkey=zx96vdgiuud9z9nxeebuxu7aw&st=m4zx8tu0&dl=1', // Remember to change this
    243243            'loader'    => $operator_dir.'/mocean/vendor/autoload.php',
    244244            'myscript'  => oelm_PATH.'/includes/servicesScripts/class-oelm-mocean.php'
  • otp-easy-login-with-mocean/trunk/includes/servicesScripts/class-oelm-mocean.php

    r2326240 r3374816  
    2727        $this->account_sid = self::$settings['mocean-account-sid'];
    2828        $this->auth_token = self::$settings['mocean-auth-token'];
     29        $this->api_token = self::$settings['mocean-api-token'];
    2930        $this->senders_number = self::$settings['mocean-sender-number'];   
    3031    }
     
    3233    public function sendSMS( $phone, $message ){
    3334
    34         $mocean = new Client(new Basic(
    35             $this->account_sid,
    36             $this->auth_token
    37         ));
     35        $mocean = new Client(new Basic(["apiKey" => $this->account_sid, "apiSecret" => $this->auth_token, "apiToken" => $this->api_token]));
    3836       
    3937
  • otp-easy-login-with-mocean/trunk/readme.txt

    r3004008 r3374816  
    55Requires at least: 3.0.1
    66Tested up to: 6.3
    7 Stable tag: 1.1.2
     7Stable tag: 1.2.0
    88License: GPLv2
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset for help on using the changeset viewer.