Skip to content

Commit 8944669

Browse files
author
Andrew Morin
committed
Additional error handling in login/logout situations
1 parent 0d859fe commit 8944669

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

interact.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,17 @@ public function login( $username, $password )
229229
$this->print_xml();
230230
}
231231
}
232+
else
233+
{
234+
throw new Exception (self::SOAP_ERROR_LOGIN);
235+
}
236+
}
237+
else
238+
{
239+
if ($this->debug) {
240+
echo "Attempt to login when already logged in";
241+
}
242+
$result = true;
232243
}
233244

234245
return $result;
@@ -260,6 +271,13 @@ public function logout()
260271
}
261272
$result = true;
262273
}
274+
else
275+
{
276+
if( $this->debug == true ) {
277+
echo "Unable to perform logout";
278+
$this->print_xml();
279+
}
280+
}
263281
}
264282

265283
return $result;
@@ -452,6 +470,9 @@ public function loginWithCertificate( $user, $byte_array_challenge, $wsdl, $endp
452470
throw new Exception( self::SOAP_ERROR_HEADER );
453471
}
454472
}
473+
else {
474+
throw new Exception (self::SOAP_ERROR_LOGIN);
475+
}
455476

456477
//print_r( $result );
457478
return $result;

0 commit comments

Comments
 (0)