Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Michael Simpson

    (@msimpson)

    That message cannot be changed or removed.

    Thread Starter Gonzalo

    (@gonzalo-sanchez)

    would be ideal to choose when to show it or not, for instance as a parameter of the shortcode, I need show information to the administrator only and normal users do not know it’s there. Otherwise I should create a special page for the administrator and that is very little flaxible.

    Plugin Author Michael Simpson

    (@msimpson)

    I agree. I’ll look into making that configurable.

    Plugin Author Michael Simpson

    (@msimpson)

    In the mean time, if you like, edit your version of the file ExportBase.php

    Find this code:

    protected function assertSecurityErrorMessage() {
            $errMsg = __('You do not have sufficient permissions to access this data.', 'contact-form-7-to-database-extension');
            if ($this->isFromShortCode) {
                echo $errMsg;
            }
            else {
                include_once('CFDBDie.php');
                CFDBDie::wp_die($errMsg);
            }
        }

    And just change
    $errMsg = __('You do not have sufficient permissions to access this data.', 'contact-form-7-to-database-extension');
    to
    $errMsg = '';

    Plugin Author Michael Simpson

    (@msimpson)

    Update:

    I recoded that function to do what you suggest. Edit your code to replace that function with the following (your version I assuming is 2.4). I’ll have this code in the next update.

    Then you can add new permissionmsg attribute like this to turn off the message:

    [cfdb-table form=”My Form” permissionmsg=”false”]

    protected function assertSecurityErrorMessage() {
            $showMessage = true;
    
            if (isset($this->options['permissionmsg'])) {
                $showMessage = $this->options['permissionmsg'] != 'false';
            }
    
            $errMsg = $showMessage ? __('You do not have sufficient permissions to access this data.', 'contact-form-7-to-database-extension') : '';
            if ($this->isFromShortCode) {
                echo $errMsg;
            }
            else {
                include_once('CFDBDie.php');
                CFDBDie::wp_die($errMsg);
            }
        }
    Thread Starter Gonzalo

    (@gonzalo-sanchez)

    Hello friend! I am very happy that I have answered and even more glad you accepted my suggestion! I did not expect much attention, really. So thank you very much! I want to congratulate you for the plugin you created and want you to know that is a great addition for us developers, we have to meet the requirements of our customers with quick and effective solutions. Immediately seek your website and I will pass through the area of ??donations. I think it’s the least I can do to support developers like you that make my life easier. Again… thank you very much!
    In short I will comment to you if the solution you’ve suggested me is working properly. Sure it works!
    Sincerely,
    Gonzalo.

    Thread Starter Gonzalo

    (@gonzalo-sanchez)

    ok man! is working perfect! thank you very much again.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: Contact Form 7 to Database Extension] Removing the message "You do not have sufficient’ is closed to new replies.