Plugin Directory

Changeset 1156549


Ignore:
Timestamp:
05/08/2015 10:47:26 PM (11 years ago)
Author:
websitezcom
Message:

Fixing the password not being set for previous installs

Location:
wp-mobile-detector
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wp-mobile-detector/tags/3.1/functions.php

    r1156375 r1156549  
    565565   
    566566    //Default options for the customizable mobile theme
    567     $websitez_options = array(
     567    $websitez_options_default = array(
    568568        'colors' => array(
    569569            "custom_color_light"=>"4f7498",
     
    610610   
    611611    //Set the default options if they do not exist
    612     if(!get_option("websitez-options"))
    613         add_option("websitez-options", serialize($websitez_options), '', 'yes');
     612    $websitez_options = websitez_get_options();
     613    if(!$websitez_options){
     614        websitez_set_options($websitez_options_default);
     615    }else{
     616        if(strlen($websitez_options['general']['password']) == 0){
     617            $websitez_options['general']['password'] = websitez_gen_uuid();
     618            websitez_set_options($websitez_options);
     619        }
     620    }
    614621   
    615622    if(!get_option(WEBSITEZ_LICENSE_KEY_NAME))
  • wp-mobile-detector/trunk/functions.php

    r1156375 r1156549  
    565565   
    566566    //Default options for the customizable mobile theme
    567     $websitez_options = array(
     567    $websitez_options_default = array(
    568568        'colors' => array(
    569569            "custom_color_light"=>"4f7498",
     
    610610   
    611611    //Set the default options if they do not exist
    612     if(!get_option("websitez-options"))
    613         add_option("websitez-options", serialize($websitez_options), '', 'yes');
     612    $websitez_options = websitez_get_options();
     613    if(!$websitez_options){
     614        websitez_set_options($websitez_options_default);
     615    }else{
     616        if(strlen($websitez_options['general']['password']) == 0){
     617            $websitez_options['general']['password'] = websitez_gen_uuid();
     618            websitez_set_options($websitez_options);
     619        }
     620    }
    614621   
    615622    if(!get_option(WEBSITEZ_LICENSE_KEY_NAME))
Note: See TracChangeset for help on using the changeset viewer.