Commit 378fefda authored by Patrick Schmalstig's avatar Patrick Schmalstig
Browse files

Fixed MANTIS-5766 (Many missing addon guards)

parent d5a52976
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -431,6 +431,9 @@ class Module_admin_points
        $labels = [];
        foreach ($hook_obs as $name => $hook_ob) {
            $data = $hook_ob->points_profile(null, null);
            if ($data === null) {
                continue;
            }
            $selected = (($_filter_t_type != '') && (in_array($name, $filter_t_type)));
            $labels[] = [
                'label' => $data['label'],
+1 −1
Original line number Diff line number Diff line
@@ -814,7 +814,7 @@ class Module_groups
        require_javascript('ajax_people_lists');

        $forum_id = null;
        if ($club) {
        if ($club && addon_installed('cns_clubs')) {
            $forum_where = ['f_name' => $group_name, 'f_forum_grouping_id' => intval(get_option('club_forum_parent_forum_grouping')), 'f_parent_forum_id' => intval(get_option('club_forum_parent_forum'))];
            $forum_id = $GLOBALS['FORUM_DB']->query_select_value_if_there('f_forums', 'id', $forum_where);
        }
+6 −5
Original line number Diff line number Diff line
@@ -90,11 +90,12 @@ class Block_main_cns_involved_topics
        }

        $forum1 = null;//$GLOBALS['FORUM_DRIVER']->forum_id_from_name(get_option('comments_forum_name'));
        $forum2 = null;
        if (addon_installed('tickets')) {
            $tf = get_option('ticket_forum_name', true);
            if ($tf !== null) {
                $forum2 = $GLOBALS['FORUM_DRIVER']->forum_id_from_name($tf);
        } else {
            $forum2 = null;
            }
        }
        */

+5 −1
Original line number Diff line number Diff line
@@ -338,7 +338,11 @@ function install_cns(?float $upgrade_from = null)
        $GLOBALS['FORUM_DB']->query_update('f_custom_fields', ['cf_type' => 'list', 'cf_options' => 'widget=radio'], ['cf_type' => 'radiolist']);
        $GLOBALS['FORUM_DB']->query_update('f_custom_fields', ['cf_type' => 'integer', 'cf_options' => 'default=AUTO_INCREMENT'], ['cf_type' => 'auto_increment']);

        $GLOBALS['FORUM_DB']->add_table_field('f_forums', 'f_allows_anonymous_posts', 'BINARY', intval(get_option('is_on_anonymous_posts')));
        $is_on_anonymous_posts = get_option('is_on_anonymous_posts', true);
        if ($is_on_anonymous_posts === null) {
            $is_on_anonymous_posts = '0';
        }
        $GLOBALS['FORUM_DB']->add_table_field('f_forums', 'f_allows_anonymous_posts', 'BINARY', intval($is_on_anonymous_posts));

        $GLOBALS['FORUM_DB']->add_table_field('f_members', 'm_auto_mark_read', 'BINARY', 1);

+2 −2
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@ function cns_join_form(object $url, bool $captcha_if_enabled = true, bool $intro
    url_default_parameters__disable();
    $hidden->attach($_hidden);

    if ($intro_message_if_enabled) {
    if ($intro_message_if_enabled && addon_installed('cns_forum')) {
        $forum_id = get_option('intro_forum_id');
        if ($forum_id != '') {
            $fields->attach(do_template('FORM_SCREEN_FIELD_SPACER', ['_GUID' => 'b8197832e4467b08e953535202235501', 'TITLE' => do_lang_tempcode('INTRODUCE_YOURSELF')]));
@@ -445,7 +445,7 @@ function cns_join_actual(string $declarations_made = '', bool $captcha_if_enable
    dispatch_notification('cns_new_member', null, do_lang('NEW_MEMBER_NOTIFICATION_MAIL_SUBJECT', $username, get_site_name(), null, get_site_default_lang()), $message, null, A_FROM_SYSTEM_PRIVILEGED);

    // Intro post
    if ($intro_message_if_enabled) {
    if ($intro_message_if_enabled && addon_installed('cns_forum')) {
        $forum_id = get_option('intro_forum_id');
        if ($forum_id != '') {
            if (!is_numeric($forum_id)) {
Loading