Skip to content
Permalink
Browse files

Fixed some Google Search Console reported issues re Sitemap not check…

…ing privileges correctly
  • Loading branch information...
chrisgraham committed Jul 3, 2019
1 parent fd4d9ca commit ab81cbfd7b67b92b80511892489bc7626ce78803
@@ -55,6 +55,10 @@ public function get_entry_points($check_perms = true, $member_id = null, $suppor
return null;
}
if ($member_id === null) {
$member_id = get_member();
}
$ret = array(
'browse' => array('MEMBERS', 'menu/social/members'),
'step1' => array('ADD_MEMBER', 'menu/adminzone/tools/users/member_add'),
@@ -67,7 +71,7 @@ public function get_entry_points($check_perms = true, $member_id = null, $suppor
}
if ($support_crosslinks) {
if (has_privilege(get_member(), 'member_maintenance')) {
if (has_privilege($member_id, 'member_maintenance')) {
$ret['_SEARCH:members:browse'] = array('MEMBER_DIRECTORY', 'menu/adminzone/tools/users/member_edit');
}
$ret['_SEARCH:admin_cns_merge_members:browse'] = array('MERGE_MEMBERS', 'menu/adminzone/tools/users/merge_members');
@@ -55,7 +55,11 @@ class Module_cms_blogs extends Standard_crud_module
*/
public function get_entry_points($check_perms = true, $member_id = null, $support_crosslinks = true, $be_deferential = false)
{
if (!has_privilege(get_member(), 'have_personal_category', 'cms_news')) {
if ($member_id === null) {
$member_id = get_member();
}
if (!has_privilege($member_id, 'have_personal_category', 'cms_news')) {
return null;
}
@@ -59,24 +59,51 @@ class Module_cms_catalogues extends Standard_crud_module
*/
public function get_entry_points($check_perms = true, $member_id = null, $support_crosslinks = true, $be_deferential = false, $simplified = false)
{
if ($member_id === null) {
$member_id = get_member();
}
$ret = array(
'browse' => array('MANAGE_CATALOGUES', 'menu/rich_content/catalogues/catalogues'),
'add_category' => array('ADD_CATALOGUE_CATEGORY', 'menu/_generic_admin/add_one_category'),
'edit_category' => array('EDIT_CATALOGUE_CATEGORY', 'menu/_generic_admin/edit_one_category'),
);
if (has_privilege($member_id, 'submit_cat_highrange_content', 'cms_catalogues')) {
$ret += array(
'add_category' => array('ADD_CATALOGUE_CATEGORY', 'menu/_generic_admin/add_one_category'),
);
}
if (has_privilege($member_id, 'edit_cat_highrange_content', 'cms_catalogues')) {
$ret += array(
'edit_category' => array('EDIT_CATALOGUE_CATEGORY', 'menu/_generic_admin/edit_one_category'),
);
}
if (!$simplified) {
if (has_privilege($member_id, 'submit_cat_highrange_content', 'cms_catalogues')) {
$ret += array(
'add_catalogue' => array('ADD_CATALOGUE', 'menu/cms/catalogues/add_one_catalogue'),
);
}
if (has_privilege($member_id, 'edit_cat_highrange_content', 'cms_catalogues')) {
$ret += array(
'edit_catalogue' => array('EDIT_CATALOGUE', 'menu/cms/catalogues/edit_one_catalogue'),
);
}
}
if (has_privilege($member_id, 'mass_import', 'cms_catalogues')) {
$ret += array(
'add_catalogue' => array('ADD_CATALOGUE', 'menu/cms/catalogues/add_one_catalogue'),
'edit_catalogue' => array('EDIT_CATALOGUE', 'menu/cms/catalogues/edit_one_catalogue'),
'import' => array('IMPORT_CATALOGUE_ENTRIES', 'menu/_generic_admin/import_csv'),
);
}
$ret += array(
'import' => array('IMPORT_CATALOGUE_ENTRIES', 'menu/_generic_admin/import_csv'),
'export' => array('CATALOGUE_EXPORT', 'menu/_generic_admin/export'),
);
if ($GLOBALS['FORUM_DRIVER']->is_super_admin($member_id)) {
$ret += array(
'export' => array('CATALOGUE_EXPORT', 'menu/_generic_admin/export'),
);
}
$this->cat_crud_module = class_exists('Mx_cms_catalogues_cat') ? new Mx_cms_catalogues_cat() : new Module_cms_catalogues_cat();
$this->alt_crud_module = class_exists('Mx_cms_catalogues_alt') ? new Mx_cms_catalogues_alt() : new Module_cms_catalogues_alt();
@@ -52,6 +52,10 @@ class Module_cms_downloads extends Standard_crud_module
*/
public function get_entry_points($check_perms = true, $member_id = null, $support_crosslinks = true, $be_deferential = false)
{
if ($member_id === null) {
$member_id = get_member();
}
$ret = array(
'browse' => array('MANAGE_DOWNLOADS', 'menu/rich_content/downloads'),
);
@@ -61,12 +65,19 @@ public function get_entry_points($check_perms = true, $member_id = null, $suppor
$ret += parent::get_entry_points();
$ret += array(
'add_other' => array('ADD_DOWNLOAD_LICENCE', 'menu/cms/downloads/add_one_licence'),
'edit_other' => array('EDIT_DOWNLOAD_LICENCE', 'menu/cms/downloads/edit_one_licence'),
);
if (has_privilege($member_id, 'submit_cat_highrange_content', 'cms_downloads')) {
$ret += array(
'add_other' => array('ADD_DOWNLOAD_LICENCE', 'menu/cms/downloads/add_one_licence'),
);
}
if (has_privilege($member_id, 'edit_cat_highrange_content', 'cms_downloads')) {
$ret += array(
'edit_other' => array('EDIT_DOWNLOAD_LICENCE', 'menu/cms/downloads/edit_one_licence'),
);
}
if (has_privilege(get_member(), 'mass_import', 'cms_downloads')) {
if (has_privilege($member_id, 'mass_import', 'cms_downloads')) {
if (function_exists('ftp_connect')) {
$ret['import'] = array('FTP_DOWNLOADS', 'menu/_generic_admin/import');
}
@@ -52,15 +52,39 @@ class Module_cms_galleries extends Standard_crud_module
*/
public function get_entry_points($check_perms = true, $member_id = null, $support_crosslinks = true, $be_deferential = false)
{
if ($member_id === null) {
$member_id = get_member();
}
$ret = array(
'browse' => array('MANAGE_GALLERIES', 'menu/rich_content/galleries'),
'add' => array('ADD_IMAGE', 'menu/cms/galleries/add_one_image'),
'edit' => array('EDIT_IMAGE', 'menu/cms/galleries/edit_one_image'),
'add_other' => array('ADD_VIDEO', 'menu/cms/galleries/add_one_video'),
'edit_other' => array('EDIT_VIDEO', 'menu/cms/galleries/edit_one_video'),
);
if (has_privilege(get_member(), 'mass_import', 'cms_galleries')) {
if (has_privilege($member_id, 'submit_midrange_content', 'cms_galleries')) {
$ret += array(
'add' => array('ADD_IMAGE', 'menu/cms/galleries/add_one_image'),
);
}
if (has_privilege($member_id, 'edit_midrange_content', 'cms_galleries')) {
$ret += array(
'edit' => array('EDIT_IMAGE', 'menu/cms/galleries/edit_one_image'),
);
}
if (has_privilege($member_id, 'submit_midrange_content', 'cms_galleries')) {
$ret += array(
'add_other' => array('ADD_VIDEO', 'menu/cms/galleries/add_one_video'),
);
}
if (has_privilege($member_id, 'edit_midrange_content', 'cms_galleries')) {
$ret += array(
'edit_other' => array('EDIT_VIDEO', 'menu/cms/galleries/edit_one_video'),
);
}
if (has_privilege($member_id, 'mass_import', 'cms_galleries')) {
$ret['import'] = array('GALLERY_IMPORT', 'menu/_generic_admin/import');
}
@@ -105,10 +105,14 @@ public function install($upgrade_from = null, $upgrade_from_hack = null)
*/
public function get_entry_points($check_perms = true, $member_id = null, $support_crosslinks = true, $be_deferential = false)
{
if ($member_id === null) {
$member_id = get_member();
}
$ret = array(
'browse' => array('FILEDUMP', 'menu/cms/filedump'),
);
if ($GLOBALS['FORUM_DRIVER']->is_super_admin(get_member())) {
if ($GLOBALS['FORUM_DRIVER']->is_super_admin($member_id)) {
$ret += array(
'broken' => array('FIND_BROKEN_FILEDUMP_LINKS', 'menu/adminzone/tools/cleanup'),
);
@@ -44,17 +44,65 @@ class Module_cms_booking extends Standard_crud_module
*/
public function get_entry_points($check_perms = true, $member_id = null, $support_crosslinks = true, $be_deferential = false)
{
return array(
if ($member_id === null) {
$member_id = get_member();
}
$ret = array(
'browse' => array('BOOKINGS', 'menu/booking'),
'add_booking' => array('ADD_BOOKING', 'menu/booking'),
'edit_booking' => array('EDIT_BOOKING', 'menu/booking'),
'add' => array('ADD_BOOKABLE', 'menu/bookable'),
'edit' => array('EDIT_BOOKABLE', 'menu/bookable'),
'add_category' => array('ADD_BOOKABLE_SUPPLEMENT', 'menu/supplement'),
'edit_category' => array('EDIT_BOOKABLE_SUPPLEMENT', 'menu/supplement'),
'add_other' => array('ADD_BOOKABLE_BLACKED', 'menu/blacked'),
'edit_other' => array('EDIT_BOOKABLE_BLACKED', 'menu/blacked'),
) + parent::get_entry_points();
);
if (has_privilege($member_id, 'submit_highrange_content', 'cms_booking')) {
$ret += array(
'add_booking' => array('ADD_BOOKING', 'menu/booking'),
);
}
if (has_privilege($member_id, 'edit_highrange_content', 'cms_booking')) {
$ret += array(
'edit_booking' => array('EDIT_BOOKING', 'menu/booking'),
);
}
if (has_privilege($member_id, 'submit_cat_highrange_content', 'cms_booking')) {
$ret += array(
'add' => array('ADD_BOOKABLE', 'menu/bookable'),
);
}
if (has_privilege($member_id, 'edit_cat_highrange_content', 'cms_booking')) {
$ret += array(
'edit' => array('EDIT_BOOKABLE', 'menu/bookable'),
);
}
if (has_privilege($member_id, 'submit_cat_highrange_content', 'cms_booking')) {
$ret += array(
'add_category' => array('ADD_BOOKABLE_SUPPLEMENT', 'menu/supplement'),
);
}
if (has_privilege($member_id, 'edit_cat_highrange_content', 'cms_booking')) {
$ret += array(
'edit_category' => array('EDIT_BOOKABLE_SUPPLEMENT', 'menu/supplement'),
);
}
if (has_privilege($member_id, 'submit_cat_highrange_content', 'cms_booking')) {
$ret += array(
'add_other' => array('ADD_BOOKABLE_BLACKED', 'menu/blacked'),
);
}
if (has_privilege($member_id, 'edit_cat_highrange_content', 'cms_booking')) {
$ret += array(
'edit_other' => array('EDIT_BOOKABLE_BLACKED', 'menu/blacked'),
);
}
$ret += parent::get_entry_points();
return $ret;
}
/**
@@ -89,7 +89,11 @@ public function install($upgrade_from = null, $upgrade_from_hack = null)
*/
public function get_entry_points($check_perms = true, $member_id = null, $support_crosslinks = true, $be_deferential = false)
{
if ((!$check_perms || !is_guest($member_id)) && ($GLOBALS['SITE_DB']->query_select_value('invoices', 'COUNT(*)', array('i_member_id' => get_member())) > 0)) {
if ($member_id === null) {
$member_id = get_member();
}
if ((!$check_perms || !is_guest($member_id)) && ($GLOBALS['SITE_DB']->query_select_value('invoices', 'COUNT(*)', array('i_member_id' => $member_id)) > 0)) {
return array(
'browse' => array('MY_INVOICES', 'menu/adminzone/audit/ecommerce/invoices'),
);
@@ -141,26 +141,51 @@ public function info()
*/
public function get_entry_points($check_perms = true, $member_id = null, $support_crosslinks = true, $be_deferential = false)
{
$entry_points = array();
if ($member_id === null) {
$member_id = get_member();
}
$ret = array();
if (method_exists($this, 'add_actualisation')) {
$entry_points += array(
'add' => array('ADD_' . $this->lang_type, 'menu/_generic_admin/add_one'),
'edit' => array('EDIT_' . $this->lang_type, 'menu/_generic_admin/edit_one'),
);
if (($this->permissions_require === null) || (has_privilege($member_id, 'submit_' . $this->permissions_require . 'range_content', $this->privilege_page_name))) {
$ret += array(
'add' => array('ADD_' . $this->lang_type, 'menu/_generic_admin/add_one'),
);
}
if (($this->permissions_require === null) || (has_privilege($member_id, 'edit_' . $this->permissions_require . 'range_content', $this->privilege_page_name))) {
$ret += array(
'edit' => array('EDIT_' . $this->lang_type, 'menu/_generic_admin/edit_one'),
);
}
}
if (!is_null($this->cat_crud_module)) {
$entry_points += array(
'add_category' => array('ADD_' . $this->cat_crud_module->lang_type, 'menu/_generic_admin/add_one_category'),
'edit_category' => array('EDIT_' . $this->cat_crud_module->lang_type, 'menu/_generic_admin/edit_one_category'),
);
if (($this->permissions_require === null) || (has_privilege($member_id, 'submit_' . $this->permissions_require . 'range_content', $this->privilege_page_name))) {
$ret += array(
'add_category' => array('ADD_' . $this->cat_crud_module->lang_type, 'menu/_generic_admin/add_one_category'),
);
}
if (($this->permissions_require === null) || (has_privilege($member_id, 'edit_' . $this->permissions_require . 'range_content', $this->privilege_page_name))) {
$ret += array(
'edit_category' => array('EDIT_' . $this->cat_crud_module->lang_type, 'menu/_generic_admin/edit_one_category'),
);
}
}
if (!is_null($this->alt_crud_module)) {
$entry_points += array(
'add_other' => array('ADD_' . $this->alt_crud_module->lang_type, 'menu/_generic_admin/add_one'),
'edit_other' => array('EDIT_' . $this->alt_crud_module->lang_type, 'menu/_generic_admin/edit_one'),
);
if (($this->permissions_require === null) || (has_privilege($member_id, 'submit_' . $this->permissions_require . 'range_content', $this->privilege_page_name))) {
$ret += array(
'add_other' => array('ADD_' . $this->alt_crud_module->lang_type, 'menu/_generic_admin/add_one'),
);
}
if (($this->permissions_require === null) || (has_privilege($member_id, 'edit_' . $this->permissions_require . 'range_content', $this->privilege_page_name))) {
$ret += array(
'edit_other' => array('EDIT_' . $this->alt_crud_module->lang_type, 'menu/_generic_admin/edit_one'),
);
}
}
return $entry_points;
return $ret;
}
public $doing;

0 comments on commit ab81cbf

Please sign in to comment.
You can’t perform that action at this time.