Plugin Directory

Changeset 1498036


Ignore:
Timestamp:
09/19/2016 09:54:53 AM (9 years ago)
Author:
rcdevs
Message:

tagging version 1.2.3

Location:
openotp-authentication/tags
Files:
4 edited
6 copied

Legend:

Unmodified
Added
Removed
  • openotp-authentication/tags/1.2.0/openotp.class.php

    r1077590 r1498036  
    196196            }
    197197        }
    198            
    199         $soap_client = new SoapClient(dirname(__FILE__).'/openotp.wsdl', $options);
     198       
     199        $stream_context = stream_context_create(array('ssl' => array('verify_peer' => false)));
     200        if ($stream_context){
     201            $options['stream_context'] = $stream_context;
     202        }
     203                   
     204        $soap_client = new SoapClientTimeout(dirname(__FILE__).'/openotp.wsdl', $options);
    200205        if (!$soap_client) {
    201206            return false;
    202207        }
     208        $soap_client->setTimeout(30);       
    203209        $this->soap_client = $soap_client; 
    204210        return true;
     
    207213    public function openOTPSimpleLogin($username, $domain, $password){
    208214        if (!$this->soapRequest()) return false;
    209         $resp = $this->soap_client->openotpSimpleLogin($username, $domain, $password, $this->client_id, $_SERVER["REMOTE_ADDR"], $this->user_settings);
     215        $resp = $this->soap_client->openotpSimpleLogin($username, $domain, $password, $this->client_id, $_SERVER["REMOTE_ADDR"], $this->user_settings, NULL, NULL);
    210216       
    211217        return $resp;
     
    220226}
    221227
     228class SoapClientTimeout extends SoapClient {
     229    private $timeout;
     230
     231    public function setTimeout ($timeout) {
     232        $this->timeout = $timeout;
     233    }
     234
     235    public function __doRequest($request, $location, $action, $version, $one_way=false) {
     236        if (!$this->timeout) {
     237            // Call via parent because we require no timeout
     238            $response = parent::__doRequest($request, $location, $action, $version, $one_way);
     239        } else {
     240            // Call via Curl and use the timeout
     241            $curl = curl_init($location);
     242
     243            curl_setopt($curl, CURLOPT_VERBOSE, false);
     244            curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
     245            curl_setopt($curl, CURLOPT_POST, true);
     246            curl_setopt($curl, CURLOPT_POSTFIELDS, $request);
     247            curl_setopt($curl, CURLOPT_HEADER, false);
     248            curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-Type: text/xml"));
     249            curl_setopt($curl, CURLOPT_TIMEOUT, $this->timeout);
     250
     251            $response = curl_exec($curl);
     252            if (curl_errno($curl)) throw new Exception(curl_error($curl));
     253            curl_close($curl);
     254        }
     255
     256        if (!$one_way) return ($response);
     257    }
     258}
     259
    222260?>
  • openotp-authentication/tags/1.2.0/openotp.js

    r1077590 r1498036  
    5555       
    5656    if( otp_settings.openotp_otpChallenge || ( !otp_settings.openotp_otpChallenge && !otp_settings.openotp_u2fChallenge ) ){
    57     oinnerHTML += '<tr style="border:none;"><td id="inputs_cell" style="text-align:center; padding-top:25px; border:none;"><input style="border:1px solid grey; background-color:white; margin-top:0; margin-bottom:0; padding:3px; vertical-align:middle; font-size:14px; width:auto;" type="text" size=15 name="openotp_password">&nbsp;'
     57    oinnerHTML += '<tr style="border:none;"><td id="inputs_cell" style="text-align:center; padding-top:25px; border:none;"><input style="border:1px solid grey; background-color:white; margin-top:0; margin-bottom:0; padding:3px; vertical-align:middle; font-size:14px; width:auto;" type="password" size=15 name="openotp_password">&nbsp;'
    5858        + '<input style="vertical-align:middle; padding:0 10px;" name="submit1" type="submit" value="Ok" class="button btn btn-primary"></td></tr>';
    5959    }
     
    8989    document.getElementById('div_orange').style.width=new_width+'px';
    9090   
    91     if( document.getElementById('openotp_password') ){
    92         document.getElementById('openotp_password').focus();
     91    if( document.getElementsByName('openotp_password') ){
     92        document.getElementsByName('openotp_password')[0].focus();
    9393    }
    9494   
     
    137137
    138138if( otp_settings.openotp_u2fChallenge){
    139     if (typeof u2f !== 'object' || typeof u2f.sign !== 'function'){ var u2f_activate = document.getElementById('u2f_activate'); u2f_activate.innerHTML = '[Not Supported]'; u2f_activate.style.color='red'; }
    140     else { u2f.sign([ JSON.parse(otp_settings.openotp_u2fChallenge)],
    141         function(response) { 
    142             document.getElementsByName('openotp_u2f')[0].value = JSON.stringify(response);
    143             document.getElementById("openotpform").submit(); },
    144             otp_settings.openotp_timeout
    145         );
     139    if (/chrom(e|ium)/.test(navigator.userAgent.toLowerCase())) {
     140        u2f.sign([ JSON.parse(otp_settings.openotp_u2fChallenge)], function(response) {
     141        document.getElementsByName('openotp_u2f')[0].value = JSON.stringify(response);
     142        document.getElementById("openotpform").submit();
     143        }, otp_settings.openotp_timeout ); 
     144    } else {
     145        var u2f_activate = document.getElementById('u2f_activate');
     146        u2f_activate.innerHTML = '[Not Supported]';
     147        u2f_activate.style.color='red';
    146148    }
    147149}
     150
     151
     152
     153
     154
     155
     156
     157
     158
     159
     160
     161
     162
     163
     164
  • openotp-authentication/tags/1.2.0/openotp.php

    r1077590 r1498036  
    55 * Description: Add <a href="http://www.rcdevs.com/">OpenOTP</a> two-factor authentication to WordPress.
    66 * Author: RCDevs Inc
    7  * Version: 1.2.0
     7 * Version: 1.2.3
    88 * Author URI: https://www.rcdevs.com
    99 * License: GPL2+
     
    441441
    442442              <?php else :  ?>
    443                   <p><?php printf( __( 'To use the OpenOTP plugin on Wordpress, you must doownload and configure OpenOTP server <a href="%1$s"><strong>%1$s</strong></a>.', 'opneotp' ), 'http://www.rcdevs.com' ); ?></p>
     443                  <p><?php printf( __( 'To use the OpenOTP plugin on Wordpress, you must download and configure OpenOTP server <a href="%1$s"><strong>%1$s</strong></a>.', 'openotp' ), 'http://www.rcdevs.com' ); ?></p>
    444444                  <p><?php _e( "Once you've configured your server, enter at least your server url in the fields below.", 'openotp' ); ?></p>
    445445                  <p><?php printf( __( 'Until your server URL is entered, the %s plugin cannot function.', 'openotp' ), $plugin_name ); ?></p>
     
    609609    public function openotp_AddJSToLogin(){
    610610        if($this->show_openotp_challenge){
    611             $this->js_inside_body();
     611            //$this->js_inside_body();
    612612            //wp_enqueue_script( 'u2f_api', '//chrome-extension://pfboblefjcgdjicmnffhdgionmgcdmne/u2f-api.js', array(), '3', true);
    613613           
     614            wp_enqueue_script( 'fidou2f', plugin_dir_url( __FILE__ ) . 'fidou2f.js',null,'',true);
    614615            wp_enqueue_script( 'openotp_overlay', plugin_dir_url( __FILE__ ) . 'openotp.js',null,'',true);
    615616            wp_localize_script( 'openotp_overlay', 'otp_settings', array(
  • openotp-authentication/tags/1.2.0/openotp.wsdl

    r1077590 r1498036  
    1818    <part name="settings" type="xsd:string"/>
    1919    <part name="options" type="xsd:string"/>
     20    <part name="context" type="xsd:string"/>
    2021</message>
    2122
     
    2930    <part name="settings" type="xsd:string"/>
    3031    <part name="options" type="xsd:string"/>
     32    <part name="context" type="xsd:string"/>
    3133</message>
    3234
     
    3638    <part name="session" type="xsd:string"/>
    3739    <part name="data" type="xsd:string"/>
     40    <part name="concat" type="xsd:integer"/>
    3841    <part name="timeout" type="xsd:integer"/>
    3942    <part name="otpChallenge" type="xsd:string"/>
     
    8992   <operation name="openotpSimpleLogin">
    9093      <soap:operation soapAction="openotpSimpleLogin"/>
    91       <input><soap:body use="encoded" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
    92       <output><soap:body use="encoded" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
     94      <input><soap:body use="literal" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
     95      <output><soap:body use="literal" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
    9396   </operation>
    9497   <operation name="openotpNormalLogin">
    9598      <soap:operation soapAction="openotpNormalLogin"/>
    96       <input><soap:body use="encoded" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
    97       <output><soap:body use="encoded" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
     99      <input><soap:body use="literal" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
     100      <output><soap:body use="literal" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
    98101   </operation>
    99102   <operation name="openotpLogin">
     
    101104           It is kept for backward compatibility with OpenOTP v1.0. -->
    102105      <soap:operation soapAction="openotpLogin"/>
    103       <input><soap:body use="encoded" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
    104       <output><soap:body use="encoded" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
     106      <input><soap:body use="literal" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
     107      <output><soap:body use="literal" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
    105108   </operation>
    106109   <operation name="openotpChallenge">
    107110      <soap:operation soapAction="openotpChallenge"/>
    108       <input><soap:body use="encoded" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
    109       <output><soap:body use="encoded" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
     111      <input><soap:body use="literal" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
     112      <output><soap:body use="literal" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
    110113   </operation>
    111114   <operation name="openotpStatus">
    112115      <soap:operation soapAction="openotpStatus"/>
    113       <input><soap:body use="encoded" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
    114       <output><soap:body use="encoded" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
     116      <input><soap:body use="literal" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
     117      <output><soap:body use="literal" namespace="urn:openotp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
    115118   </operation>
    116119</binding>
Note: See TracChangeset for help on using the changeset viewer.