0

I wrote this rule to check if a user is in a specific group. But when executing, $result shows a "1" as output to show it's true that the user is member of that group.

$result = $adldap->user()->inGroup('john.doe', 'Testgroup', $recursive=NULL);
print_r($result);

How can I replace this output to a custom echo message for example?

I'm using this PHP class for my project: http://adldap.sourceforge.net/

1 Answer 1

1
if($result == 1) {
  echo "Whatever you want";
} else {
  echo "User is not in group";
}
Sign up to request clarification or add additional context in comments.

3 Comments

I tested it and now i'm still getting the "1" and right after that the first echo? Like this: "1Whatever you want". It's not replacing.
did you remove the print_r($result);?
Ah, that was the problem, thanks. It works perfect now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.