Exemplo n.º 1
0
BW Rox is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
BW Rox is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/> or
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA  02111-1307, USA.
*/
$purifier = MOD_htmlpure::getBasicHtmlPurifier();
$rights = new MOD_right();
$rights->HasRight('Comments');
function getShowCondition($com, $login)
{
    // show comment when marked as display in public (default situation)
    if ($com->DisplayInPublic == 1) {
        return 1;
    }
    // show comment to Safety team
    if (MOD_right::get()->HasRight('Comments')) {
        return 2;
    }
    // show comment to writer
    if ($com->UsernameFromMember == $login) {
        return 3;
    }
    // do not show comment