Exemplo n.º 1
0
 /**
  * Returns default options
  *
  * @since 6.3
  * @access public
  */
 public static function default_options()
 {
     return Theme_My_Login_Custom_Email::default_options();
 }
 /**
  * Applies user moderation upon registration
  *
  * @since 6.0
  * @access public
  */
 public function register_post()
 {
     // Remove default new user notification
     if (has_action('tml_new_user_registered', 'wp_new_user_notification')) {
         remove_action('tml_new_user_registered', 'wp_new_user_notification', 10, 2);
     }
     // Remove Custom Email new user notification
     if (class_exists('Theme_My_Login_Custom_Email')) {
         $custom_email = Theme_My_Login_Custom_Email::get_object();
         if (has_action('tml_new_user_registered', array(&$custom_email, 'new_user_notification'))) {
             remove_action('tml_new_user_registered', array(&$custom_email, 'new_user_notification'), 10, 2);
         }
     }
     // Moderate user upon registration
     add_action('tml_new_user_registered', array(&$this, 'moderate_user'), 100, 2);
 }
Exemplo n.º 3
0
 /**
  * Changes the user denial e-mail message
  *
  * Callback for "user_denial_notification_message" hook in Theme_My_Login_User_Moderation_Admin::deny_user()
  *
  * @see Theme_My_Login_User_Moderation_Admin::deny_user()
  * @since 6.1
  * @access public
  *
  * @param string $message The default message
  * @param int $user_id The user's ID
  * @return string The filtered message
  */
 function user_denial_notification_message_filter($message, $user_id)
 {
     $_message = $GLOBALS['theme_my_login']->options->get_option(array('email', 'user_denial', 'message'));
     return empty($_message) ? $message : Theme_My_Login_Custom_Email::replace_vars($_message, $user_id);
 }
         * @access public
         *
         * @param object $user User object
         */
        public function password_change_notification(&$user)
        {
            global $current_site;
            $to = apply_filters('password_change_notification_mail_to', get_option('admin_email'));
            // send a copy of password change notification to the admin
            // but check to see if it's the admin whose password we're changing, and skip this
            if ($user->user_email != $to && apply_filters('send_password_change_notification', true)) {
                if (is_multisite()) {
                    $blogname = $current_site->site_name;
                } else {
                    // 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);
                }
                $title = sprintf(__('[%s] Password Lost/Changed', 'theme-my-login'), $blogname);
                $message = sprintf(__('Password Lost and Changed for user: %s', 'theme-my-login'), $user->user_login) . "\r\n";
                $title = apply_filters('password_change_notification_title', $title, $user->ID);
                $message = apply_filters('password_change_notification_message', $message, $user->ID);
                wp_mail($to, $title, $message);
            }
        }
    }
    Theme_My_Login_Custom_Email::get_object();
}
if (is_admin()) {
    include_once dirname(__FILE__) . '/admin/custom-email-admin.php';
}
 /**
  * Activates this module
  *
  * Callback for "tml_activate_custom-email/custom-email.php" hook in method Theme_My_Login_Admin::activate_module()
  *
  * @see Theme_My_Login_Admin::activate_module()
  * @since 6.0
  * @access public
  *
  * @param object $theme_my_login Reference to global $theme_my_login object
  */
 function activate(&$theme_my_login)
 {
     $options = Theme_My_Login_Custom_Email::init_options();
     $theme_my_login->options->set_option('email', $options['email']);
 }