File tree 1 file changed +9
-4
lines changed
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -604,13 +604,18 @@ function mci_soap_fault_login_failed() {
604
604
* Returns a soap_fault signalling that the user does not have
605
605
* access rights for the specific action.
606
606
*
607
- * @param int $p_user_id a valid user id
607
+ * @param int $p_user_id a user id, optional
608
608
* @param string $p_detail The optional details to append to the error message
609
609
* @return soap_fault
610
610
*/
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
+
614
619
if ( !is_blank ( $ p_detail ))
615
620
$ t_reason .= ' Reason: ' . $ p_detail . '. ' ;
616
621
You can’t perform that action at this time.
0 commit comments