/** * Checks if user is allowed to access News category * @param $catlink * @param $hint * @param $show * @deprecated */ function checkNewsCategoryPassword($catlink, $hint, $show) { deprecated_function_notify(gettext('Use instead the Zenpage category class method checkforGuest().'), E_USER_NOTICE); $catobj = new ZenpageCategory($catlink); return $catobj->checkforGuest(); }
/** * See if a guest is logged on to the news category. * Note: If any belonging category is plublic or he is logged on, then success. * @param $hint * @param $show */ function checkforGuest(&$hint = NULL, &$show = NULL) { if (!parent::checkForGuest()) { return false; } $categories = $this->getCategories(); if (empty($categories)) { // cannot be protected! return 'zp_public_access'; } else { foreach ($categories as $cat) { $catobj = new ZenpageCategory($cat['titlelink']); $guestaccess = $catobj->checkforGuest($hint, $show); if ($guestaccess) { return $guestaccess; } } } return false; }