From: Raphaël Barrois Date: Tue, 31 Aug 2010 23:49:43 +0000 (+0200) Subject: Improve default ProfileVisibility wrt new perm levels. X-Git-Tag: xorg/1.0.1~238 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=15f9cd37fa5df85b022756f0071a5b637dd7e6cc;p=platal.git Improve default ProfileVisibility wrt new perm levels. Signed-off-by: Raphaël Barrois --- diff --git a/classes/profile.php b/classes/profile.php index a747063..c26a545 100644 --- a/classes/profile.php +++ b/classes/profile.php @@ -42,9 +42,14 @@ class ProfileVisibility Platal::page()->kill("Invalid visibility: " . $level); } - if (!S::logged()) { + // Unlogged or not allowed to view directory_ax or requesting public + // => public view + if (!S::logged() || !S::user()->checkPerms('directory_ax') || $level == self::VIS_PUBLIC) { $level = self::VIS_PUBLIC; - } else if ($level == null) { + // Not allowed to view directory_private or requesting ax + } else if (!S::user()->checkPerms('directory_private') || $level == self::VIS_AX) { + $level = self::VIS_AX; + } else { $level = self::VIS_PRIVATE; }