Changeset 1498036
- Timestamp:
- 09/19/2016 09:54:53 AM (9 years ago)
- Location:
- openotp-authentication/tags
- Files:
-
- 4 edited
- 6 copied
Legend:
- Unmodified
- Added
- Removed
-
openotp-authentication/tags/1.2.0/openotp.class.php
r1077590 r1498036 196 196 } 197 197 } 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); 200 205 if (!$soap_client) { 201 206 return false; 202 207 } 208 $soap_client->setTimeout(30); 203 209 $this->soap_client = $soap_client; 204 210 return true; … … 207 213 public function openOTPSimpleLogin($username, $domain, $password){ 208 214 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); 210 216 211 217 return $resp; … … 220 226 } 221 227 228 class 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 222 260 ?> -
openotp-authentication/tags/1.2.0/openotp.js
r1077590 r1498036 55 55 56 56 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"> '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"> ' 58 58 + '<input style="vertical-align:middle; padding:0 10px;" name="submit1" type="submit" value="Ok" class="button btn btn-primary"></td></tr>'; 59 59 } … … 89 89 document.getElementById('div_orange').style.width=new_width+'px'; 90 90 91 if( document.getElement ById('openotp_password') ){92 document.getElement ById('openotp_password').focus();91 if( document.getElementsByName('openotp_password') ){ 92 document.getElementsByName('openotp_password')[0].focus(); 93 93 } 94 94 … … 137 137 138 138 if( 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'; 146 148 } 147 149 } 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 5 5 * Description: Add <a href="http://www.rcdevs.com/">OpenOTP</a> two-factor authentication to WordPress. 6 6 * Author: RCDevs Inc 7 * Version: 1.2. 07 * Version: 1.2.3 8 8 * Author URI: https://www.rcdevs.com 9 9 * License: GPL2+ … … 441 441 442 442 <?php else : ?> 443 <p><?php printf( __( 'To use the OpenOTP plugin on Wordpress, you must do ownload 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> 444 444 <p><?php _e( "Once you've configured your server, enter at least your server url in the fields below.", 'openotp' ); ?></p> 445 445 <p><?php printf( __( 'Until your server URL is entered, the %s plugin cannot function.', 'openotp' ), $plugin_name ); ?></p> … … 609 609 public function openotp_AddJSToLogin(){ 610 610 if($this->show_openotp_challenge){ 611 $this->js_inside_body();611 //$this->js_inside_body(); 612 612 //wp_enqueue_script( 'u2f_api', '//chrome-extension://pfboblefjcgdjicmnffhdgionmgcdmne/u2f-api.js', array(), '3', true); 613 613 614 wp_enqueue_script( 'fidou2f', plugin_dir_url( __FILE__ ) . 'fidou2f.js',null,'',true); 614 615 wp_enqueue_script( 'openotp_overlay', plugin_dir_url( __FILE__ ) . 'openotp.js',null,'',true); 615 616 wp_localize_script( 'openotp_overlay', 'otp_settings', array( -
openotp-authentication/tags/1.2.0/openotp.wsdl
r1077590 r1498036 18 18 <part name="settings" type="xsd:string"/> 19 19 <part name="options" type="xsd:string"/> 20 <part name="context" type="xsd:string"/> 20 21 </message> 21 22 … … 29 30 <part name="settings" type="xsd:string"/> 30 31 <part name="options" type="xsd:string"/> 32 <part name="context" type="xsd:string"/> 31 33 </message> 32 34 … … 36 38 <part name="session" type="xsd:string"/> 37 39 <part name="data" type="xsd:string"/> 40 <part name="concat" type="xsd:integer"/> 38 41 <part name="timeout" type="xsd:integer"/> 39 42 <part name="otpChallenge" type="xsd:string"/> … … 89 92 <operation name="openotpSimpleLogin"> 90 93 <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> 93 96 </operation> 94 97 <operation name="openotpNormalLogin"> 95 98 <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> 98 101 </operation> 99 102 <operation name="openotpLogin"> … … 101 104 It is kept for backward compatibility with OpenOTP v1.0. --> 102 105 <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> 105 108 </operation> 106 109 <operation name="openotpChallenge"> 107 110 <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> 110 113 </operation> 111 114 <operation name="openotpStatus"> 112 115 <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> 115 118 </operation> 116 119 </binding>
Note: See TracChangeset
for help on using the changeset viewer.