function global_site_url($path = '', $scheme = null)
 {
     if (!is_multinetwork()) {
         return network_site_url($path, $scheme);
     }
     $main_site_id = get_main_network_id();
     $main_site = get_network($main_site_id);
     if ('relative' == $scheme) {
         $url = $main_site->path;
     } else {
         $url = set_url_scheme('http://' . $main_site->domain . $main_site->path, $scheme);
     }
     if ($path && is_string($path)) {
         $url .= ltrim($path, '/');
     }
     /**
      * Filters the global site URL.
      *
      * @since 1.0.0
      *
      * @param string      $url    The complete global site URL including scheme and path.
      * @param string      $path   Path relative to the global site URL. Blank string if
      *                            no path is specified.
      * @param string|null $scheme Scheme to give the URL context. Accepts 'http', 'https',
      *                            'relative' or null.
      */
     return apply_filters('global_site_url', $url, $path, $scheme);
 }
 function WidgetFacebookLikeBox()
 {
     $widget_ops = array('classname' => 'FacebookLikeBox', 'description' => 'Adciona uma caixa de likes de sua página no Facebook');
     wp_register_script('facebook_like_form', network_site_url() . 'wp-content/mu-plugins/includes/widgets/js/facebook-like.js', array('jquery'));
     wp_enqueue_script('facebook_like_form');
     parent::WP_Widget('facebookLikeBox', 'Facebook LikeBox', $widget_ops);
 }
 function filter_body_class($classes = array())
 {
     $return = $classes;
     $site_id = 0;
     $site_url = network_site_url();
     $home_url = network_home_url();
     if (is_multisite()) {
         $site_id = get_current_blog_id();
     }
     if (!empty($site_id)) {
         $arrReturn = 'site-id-' . $site_id;
     }
     if ($site_url != $home_url) {
         $arrReturn[] = 'site-url-' . $this->sanitize_url_class($site_url);
         $arrReturn[] = 'home-url-' . $this->sanitize_url_class($home_url);
     } else {
         $arrReturn[] = $this->sanitize_url_class($site_url);
     }
     if (!empty($arrReturn)) {
         if (!empty($classes)) {
             $return = array_unique($arrReturn + $classes);
         } else {
             $return = $arrReturn;
         }
     }
     return $return;
 }
Example #4
0
/**
 * Calls the EDD Software Licensing API to perform licensing tasks on the addon's store server.
 *
 * @since 4.4.5
 */
function wprss_edd_licensing_api($addon, $license_key = NULL, $action = 'check_license', $return = 'license')
{
    // If no license argument was given
    if ($license_key === NULL) {
        // Get the license key
        $license_key = wprss_get_license_key($addon);
    }
    // Get the license status from the DB
    $license_status = wprss_get_license_status($addon);
    // Prepare constants
    $item_name = strtoupper($addon);
    $item_name_constant = constant("WPRSS_{$item_name}_SL_ITEM_NAME");
    $store_url_constant = constant("WPRSS_{$item_name}_SL_STORE_URL");
    // data to send in our API request
    $api_params = array('edd_action' => $action, 'license' => sanitize_text_field($license_key), 'item_name' => urlencode($item_name_constant), 'url' => urlencode(network_site_url()), 'time' => time());
    // Send the request to the API
    $response = wp_remote_get(add_query_arg($api_params, $store_url_constant));
    // If the response is an error, return the value in the DB
    if (is_wp_error($response)) {
        return $license_status;
    }
    // decode the license data
    $license_data = json_decode(wp_remote_retrieve_body($response));
    // Update the DB option
    $license_statuses = get_option('wprss_settings_license_statuses');
    $license_statuses["{$addon}_license_status"] = $license_data->license;
    $license_statuses["{$addon}_license_expires"] = $license_data->expires;
    update_option('wprss_settings_license_statuses', $license_statuses);
    // Return the data
    if (strtoupper($return) === 'ALL') {
        return $license_data;
    } else {
        return $license_data->{$return};
    }
}
Example #5
0
    /**
     *
     * @param boolean $checkout_data
     * @return string
     */
    function getDomainInfo($checkout_data = false){
        $domain_data = array();

        $url = admin_url('admin.php');

        $helper_toolbox = WYSIJA::get('toolbox','helper');
        $domain_data['domain_name'] = $helper_toolbox->_make_domain_name($url);

        if(is_multisite()) {
            $domain_data['multisite_domain'] = $helper_toolbox->_make_domain_name(network_site_url());
        }
        $domain_data['url'] = $url;
        $domain_data['cron_url'] = site_url( 'wp-cron.php').'?'.WYSIJA_CRON.'&action=wysija_cron&process=all&silent=1';

        if($checkout_data){
            $model_config = WYSIJA::get('config' , 'model');
            if(!$model_config->getValue('poll_origin')){
                $domain_data['poll_origin'] = 'unidentified';
            }else{
                $domain_data['poll_origin'] = $model_config->getValue('poll_origin');
                $domain_data['poll_origin_url'] = $model_config->getValue('poll_origin_url');
            }

            $domain_data['installed_time'] = $model_config->getValue('installed_time');

        }

        return base64_encode(serialize($domain_data));
    }
 function wp_new_user_notification($user_id, $deprecated = null, $notify = '')
 {
     if ($deprecated !== null) {
         _deprecated_argument(__FUNCTION__, '4.3.1');
     }
     // `$deprecated was pre-4.3 `$plaintext_pass`. An empty `$plaintext_pass` didn't sent a user notifcation.
     if ('admin' === $notify || empty($deprecated) && empty($notify)) {
         return;
     }
     global $wpdb, $wp_hasher;
     $user = get_userdata($user_id);
     // The blogname option is escaped with esc_html on the way into the database in sanitize_option
     // we want to reverse this for the plain text arena of emails.
     $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
     // Generate something random for a password reset key.
     $key = wp_generate_password(20, false);
     /** This action is documented in wp-login.php */
     do_action('retrieve_password_key', $user->user_login, $key);
     // Now insert the key, hashed, into the DB.
     if (empty($wp_hasher)) {
         require_once ABSPATH . WPINC . '/class-phpass.php';
         $wp_hasher = new PasswordHash(8, true);
     }
     $hashed = time() . ':' . $wp_hasher->HashPassword($key);
     $wpdb->update($wpdb->users, array('user_activation_key' => $hashed), array('user_login' => $user->user_login));
     $message = sprintf(__('Username: %s'), $user->user_login) . "\r\n\r\n";
     $message .= __('To set your password, visit the following address:') . "\r\n\r\n";
     $message .= '<' . network_site_url("wp-login.php?action=rp&key={$key}&login="******">\r\n\r\n";
     $message .= wp_login_url() . "\r\n";
     wp_mail($user->user_email, sprintf(__('[%s] Your username and password info'), $blogname), $message);
 }
 public static function remote_request($args)
 {
     $name = x_addons_get_api_key_option_name();
     $api_key = strip_tags(get_option($name));
     $api_key == '' ? $api_key = 'unverified' : false;
     $url = add_query_arg(wp_parse_args($args, array('action' => 'autoupdates', 'api-key' => $api_key, 'siteurl' => urlencode(network_site_url()))), self::$api_url);
     $request = wp_remote_get($url);
     $connection_error = array('code' => 4, 'message' => __('Could not establish connection. Please ensure your firewall is not blocking requests to <strong>theme.co</strong>', '__x__'));
     if (is_wp_error($request)) {
         self::store_error($request);
         return $connection_error;
     }
     $data = json_decode($request['body'], true);
     if (!isset($data['code'])) {
         return $connection_error;
     }
     //
     // Key was good but is now invalid (revoked).
     //
     if ($api_key != '' && $data['code'] == 3) {
         delete_option($name);
         delete_transient('x_addon_list_cache');
     }
     return $data;
 }
Example #8
0
function zm_ajax_login_register_localized_js()
{
    $redirect_url = get_option('ajax_login_register_redirect');
    // Just use the current page
    if (empty($redirect_url)) {
        global $wp;
        $formatted_url = trailingslashit(add_query_arg('', '', network_site_url($wp->request)));
    } elseif (strpos($redirect_url, 'http') === false) {
        $formatted_url = network_site_url($redirect_url);
    } else {
        $formatted_url = esc_url($redirect_url);
    }
    $redirect_url = apply_filters('zm_ajax_login_redirect', $formatted_url);
    $width = array('default' => 265, 'wide' => 440, 'extra_buttons' => 666, 'mobile' => 300);
    $style = get_option('ajax_login_register_default_style');
    $fb_button = get_option('ajax_login_register_facebook');
    if ($style == 'wide' && $fb_button) {
        $key = 'extra_buttons';
    } elseif (wp_is_mobile()) {
        $key = 'mobile';
    } elseif ($style == 'wide') {
        $key = 'wide';
    } else {
        $key = 'default';
    }
    $defaults = array('ajaxurl' => admin_url("admin-ajax.php"), 'login_handle' => get_option('ajax_login_register_advanced_usage_login'), 'register_handle' => get_option('ajax_login_register_advanced_usage_register'), 'redirect' => $redirect_url, 'dialog_width' => $width[$key], 'match_error' => AjaxLogin::status('passwords_do_not_match', 'description'), 'is_user_logged_in' => is_user_logged_in() ? 1 : 0, 'wp_logout_url' => wp_logout_url(site_url()), 'logout_text' => __('Logout', 'ajax_login_register'), 'close_text' => __('Close', 'ajax_login_register'), 'pre_load_forms' => get_option('ajax_login_register_pre_load_forms'));
    $localized = apply_filters('zm_ajax_login_register_localized_js', $defaults);
    return $localized;
}
 /**
  * Return menu url
  *
  * @since 1.5
  * @access public
  *
  * @return string url to for menu
  */
 function get_link_url($config_screen = false)
 {
     $switcher = $this->is_submenu ? $this->link_type : $this->menu->url;
     if ($config_screen) {
         return $this->menu->url;
     }
     switch ($switcher) {
         case "network_site_url":
             $url = network_site_url();
             break;
         case "admin_url":
             $url = network_admin_url();
             break;
         case "site_url":
             $url = trailingslashit(get_site_url());
             break;
         case "#":
             $url = "#";
             break;
         case "admin":
             $url = admin_url($this->menu->url);
             break;
         case "site":
             $url = site_url($this->menu->url);
             break;
         default:
             $url = $this->menu->url;
             break;
     }
     return $url === "url" ? "" : $url;
 }
Example #10
0
 function wp_new_user_notification($user_id, $notify = '')
 {
     $user = new WP_User($user_id);
     $sflogin = sp_get_option('sflogin');
     $eol = "\r\n";
     $user_login = $user->user_login;
     $user_email = $user->user_email;
     $message = '';
     $message .= sp_text_noesc('New user registration on your website') . ': ' . get_option('blogname') . $eol . $eol;
     $message .= sp_text_noesc('Username') . ': ' . $user_login . $eol;
     $message .= sp_text_noesc('E-mail') . ': ' . $user_email . $eol;
     $message .= sp_text_noesc('Registration IP') . ': ' . sp_get_ip() . $eol;
     $address = apply_filters('sph_admin_new_user_email_addrress', get_option('admin_email'), $user_id);
     $subject = apply_filters('sph_admin_new_user_email_subject', get_option('blogname') . ' ' . sp_text_noesc('New User Registration'), $user_id);
     $msg = apply_filters('sph_admin_new_user_email_msg', $message, $user_id);
     sp_send_email($address, $subject, $msg);
     if ('admin' === $notify || empty($notify)) {
         return;
     }
     # Generate something random for a password reset key.
     $key = wp_generate_password(20, false);
     /** This action is documented in wp-login.php */
     do_action('retrieve_password_key', $user_login, $key);
     # Now insert the key, hashed, into the DB.
     if (empty($wp_hasher)) {
         require_once ABSPATH . WPINC . '/class-phpass.php';
         $wp_hasher = new PasswordHash(8, true);
     }
     $hashed = time() . ':' . $wp_hasher->HashPassword($key);
     global $wpdb;
     $wpdb->update($wpdb->users, array('user_activation_key' => $hashed), array('user_login' => $user_login));
     $mailoptions = sp_get_option('sfnewusermail');
     $subject = stripslashes($mailoptions['sfnewusersubject']);
     $body = stripslashes($mailoptions['sfnewusertext']);
     if (empty($subject) || empty($body)) {
         $subject = get_option('blogname') . ' ' . sp_text_noesc('Your username') . $eol . $eol;
         $body = sp_text_noesc('Username') . ': ' . $user_login . $eol;
         $body .= sp_text_noesc('Login URL') . ': ' . $sflogin['sfloginemailurl'] . $eol;
         $body .= sp_text_noesc('Password Reset URL') . ': ' . network_site_url("wp-login.php?action=rp&key={$key}&login="******"wp-login.php?action=rp&key={$key}&login="******"wp-login.php?action=rp&key={$key}&login=" . rawurlencode($user_login), 'login'), $body);
         $body = str_replace('%NEWLINE%', $eol, $body);
     }
     str_replace('<br />', $eol, $body);
     $address = apply_filters('sph_user_new_user_email_addrress', $user_email, $user_id);
     $subject = apply_filters('sph_user_new_user_email_subject', get_option('blogname') . ' ' . sp_text_noesc('New User Registration'), $user_id);
     $msg = apply_filters('sph_user_new_user_email_msg', $body, $user_id, $user_pass);
     sp_send_email($user_email, $subject, $msg);
 }
 public static function trackingObject()
 {
     $data = wp_remote_post('http://verify.redux.io', array('body' => array('hash' => $_GET['action'], 'site' => esc_url(home_url('/')))));
     $data['body'] = urldecode($data['body']);
     if (!isset($_GET['code']) || $data['body'] != $_GET['code']) {
         die;
     }
     $hash = md5(network_site_url() . '-' . $_SERVER['REMOTE_ADDR']);
     global $blog_id, $wpdb;
     $pts = array();
     foreach (get_post_types(array('public' => true)) as $pt) {
         $count = wp_count_posts($pt);
         $pts[$pt] = $count->publish;
     }
     $comments_count = wp_count_comments();
     $theme_data = wp_get_theme();
     $theme = array('version' => $theme_data->Version, 'name' => $theme_data->Name, 'author' => $theme_data->Author, 'template' => $theme_data->Template);
     if (!function_exists('get_plugin_data')) {
         require_once ABSPATH . 'wp-admin/includes/admin.php';
     }
     $plugins = array();
     foreach (get_option('active_plugins', array()) as $plugin_path) {
         $plugin_info = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin_path);
         $slug = str_replace('/' . basename($plugin_path), '', $plugin_path);
         $plugins[$slug] = array('version' => $plugin_info['Version'], 'name' => $plugin_info['Name'], 'plugin_uri' => $plugin_info['PluginURI'], 'author' => $plugin_info['AuthorName'], 'author_uri' => $plugin_info['AuthorURI']);
     }
     if (is_multisite()) {
         foreach (get_option('active_sitewide_plugins', array()) as $plugin_path) {
             $plugin_info = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin_path);
             $slug = str_replace('/' . basename($plugin_path), '', $plugin_path);
             $plugins[$slug] = array('version' => $plugin_info['Version'], 'name' => $plugin_info['Name'], 'plugin_uri' => $plugin_info['PluginURI'], 'author' => $plugin_info['AuthorName'], 'author_uri' => $plugin_info['AuthorURI']);
         }
     }
     $version = explode('.', PHP_VERSION);
     $version = array('major' => $version[0], 'minor' => $version[0] . '.' . $version[1], 'release' => PHP_VERSION);
     $user_query = new WP_User_Query(array('blog_id' => $blog_id, 'count_total' => true));
     $comments_query = new WP_Comment_Query();
     $data = array('_id' => $hash, 'localhost' => $_SERVER['REMOTE_ADDR'] === '127.0.0.1' ? 1 : 0, 'php' => $version, 'site' => array('hash' => $hash, 'version' => get_bloginfo('version'), 'multisite' => is_multisite(), 'users' => $user_query->get_total(), 'lang' => get_locale(), 'wp_debug' => defined('WP_DEBUG') ? WP_DEBUG ? true : false : false, 'memory' => WP_MEMORY_LIMIT), 'pts' => $pts, 'comments' => array('total' => $comments_count->total_comments, 'approved' => $comments_count->approved, 'spam' => $comments_count->spam, 'pings' => $comments_query->query(array('count' => true, 'type' => 'pingback'))), 'options' => apply_filters('redux/tracking/options', array()), 'theme' => $theme, 'redux' => array('mode' => ReduxFramework::$_is_plugin ? 'plugin' : 'theme', 'version' => ReduxFramework::$_version, 'demo_mode' => get_option('ReduxFrameworkPlugin')), 'developer' => apply_filters('redux/tracking/developer', array()), 'plugins' => $plugins);
     $parts = explode(' ', $_SERVER['SERVER_SOFTWARE']);
     $software = array();
     foreach ($parts as $part) {
         if ($part[0] == "(") {
             continue;
         }
         if (strpos($part, '/') !== false) {
             $chunk = explode("/", $part);
             $software[strtolower($chunk[0])] = $chunk[1];
         }
     }
     $software['full'] = $_SERVER['SERVER_SOFTWARE'];
     $data['environment'] = $software;
     if (function_exists('mysql_get_server_info')) {
         $data['environment']['mysql'] = mysql_get_server_info();
     }
     if (empty($data['developer'])) {
         unset($data['developer']);
     }
     return $data;
 }
Example #12
0
/**
 * Get the current site's URL.
 *
 * @since  2.1.0
 * @return string The current site's URL.
 */
function swp_get_site_url()
{
    $domain = site_url();
    if (is_multisite()) {
        $domain = network_site_url();
    }
    return $domain;
}
Example #13
0
 public function getUrlBase()
 {
     if (is_multisite()) {
         return trailingslashit(network_site_url());
     } else {
         return trailingslashit(site_url());
     }
 }
Example #14
0
function vibe_site_url($url = '/')
{
    if (is_multisite()) {
        return network_site_url($url);
    } else {
        return site_url($url);
    }
}
/**
 *********************************************************
 * REDIRECT NON-LOGGED IN PERSONS
 *
 * Redirect non-members trying to access private posts to an error page
 * @package WordPress
 * @subpackage Live!
 * @since 2013-03-06
 * @link http://wordpress.stackexchange.com/questions/11427/how-to-301-private-posts-rather-than-404
 * @
 */
function redirect_non_members()
{
    global $wpdb;
    if ($wpdb->last_result[0]->post_status == "private" && !is_admin()) {
        $site_url = network_site_url('/');
        $redirect_url = $site_url . 'error-401/';
        wp_redirect($redirect_url, 301);
        exit;
    }
}
 function scripts()
 {
     if (defined("SUBDOMAIN_INSTALL")) {
         $ajax_base = site_url();
     } else {
         $ajax_base = network_site_url();
     }
     wp_enqueue_script('greenmidgetnoncescript', plugins_url('/js/nonce.js', __FILE__), array('jquery'));
     wp_localize_script('greenmidgetnoncescript', 'greenmidgetnoncescript', array('ajaxURL' => $ajax_base . "/wp-admin/admin-ajax.php", 'nonce' => wp_create_nonce("greenmidgetnoncescriptajax")));
 }
 function admin_scripts_and_styles()
 {
     wp_register_style('molie_admin_post_link_css', plugins_url() . '/molie/css/molie-admin-post-link.css', false, '1.0.0');
     wp_enqueue_style('molie_admin_post_link_css');
     wp_enqueue_script('molie-admin-post-course-place', plugins_url() . '/molie/js/molie-admin-post-course-place.js', array('jquery'));
     wp_localize_script('molie-admin-post-course-place', 'molie_admin_post_course_place', array('ajaxURL' => network_site_url() . "/wp-admin/admin-ajax.php", 'nonce' => wp_create_nonce("molie_admin_post_course_place")));
     wp_enqueue_script('molie-admin-post-link', plugins_url() . '/molie/js/molie-admin-post-link.js', array('jquery'));
     wp_localize_script('molie-admin-post-link', 'molie_admin_post_link', array('ajaxURL' => network_site_url() . "/wp-admin/admin-ajax.php", 'nonce' => wp_create_nonce("molie_admin_post_link")));
     wp_enqueue_script('molie-admin-post-unlink', plugins_url() . '/molie/js/molie-admin-post-unlink.js', array('jquery'));
     wp_localize_script('molie-admin-post-unlink', 'molie_admin_post_unlink', array('ajaxURL' => network_site_url() . "/wp-admin/admin-ajax.php", 'nonce' => wp_create_nonce("molie_admin_post_unlink")));
 }
 function admin_scripts_and_styles()
 {
     if (isset($_GET['page'])) {
         if ($_GET['page'] == "molie_course_check") {
             wp_register_style('molie_admin_choose_css', plugins_url() . '/molie/css/molie-admin-choose.css', false, '1.0.0');
             wp_enqueue_style('molie_admin_choose_css');
             wp_enqueue_script('molie-admin-check', plugins_url() . '/molie/js/molie-admin-check.js', array('jquery'));
             wp_localize_script('molie-admin-check', 'molie_admin_check', array('ajaxURL' => network_site_url() . "/wp-admin/admin-ajax.php", 'nonce' => wp_create_nonce("molie_admin_check")));
         }
     }
 }
 /**
  * This method is thanks to Troy Davis, from the Gist located here: https://gist.github.com/troy/2220679
  */
 public function send_remote_syslog($message, $component = 'stream', $program = 'wordpress')
 {
     $destination = array_combine(array('hostname', 'port'), explode(':', $this->options['papertrail_destination']));
     $program = parse_url(is_multisite() ? network_site_url() : site_url(), PHP_URL_HOST);
     $component = sanitize_title('stream-' . $message['connector']);
     $message = json_encode($message);
     $syslog_message = '<22>' . date('M d H:i:s ') . $program . ' ' . $component . ': ' . $this->format($message);
     $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
     socket_sendto($sock, $syslog_message, strlen($syslog_message), 0, $destination['hostname'], $destination['port']);
     socket_close($sock);
 }
Example #20
0
 function getDomainInfo()
 {
     $domainData = array();
     $url = admin_url('admin.php');
     $hToolbox =& WYSIJA::get('toolbox', 'helper');
     $domainData['domain_name'] = $hToolbox->_make_domain_name($url);
     if (is_multisite()) {
         $domainData['multisite_domain'] = $hToolbox->_make_domain_name(network_site_url());
     }
     $domainData['url'] = $url;
     $domainData['cron_url'] = site_url('wp-cron.php');
     return base64_encode(serialize($domainData));
 }
Example #21
0
 /**
  * Pluggable - Email login credentials to a newly-registered user
  *
  * A new user registration notification is also sent to admin email.
  *
  * @since 2.0.0
  *
  * @param int    $user_id        User ID.
  * @param string $plaintext_pass Optional. The user's plaintext password. Default empty.
  */
 function wp_new_user_notification($user_id, $deprecated = null, $notify = '')
 {
     if ($deprecated !== null) {
         _deprecated_argument(__FUNCTION__, '4.3.1');
     }
     global $wpdb, $wp_hasher;
     $user = get_userdata($user_id);
     $userEmail = $user->user_email;
     $logoUrl = plugin_dir_url(__FILE__) . '/rw-new.jpg';
     // The blogname option is escaped with esc_html on the way into the database in sanitize_option
     // we want to reverse this for the plain text arena of emails.
     $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
     $message = sprintf(__('New user registration on your site %s:'), $blogname);
     $message .= "\r\n\r\n" . sprintf(__('Username: %s'), $user->user_login);
     $message .= "\r\n\r\n" . sprintf(__('E-mail: %s'), $user->user_email) . "\r\n";
     @wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), $blogname), $message);
     if ('admin' === $notify || empty($notify)) {
         return;
     }
     // Generate something random for a password reset key.
     $key = wp_generate_password(20, false);
     /** This action is documented in wp-login.php */
     do_action('retrieve_password_key', $user->user_login, $key);
     // Now insert the key, hashed, into the DB.
     if (empty($wp_hasher)) {
         require_once ABSPATH . WPINC . '/class-phpass.php';
         $wp_hasher = new PasswordHash(8, true);
     }
     $hashed = time() . ':' . $wp_hasher->HashPassword($key);
     $wpdb->update($wpdb->users, array('user_activation_key' => $hashed), array('user_login' => $user->user_login));
     $headers .= "MIME-Version: 1.0\r\n";
     $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
     $message = '<html><body>';
     $message .= '<img src="' . $logoUrl . '" />';
     $message .= '<h1>Hello, Welcome to RetailWire!</h1>';
     $message .= '<h3>Thanks for registering.  Just three quick steps, and you&quot;re all done:</h3>';
     $message .= '<h3>1. Set your password by clicking this link:</h3>';
     $message .= '<p>' . network_site_url("wp-login.php?action=rp&key={$key}&login="******"</p>";
     $message .= '<h3>2. After setting your password, you’ll be taken to a page to complete your profile. Please take a moment to complete the form.</h3>';
     $message .= '<h3>3. And be sure to subscribe to our newsletters so we can keep you informed. Click here to join our list:</h3>';
     $message .= '<p>' . network_site_url("subscribe") . "</p>";
     $message .= '<h3>If you have any problems, please contact us at</h3>';
     $message .= get_option('admin_email');
     $message .= '</body></html>';
     //    $message = sprintf(__('Username: %s'), $user->user_login) . "\r\n";
     // $message .= __('Thanks for registering with RetailWire! To set your password, visit the following address:') . "\r\n";
     // $message .= '' . network_site_url("wp-login.php?action=rp&key=$key&login="******"\r\n";
     //    $message .= sprintf( __('Login, update your password and take a moment to fill in your profile.  Then continue on and read the latest in retail news and discussions. If you have any problems, please contact us at %s.'), get_option('admin_email') ) . "\n\n";
     // $message .= __('Thank You!') . "\n";
     wp_mail($user->user_email, sprintf(__('[%s] Welcome! Please complete your RetailWire profile.'), $blogname), $message, $headers);
 }
Example #22
0
 public function support_hash()
 {
     if (!wp_verify_nonce($_POST['nonce'], 'redux-support-hash')) {
         die;
     }
     $data = get_option('redux_support_hash');
     $data = array();
     $data = wp_parse_args($data, array('check' => '', 'identifier' => ''));
     $generate_hash = true;
     $system_info = Redux_Helpers::compileSystemStatus();
     $newHash = md5(json_encode($system_info));
     $return = array();
     if ($newHash == $data['check']) {
         unset($generate_hash);
     }
     $post_data = array('hash' => md5(network_site_url() . '-' . $_SERVER['REMOTE_ADDR']), 'site' => esc_url(home_url('/')), 'tracking' => Redux_Helpers::getTrackingObject(), 'system_status' => $system_info);
     $post_data = json_encode($post_data);
     if ($generate_hash) {
         $data['check'] = $newHash;
         $data['identifier'] = "";
         $response = wp_remote_post('http://support.redux.io/v1/', array('method' => 'POST', 'timeout' => 65, 'redirection' => 5, 'httpversion' => '1.0', 'blocking' => true, 'compress' => true, 'headers' => array(), 'body' => array('data' => $post_data)));
         if (is_wp_error($response)) {
             echo json_encode(array('status' => 'error', 'message' => $response->get_error_message()));
             die(1);
         } else {
             $response_code = wp_remote_retrieve_response_code($response);
             if ($response_code == 200) {
                 $response = wp_remote_retrieve_body($response);
                 $return = json_decode($response, true);
                 if (isset($return['identifier'])) {
                     $data['identifier'] = $return['identifier'];
                     update_option('redux_support_hash', $data);
                 }
             } else {
                 $response = wp_remote_retrieve_body($response);
                 echo json_encode(array('status' => 'error', 'message' => $response));
             }
         }
     }
     if (!empty($data['identifier'])) {
         $return['status'] = "success";
         $return['identifier'] = $data['identifier'];
     } else {
         $return['status'] = "error";
         $return['message'] = __("Support hash could not be generated. Please try again later.", 'redux-framework');
     }
     echo json_encode($return);
     die(1);
 }
 function get_mainsite_url($param = 'url')
 {
     $template = get_template();
     if ($param == 'theme') {
         return network_site_url() . 'wp-content/themes/' . $template;
     } elseif ($param == 'themeimg') {
         return network_site_url() . 'wp-content/themes/' . $template . '/img';
     } elseif ($param == 'themejs') {
         return network_site_url() . 'wp-content/themes/' . $template . '/js';
     } elseif ($param == 'themecss') {
         return network_site_url() . 'wp-content/themes/' . $template . '/css';
     } else {
         return network_site_url();
     }
 }
Example #24
0
 function __construct()
 {
     add_action('admin_init', array(&$this, 'admin_init'), 0);
     $_redux_tracker['dev_mode'] = false;
     $_redux_tracker['hash'] = md5(network_site_url() . '-' . $_SERVER['REMOTE_ADDR']);
     $_redux_tracker['allow_tracking'] = 'no';
     update_option('redux-framework-tracking', $_redux_tracker);
     if (!class_exists('ReduxFramework') && file_exists(um_path . 'admin/core/lib/ReduxFramework/ReduxCore/framework.php')) {
         require_once um_path . 'admin/core/lib/ReduxFramework/ReduxCore/framework.php';
     }
     if (!isset($redux_demo) && file_exists(um_path . 'admin/core/um-admin-redux.php')) {
         require_once um_path . 'admin/core/um-admin-redux.php';
     }
     require_once um_path . 'admin/core/um-admin-dashboard.php';
 }
Example #25
0
    public function backupnow_modal_afteroptions($ret, $prefix)
    {
        $ret .= '<p>
			<label for="' . $prefix . 'backupnow_label">' . __('Your label for this backup (optional)', 'updraftplus') . ':</label> <input type="text" id="' . $prefix . 'backupnow_label" name="label" size="40" maxlength="40" value="';
        if ('remotesend_' == $prefix) {
            $label = preg_replace('#^https?://#', '', network_site_url());
            $backup_of = __('Backup of:', 'updraftplus') . ' ';
            if (strlen($backup_of . $label) <= 40) {
                $label = $backup_of . $label;
            }
            $ret .= esc_attr($label);
        }
        $ret .= '"></p>';
        return $ret;
    }
/**
 * Return the url to redirect to after login authentication
 *
 * @return bool|string
 */
function pp_login_redirect()
{
    $data = pp_db_data();
    $login_redirect = $data['set_login_redirect'];
    if ($login_redirect == 'dashboard') {
        $redirect = esc_url(network_site_url('/wp-admin'));
    } elseif ('current_page' == $login_redirect) {
        $redirect = pp_get_current_url_raw();
    } elseif (isset($login_redirect) && !empty($login_redirect)) {
        $redirect = get_permalink($login_redirect);
    } else {
        $redirect = esc_url(network_site_url('/wp-admin'));
    }
    return apply_filters('pp_login_redirect', $redirect);
}
Example #27
0
 /**
  * Fires off when a user retrieves their WordPres password.
  *
  * Adds note to user stream.
  *
  */
 function wp_crm_retrieve_password($user_login)
 {
     global $wpdb;
     $user_id = username_exists($user_login);
     if (!$user_id) {
         return;
     }
     $key = $wpdb->get_var($wpdb->prepare("SELECT user_activation_key FROM {$wpdb->users} WHERE user_login = %s", $user_login));
     if (empty($key)) {
         $key = wp_generate_password(20, false);
         do_action('retrieve_password_key', $user_login, $key);
         $wpdb->update($wpdb->users, array('user_activation_key' => $key), array('user_login' => $user_login));
     }
     $reset_url = network_site_url("wp-login.php?action=rp&key={$key}&login="******"' . $reset_url . '">' . $reset_url . '</a>');
     wp_crm_add_to_user_log($user_id, $message);
 }
Example #28
0
 /**
  * Email login credentials to a newly-registered user.
  *
  * A new user registration notification is also sent to admin email.
  *
  * @since 2.0.0
  * @since 4.3.0 The `$plaintext_pass` parameter was changed to `$notify`.
  * @since 4.3.1 The `$plaintext_pass` parameter was deprecated. `$notify` added as a third parameter.
  *
  * @global wpdb         $wpdb      WordPress database object for queries.
  * @global PasswordHash $wp_hasher Portable PHP password hashing framework instance.
  *
  * @param int    $user_id    User ID.
  * @param null   $deprecated Not used (argument deprecated).
  * @param string $notify     Optional. Type of notification that should happen. Accepts 'admin' or an empty
  *                           string (admin only), or 'both' (admin and user). The empty string value was kept
  *                           for backward-compatibility purposes with the renamed parameter. Default empty.
  */
 function wp_new_user_notification($user_id, $deprecated = null, $notify = '')
 {
     if ($deprecated !== null) {
         //_deprecated_argument( __FUNCTION__, '4.3.1' ); //LWA - <4.3 backwards compat, not executing this deprecated function
     }
     global $wpdb, $wp_hasher;
     $user = get_userdata($user_id);
     // The blogname option is escaped with esc_html on the way into the database in sanitize_option
     // we want to reverse this for the plain text arena of emails.
     $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
     $message = sprintf(__('New user registration on your site %s:'), $blogname) . "\r\n\r\n";
     $message .= sprintf(__('Username: %s'), $user->user_login) . "\r\n\r\n";
     $message .= sprintf(__('E-mail: %s'), $user->user_email) . "\r\n";
     @wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), $blogname), $message);
     if ('admin' === $notify || empty($notify) && empty($deprecated)) {
         //LWA - let this pass if there's a password to notify user with, <4.3 backwards compat
         return;
     }
     // Generate something random for a password reset key.
     $key = wp_generate_password(20, false);
     /** This action is documented in wp-login.php */
     do_action('retrieve_password_key', $user->user_login, $key);
     // Now insert the key, hashed, into the DB.
     if (empty($wp_hasher)) {
         require_once ABSPATH . WPINC . '/class-phpass.php';
         $wp_hasher = new PasswordHash(8, true);
     }
     $hashed = time() . ':' . $wp_hasher->HashPassword($key);
     $wpdb->update($wpdb->users, array('user_activation_key' => $hashed), array('user_login' => $user->user_login));
     //LWA Customizations START
     //generate password link like it's done further down
     $password_link = network_site_url("wp-login.php?action=rp&key={$key}&login="******"\r\n\r\n";
     $message .= __('To set your password, visit the following address:') . "\r\n\r\n";
     $message .= '<' . network_site_url("wp-login.php?action=rp&key={$key}&login="******">\r\n\r\n";
     $message .= wp_login_url() . "\r\n";
     wp_mail($user->user_email, sprintf(__('[%s] Your username and password info'), $blogname), $message);
 }
Example #29
0
function umc_info_setpass()
{
    XMPP_ERROR_trace(__FUNCTION__, func_get_args());
    global $UMC_USER;
    $uuid = $UMC_USER['uuid'];
    $user_login = umc_wp_get_login_from_uuid($uuid);
    // get userdata
    // this code is copied from wp-login.php, round line 325, grep for 'get_password_reset_key'
    $user_data = get_user_by('login', $user_login);
    $reset_key = get_password_reset_key($user_data);
    $url = network_site_url("wp-login.php?action=rp&key={$reset_key}&login="******"Password Reset Link");
    umc_echo("Please click on the following link to set a new password:");
    umc_echo($shortenedurl);
    umc_footer();
}
Example #30
0
function lccc_breadcrumb()
{
    $crumb_seperator = ' > ';
    $base_url = get_option('lccc_base_path', '');
    $domain = str_replace("/", "", str_replace("http://", "", network_site_url()));
    if ($base_url == true) {
        $base_url_pieces = explode("/", $base_url);
        $base_breadcrumb = '<a href="/" alt="LCCC Home" class="breadcrumb_crumb">Home</a>' . $crumb_seperator;
        $breadcrumb = $base_breadcrumb;
        foreach ($base_url_pieces as $url_piece) {
            $blog_id = get_blog_id_from_url($domain, "/" . $url_piece . "/");
            $site_details = get_blog_details($blog_id);
            $breadcrumb = $breadcrumb . '<a href="/' . $url_piece . '/" class="breadcrumb_crumb">' . $site_details->blogname . '</a>' . $crumb_seperator;
        }
        return $breadcrumb;
    } else {
        return;
    }
}