Skip to content

Commit

Permalink
SOAP API: make the first parameter of mci_soap_fault_access_denied
Browse files Browse the repository at this point in the history
optional

Fixes #14871: Add support for the built-in soap extension in addition to
nusoap
  • Loading branch information
rombert committed Nov 14, 2012
1 parent 77cb4d9 commit 8fa6a5c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions api/soap/mc_api.php
Expand Up @@ -604,13 +604,18 @@ function mci_soap_fault_login_failed() {
* Returns a soap_fault signalling that the user does not have
* access rights for the specific action.
*
* @param int $p_user_id a valid user id
* @param int $p_user_id a user id, optional
* @param string $p_detail The optional details to append to the error message
* @return soap_fault
*/
function mci_soap_fault_access_denied( $p_user_id, $p_detail = '' ) {
$t_user_name = user_get_name( $p_user_id );
$t_reason = 'Access denied for user '. $t_user_name . '.';
function mci_soap_fault_access_denied( $p_user_id = 0, $p_detail = '' ) {
if ( $p_user_id ) {
$t_user_name = user_get_name( $p_user_id );
$t_reason = 'Access denied for user '. $t_user_name . '.';
} else {
$t_reason = 'Access denied';
}

if ( !is_blank( $p_detail ))
$t_reason .= ' Reason: ' . $p_detail . '.';

Expand Down

0 comments on commit 8fa6a5c

Please sign in to comment.