You are here

private function ForumAccessTestCase::testForumAccessGetModeratorStatus in Forum Access 6

This function adds a user as a moderator to a forum (must be used by the admin user!)

1 call to ForumAccessTestCase::testForumAccessGetModeratorStatus()
ForumAccessTestCase::testForumAccessDumpDebugInfo in ./forum_access.test
This function is called when the program detects an error. It gives extra information so that the error can be fixed. hopefully :)

File

./forum_access.test, line 1175
Test file for forum_access.module.

Class

ForumAccessTestCase
This is the base class for forum access testing.

Code

private function testForumAccessGetModeratorStatus($uid = 0) {
  if (intval($this->testForumAccessCurrentForumId) > 0 && intval($uid) > 0) {
    $result = db_fetch_object(db_query("SELECT uid FROM {acl_user} WHERE uid = %d AND acl_id = (SELECT acl_id FROM {acl} WHERE module = 'forum_access' AND (name = '%s' OR number = %d))", $uid, $this->testForumAccessCurrentForumId, $this->testForumAccessCurrentForumId));
    if (isset($result->uid) && intval($result->uid) > 0 && $uid == $result->uid) {
      return TRUE;
    }
    else {
      return FALSE;
    }
  }
}