/html/AppCode/expressionengine/modules/member/mod.member.php
PHP | 3699 lines | 2388 code | 782 blank | 529 comment | 393 complexity | 303e2a6e46ec459696cce654cfed1fc4 MD5 | raw file
Possible License(s): AGPL-3.0
Large files files are truncated, but you can click here to view the full file
- <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
- /**
- * ExpressionEngine - by EllisLab
- *
- * @package ExpressionEngine
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2003 - 2010, EllisLab, Inc.
- * @license http://expressionengine.com/user_guide/license.html
- * @link http://expressionengine.com
- * @since Version 2.0
- * @filesource
- */
- // --------------------------------------------------------------------
- /**
- * Member Management Class
- *
- * @package ExpressionEngine
- * @subpackage Modules
- * @category Modules
- * @author ExpressionEngine Dev Team
- * @link http://expressionengine.com
- */
- /*
- Multi Site Login
- The login routine can set cookies for multiple domains if needed.
- This allows users who run separate domains for each channel to have
- a way to enable users to log-in once and remain logged-in across
- domains. In order to use this feature this array index must be
- added to the config file:
- $conf['multi_login_sites'] = "http://www.siteone.com/|http://www.sitetwo.com";
- Separate each domain with a pipe.
- */
- class Member {
- var $trigger = 'member';
- var $theme_class = 'profile_theme';
- var $request = 'public_profile';
- var $no_menu = array('public_profile', 'memberlist', 'do_member_search', 'member_search', 'register', 'smileys', 'login', 'unpw_update', 'email_console', 'send_email', 'aim_console', 'icq_console', 'forgot_password', 'delete', 'member_mini_search', 'do_member_mini_search');
- var $no_login = array('public_profile', 'memberlist', 'do_member_search', 'member_search', 'register', 'forgot_password', 'unpw_update');
- var $id_override = array('edit_subscriptions', 'memberlist', 'member_search', 'browse_avatars', 'messages', 'unpw_update');
- var $no_breadcrumb = array('email_console', 'send_email', 'aim_console', 'icq_console', 'member_mini_search', 'do_member_mini_search');
- var $simple_page = array('email_console', 'send_email', 'aim_console', 'icq_console', 'smileys', 'member_mini_search', 'do_member_mini_search');
- var $page_title = '';
- var $basepath = '';
- var $forum_path = '';
- var $image_url = '';
- var $theme_path = '';
- var $cur_id = '';
- var $uri_extra = '';
- var $return_data = '';
- var $javascript = '';
- var $head_extra = '';
- var $var_single = '';
- var $var_pair = '';
- var $var_cond = '';
- var $css_file_path = '';
- var $board_id = '';
- var $show_headings = TRUE;
- var $in_forum = FALSE;
- var $is_admin = FALSE;
- var $breadcrumb = TRUE;
- var $us_datecodes = array('long' => '%F %d, %Y %h:%i %A');
- var $eu_datecodes = array('long' => '%d %F, %Y %H:%i');
- var $crumb_map = array(
- 'profile' => 'your_control_panel',
- 'delete' => 'mbr_delete',
- 'forgot_password' => 'mbr_forgotten_password',
- 'login' => 'mbr_login',
- 'unpw_update' => 'settings_update',
- 'register' => 'mbr_member_registration',
- 'email' => 'mbr_email_member',
- 'send_email' => 'mbr_send_email',
- 'aim' => 'mbr_aim_console',
- 'icq' => 'mbr_icq_console',
- 'profile_main' => 'mbr_my_account',
- 'edit_profile' => 'mbr_edit_your_profile',
- 'edit_email' => 'email_settings',
- 'edit_userpass' => 'username_and_password',
- 'edit_localization' => 'localization_settings',
- 'edit_subscriptions' => 'subscriptions',
- 'edit_ignore_list' => 'ignore_list',
- 'edit_notepad' => 'notepad',
- 'edit_avatar' => 'edit_avatar',
- 'edit_photo' => 'edit_photo',
- 'edit_preferences' => 'edit_preferences',
- 'update_preferences' => 'update_preferences',
- 'upload_photo' => 'update_photo',
- 'browse_avatars' => 'browse_avatars',
- 'update_profile' => 'profile_updated',
- 'update_email' => 'mbr_email_updated',
- 'update_userpass' => 'username_and_password',
- 'update_localization' => 'localization_settings',
- 'update_subscriptions' => 'subscription_manager',
- 'update_ignore_list' => 'ignore_list',
- 'update_notepad' => 'notepad',
- 'select_avatar' => 'update_avatar',
- 'upload_avatar' => 'upload_avatar',
- 'update_avatar' => 'update_avatar',
- 'pm_view' => 'private_messages',
- 'pm' => 'compose_message',
- 'view_folder' => 'view_folder',
- 'view_message' => 'view_message',
- 'edit_signature' => 'edit_signature',
- 'update_signature' => 'update_signature',
- 'compose' => 'compose_message',
- 'deleted' => 'deleted_messages',
- 'folders' => 'edit_folders',
- 'buddies' => 'buddy_list',
- 'blocked' => 'blocked_list',
- 'edit_folders' => 'edit_folders',
- 'inbox' => 'view_folder',
- 'edit_list' => 'edit_list',
- 'send_message' => 'view_folder',
- 'modify_messages' => 'private_messages',
- 'bulletin_board' => 'bulletin_board',
- 'send_bulletin' => 'send_bulletin',
- 'sending_bulletin' => 'sending_bulletin'
- );
- /** ----------------------------------
- /** Member Profile Constructor
- /** ----------------------------------*/
- function Member()
- {
- // Make a local reference to the ExpressionEngine super object
- $this->EE =& get_instance();
- /** ----------------------------------
- /** Load language files
- /** ----------------------------------*/
- $this->EE->lang->loadfile('myaccount');
- $this->EE->lang->loadfile('member');
- $this->EE->functions->template_type = 'webpage';
- $this->EE->db->cache_off();
- }
- /** ----------------------------------
- /** Prep the Request String
- /** ----------------------------------*/
- function _prep_request()
- {
- // Typcially the profile page URLs will be something like:
- //
- // index.php/member/123/
- // index.php/member/memberlist/
- // index.php/member/profile/
- // etc...
- //
- // The second segment will be assigned to the $this->request variable.
- // This determines what page is shown. Anything after that will normally
- // be an ID number, so we'll assign it to the $this->cur_id variable.
- // Load the string helper
- $this->EE->load->helper('string');
- $this->request = trim_slashes($this->EE->uri->uri_string);
- if (FALSE !== ($pos = strpos($this->request, $this->trigger.'/')))
- {
- $this->request = substr($this->request, $pos);
- }
- if (preg_match("#/simple#", $this->request))
- {
- $this->request = str_replace("/simple", '', $this->request);
- $this->show_headings = FALSE;
- }
- if ($this->request == $this->trigger)
- {
- $this->request = '';
- }
- elseif (strpos($this->request, '/') !== FALSE)
- {
- $xr = explode("/", $this->request);
- $this->request = str_replace(current($xr).'/', '', $this->request);
- }
- /** ----------------------------------
- /** Determine the ID number, if any
- /** ----------------------------------*/
- $this->cur_id = '';
- if (strpos($this->request, '/') !== FALSE)
- {
- $x = explode("/", $this->request);
- if (count($x) > 2)
- {
- $this->request = $x['0'];
- $this->cur_id = $x['1'];
- $this->uri_extra = $x['2'];
- }
- else
- {
- $this->request = $x['0'];
- $this->cur_id = $x['1'];
- }
- }
- /** ----------------------------------
- /** Is this a public profile request?
- /** ----------------------------------*/
- // Public member profiles are found at:
- //
- // index.php/member/123/
- //
- // Since the second segment contains a number instead of the
- // normal text string we know it's a public profile request.
- // We'll do a little reassignment...
- if (is_numeric($this->request))
- {
- $this->cur_id = $this->request;
- $this->request = 'public_profile';
- }
-
- if ($this->request == '')
- {
- $this->request = 'public_profile';
- }
-
- /** ----------------------------------
- /** Disable the full page view
- /** ----------------------------------*/
-
- if (in_array($this->request, $this->simple_page))
- {
- $this->show_headings = FALSE;
- }
-
- if (in_array($this->request, $this->no_breadcrumb))
- {
- $this->breadcrumb = FALSE;
- }
-
- /** ----------------------------------
- /** Validate ID number
- /** ----------------------------------*/
- // The $this->cur_id variable can only contain a number.
- // There are a few exceptions like the memberlist page and the
- // subscriptions page
- if ( ! in_array($this->request, $this->id_override) AND $this->cur_id != '' AND ! is_numeric($this->cur_id))
- {
- return FALSE;
- }
-
- return TRUE;
- }
- /** ----------------------------------
- /** Run the Member Class
- /** ----------------------------------*/
- function manager()
- {
- /** ---------------------------------
- /** Prep the request
- /** ---------------------------------*/
- if ( ! $this->_prep_request())
- {
- exit("Invalid Page Request");
- }
- // -------------------------------------------
- // 'member_manager' hook.
- // - Seize control over any Member Module user side request
- // - Added: 1.5.2
- //
- if ($this->EE->extensions->active_hook('member_manager') === TRUE)
- {
- $edata = $this->EE->extensions->universal_call('member_manager', $this);
- if ($this->EE->extensions->end_script === TRUE) return $edata;
- }
- //
- // -------------------------------------------
- /** ---------------------------------
- /** Is the user logged in?
- /** ---------------------------------*/
- if ($this->request != 'login' AND ! in_array($this->request, $this->no_login) AND $this->EE->session->userdata('member_id') == 0)
- {
- return $this->_final_prep($this->profile_login_form('self'));
- }
- /** ---------------------------------
- /** Left-side Menu
- /** ---------------------------------*/
- $left = ( ! in_array($this->request, $this->no_menu)) ? $this->profile_menu() : '';
- /** ------------------------------
- /** Validate the request
- /** ------------------------------*/
- $methods = array(
- 'public_profile',
- 'memberlist',
- 'member_search',
- 'do_member_search',
- 'login',
- 'unpw_update',
- 'register',
- 'profile',
- 'edit_preferences',
- 'update_preferences',
- 'edit_profile',
- 'update_profile',
- 'edit_email',
- 'update_email',
- 'edit_userpass',
- 'update_userpass',
- 'edit_localization',
- 'update_localization',
- 'edit_notepad',
- 'update_notepad',
- 'edit_signature',
- 'update_signature',
- 'edit_avatar',
- 'browse_avatars',
- 'select_avatar',
- 'upload_avatar',
- 'edit_photo',
- 'upload_photo',
- 'edit_subscriptions',
- 'update_subscriptions',
- 'edit_ignore_list',
- 'update_ignore_list',
- 'member_mini_search',
- 'do_member_mini_search',
- 'email_console',
- 'aim_console',
- 'icq_console',
- 'send_email',
- 'forgot_password',
- 'smileys',
- 'messages',
- 'delete'
- );
- if ( ! in_array($this->request, $methods))
- {
- return $this->EE->output->show_user_error('general', array($this->EE->lang->line('invalid_action')));
- }
- /** ------------------------------
- /** Call the requested function
- /** ------------------------------*/
- if ($this->request == 'profile') $this->request = 'profile_main';
- if ($this->request == 'register') $this->request = 'registration_form';
- if ($this->cur_id == 'member_search') {$left = ''; $this->breadcrumb = FALSE; $this->show_headings = FALSE;}
- if ($this->cur_id == 'do_member_search') {$left = ''; $this->breadcrumb = FALSE; $this->show_headings = FALSE;}
- if ($this->cur_id == 'buddy_search') {$left = ''; $this->breadcrumb = FALSE; $this->show_headings = FALSE;}
- if ($this->cur_id == 'do_buddy_search') {$left = ''; $this->breadcrumb = FALSE; $this->show_headings = FALSE;}
- $function = $this->request;
- if (in_array($function, array('upload_photo', 'upload_avatar', 'upload_signature_image', '_upload_image')))
- {
- require_once PATH_MOD.'member/mod.member_images.php';
- $MI = new Member_images();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MI->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MI->$attribute =& $this->$attribute;
- }
- }
- $content = $MI->$function();
- }
- else
- {
- $content = $this->$function();
- }
- if ($this->cur_id == 'edit_folders') {$left = $this->profile_menu();}
- if ($this->cur_id == 'send_message') {$left = $this->profile_menu();}
- /** ------------------------------
- /** Parse the template the template
- /** ------------------------------*/
- if ($left == '')
- {
- $out = $this->_var_swap($this->_load_element('basic_profile'),
- array(
- 'include:content' => $content
- )
- );
- }
- else
- {
- $out = $this->_var_swap($this->_load_element('full_profile'),
- array(
- 'include:menu' => $left,
- 'include:content' => $content
- )
- );
- }
- /** ------------------------------
- /** Output the finalized request
- /** ------------------------------*/
- return $this->_final_prep($out);
- }
- /** ----------------------------------------
- /** Private Messages
- /** ----------------------------------------*/
- function messages()
- {
- if (($this->EE->session->userdata['can_send_private_messages'] != 'y' && $this->EE->session->userdata['group_id'] != '1') OR $this->EE->session->userdata['accept_messages'] != 'y')
- {
- return $this->profile_main();
- }
- if ( ! class_exists('EE_Messages'))
- {
- require APPPATH.'libraries/Messages'.EXT;
- }
- $MESS = new EE_Messages;
- $MESS->base_url = $this->_member_path('messages').'/';
- $MESS->allegiance = 'user';
- $MESS->theme_path = $this->theme_path;
- $MESS->request = $this->cur_id;
- $MESS->cur_id = $this->uri_extra;
- $MESS->MS =& $this;
- $MESS->manager();
- $this->page_title = $MESS->title;
- $this->head_extra = $MESS->header_javascript;
- return $MESS->return_data;
- }
- /** ----------------------------------------
- /** Member Profile - Menu
- /** ----------------------------------------*/
- function profile_menu()
- {
- if ( ! class_exists('Member_settings'))
- {
- require PATH_MOD.'member/mod.member_settings.php';
- }
- $MS = new Member_settings();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MS->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MS->$attribute =& $this->$attribute;
- }
- }
- return $MS->profile_menu();
- }
- /** ----------------------------------------
- /** Private Messages - Menu
- /** ----------------------------------------*/
- function pm_menu()
- {
- if (($this->EE->session->userdata['can_send_private_messages'] != 'y' && $this->EE->session->userdata['group_id'] != '1') OR $this->EE->session->userdata['accept_messages'] != 'y')
- {
- return;
- }
- if ( ! class_exists('EE_Messages'))
- {
- require APPPATH.'libraries/Messages'.EXT;
- }
- $MESS = new EE_Messages;
- $MESS->base_url = $this->_member_path('messages');
- $MESS->allegiance = 'user';
- $MESS->theme_path = $this->theme_path;
- $MESS->MS =& $this;
-
- $MESS->create_menu();
- return $MESS->menu;
- }
- /** ----------------------------------------
- /** Member Profile Main Page
- /** ----------------------------------------*/
- function profile_main()
- {
- if ( ! class_exists('Member_settings'))
- {
- require PATH_MOD.'member/mod.member_settings.php';
- }
- $MS = new Member_settings();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MS->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MS->$attribute =& $this->$attribute;
- }
- }
- return $MS->profile_main();
- }
- /** ----------------------------------------
- /** Member Public Profile
- /** ----------------------------------------*/
- function public_profile()
- {
- if ( ! class_exists('Member_settings'))
- {
- require PATH_MOD.'member/mod.member_settings.php';
- }
- $MS = new Member_settings();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MS->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MS->$attribute =& $this->$attribute;
- }
- }
- return $MS->public_profile();
- }
- /** ----------------------------------------
- /** Login Page
- /** ----------------------------------------*/
- function profile_login_form($return = '-2')
- {
- if ( ! class_exists('Member_auth'))
- {
- require PATH_MOD.'member/mod.member_auth.php';
- }
- $MA = new Member_auth();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MA->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MA->$attribute =& $this->$attribute;
- }
- }
- return $MA->profile_login_form($return);
- }
- /** ----------------------------------------
- /** Member Profile Edit Page
- /** ----------------------------------------*/
- function edit_profile()
- {
- if ( ! class_exists('Member_settings'))
- {
- require PATH_MOD.'member/mod.member_settings.php';
- }
- $MS = new Member_settings();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MS->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MS->$attribute =& $this->$attribute;
- }
- }
- return $MS->edit_profile();
- }
- /** ----------------------------------------
- /** Profile Update
- /** ----------------------------------------*/
- function update_profile()
- {
- if ( ! class_exists('Member_settings'))
- {
- require PATH_MOD.'member/mod.member_settings.php';
- }
- $MS = new Member_settings();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MS->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MS->$attribute =& $this->$attribute;
- }
- }
- return $MS->update_profile();
- }
- /** ----------------------------------------
- /** Forum Preferences
- /** ----------------------------------------*/
- function edit_preferences()
- {
- if ( ! class_exists('Member_settings'))
- {
- require PATH_MOD.'member/mod.member_settings.php';
- }
- $MS = new Member_settings();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MS->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MS->$attribute =& $this->$attribute;
- }
- }
- return $MS->edit_preferences();
- }
- /** ----------------------------------------
- /** Update Preferences
- /** ----------------------------------------*/
- function update_preferences()
- {
- if ( ! class_exists('Member_settings'))
- {
- require PATH_MOD.'member/mod.member_settings.php';
- }
- $MS = new Member_settings();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MS->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MS->$attribute =& $this->$attribute;
- }
- }
- return $MS->update_preferences();
- }
- /** ----------------------------------------
- /** Email Settings
- /** ----------------------------------------*/
- function edit_email()
- {
- if ( ! class_exists('Member_settings'))
- {
- require PATH_MOD.'member/mod.member_settings.php';
- }
- $MS = new Member_settings();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MS->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MS->$attribute =& $this->$attribute;
- }
- }
- return $MS->edit_email();
- }
- /** ----------------------------------------
- /** Email Update
- /** ----------------------------------------*/
- function update_email()
- {
- if ( ! class_exists('Member_settings'))
- {
- require PATH_MOD.'member/mod.member_settings.php';
- }
- $MS = new Member_settings();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MS->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MS->$attribute =& $this->$attribute;
- }
- }
- return $MS->update_email();
- }
- /** ----------------------------------------
- /** Username/Password Preferences
- /** ----------------------------------------*/
- function edit_userpass()
- {
- if ( ! class_exists('Member_settings'))
- {
- require PATH_MOD.'member/mod.member_settings.php';
- }
- $MS = new Member_settings();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MS->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MS->$attribute =& $this->$attribute;
- }
- }
- return $MS->edit_userpass();
- }
- /** ----------------------------------------
- /** Username/Password Update
- /** ----------------------------------------*/
- function update_userpass()
- {
- if ( ! class_exists('Member_settings'))
- {
- require PATH_MOD.'member/mod.member_settings.php';
- }
- $MS = new Member_settings();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MS->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MS->$attribute =& $this->$attribute;
- }
- }
- return $MS->update_userpass();
- }
- /** ----------------------------------------
- /** Localization Edit Form
- /** ----------------------------------------*/
- function edit_localization()
- {
- if ( ! class_exists('Member_settings'))
- {
- require PATH_MOD.'member/mod.member_settings.php';
- }
- $MS = new Member_settings();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MS->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MS->$attribute =& $this->$attribute;
- }
- }
- return $MS->edit_localization();
- }
- /** ----------------------------------------
- /** Update Localization Prefs
- /** ----------------------------------------*/
- function update_localization()
- {
- if ( ! class_exists('Member_settings'))
- {
- require PATH_MOD.'member/mod.member_settings.php';
- }
- $MS = new Member_settings();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MS->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MS->$attribute =& $this->$attribute;
- }
- }
- return $MS->update_localization();
- }
- /** ----------------------------------------
- /** Signature Edit Form
- /** ----------------------------------------*/
- function edit_signature()
- {
- if ( ! class_exists('Member_images'))
- {
- require PATH_MOD.'member/mod.member_images.php';
- }
- $MI = new Member_images();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MI->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MI->$attribute =& $this->$attribute;
- }
- }
- return $MI->edit_signature();
- }
- /** ----------------------------------------
- /** Update Signature
- /** ----------------------------------------*/
- function update_signature()
- {
- if ( ! class_exists('Member_images'))
- {
- require PATH_MOD.'member/mod.member_images.php';
- }
- $MI = new Member_images();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MI->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MI->$attribute =& $this->$attribute;
- }
- }
- return $MI->update_signature();
- }
- /** ----------------------------------------
- /** Avatar Edit Form
- /** ----------------------------------------*/
- function edit_avatar()
- {
- if ( ! class_exists('Member_images'))
- {
- require PATH_MOD.'member/mod.member_images.php';
- }
- $MI = new Member_images();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MI->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MI->$attribute =& $this->$attribute;
- }
- }
- return $MI->edit_avatar();
- }
- /** ----------------------------------------
- /** Browse Avatars
- /** ----------------------------------------*/
- function browse_avatars()
- {
- if ( ! class_exists('Member_images'))
- {
- require PATH_MOD.'member/mod.member_images.php';
- }
- $MI = new Member_images();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MI->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MI->$attribute =& $this->$attribute;
- }
- }
- return $MI->browse_avatars();
- }
- /** ----------------------------------------
- /** Select Avatar From Library
- /** ----------------------------------------*/
- function select_avatar()
- {
- if ( ! class_exists('Member_images'))
- {
- require PATH_MOD.'member/mod.member_images.php';
- }
- $MI = new Member_images();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MI->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MI->$attribute =& $this->$attribute;
- }
- }
- return $MI->select_avatar();
- }
- /** ----------------------------------------
- /** Photo Edit Form
- /** ----------------------------------------*/
- function edit_photo()
- {
- if ( ! class_exists('Member_images'))
- {
- require PATH_MOD.'member/mod.member_images.php';
- }
- $MI = new Member_images();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MI->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MI->$attribute =& $this->$attribute;
- }
- }
- return $MI->edit_photo();
- }
- /** ----------------------------------------
- /** Notepad Edit Form
- /** ----------------------------------------*/
- function edit_notepad()
- {
- if ( ! class_exists('Member_settings'))
- {
- require PATH_MOD.'member/mod.member_settings.php';
- }
- $MS = new Member_settings();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MS->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MS->$attribute =& $this->$attribute;
- }
- }
- return $MS->edit_notepad();
- }
- /** ----------------------------------------
- /** Update Notepad
- /** ----------------------------------------*/
- function update_notepad()
- {
- if ( ! class_exists('Member_settings'))
- {
- require PATH_MOD.'member/mod.member_settings.php';
- }
- $MS = new Member_settings();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MS->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MS->$attribute =& $this->$attribute;
- }
- }
- return $MS->update_notepad();
- }
- /** ----------------------------------------
- /** Member Login
- /** ----------------------------------------*/
- function member_login()
- {
- if ( ! class_exists('Member_auth'))
- {
- require PATH_MOD.'member/mod.member_auth.php';
- }
- $MA = new Member_auth();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MA->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MA->$attribute =& $this->$attribute;
- }
- }
- $MA->member_login();
- }
- /** ----------------------------------------
- /** Member Logout
- /** ----------------------------------------*/
- function member_logout()
- {
- if ( ! class_exists('Member_auth'))
- {
- require PATH_MOD.'member/mod.member_auth.php';
- }
- $MA = new Member_auth();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MA->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MA->$attribute =& $this->$attribute;
- }
- }
- $MA->member_logout();
- }
- /** ----------------------------------------
- /** Member Forgot Password Form
- /** ----------------------------------------*/
- function forgot_password($ret = '-3')
- {
- if ( ! class_exists('Member_auth'))
- {
- require PATH_MOD.'member/mod.member_auth.php';
- }
- $MA = new Member_auth();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MA->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MA->$attribute =& $this->$attribute;
- }
- }
- return $MA->forgot_password($ret);
- }
- /** ----------------------------------------
- /** Retreive Forgotten Password
- /** ----------------------------------------*/
- function retrieve_password()
- {
- if ( ! class_exists('Member_auth'))
- {
- require PATH_MOD.'member/mod.member_auth.php';
- }
- $MA = new Member_auth();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MA->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MA->$attribute =& $this->$attribute;
- }
- }
- $MA->retrieve_password();
- }
- /** ----------------------------------------
- /** Reset the user's password
- /** ----------------------------------------*/
- function reset_password()
- {
- if ( ! class_exists('Member_auth'))
- {
- require PATH_MOD.'member/mod.member_auth.php';
- }
- $MA = new Member_auth();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MA->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MA->$attribute =& $this->$attribute;
- }
- }
- $MA->reset_password();
- }
- /** ----------------------------------------
- /** Subscriptions Edit Form
- /** ----------------------------------------*/
- function edit_subscriptions()
- {
- if ( ! class_exists('Member_subscriptions'))
- {
- require PATH_MOD.'member/mod.member_subscriptions.php';
- }
- $MS = new Member_subscriptions();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MS->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MS->$attribute =& $this->$attribute;
- }
- }
- return $MS->edit_subscriptions();
- }
- /** ----------------------------------------
- /** Update Subscriptions
- /** ----------------------------------------*/
- function update_subscriptions()
- {
- if ( ! class_exists('Member_subscriptions'))
- {
- require PATH_MOD.'member/mod.member_subscriptions.php';
- }
- $MS = new Member_subscriptions();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MS->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MS->$attribute =& $this->$attribute;
- }
- }
- return $MS->update_subscriptions();
- }
- /** -------------------------------------
- /** Edit Ignore List Form
- /** -------------------------------------*/
- function edit_ignore_list()
- {
- if ( ! class_exists('Member_settings'))
- {
- require PATH_MOD.'member/mod.member_settings.php';
- }
- $MS = new Member_settings();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MS->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MS->$attribute =& $this->$attribute;
- }
- }
- return $MS->edit_ignore_list();
- }
- /** -------------------------------------
- /** Update Ignore List
- /** -------------------------------------*/
- function update_ignore_list()
- {
- if ( ! class_exists('Member_settings'))
- {
- require PATH_MOD.'member/mod.member_settings.php';
- }
- $MS = new Member_settings();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MS->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MS->$attribute =& $this->$attribute;
- }
- }
- return $MS->update_ignore_list();
- }
- /** -------------------------------------
- /** Member Mini Search
- /** -------------------------------------*/
- function member_mini_search()
- {
- if ( ! class_exists('Member_settings'))
- {
- require PATH_MOD.'member/mod.member_settings.php';
- }
- $MS = new Member_settings();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MS->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MS->$attribute =& $this->$attribute;
- }
- }
- $this->_set_page_title($this->EE->lang->line('member_search'));
- return $MS->member_mini_search();
- }
- /** -------------------------------------
- /** Do Member Mini Search
- /** -------------------------------------*/
- function do_member_mini_search()
- {
- if ( ! class_exists('Member_settings'))
- {
- require PATH_MOD.'member/mod.member_settings.php';
- }
- $MS = new Member_settings();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MS->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MS->$attribute =& $this->$attribute;
- }
- }
- $this->_set_page_title($this->EE->lang->line('member_search'));
- return $MS->do_member_mini_search();
- }
- /** ----------------------------------------
- /** Member Registration Form
- /** ----------------------------------------*/
- function registration_form()
- {
- if ( ! class_exists('Member_register'))
- {
- require PATH_MOD.'member/mod.member_register.php';
- }
- $MR = new Member_register();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MR->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MR->$attribute =& $this->$attribute;
- }
- }
- return $MR->registration_form();
- }
- /** ----------------------------------------
- /** Register Member
- /** ----------------------------------------*/
- function register_member()
- {
- if ( ! class_exists('Member_register'))
- {
- require PATH_MOD.'member/mod.member_register.php';
- }
- $MR = new Member_register();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MR->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MR->$attribute =& $this->$attribute;
- }
- }
- $MR->register_member();
- }
- /** ----------------------------------------
- /** Member Self-Activation
- /** ----------------------------------------*/
- function activate_member()
- {
- if ( ! class_exists('Member_register'))
- {
- require PATH_MOD.'member/mod.member_register.php';
- }
- $MR = new Member_register();
- if (is_php('5.0.0') == TRUE)
- {
- foreach(get_object_vars($this) as $key => $value)
- {
- $MR->{$key} = $value;
- }
- }
- else
- {
- // sync everything since PHP4 was working from a copy
- foreach (array_keys(get_object_vars($this)) as $attribute)
- {
- $MR->$attribute =& $this->$attribute;
- }
- }
- $MR->activate_member();
- }
- /** -------------------------------------
- /** Delete Page
- /** -------------------------------------*/
- function delete()
- {
- return $this->confirm_delete_form();
- }
- /** -------------------------------------
- /** Self-delete confirmation form
- /** -------------------------------------*/
- function confirm_delete_form()
- {
- if ($this->EE->session->userdata['can_delete_self'] !== 'y')
- {
- return $this->EE->output->show_user_error('general', $this->EE->lang->line('cannot_delete_self'));
- }
- else
- {
- $delete_form = $this->_load_element('delete_confirmation_form');
- $data['hidden_fields']['ACT'] = $this->EE->functions->fetch_action_id('Member', 'member_delete');
- $data['onsubmit'] = "if( ! confirm('{lang:final_delete_confirm}')) return false;";
- $data['id'] = 'member_delete_form';
- $this->_set_page_title($this->EE->lang->line('member_delete'));
- return $this->_var_swap($delete_form, array('form_declaration' => $this->EE->functions->form_declaration($data)));
- }
- }
- /** -------------------------------------
- /** Member self-delete
- /** -------------------------------------*/
- function member_delete()
- {
- /** -------------------------------------
- /** Make sure they got here via a form
- /** -------------------------------------*/
- if ( ! $this->EE->input->post('ACT'))
- {
- // No output for you, Mr. URL Hax0r
- return FALSE;
- }
- $this->EE->lang->loadfile('login');
- /* -------------------------------------
- /* No sneakiness - we'll do this in case the site administrator
- /* has foolishly turned off secure forms and some monkey is
- /* trying to delete their account from an off-site form or
- /* after logging out.
- /* -------------------------------------*/
- if ($this->EE->session->userdata['member_id'] == 0 OR $this->EE->session->userdata['can_delete_self'] !== 'y')
- {
- return $this->EE->output->show_user_error('general', $this->EE->lang->line('not_authorized'));
- }
- /** -------------------------------------
- /** If the user is a SuperAdmin, then no deletion
- /** -------------------------------------*/
- if ($this->EE->session->userdata['group_id'] == 1)
- {
- return $this->EE->output->show_user_error('general', $this->EE->lang->line('cannot_delete_super_admin'));
- }
- /** ----------------------------------------
- /** Is IP and User Agent required for login? Then, same here.
- /** ----------------------------------------*/
- if ($this->EE->config->item('require_ip_for_login') == 'y')
- {
- if ($this->EE->session->userdata['ip_address'] == '' OR $this->EE->session->userdata['user_agent'] == '')
- {
- return $this->EE->output->show_user_error('general', $this->EE->lang->line('unauthorized_request'));
- }
- }
- /** ----------------------------------------
- /** Check password lockout status
- /** ----------------------------------------*/
- if ($this->EE->session->check_password_lockout($this->EE->session->userdata['username']) === TRUE)
- {
- return $this->EE->output->show_user_error('general', str_replace("%x", $this->EE->config->item('password_lockout_interval'), $this->EE->lang->line('password_lockout_in_effect')));
- }
- /* -------------------------------------
- /* Are you who you say you are, or someone sitting at someone
- /* else's computer being mean?!
- /* -------------------------------------*/
- $query = $this->EE->db->query("SELECT password FROM exp_members WHERE member_id = '".$this->EE->session->userdata['member_id']."'");
- $password = $this->EE->functions->hash(stripslashes($this->EE->input->post('password')));
- if ($query->row('password') != $password)
- {
- $this->EE->session->save_password_lockout($this->EE->session->userdata['username']);
- return $this->EE->output->show_user_error('general', $this->EE->lang->line('invalid_pw'));
- }
- /** -------------------------------------
- /** No turning back, get to deletin'!
- /** -------------------------------------*/
- $id = $this->EE->session->userdata['member_id'];
- $this->EE->db->query("DELETE FROM exp_members WHERE member_id = '{$id}'");
- $this->EE->db->query("DELETE FROM exp_member_data WHERE member_id = '{$id}'");
- $this->EE->db->query("DELETE FROM exp_member_homepage WHERE member_id = '{$id}'");
- $message_query = $this->EE->db->query("SELECT DISTINCT recipient_id FROM exp_message_copies WHERE sender_id = '{$id}' AND message_read = 'n'");
- $this->EE->db->query("DELETE FROM exp_message_copies WHERE sender_id = '{$id}'");
- $this->EE->db->query("DELETE FROM exp_message_data WHERE sender_id = '{$id}'");
- $this->EE->db->query("DELETE FROM exp_message_folders WHERE member_id = '{$id}'");
- $this->EE->db->query("DELETE FROM exp_message_listed WHERE member_id = '{$id}'");
- if ($message_query->num_rows() > 0)
- {
- foreach($message_query->result_array() as $row)
- {
- $count_query = $this->EE->db->query("SELECT COUNT(*) AS count FROM exp_message_copies WHERE recipient_id = '".$row['recipient_id']."' AND message_read = 'n'");
- $this->EE->db->query($this->EE->db->update_string('exp_members', array('private_messages' => $count_query->row('count') ), "member_id = '".$row['recipient_id']."'"));
- }
- }
- /** -------------------------------------
- /** Delete Forum Posts
- /** -------------------------------------*/
- if ($this->EE->config->item('forum_is_installed') == "y")
- {
- $this->EE->db->query("DELETE FROM exp_forum_subscriptions WHERE member_id = '{$id}'");
- $this->EE->db->query("DELETE FROM exp_forum_pollvotes WHERE member_id = '{$id}'");
- $this->EE->db->query("DELETE FROM exp_forum_topics WHERE author_id = '{$id}'");
- $this->EE->db->query("DELETE FROM exp_forum_administrators WHERE admin_member_id = '{$id}'");
- $this->EE->db->query("DELETE FROM exp_forum_moderators WHERE mod_member_id = '{$id}'");
- // Snag the affected topic id's before deleting the member for the update afterwards
- $query = $this->EE->db->query("SELECT topic_id FROM exp_forum_posts WHERE author_id = '{$id}'");
- if ($query->num_rows() > 0)
- {
- $topic_ids = array();
- foreach ($query->result_array() as $row)
- {
- $topic_ids[] = $row['topic_id'];
- }
- $topic_ids = array_unique($topic_ids);
- }
- $this->EE->db->query("DELETE FROM exp_forum_posts WHERE author_id = '{$id}'");
- $this->EE->db->query("DELETE FROM exp_forum_polls WHERE author_id = '{$id}'");
- // Kill any attachments
- $query = $this->EE->db->query("SELECT attachment_id, filehash, extension, board_id FROM exp_forum_attachments WHERE member_id = '{$id}'");
- if ($query->num_rows() > 0)
- {
- // Grab the upload path
- $res = $this->EE->db->query('SELECT board_id, board_upload_path FROM exp_forum_boards');
- $paths = array();
- foreach ($res->result_array() as $row)
- {
- $paths[$row['board_id']] = $row['board_upload_path'];
- }
- foreach ($query->result_array() as $row)
- {
- if ( ! isset($paths[$row['board_id']]))
- {
- continue;
- }
- $file = $paths[$row['board_id']].$row['filehash'].$row['extension'];
- $thumb = $paths[$row['board_id']].$row['filehash'].'_t'.$row['extension'];
- @unlink($file);
- @unlink($thumb);
- $this->EE->db->query("DELETE FROM exp_forum_attachments WHERE attachment_id = '{$row['attachment_id']}'");
- }
- }
- // Update the forum stats
- $query = $this->EE->db->query("SELECT forum_id FROM exp_forums WHERE forum_is_cat = 'n'");
- if ( ! class_exists('Forum'))
- {
- require PATH_MOD.'forum/mod.forum'.EXT;
- require PATH_MOD.'forum/mod.forum_core'.EXT;
- }
- $FRM = new Forum_Core;
- foreach ($query->result_array() as $row)
- {
- $FRM->_update_post_stats($row['forum_id']);
- }
- if (isset($topic_ids))
- {
- foreach ($topic_ids as $topic_id)
- {
- $FRM->_update_topic_stats($topic_id);
- }
- }
- }
- /** -------------------------------------
- /** Va-poo-rize Channel Entries and Comments
- /** -------------------------------------*/
- $entry_ids = array();
- $channel_ids = array();
- $recount_ids = array();
- // Find Entry IDs and Channel IDs, then delete
- $query = $this->EE->db->query("SELECT entry_id, channel_id FROM exp_channel_titles WHERE author_id = '{$id}'");
- if ($query->num_rows() > 0)
- {
- foreach ($query->result_array() as $row)
- {
- $entry_ids[] = $row['entry_id'];
- $channel_ids[] = $row['channel_id'];
- }
- $this->EE->db->query("DELETE FROM exp_channel_titles WHERE author_id = '{$id}'");
- $this->EE->db->query("DELETE FROM exp_channel_data WHERE entry_id IN ('".implode("','", $entry_ids)."')");
- $this->EE->db->query("DELETE FROM exp_comments WHERE entry_id IN ('".implode("','", $entry_ids)."')");
- }
- // Find the affected entries AND channel ids for author's comments
- $query = $this->EE->db->query("SELECT DISTINCT(entry_id), channel_id FROM exp_comments WHERE author_id = '{$id}'");
- if ($query->num_rows() > 0)
- {
- foreach ($query->result_array() as $row)
- {
- $recount_ids[] = $row['entry_id'];
- $channel_ids[] = $row['channel_id'];
- }
- $recount_ids = array_diff($recount_ids, $entry_ids);
- }
- // Delete comments by member
- $this->EE->db->query("DELETE FROM exp_comments WHERE author_id = '{$id}'");
- // Update stats on channel entries that were NOT deleted AND had comments by author
- if (count($recount_ids) > 0)
- {
- foreach (array_unique($recount_ids) as $entry_id)
- {
- $query = $this->EE->db->query("SELECT MAX(comment_date) AS max_date FROM exp_comments WHERE status = 'o' AND entry_id = '".$this->EE->db->escape_str($entry_id)."'");
- $comment_date = ($query->num_rows() == 0 OR ! is_numeric($query->row('max_date') )) ? 0 : $query->row('max_date') ;
- $query = $this->EE->db->query("SELECT COUNT(*) AS count FROM exp_comments WHERE entry_id = '{$entry_id}' AND status = 'o'");
- $this->EE->db->query("UPDATE exp_channel_titles SET comment_total = '".$this->EE->db->escape_str($query->row('count') )."', recent_comment_date = '$comment_date' WHERE entry_id = '{$entry_id}'");
- }
- }
- if (count($channel_ids) > 0)
- {
- foreach (array_unique($channel_ids) as $channel_id)
- {
- $this->EE->stats->update_channel_stats($channel_id);
- $this->EE->stats->update_comment_stats($channel_id);
- }
- }
- /** -------------------------------------
- /** Email notification recipients
- /** -------------------------------------*/
- if ($this->EE->session->userdata['mbr_delete_notify_emails'] != '')
- {
- $notify_address = $this->EE->session->userdata['mbr_delete_notify_emails'];
- $swap = array(
- 'name' => $this->EE->session->userdata['screen_name'],
- 'email' => $this->EE->session->userdata['email'],
- 'site_name' => stripslashes($this->EE->config->item('site_name'))
- );
- $email_tit = $this->EE->functions->var_swap($this->EE->lang->line('mbr_delete_notify_title'), $swap);
- $email_msg = $this->EE->functions->var_swap($this->EE->lang->line('mbr_delete_notify_message'), $swap);
- // No notification for the user themselves, if they're in the list
- if (strpos($notify_address, $this->EE->session->userdata('email')) !== FALSE)
- {
- $notify_address = str_replace($this->EE->session->userdata['email'], "", $notify_address);
- }
- $this->EE->load->helper('string');
- // Remove multiple commas
- $notify_address = reduce_multiples($notify_address, ',', TRUE);
- if ($notify_address != '')
- {
- /** ----------------------------
- /** Send email
- /** ----------------------------*/
- $this->EE->load->library('email');
- // Load the text helper
- $this->EE->load->helper('text');
- foreach (explode(',', $notify_address) as $addy)
- {
- $this->EE->email->EE_initialize();
- $this->EE->email->wordwrap = FALSE;
- $this->EE->email->from($this->EE->conf…
Large files files are truncated, but you can click here to view the full file