Ejemplo n.º 1
0
function save_settings()
{
    validate_request_vars();
    if (sizeof($_REQUEST)) {
        foreach ($_REQUEST as $var => $value) {
            switch ($var) {
                case 'timespan':
                    set_user_setting('cycle_timespan', get_request_var('timespan'));
                    break;
                case 'refresh':
                    set_user_setting('cycle_delay', get_request_var('refresh'));
                    break;
                case 'graphs':
                    set_user_setting('cycle_graphs', get_request_var('graphs'));
                    break;
                case 'cols':
                    set_user_setting('cycle_columns', get_request_var('cols'));
                    break;
                case 'height':
                    set_user_setting('cycle_height', get_request_var('height'));
                    break;
                case 'width':
                    set_user_setting('cycle_width', get_request_var('width'));
                    break;
                case 'legend':
                    set_user_setting('cycle_legend', get_request_var('legend'));
                    break;
                case 'filter':
                    set_user_setting('cycle_filter', get_request_var('filter'));
                    break;
            }
        }
    }
    validate_request_vars(true);
}
Ejemplo n.º 2
0
 /**
  * Sets up theme defaults and registers support for various WordPress features.
  *
  * Note that this function is hooked into the after_setup_theme hook, which runs
  * before the init hook. The init hook is too late for some features, such as indicating
  * support post thumbnails.
  *
  * @since Independent Publisher 1.0
  */
 function independent_publisher_setup()
 {
     /**
      * Custom template tags for this theme.
      */
     require get_stylesheet_directory() . '/inc/template-tags.php';
     /**
      * Customizer additions.
      */
     require get_stylesheet_directory() . '/inc/customizer.php';
     /**
      * Make theme available for translation
      * Translations can be filed in the /languages/ directory
      */
     load_theme_textdomain('independent-publisher', get_stylesheet_directory() . '/languages');
     /**
      * Add default posts and comments RSS feed links to head
      */
     add_theme_support('automatic-feed-links');
     /**
      * Enable Custom Backgrounds
      */
     add_theme_support('custom-background', apply_filters('independent_publisher_custom_background_args', array('default-color' => 'ffffff', 'default-image' => '')));
     // Enable support for HTML5 markup.
     add_theme_support('html5', array('comment-list', 'search-form', 'comment-form', 'gallery'));
     /**
      * Enable Post Thumbnails
      */
     add_theme_support('post-thumbnails');
     /*
      * Add custom thumbnail size for use with featured images
      */
     add_image_size('independent_publisher_post_thumbnail', 700, 700);
     /**
      * Enable editor style
      */
     add_editor_style();
     /**
      * Set max width of full screen visual editor to match content width
      */
     set_user_setting('dfw_width', 700);
     /**
      * Set default value for Show Post Word Count theme option
      */
     add_option('independent_publisher_general_options', array('show_post_word_count' => true));
     /**
      * This theme uses wp_nav_menu() in two locations.
      */
     register_nav_menus(array('primary' => __('Primary Menu', 'independent-publisher'), 'single' => __('Single Posts Menu', 'independent-publisher'), 'social' => __('Social', 'independent-publisher')));
     /**
      * Add support for the Aside Post Formats
      */
     add_theme_support('post-formats', array('aside', 'link', 'gallery', 'status', 'quote', 'chat', 'image', 'video', 'audio'));
 }
 /**
  *
  * @global string $usersearch
  * @global string $role
  * @global wpdb   $wpdb
  * @global string $mode
  */
 public function prepare_items()
 {
     global $usersearch, $role, $wpdb, $mode;
     $usersearch = isset($_REQUEST['s']) ? wp_unslash(trim($_REQUEST['s'])) : '';
     $users_per_page = $this->get_items_per_page('users_network_per_page');
     $role = isset($_REQUEST['role']) ? $_REQUEST['role'] : '';
     $paged = $this->get_pagenum();
     $args = array('number' => $users_per_page, 'offset' => ($paged - 1) * $users_per_page, 'search' => $usersearch, 'blog_id' => 0, 'fields' => 'all_with_meta');
     if (wp_is_large_network('users')) {
         $args['search'] = ltrim($args['search'], '*');
     } else {
         if ('' !== $args['search']) {
             $args['search'] = trim($args['search'], '*');
             $args['search'] = '*' . $args['search'] . '*';
         }
     }
     if ($role === 'super') {
         $logins = implode("', '", get_super_admins());
         $args['include'] = $wpdb->get_col("SELECT ID FROM {$wpdb->users} WHERE user_login IN ('{$logins}')");
     }
     /*
      * If the network is large and a search is not being performed,
      * show only the latest users with no paging in order to avoid
      * expensive count queries.
      */
     if (!$usersearch && wp_is_large_network('users')) {
         if (!isset($_REQUEST['orderby'])) {
             $_GET['orderby'] = $_REQUEST['orderby'] = 'id';
         }
         if (!isset($_REQUEST['order'])) {
             $_GET['order'] = $_REQUEST['order'] = 'DESC';
         }
         $args['count_total'] = false;
     }
     if (isset($_REQUEST['orderby'])) {
         $args['orderby'] = $_REQUEST['orderby'];
     }
     if (isset($_REQUEST['order'])) {
         $args['order'] = $_REQUEST['order'];
     }
     if (!empty($_REQUEST['mode'])) {
         $mode = $_REQUEST['mode'] === 'excerpt' ? 'excerpt' : 'list';
         set_user_setting('network_users_list_mode', $mode);
     } else {
         $mode = get_user_setting('network_users_list_mode', 'list');
     }
     /** This filter is documented in wp-admin/includes/class-wp-users-list-table.php */
     $args = apply_filters('users_list_table_query_args', $args);
     // Query the user IDs for this page
     $wp_user_search = new WP_User_Query($args);
     $this->items = $wp_user_search->get_results();
     $this->set_pagination_args(array('total_items' => $wp_user_search->get_total(), 'per_page' => $users_per_page));
 }
 /**
  * クラスの初期化
  *
  * @since    1.0.0
  * @param      object $blocks ブロックのインスタンス
  */
 public function __construct($blocks)
 {
     BCE_Utilis::set_option();
     // 自動最大高さ機能をオフ
     set_user_setting('editor_expand', 'off');
     $this->plugin_name = BCE_Utilis::get_plugin_name();
     $this->version = BCE_Utilis::get_version();
     $this->blocks = $blocks;
     add_filter('the_editor', array($this, 'the_editor'), 10, 1);
     add_action('wp_footer', array($this, 'output_locales'));
     add_action('admin_footer', array($this, 'output_locales'));
 }
Ejemplo n.º 5
0
function get_user_setting($key, $should_set = true)
{
    global $default_user_settings, $mobile_detect;
    if (array_key_exists($key, $_COOKIE)) {
        return $_COOKIE[$key];
    } else {
        switch ($key) {
            case 'use_dialogs':
                $default_value = is_mobile_browser() ? 'no' : 'yes';
                break;
            default:
                $default_value = $default_user_settings[$key];
                break;
        }
        if ($should_set) {
            set_user_setting($key, $default_value);
        }
        return $default_value;
    }
}
Ejemplo n.º 6
0
/**
 * Updates the login time in the database of the given user
 * The login time is used to automatically logout users who have been
 * inactive for the defined session time
 * @param string $username	the username to update the login info for
 */
function userUpdateLogin($user_id)
{
    set_user_setting($user_id, 'sessiontime', time());
}
Ejemplo n.º 7
0
                 $response = do_xmlrpc(xmlrpc_encode_request($cmd, $params));
                 if (!response || @xmlrpc_is_fault($response)) {
                     $errors[] = "Failed to add torrent \"{$d_name}\" to rTorrent:\n\n" . print_r($response, true);
                 }
             }
         }
     }
     if (count($errors)) {
         array_unshift($errors, "One or more errors occurred:\n");
         $script = 'alert(' . json_encode($errors) . '.join("\\n"))';
     } else {
         if (is_array($r_tags)) {
             set_error_handler('handleError');
             try {
                 set_torrent_tags($r_add_torrent, $r_tags, array());
                 set_user_setting('new_torrent_tags', implode('|', $r_tags));
             } catch (Exception $e) {
                 restore_error_handler();
                 die('Error setting tags: ' . $e->getMessage());
             }
             restore_error_handler();
         }
         $script = 'closeWindow();';
     }
     print "<script type=\"text/javascript\">{$script}</script>\n";
     break;
 case 'delete_files':
     if (is_array($_SESSION['to_add_data'])) {
         foreach ($_SESSION['to_add_data'] as $data) {
             @unlink("{$tmp_add_dir}/" . $data['filename']);
         }
 /**
  * ajax_toggle_advanced_items function.
  * 
  * @access public
  * @return void
  */
 public function ajax_toggle_advanced_items()
 {
     $nonce = $_POST['beansidebars_advanced_noonce'];
     $status = $_POST['new_status'];
     //Add nonce security to the request
     if (!wp_verify_nonce($nonce, 'beansidebars_advanced_noonce')) {
         die;
     }
     $response = set_user_setting('beansidebarsshowadvanced', $status);
     echo $response;
     die;
     // WordPress may print out a spurious zero without this can be particularly bad if using JSON
 }
Ejemplo n.º 9
0
 * Widgets administration panel.
 *
 * @package WordPress
 * @subpackage Administration
 */
/** WordPress Administration Bootstrap */
require_once dirname(__FILE__) . '/admin.php';
/** WordPress Administration Widgets API */
require_once ABSPATH . 'wp-admin/includes/widgets.php';
if (!current_user_can('edit_theme_options')) {
    wp_die(__('Cheatin&#8217; uh?'), 403);
}
$widgets_access = get_user_setting('widgets_access');
if (isset($_GET['widgets-access'])) {
    $widgets_access = 'on' == $_GET['widgets-access'] ? 'on' : 'off';
    set_user_setting('widgets_access', $widgets_access);
}
function wp_widgets_access_body_class($classes)
{
    return "{$classes} widgets_access ";
}
if ('on' == $widgets_access) {
    add_filter('admin_body_class', 'wp_widgets_access_body_class');
} else {
    wp_enqueue_script('admin-widgets');
    if (wp_is_mobile()) {
        wp_enqueue_script('jquery-touch-punch');
    }
}
/**
 * Fires early before the Widgets administration screen loads,
 /**
  *
  * @global string $s
  * @global string $mode
  * @global wpdb   $wpdb
  */
 public function prepare_items()
 {
     global $s, $mode, $wpdb;
     $current_site = get_current_site();
     if (!empty($_REQUEST['mode'])) {
         $mode = $_REQUEST['mode'] === 'excerpt' ? 'excerpt' : 'list';
         set_user_setting('sites_list_mode', $mode);
     } else {
         $mode = get_user_setting('sites_list_mode', 'list');
     }
     $per_page = $this->get_items_per_page('sites_network_per_page');
     $pagenum = $this->get_pagenum();
     $s = isset($_REQUEST['s']) ? wp_unslash(trim($_REQUEST['s'])) : '';
     $wild = '';
     if (false !== strpos($s, '*')) {
         $wild = '%';
         $s = trim($s, '*');
     }
     /*
      * If the network is large and a search is not being performed, show only
      * the latest sites with no paging in order to avoid expensive count queries.
      */
     if (!$s && wp_is_large_network()) {
         if (!isset($_REQUEST['orderby'])) {
             $_GET['orderby'] = $_REQUEST['orderby'] = '';
         }
         if (!isset($_REQUEST['order'])) {
             $_GET['order'] = $_REQUEST['order'] = 'DESC';
         }
     }
     $query = "SELECT * FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' ";
     if (empty($s)) {
         // Nothing to do.
     } elseif (preg_match('/^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$/', $s) || preg_match('/^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.?$/', $s) || preg_match('/^[0-9]{1,3}\\.[0-9]{1,3}\\.?$/', $s) || preg_match('/^[0-9]{1,3}\\.$/', $s)) {
         // IPv4 address
         $sql = $wpdb->prepare("SELECT blog_id FROM {$wpdb->registration_log} WHERE {$wpdb->registration_log}.IP LIKE %s", $wpdb->esc_like($s) . $wild);
         $reg_blog_ids = $wpdb->get_col($sql);
         if (!$reg_blog_ids) {
             $reg_blog_ids = array(0);
         }
         $query = "SELECT *\n\t\t\t\tFROM {$wpdb->blogs}\n\t\t\t\tWHERE site_id = '{$wpdb->siteid}'\n\t\t\t\tAND {$wpdb->blogs}.blog_id IN (" . implode(', ', $reg_blog_ids) . ")";
     } else {
         if (is_numeric($s) && empty($wild)) {
             $query .= $wpdb->prepare(" AND ( {$wpdb->blogs}.blog_id = %s )", $s);
         } elseif (is_subdomain_install()) {
             $blog_s = str_replace('.' . $current_site->domain, '', $s);
             $blog_s = $wpdb->esc_like($blog_s) . $wild . $wpdb->esc_like('.' . $current_site->domain);
             $query .= $wpdb->prepare(" AND ( {$wpdb->blogs}.domain LIKE %s ) ", $blog_s);
         } else {
             if ($s != trim('/', $current_site->path)) {
                 $blog_s = $wpdb->esc_like($current_site->path . $s) . $wild . $wpdb->esc_like('/');
             } else {
                 $blog_s = $wpdb->esc_like($s);
             }
             $query .= $wpdb->prepare(" AND  ( {$wpdb->blogs}.path LIKE %s )", $blog_s);
         }
     }
     $order_by = isset($_REQUEST['orderby']) ? $_REQUEST['orderby'] : '';
     if ($order_by === 'registered') {
         $query .= ' ORDER BY registered ';
     } elseif ($order_by === 'lastupdated') {
         $query .= ' ORDER BY last_updated ';
     } elseif ($order_by === 'blogname') {
         if (is_subdomain_install()) {
             $query .= ' ORDER BY domain ';
         } else {
             $query .= ' ORDER BY path ';
         }
     } elseif ($order_by === 'blog_id') {
         $query .= ' ORDER BY blog_id ';
     } else {
         $order_by = null;
     }
     if (isset($order_by)) {
         $order = isset($_REQUEST['order']) && 'DESC' === strtoupper($_REQUEST['order']) ? "DESC" : "ASC";
         $query .= $order;
     }
     // Don't do an unbounded count on large networks
     if (!wp_is_large_network()) {
         $total = $wpdb->get_var(str_replace('SELECT *', 'SELECT COUNT( blog_id )', $query));
     }
     $query .= " LIMIT " . intval(($pagenum - 1) * $per_page) . ", " . intval($per_page);
     $this->items = $wpdb->get_results($query, ARRAY_A);
     if (wp_is_large_network()) {
         $total = count($this->items);
     }
     $this->set_pagination_args(array('total_items' => $total, 'per_page' => $per_page));
 }
 /**
  * Hide the WooTransmitter notification forever, if desired.
  * @since  1.0.0
  * @return void
  */
 public function hide_forever()
 {
     if (is_user_logged_in() && isset($_GET['wootransmitter-hide']) && $_GET['wootransmitter-hide'] == 'yes' && isset($_GET['_wpnonce']) && wp_verify_nonce($_GET['_wpnonce'], 'wootransmitter-hide')) {
         set_user_setting('wootransmitterbridgehide', '1');
         $redirect = remove_query_arg(array('wootransmitter-hide', '_wpnonce'), $this->current_url());
         wp_safe_redirect($redirect);
         exit;
     }
 }
Ejemplo n.º 12
0
/**
* Accpet changed gedcom record into database
*
* This function gets an updated record from the gedcom file and replaces it in the database
* @author John Finlay
* @param string $cid The change id of the record to accept
*/
function accept_changes($cid)
{
    global $pgv_changes, $GEDCOM, $TBLPREFIX, $FILE, $GEDCOMS;
    global $INDEX_DIRECTORY, $SYNC_GEDCOM_FILE, $fcontents, $manual_save;
    if (isset($pgv_changes[$cid])) {
        $changes = $pgv_changes[$cid];
        $change = $changes[count($changes) - 1];
        if ($GEDCOM != $change["gedcom"]) {
            $GEDCOM = $change["gedcom"];
        }
        $FILE = $GEDCOM;
        $gid = $change["gid"];
        $gedrec = $change["undo"];
        if (empty($gedrec)) {
            $gedrec = find_gedcom_record($gid);
        }
        update_record($gedrec, $change["type"] == "delete");
        //-- write the changes back to the gedcom file
        if ($SYNC_GEDCOM_FILE) {
            // TODO: We merge CONC lines on import, so need to add them back on export
            if (!isset($manual_save) || $manual_save == false) {
                //-- only allow one thread to accept changes at a time
                //				$mutex = new Mutex("accept_changes");
                //				$mutex->Wait();
            }
            if (empty($fcontents)) {
                read_gedcom_file();
            }
            if ($change["type"] == "delete") {
                $pos1 = find_newline_string($fcontents, "0 @{$gid}@");
                if ($pos1 !== false) {
                    $pos2 = find_newline_string($fcontents, "0", $pos1 + 5);
                    if ($pos2 === false) {
                        $fcontents = substr($fcontents, 0, $pos1) . '0 TRLR' . PGV_EOL;
                        AddToLog("Corruption found in GEDCOM {$GEDCOM} Attempted to correct");
                    } else {
                        $fcontents = substr($fcontents, 0, $pos1) . substr($fcontents, $pos2);
                    }
                } else {
                    AddToLog("Corruption found in GEDCOM {$GEDCOM} Attempted to correct.  Deleted gedcom record {$gid} was not found in the gedcom file.");
                }
            } elseif ($change["type"] == "append") {
                $pos1 = find_newline_string($fcontents, "0 TRLR");
                $fcontents = substr($fcontents, 0, $pos1) . reformat_record_export($gedrec) . '0 TRLR' . PGV_EOL;
            } elseif ($change["type"] == "replace") {
                $pos1 = find_newline_string($fcontents, "0 @{$gid}@");
                if ($pos1 !== false) {
                    $pos2 = find_newline_string($fcontents, "0", $pos1 + 5);
                    if ($pos2 === false) {
                        $fcontents = substr($fcontents, 0, $pos1) . '0 TRLR' . PGV_EOL;
                        AddToLog("Corruption found in GEDCOM {$GEDCOM} Attempted to correct");
                    } else {
                        $fcontents = substr($fcontents, 0, $pos1) . reformat_record_export($gedrec) . substr($fcontents, $pos2);
                    }
                } else {
                    //-- attempted to replace a record that doesn't exist
                    AddToLog("Corruption found in GEDCOM {$GEDCOM} Attempted to correct.  Replaced gedcom record {$gid} was not found in the gedcom file.");
                    $pos1 = find_newline_string($fcontents, "0 TRLR");
                    $fcontents = substr($fcontents, 0, $pos1) . reformat_record_export($gedrec) . '0 TRLR' . PGV_EOL;
                    AddToLog("Gedcom record {$gid} was appended back to the GEDCOM file.");
                }
            }
            if (!isset($manual_save) || $manual_save == false) {
                write_file();
                //				$mutex->Release();
            }
        }
        if ($change["type"] != "delete") {
            //-- synchronize the gedcom record with any user account
            $username = get_user_from_gedcom_xref($GEDCOM, $gid);
            if ($username && get_user_setting($username, 'sync_gedcom') == 'Y') {
                $firstname = get_gedcom_value("GIVN", 2, $gedrec);
                $lastname = get_gedcom_value("SURN", 2, $gedrec);
                if (empty($lastname)) {
                    $fullname = get_gedcom_value("NAME", 1, $gedrec, "", false);
                    $ct = preg_match("~(.*)/(.*)/~", $fullname, $match);
                    if ($ct > 0) {
                        $firstname = $match[1];
                        $lastname = $match[2];
                    } else {
                        $firstname = $fullname;
                    }
                }
                //-- SEE [ 1753047 ] Email/sync with account
                $email = get_gedcom_value("EMAIL", 1, $gedrec);
                if (empty($email)) {
                    $email = get_gedcom_value("_EMAIL", 1, $gedrec);
                }
                if (!empty($email)) {
                    set_user_setting($username, 'email', $email);
                }
                set_user_setting($username, 'firstname', $firstname);
                set_user_setting($username, 'lastname', $lastname);
            }
        }
        unset($pgv_changes[$cid]);
        if (!isset($manual_save) || $manual_save == false) {
            write_changes();
        }
        $logline = AddToLog("Accepted change {$cid} " . $change["type"] . " into database");
        check_in($logline, $GEDCOM, dirname($GEDCOMS[$GEDCOM]['path']));
        if (isset($change["linkpid"])) {
            accept_changes($change["linkpid"] . "_" . $GEDCOM);
        }
        return true;
    }
    return false;
}
Ejemplo n.º 13
0
function set_user_gedcom_setting($user_id, $ged_id, $parameter, $value)
{
    $ged_name = get_gedcom_from_id($ged_id);
    $tmp = get_user_setting($user_id, $parameter);
    if (is_string($tmp)) {
        $tmp_array = unserialize($tmp);
        if (!is_array($tmp_array)) {
            $tmp_array = array();
        }
    } else {
        $tmp_array = array();
    }
    if (empty($value)) {
        // delete the value
        unset($tmp_array[$ged_name]);
    } else {
        // update the value
        $tmp_array[$ged_name] = $value;
    }
    set_user_setting($user_id, $parameter, serialize($tmp_array));
    global $PGV_USERS_cache;
    if (isset($PGV_USERS_cache[$user_id])) {
        unset($PGV_USERS_cache[$user_id]);
    }
}
Ejemplo n.º 14
0
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with rtGui.  If not, see <http://www.gnu.org/licenses/>.
require_once 'config.php';
require_once 'functions.php';
rtgui_session_start();
extract($_REQUEST, EXTR_PREFIX_ALL, 'r');
if ($r_operation == 'save_settings') {
    set_user_setting('refresh_interval', $r_set_refresh);
    rtorrent_xmlrpc('set_upload_rate', array($r_set_max_up));
    rtorrent_xmlrpc('set_download_rate', array($r_set_max_down));
    set_user_setting('theme', $r_set_theme);
    set_user_setting('use_dialogs', $r_set_use_dialogs ? 'yes' : 'no');
    set_user_setting('show_hidden', $r_set_show_hidden ? 'yes' : 'no');
}
$download_cap = rtorrent_xmlrpc('get_download_rate');
$upload_cap = rtorrent_xmlrpc('get_upload_rate');
if (isset($r_submit)) {
    if ($r_dialog) {
        echo <<<JS
<script type="text/javascript">
window.top.reloadUserSettings();
window.top.hideDialog(true);
</script>
JS;
    } else {
        header('Location: .');
    }
    die;
Ejemplo n.º 15
0
<?php

global $current_screen;
/** WordPress Administration fields API */
//require_once(ABSPATH . 'wp-admin/includes/fields.php');
//require( SCF_DIR . '/inc/functions.widget.php');
if (!current_user_can('edit_theme_options')) {
    wp_die(__('Cheatin&#8217; uh?'));
}
wp_admin_css('widgets', true);
$fields_access = get_user_setting('widgets_access');
if (isset($_GET['fields-access'])) {
    $fields_access = 'on' == $_GET['fields-access'] ? 'on' : 'off';
    set_user_setting('widgets_access', $fields_access);
}
if ('on' == $fields_access) {
    add_filter('admin_body_class', create_function('', '{return " widgets_access ";}'));
} else {
    wp_enqueue_script('admin-widgets');
}
do_action('sidebar_admin_setup');
$title = __('Page Fields', 'custom_fields');
$parent_file = 'themes.php';
$help = '
	<p>' . __('fields are independent sections of content that can be placed into any fieldized area provided by your theme (commonly called sidebars). To populate your sidebars/field areas with individual fields, drag and drop the title bars into the desired area. By default, only the first field area is expanded. To populate additional field areas, click on their title bars to expand them.') . '</p>
	<p>' . __('Available fields section contains all the fields you can choose from. Once you drag a field into a sidebar, it will open to allow you to configure its settings. When you are happy with the field settings, click the Save button and the field will go live on your site. If you click Delete, it will remove the field.') . '</p>
	<p>' . __('If you want to remove the field but save its setting for possible future use, just drag it into the Inactive fields area. You can add them back anytime from there. This is especially helpful when you switch to a theme with less or different field areas.') . '</p>
	<p>' . __('fields may be used multiple times. You can give each field a title, to display on your site, but it&#8217;s not required.') . '</p>
	<p>' . __('Enabling Accessibility Mode, via Screen Options, allows you to use Add and Edit buttons instead of using drag and drop.') . '</p>
';
$help .= '<p><strong>' . __('For more information:') . '</strong></p>';
Ejemplo n.º 16
0
 $controller->setPageTitle(WT_I18N::translate('User verification'));
 $controller->pageHeader();
 echo '<div id="login-register-page">';
 echo '<h2>' . WT_I18N::translate('User verification') . '</h2>';
 echo '<div id="user-verify">';
 echo WT_I18N::translate('The data for the user <b>%s</b> was checked.', $user_name);
 if ($user) {
     if ($user->checkPassword($user_password) && $user->getSetting('reg_hashcode') == $user_hashcode) {
         WT_Mail::send($WT_TREE, $webmaster->getEmail(), $webmaster->getRealName(), $WEBTREES_EMAIL, $WEBTREES_EMAIL, $mail1_subject, $mail1_body);
         $mail1_method = $webmaster->getSetting('CONTACT_METHOD');
         if ($mail1_method != 'messaging3' && $mail1_method != 'mailto' && $mail1_method != 'none') {
             WT_DB::prepare("INSERT INTO `##message` (sender, ip_address, user_id, subject, body) VALUES (? ,? ,? ,? ,?)")->execute(array($user_name, $WT_REQUEST->getClientIp(), $webmaster->getUserId(), $mail1_subject, WT_Filter::unescapeHtml($mail1_body)));
         }
         $user->setSetting('verified', 1)->setSetting('reg_timestamp', date("U"))->setSetting('reg_hashcode', null);
         if (!$REQUIRE_ADMIN_AUTH_REGISTRATION) {
             set_user_setting($user_id, 'verified_by_admin', 1);
         }
         Log::addAuthenticationLog('User ' . $user_name . ' verified their email address');
         echo '<br><br>' . WT_I18N::translate('You have confirmed your request to become a registered user.') . '<br><br>';
         if ($REQUIRE_ADMIN_AUTH_REGISTRATION && !$user->getSetting('verified_by_admin')) {
             echo WT_I18N::translate('The administrator has been informed.  As soon as he gives you permission to login, you can login with your user name and password.');
         } else {
             echo WT_I18N::translate('You can now login with your user name and password.');
         }
         echo '<br><br>';
     } else {
         Log::addAuthenticationLog('User ' . $user_name . ' failed to verify their email address');
         echo '<br><br>';
         echo '<span class="warning">';
         echo WT_I18N::translate('Data was not correct, please try again');
         echo '</span><br><br>';
Ejemplo n.º 17
0
 /**
  * Import users etc. from index files
  *
  */
 function import()
 {
     global $INDEX_DIRECTORY, $TBLPREFIX, $pgv_lang, $GEDCOMS, $GEDCOM, $gBitDb;
     if (file_exists($INDEX_DIRECTORY . "authenticate.php") == false) {
         $this->impSuccess = false;
         return;
     } else {
         require $INDEX_DIRECTORY . "authenticate.php";
         $countold = count($users);
         $gBitDb->query("DELETE FROM {$TBLPREFIX}users");
         foreach ($users as $username => $user) {
             if ($user["editaccount"] == "1") {
                 $user["editaccount"] = "Y";
             } else {
                 $user["editaccount"] = "N";
             }
             //-- make sure fields are set for v4.0 DB
             if (!isset($user["firstname"])) {
                 if (isset($user["fullname"])) {
                     $parts = explode(' ', trim($user["fullname"]));
                     $user["lastname"] = array_pop($parts);
                     $user["firstname"] = implode(" ", $parts);
                 } else {
                     $user["firstname"] = '';
                     $user["lastname"] = '';
                 }
             }
             if (!isset($user["comment"])) {
                 $user["comment"] = '';
             }
             if (!isset($user["comment_exp"])) {
                 $user["comment_exp"] = '';
             }
             if (!isset($user["sync_gedcom"])) {
                 $user["sync_gedcom"] = 'N';
             }
             if (!isset($user["relationship_privacy"])) {
                 $user["relationship_privacy"] = 'N';
             }
             if (!isset($user["max_relation_path"])) {
                 $user["max_relation_path"] = '2';
             }
             if (!isset($user["auto_accept"])) {
                 $user["auto_accept"] = 'N';
             }
             if ($user_id = create_user($user['username'], $user['password'])) {
                 set_user_setting($user_id, 'firstname', $user["firstname"]);
                 set_user_setting($user_id, 'lastname', $user["lastname"]);
                 set_user_setting($user_id, 'email', $user["email"]);
                 set_user_setting($user_id, 'theme', $user["theme"]);
                 set_user_setting($user_id, 'language', $user["language"]);
                 set_user_setting($user_id, 'contactmethod', $user["contactmethod"]);
                 set_user_setting($user_id, 'defaulttab', $user["defaulttab"]);
                 set_user_setting($user_id, 'comment', $user["comment"]);
                 set_user_setting($user_id, 'comment_exp', $user["comment_exp"]);
                 set_user_setting($user_id, 'pwrequested', $user["pwrequested"]);
                 set_user_setting($user_id, 'reg_timestamp', $user["reg_timestamp"]);
                 set_user_setting($user_id, 'reg_hashcode', $user["reg_hashcode"]);
                 set_user_setting($user_id, 'loggedin', $user["loggedin"]);
                 set_user_setting($user_id, 'sessiontime', $user["sessiontime"]);
                 set_user_setting($user_id, 'max_relation_path', $user["max_relation_path"]);
                 set_user_setting($user_id, 'sync_gedcom', $user["sync_gedcom"] ? 'Y' : 'N');
                 set_user_setting($user_id, 'relationship_privacy', $user["relationship_privacy"] ? 'Y' : 'N');
                 set_user_setting($user_id, 'auto_accept', $user["auto_accept"] ? 'Y' : 'N');
                 set_user_setting($user_id, 'canadmin', $user["canadmin"] ? 'Y' : 'N');
                 set_user_setting($user_id, 'visibleonline', $user["visibleonline"] ? 'Y' : 'N');
                 set_user_setting($user_id, 'editaccount', $user["editaccount"] ? 'Y' : 'N');
                 set_user_setting($user_id, 'verified', $user["verified"] ? 'yes' : 'no');
                 set_user_setting($user_id, 'verified_by_admin', $user["verified_by_admin"] ? 'yes' : 'no');
                 foreach (array('gedcomid', 'rootid', 'canedit') as $var) {
                     if ($user[$var]) {
                         foreach (unserialize(stripslashes($user[$var])) as $gedcom => $id) {
                             set_user_gedcom_setting($user_id, $gedcom, $var, $id);
                         }
                     }
                 }
                 AddToLog("added user -> {$user['username']} <-");
             }
         }
         if ($countold == get_user_count()) {
             $this->impSuccess = true;
         } else {
             $this->impSuccess = false;
         }
     }
     if (file_exists($INDEX_DIRECTORY . "messages.dat") == false) {
         $this->msgSuccess = false;
     } else {
         $gBitDb->query("DELETE FROM {$TBLPREFIX}messages");
         $messages = array();
         $fp = fopen($INDEX_DIRECTORY . "messages.dat", "rb");
         $mstring = fread($fp, filesize($INDEX_DIRECTORY . "messages.dat"));
         fclose($fp);
         $messages = unserialize($mstring);
         foreach ($messages as $newid => $message) {
             $gBitDb->query("INSERT INTO {$TBLPREFIX}messages (m_id, m_from, m_to, m_subject, m_body, m_created) VALUES (?, ? ,? ,? ,? ,?)", array($newid, $message["from"], $message["to"], $message["subject"], $message["body"], $message["created"]));
         }
         $this->msgSuccess = true;
     }
     if (file_exists($INDEX_DIRECTORY . "favorites.dat") == false) {
         $this->favSuccess = false;
         print $pgv_lang["um_nofav"] . "<br /><br />";
     } else {
         $gBitDb->query("DELETE FROM {$TBLPREFIX}favorites");
         $favorites = array();
         $fp = fopen($INDEX_DIRECTORY . "favorites.dat", "rb");
         $mstring = fread($fp, filesize($INDEX_DIRECTORY . "favorites.dat"));
         fclose($fp);
         $favorites = unserialize($mstring);
         foreach ($favorites as $newid => $favorite) {
             $res = addFavorite($favorite);
             if (!$res || DB::isError($res)) {
                 $this->errorMsg = "<span class=\"error\">Unable to update <i>Favorites</i> table.</span><br />\n";
                 return;
             }
         }
         $this->favSuccess = true;
     }
     if (file_exists($INDEX_DIRECTORY . "news.dat") == false) {
         $this->newsSuccess = false;
     } else {
         $gBitDb->query("DELETE FROM {$TBLPREFIX}news");
         $allnews = array();
         $fp = fopen($INDEX_DIRECTORY . "news.dat", "rb");
         $mstring = fread($fp, filesize($INDEX_DIRECTORY . "news.dat"));
         fclose($fp);
         $allnews = unserialize($mstring);
         foreach ($allnews as $newid => $news) {
             $res = addNews($news);
             if (!$res) {
                 $this->errorMsg = "<span class=\"error\">Unable to update <i>News</i> table.</span><br />\n";
                 return;
             }
         }
         $this->newsSuccess = true;
     }
     if (file_exists($INDEX_DIRECTORY . "blocks.dat") == false) {
         $this->blockSuccess = false;
     } else {
         $gBitDb->query("DELETE FROM {$TBLPREFIX}blocks");
         $allblocks = array();
         $fp = fopen($INDEX_DIRECTORY . "blocks.dat", "rb");
         $mstring = fread($fp, filesize($INDEX_DIRECTORY . "blocks.dat"));
         fclose($fp);
         $allblocks = unserialize($mstring);
         foreach ($allblocks as $bid => $blocks) {
             $username = $blocks["username"];
             $gBitDb->query("INSERT INTO {$TBLPREFIX}blocks (b_id, b_username, b_location, b_order, b_name, b_config) VALUES (?, ? ,? , ?, ?, ?)", array($bid, $blocks["username"], $blocks["location"], $blocks["order"], $blocks["name"], serialize($blocks["config"])));
         }
         $this->blockSuccess = true;
     }
 }
 /**
  * Prepares the list of sites for display.
  *
  * @since 3.1.0
  * @since 4.6.0 Converted to use get_sites()
  *
  * @global string $s
  * @global string $mode
  * @global wpdb   $wpdb
  */
 public function prepare_items()
 {
     global $s, $mode, $wpdb;
     if (!empty($_REQUEST['mode'])) {
         $mode = $_REQUEST['mode'] === 'excerpt' ? 'excerpt' : 'list';
         set_user_setting('sites_list_mode', $mode);
     } else {
         $mode = get_user_setting('sites_list_mode', 'list');
     }
     $per_page = $this->get_items_per_page('sites_network_per_page');
     $pagenum = $this->get_pagenum();
     $s = isset($_REQUEST['s']) ? wp_unslash(trim($_REQUEST['s'])) : '';
     $wild = '';
     if (false !== strpos($s, '*')) {
         $wild = '*';
         $s = trim($s, '*');
     }
     /*
      * If the network is large and a search is not being performed, show only
      * the latest sites with no paging in order to avoid expensive count queries.
      */
     if (!$s && wp_is_large_network()) {
         if (!isset($_REQUEST['orderby'])) {
             $_GET['orderby'] = $_REQUEST['orderby'] = '';
         }
         if (!isset($_REQUEST['order'])) {
             $_GET['order'] = $_REQUEST['order'] = 'DESC';
         }
     }
     $args = array('number' => intval($per_page), 'offset' => intval(($pagenum - 1) * $per_page), 'network_id' => get_current_network_id());
     if (empty($s)) {
         // Nothing to do.
     } elseif (preg_match('/^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$/', $s) || preg_match('/^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.?$/', $s) || preg_match('/^[0-9]{1,3}\\.[0-9]{1,3}\\.?$/', $s) || preg_match('/^[0-9]{1,3}\\.$/', $s)) {
         // IPv4 address
         $sql = $wpdb->prepare("SELECT blog_id FROM {$wpdb->registration_log} WHERE {$wpdb->registration_log}.IP LIKE %s", $wpdb->esc_like($s) . (!empty($wild) ? '%' : ''));
         $reg_blog_ids = $wpdb->get_col($sql);
         if ($reg_blog_ids) {
             $args['site__in'] = $reg_blog_ids;
         }
     } elseif (is_numeric($s) && empty($wild)) {
         $args['ID'] = $s;
     } else {
         $args['search'] = $s;
         if (!is_subdomain_install()) {
             $args['search_columns'] = array('path');
         }
     }
     $order_by = isset($_REQUEST['orderby']) ? $_REQUEST['orderby'] : '';
     if ('registered' === $order_by) {
         // registered is a valid field name.
     } elseif ('lastupdated' === $order_by) {
         $order_by = 'last_updated';
     } elseif ('blogname' === $order_by) {
         if (is_subdomain_install()) {
             $order_by = 'domain';
         } else {
             $order_by = 'path';
         }
     } elseif ('blog_id' === $order_by) {
         $order_by = 'id';
     } elseif (!$order_by) {
         $order_by = false;
     }
     $args['orderby'] = $order_by;
     if ($order_by) {
         $args['order'] = isset($_REQUEST['order']) && 'DESC' === strtoupper($_REQUEST['order']) ? "DESC" : "ASC";
     }
     if (wp_is_large_network()) {
         $args['no_found_rows'] = true;
     } else {
         $args['no_found_rows'] = false;
     }
     /**
      * Filters the arguments for the site query in the sites list table.
      *
      * @since 4.6.0
      *
      * @param array $args An array of get_sites() arguments.
      */
     $args = apply_filters('ms_sites_list_table_query_args', $args);
     $_sites = get_sites($args);
     if (is_array($_sites)) {
         update_site_cache($_sites);
         $this->items = array_slice($_sites, 0, $per_page);
     }
     $total_sites = get_sites(array_merge($args, array('count' => true, 'offset' => 0, 'number' => 0)));
     $this->set_pagination_args(array('total_items' => $total_sites, 'per_page' => $per_page));
 }
Ejemplo n.º 19
0
function save_settings()
{
    global $current_tab;
    syslog_request_validation($current_tab);
    if (sizeof($_REQUEST)) {
        foreach ($_REQUEST as $var => $value) {
            switch ($var) {
                case 'rows':
                    set_user_setting('syslog_rows', get_request_var('rows'));
                    break;
                case 'refresh':
                    set_user_setting('syslog_refresh', get_request_var('refresh'));
                    break;
                case 'removal':
                    set_user_setting('syslog_removal', get_request_var('removal'));
                    break;
                case 'trimval':
                    set_user_setting('syslog_trimval', get_request_var('trimval'));
                    break;
                case 'efacility':
                    set_user_setting('syslog_efacility', get_request_var('efacility'));
                    break;
                case 'epriority':
                    set_user_setting('syslog_epriority', get_request_var('epriority'));
                    break;
                case 'eprogram':
                    set_user_setting('syslog_eprogram', get_request_var('eprogram'));
                    break;
            }
        }
    }
    syslog_request_validation($current_tab, true);
}
Ejemplo n.º 20
0
/**
 * wooframework_ajax_banner_close function.
 *
 * @access public
 * @since 1.0.0
 */
function wooframework_ajax_banner_close()
{
    if (!current_user_can('install_plugins')) {
        wp_die(__('You do not have sufficient permissions to access this page.', 'woothemes'));
    }
    if (!check_admin_referer('wooframework_banner_close')) {
        wp_die(__('You have taken too long. Please go back and retry.', 'woothemes'));
    }
    $banner = isset($_GET['banner']) ? $_GET['banner'] : '';
    if (!$banner) {
        die;
    }
    // Run the update.
    $response = set_user_setting('wooframeworkhidebanner' . $banner, '1');
    $sendback = remove_query_arg(array('trashed', 'untrashed', 'deleted', 'ids'), wp_get_referer());
    wp_safe_redirect(esc_url_raw($sendback));
    exit;
}
 /**
  * Update tickets list view.
  * 
  * @param  [type] $check      [description]
  * @param  [type] $object_id  [description]
  * @param  [type] $meta_key   [description]
  * @param  [type] $meta_value [description]
  * @param  [type] $prev       [description]
  * @return [type]             [description]
  */
 public function set_list_mode($check, $object_id, $meta_key, $meta_value, $prev_value)
 {
     if (isset($_GET['post_type']) && 'ticket' === $_GET['post_type']) {
         if ('wp_user-settings' === $meta_key) {
             parse_str($meta_value, $values);
             /* Check if the option being updated is the list view mode */
             if (array_key_exists('posts_list_mode', $values) && isset($_REQUEST['mode'])) {
                 $val = 'excerpt' === $_REQUEST['mode'] ? 'details' : 'list';
                 remove_filter('update_user_metadata', 'wpas_set_list_mode', 10);
                 set_user_setting('tickets_list_mode', $val);
                 return false;
             }
         }
     }
     return $check;
     /**
      * Set the ticket list mode.
      */
     // global $mode;
     // if ( ! empty( $_REQUEST['mode'] ) ) {
     // 	$mode = $_REQUEST['mode'];
     // 	if ( isset( $_GET['post_type'] ) && 'ticket' === $_GET['post_type'] ) {
     // 		if ( 'excerpt' === $mode ) {
     // 			$mode = 'details';
     // 			set_user_setting ( 'tickets_list_mode', $mode );
     // 			delete_user_setting( 'posts_list_mode' );
     // 		}
     // 		if ( 'list' === $mode ) {
     // 			set_user_setting ( 'tickets_list_mode', $mode );
     // 		}
     // 	}
     // 	$mode = $_REQUEST['mode'] == 'excerpt' ? 'excerpt' : 'list';
     // 	set_user_setting ( 'posts_list_mode', $mode );
     // } else {
     // 	$mode = get_user_setting ( 'posts_list_mode', 'list' );
     // }
 }
Ejemplo n.º 22
0
/**
 * Determine whether to use CodePress or not.
 *
 * @since 2.8
**/
function use_codepress() {

	if ( isset($_GET['codepress']) ) {
		$on = 'on' == $_GET['codepress'] ? 'on' : 'off';
		set_user_setting( 'codepress', $on );
	} else {
		$on = get_user_setting('codepress', 'on');
	}

	if ( 'on' == $on ) {
		add_action( 'admin_print_footer_scripts', 'codepress_footer_js' );
		return true;
	}

	return false;
}
function so_scrollfree_editor_off()
{
    set_user_setting('editor_expand', 'off');
}
 /**
  *
  * @global array    $avail_post_stati
  * @global WP_Query $wp_query
  * @global int      $per_page
  * @global string   $mode
  */
 public function prepare_items()
 {
     global $avail_post_stati, $wp_query, $per_page, $mode;
     // is going to call wp()
     $avail_post_stati = wp_edit_posts_query();
     $this->set_hierarchical_display(is_post_type_hierarchical($this->screen->post_type) && 'menu_order title' === $wp_query->query['orderby']);
     $post_type = $this->screen->post_type;
     $per_page = $this->get_items_per_page('edit_' . $post_type . '_per_page');
     /** This filter is documented in wp-admin/includes/post.php */
     $per_page = apply_filters('edit_posts_per_page', $per_page, $post_type);
     if ($this->hierarchical_display) {
         $total_items = $wp_query->post_count;
     } elseif ($wp_query->found_posts || $this->get_pagenum() === 1) {
         $total_items = $wp_query->found_posts;
     } else {
         $post_counts = (array) wp_count_posts($post_type, 'readable');
         if (isset($_REQUEST['post_status']) && in_array($_REQUEST['post_status'], $avail_post_stati)) {
             $total_items = $post_counts[$_REQUEST['post_status']];
         } elseif (isset($_REQUEST['show_sticky']) && $_REQUEST['show_sticky']) {
             $total_items = $this->sticky_posts_count;
         } elseif (isset($_GET['author']) && $_GET['author'] == get_current_user_id()) {
             $total_items = $this->user_posts_count;
         } else {
             $total_items = array_sum($post_counts);
             // Subtract post types that are not included in the admin all list.
             foreach (get_post_stati(array('show_in_admin_all_list' => false)) as $state) {
                 $total_items -= $post_counts[$state];
             }
         }
     }
     if (!empty($_REQUEST['mode'])) {
         $mode = $_REQUEST['mode'] === 'excerpt' ? 'excerpt' : 'list';
         set_user_setting('posts_list_mode', $mode);
     } else {
         $mode = get_user_setting('posts_list_mode', 'list');
     }
     $this->is_trash = isset($_REQUEST['post_status']) && $_REQUEST['post_status'] === 'trash';
     $this->set_pagination_args(array('total_items' => $total_items, 'per_page' => $per_page));
 }
Ejemplo n.º 25
0
 if (!empty($form_pass1)) {
     AddToLog('User changed password');
     set_user_password(PGV_USER_ID, crypt($form_pass1));
 }
 $old_firstname = get_user_setting(PGV_USER_ID, 'firstname');
 $old_lastname = get_user_setting(PGV_USER_ID, 'lastname');
 $old_email = get_user_setting(PGV_USER_ID, 'email');
 // Change other settings
 set_user_setting(PGV_USER_ID, 'firstname', $form_firstname);
 set_user_setting(PGV_USER_ID, 'lastname', $form_lastname);
 set_user_setting(PGV_USER_ID, 'email', $form_email);
 set_user_setting(PGV_USER_ID, 'theme', $form_theme);
 set_user_setting(PGV_USER_ID, 'language', $form_language);
 set_user_setting(PGV_USER_ID, 'contactmethod', $form_contact_method);
 set_user_setting(PGV_USER_ID, 'visibleonline', $form_visible_online);
 set_user_setting(PGV_USER_ID, 'defaulttab', $form_default_tab);
 set_user_gedcom_setting(PGV_USER_ID, PGV_GED_ID, 'rootid', $form_rootid);
 // update gedcom record with new email address
 if (get_user_setting(PGV_USER_ID, 'sync_gedcom') == 'Y') {
     if ($form_email != $old_email) {
         foreach (get_all_gedcoms() as $ged_id => $ged_name) {
             $myid = get_user_gedcom_setting(PGV_USER_ID, $ged_id, 'gedcomid');
             if ($myid) {
                 $OLDGEDCOM = $GEDCOM;
                 $GEDCOM = $ged_name;
                 $person = Person::getInstance($myid);
                 if ($person) {
                     if (preg_match('/\\d _?EMAIL/', $person->getGedcomRecord())) {
                         replace_gedrec($myid, preg_replace("/(\n\\d _?EMAIL).*/", '$1 ' . $form_email, $person->getGedcomRecord()));
                     } else {
                         replace_gedrec($myid, $person->getGedcomRecord() . "\n1 EMAIL " . $form_email);
Ejemplo n.º 26
0
 /**
  *
  * @global array    $avail_post_stati
  * @global WP_Query $wp_query
  * @global int      $per_page
  * @global string   $mode
  */
 public function prepare_items()
 {
     global $avail_post_stati, $wp_query, $per_page, $mode;
     $avail_post_stati = wp_edit_posts_query();
     $this->set_hierarchical_display(is_post_type_hierarchical($this->screen->post_type) && 'menu_order title' == $wp_query->query['orderby']);
     $total_items = $this->hierarchical_display ? $wp_query->post_count : $wp_query->found_posts;
     $post_type = $this->screen->post_type;
     $per_page = $this->get_items_per_page('edit_' . $post_type . '_per_page');
     /** This filter is documented in wp-admin/includes/post.php */
     $per_page = apply_filters('edit_posts_per_page', $per_page, $post_type);
     if ($this->hierarchical_display) {
         $total_pages = ceil($total_items / $per_page);
     } else {
         $total_pages = $wp_query->max_num_pages;
     }
     if (!empty($_REQUEST['mode'])) {
         $mode = $_REQUEST['mode'] == 'excerpt' ? 'excerpt' : 'list';
         set_user_setting('posts_list_mode', $mode);
     } else {
         $mode = get_user_setting('posts_list_mode', 'list');
     }
     $this->is_trash = isset($_REQUEST['post_status']) && $_REQUEST['post_status'] == 'trash';
     $this->set_pagination_args(array('total_items' => $total_items, 'total_pages' => $total_pages, 'per_page' => $per_page));
 }
Ejemplo n.º 27
0
function gantry_widgets_admin_force_accessibility_off()
{
    global $wp_filter;
    $filters = $wp_filter['admin_body_class'];
    if (is_array($filters)) {
        foreach ($filters as $priority_filters) {
            foreach ($priority_filters as $filter) {
                if (is_string($filter['function']) && preg_match('/lambda_/u', $filter['function'])) {
                    remove_filter('admin_body_class', $filter['function']);
                    set_user_setting('widgets_access', 'off');
                    add_action('admin_notices', create_function(null, 'echo "<div class=\'error\'><p>"._g("Gantry themes currently do not support Widget Accessability Mode")."</p></div>";'));
                    break 2;
                }
            }
        }
    }
    wp_enqueue_script('admin-widgets');
}