Plugin Directory

Changeset 1478382


Ignore:
Timestamp:
08/19/2016 04:05:20 AM (10 years ago)
Author:
safly
Message:

Bug Fix: Some bugfixes

Location:
safly-cloud-protection/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • safly-cloud-protection/trunk/options.php

    r1477791 r1478382  
    1919    }
    2020
    21     //Notice
    22     SaFly_Options_Update_Notice();
    23 
    2421    global $safly_api_domain, $safly_api_key, $safly_api_server_url, $safly_ip_getenv;
    2522    global $safly_options_tmp, $safly_options, $safly_time_lag;
    2623    global $safly_ip, $safly_level, $saflysalt, $saflysign;
    27 
     24    global $SaFly_Options_Update_Notice;
     25    //Update Notice
     26    if (!empty($SaFly_Options_Update_Notice)) {
     27        echo $SaFly_Options_Update_Notice;
     28    }
    2829    /* SaFly Global Setting */
    2930
     
    151152    </p>
    152153    ';
    153 }
    154 
    155 function SaFly_Options_Update_Notice()
    156 {
    157     if (isset($_POST['saflysave']) || isset($_POST['saflyreset'])) {
    158         //Notice
    159         ob_start();
    160         $location = base64_decode(SaFly_Current_URL()) . '&saflynotice=on';
    161         header("location:$location");
    162     }
    163     if (isset($_GET['saflynotice'])) {
    164         echo '<div class="updated"><p>Settings updated successfully!</p></div>';
    165     }
    166154}
    167155
     
    280268        SaFly_Activated();
    281269    }
     270    //Notice
     271    SaFly_Options_Update_Notice(); 
     272
    282273    /* SaFly Dashboard */
    283274    add_action('admin_menu', 'safly_plugin_menu_page');
     
    285276}
    286277
     278function SaFly_Options_Update_Notice()
     279{
     280    global $SaFly_Options_Update_Notice;
     281    if (isset($_POST['saflysave']) || isset($_POST['saflyreset'])) {
     282        //Notice
     283        ob_start();
     284        $location = base64_decode(SaFly_Current_URL()) . '&saflynotice=on';
     285        header("location: $location");
     286        ob_end_flush();
     287        exit;
     288    }
     289    if (isset($_GET['saflynotice'])) {
     290        $SaFly_Options_Update_Notice = '<div class="updated"><p>Settings updated successfully!</p></div>';
     291    }
     292}
     293
    287294add_action('init', 'safly_load_options');
    288295
  • safly-cloud-protection/trunk/wrapper.php

    r1478376 r1478382  
    220220function SaFly_API_Key_VALIDATE($api_key)
    221221{
    222     if (!preg_match('/^(\w){32}$/', $api_key)) {
    223         wp_die('Only letters and numbers are available.', 'SaFly Cloud Protection');
     222    if (!empty($api_key) && !preg_match('/^(\w){32}$/', $api_key)) {
     223        wp_die('Invalid API KEY.', 'SaFly Cloud Protection');
    224224    }
    225225}
Note: See TracChangeset for help on using the changeset viewer.