Skip to content

Commit

Permalink
Second part of the error codes. Forgot some :(
Browse files Browse the repository at this point in the history
Added the new error codes and categories:

--- 212	Not allowed to delete media

== 230	Media edit error
--- 231	Filename not given
--- 232 File is still referenced
--- 233	Could not delete file
  • Loading branch information
timroes committed Nov 29, 2011
1 parent 1c12258 commit f3046d2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/exe/xmlrpc.php
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ function putAttachment($id, $file, $params) {
$auth = auth_quickaclcheck(getNS($id).':*');

if(!isset($id)) {
return new IXR_ERROR(1, 'Filename not given.');
return new IXR_ERROR(231, 'Filename not given.');
}

global $conf;
Expand Down Expand Up @@ -611,11 +611,11 @@ function deleteAttachment($id){
if ($res & DOKU_MEDIA_DELETED) {
return 0;
} elseif ($res & DOKU_MEDIA_NOT_AUTH) {
return new IXR_ERROR(1, "You don't have permissions to delete files.");
return new IXR_ERROR(212, "You don't have permissions to delete files.");
} elseif ($res & DOKU_MEDIA_INUSE) {
return new IXR_ERROR(1, 'File is still referenced');
return new IXR_ERROR(232, 'File is still referenced');
} else {
return new IXR_ERROR(1, 'Could not delete file');
return new IXR_ERROR(233, 'Could not delete file');
}
}

Expand Down

0 comments on commit f3046d2

Please sign in to comment.