1) { return; } /*** Owner-Based Checks ***/ // Has the profile owner's account been disabled? switch ($owner['flHideStatusID']) { case 1: $this->hideReason = self::HIDDEN; return; case 2: $this->hideReason = self::SUSPENDED; return; case 3: $this->hideReason = self::TERMINATED; return; } // Have profiles been disabled by a school the user belongs to? // Obviously, this logic is problematic if the student uses this account // for other programs that should not have the profile disabled. It // appears here for now because it was part of the pre-v8 version. // The OrigClassID clause was carried forward from the pre-v8 version // of profiles although it's purpose is unknown. $userSchoolsWithPrivacyEnabled = safe_dbread(" SELECT s.flStudentPrivacy FROM tig.TIGedClassUsers AS cu INNER JOIN tig.TIGedClasses AS c ON cu.ClassID = c.ClassID INNER JOIN tig.TIGedSchools AS s ON s.SchoolID = c.SchoolID WHERE cu.MemberID = $profileOwnerUserID AND cu.ClassUserType = 1 AND cu.OrigClassID = 0 AND s.flStudentPrivacy != 0 "); while ($school = safe_fetch_assoc($userSchoolsWithPrivacyEnabled)) { if ( $school['flStudentPrivacy'] == 2 || ($school['flStudentPrivacy'] == 1 && !$visitorUserID) ) { $this->hideReason = self::STUDENT; return; } } /*** Visitor-Based Checks ***/ // To avoid a situation where a user is told to log in to view a profile // and then told that the profile is hidden because the user is // suspended\terminated\etc., the visitor-based checks are performed // after the owner-based checks. // Has the profile owner elected to only show their profile to TIG members? if ($owner['flHidden'] && !$visitorUserID) { $this->hideReason = self::MEMBERSONLY; return; } } public function getHideReason() { return $this->hideReason; } }