if (isset($WERNIS['status'])) {
// Use raw message
return $WERNIS['status'];
- } elseif (isset($WERNIS['status'])) {
- // Fall-back to status
- return sprintf(WERNIS_ERROR_STATUS, $WERNIS['status']);
} else {
// Something bad happend
return WERNIS_UNKNOWN_ERROR;
if (strpos($response[0], "200") === false) {
// Something bad happend... :(
return array(
- 'status' => "request_eror",
+ 'status' => "request_error",
'message' => sprintf(WERNIS_API_REQUEST_ERROR, $response[0])
);
}
$return = array();
// We use only the first two entries (which shall be fine)
- if ($data[0] == "error") {
+ if ($data[0] === "error") {
// The request has failed... :(
switch ($data[1]) {
+ case "404": // Invalid API ID
case "AUTH": // Authorization has failed
$return = array(
'status' => "auth_failed",
);
break;
+ case "LOCKED": // User account is locked!
+ case "PASS": // Bad passphrase entered
case "USER": // Missing account or invalid password
$return = array(
'status' => "user_failed",