• Resolved Andrea

    (@aneises)


    Hello,

    I run the plugin on a multisite installation, so far without any problems.

    Now I have changed the main site (from https://www.example.com to https://www.otherdomain.com, previously part of the network) and can no longer access the settings of NinjaFW.

    Tried to add the line define ('NFW_ALLOWED_ADMIN', 'myadminusername'); to wp-config.php.

    Does somebody has any idea?

    Best regards,
    Andrea

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Andrea

    (@aneises)

    Tried the solution here, like posted above: https://blog.nintechnet.com/restricting-access-to-ninjafirewall-wp-edition-settings/

    NinjaFirewall (WP edition) troubleshooter
    HTTP server	:	Apache/2.4.10 (Debian)
    PHP version	:	7.4.7
    PHP SAPI	:	FPM-FCGI
     	 	 
    auto_prepend_file	:	/xxx/public_html/wp-content/nfwlog/ninjafirewall.php
    Loader's path to firewall	:	/xxx/public_html/wp-content/plugins/ninjafirewall/lib/firewall.php
    wp-config.php	:	found in /xxx/public_html/wp-config.php
    NinjaFirewall detection	:	NinjaFirewall WP Edition is loaded (Full WAF mode)
     	 	 
    Loaded INI file	:	/etc/php/7.4/fpm/php.ini
    user_ini.filename	:	.user.ini
    user_ini.cache_ttl	:	300 seconds
    User PHP INI	:	.user.ini found -
     	 	 
    DOCUMENT_ROOT	:	/xxx/public_html/
    ABSPATH	:	/xxx/public_html/
    WordPress version	:	5.6.1
     	 	Multisite installation detected
    WP_CONTENT_DIR	:	/xxx/public_html/wp-content
    Plugins directory	:	/xxx/public_html/wp-content/plugins
    User Role	:	Administrator
    User Capabilities	:	manage_options: OK - unfiltered_html: OK
    Log dir permissions	:	/xxx/public_html/wp-content/nfwlog dir is writable
    Cache dir permissions	:	/xxx/public_html/wp-content/nfwlog/cache dir is writable
    NinjaFirewall (WP edition) troubleshooter v1.9.4
    Plugin Author nintechnet

    (@nintechnet)

    Are you accessing https://www.otherdomain.com/wp-admin/network/admin.php?page=NinjaFirewall?
    If you do, is there any error returned?

    Do you see NinjaFirewall’s icon in the admin tool bar. By default it is visible in a multisite installation and, when moving the mouse over, it will show a tooltip with a link to its settings page.

    Thread Starter Andrea

    (@aneises)

    yes, I see the icon and the plugin is definitely active and working. The error message is “Sorry, you are not authorized to access this page.” (wp-die / Error 403)

    When I look in the plugin overview page https://www.newdomain.com/wp-admin/network/plugins.php, instead of the settings there is the gray text “Access restricted”, see https://imgur.com/a/wdQ0EK0

    Plugin Author nintechnet

    (@nintechnet)

    This restriction occurs when you either don’t have the manage_network capabilities or if this is not the main site, i.e., the is_main_site() function returns false.
    Copy the following code, save it to the file, e.g., “whatever.php”, upload it to your site inside the main root folder, and go to https://your-site/whatever.php:

    <?php
    require 'wp-config.php';
    if ( current_user_can('manage_network') ) {
    	echo "OK: You have the manage_network capability.</p>";
    } else {
    	echo "ERROR: You don't have the manage_network capability.</p>";
    }
    if ( is_main_site() ) {
    	echo "OK: This is the main site.</p>";
    } else {
    	echo "ERROR: This is not the main site.</p>";
    }
    
    Thread Starter Andrea

    (@aneises)

    OK: You have the manage_network capability.
    ERROR: This is not the main site.
    Thread Starter Andrea

    (@aneises)

    OK, got the point, I have to change the wp-config.

    8 is the Blog-ID of “otherdomain.com” what is my new mainsite.

    define(‘BLOG_ID_CURRENT_SITE’, 8);

    following the hints in here

    Thanks & regards, Andrea

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘No access to settings [multisite]’ is closed to new replies.