Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8fa6a5c

Browse files
committedNov 14, 2012
SOAP API: make the first parameter of mci_soap_fault_access_denied
optional Fixes #14871: Add support for the built-in soap extension in addition to nusoap
1 parent 77cb4d9 commit 8fa6a5c

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed
 

‎api/soap/mc_api.php

+9-4
Original file line numberDiff line numberDiff line change
@@ -604,13 +604,18 @@ function mci_soap_fault_login_failed() {
604604
* Returns a soap_fault signalling that the user does not have
605605
* access rights for the specific action.
606606
*
607-
* @param int $p_user_id a valid user id
607+
* @param int $p_user_id a user id, optional
608608
* @param string $p_detail The optional details to append to the error message
609609
* @return soap_fault
610610
*/
611-
function mci_soap_fault_access_denied( $p_user_id, $p_detail = '' ) {
612-
$t_user_name = user_get_name( $p_user_id );
613-
$t_reason = 'Access denied for user '. $t_user_name . '.';
611+
function mci_soap_fault_access_denied( $p_user_id = 0, $p_detail = '' ) {
612+
if ( $p_user_id ) {
613+
$t_user_name = user_get_name( $p_user_id );
614+
$t_reason = 'Access denied for user '. $t_user_name . '.';
615+
} else {
616+
$t_reason = 'Access denied';
617+
}
618+
614619
if ( !is_blank( $p_detail ))
615620
$t_reason .= ' Reason: ' . $p_detail . '.';
616621

0 commit comments

Comments
 (0)
Please sign in to comment.