/** * Initiate the registry * * @return mixed false or void */ public static function init() { $INFO = array(); $_ipsPowerSettings = array(); if (self::$initiated === TRUE) { return FALSE; } self::$initiated = TRUE; /* Load static classes */ require IPS_ROOT_PATH . "sources/base/core.php"; /*noLibHook*/ require IPS_ROOT_PATH . "sources/base/ipsMember.php"; /*noLibHook*/ /* Debugging notices? */ if (defined('IPS_ERROR_CAPTURE') and IPS_ERROR_CAPTURE !== FALSE) { @error_reporting(E_ALL | E_NOTICE); @set_error_handler("IPSDebug::errorHandler"); } /* Load core variables */ self::_loadCoreVariables(); /* Load config file */ if (is_file(DOC_IPS_ROOT_PATH . 'conf_global.php')) { require DOC_IPS_ROOT_PATH . 'conf_global.php'; /*noLibHook*/ if (is_array($INFO)) { foreach ($INFO as $key => $val) { ipsRegistry::$settings[$key] = str_replace('\', '\\', $val); } } } /* Load secret sauce */ if (is_array($_ipsPowerSettings)) { ipsRegistry::$settings = array_merge($_ipsPowerSettings, ipsRegistry::$settings); } /* Make sure we're installed */ if (empty($INFO['sql_database'])) { /* Quick PHP version check */ if (!version_compare(MIN_PHP_VERS, PHP_VERSION, '<=')) { print "You must be using PHP " . MIN_PHP_VERS . " or better. You are currently using: " . PHP_VERSION; exit; } $host = $_SERVER['HTTP_HOST'] ? $_SERVER['HTTP_HOST'] : @getenv('HTTP_HOST'); $self = $_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : @getenv('PHP_SELF'); if (IPS_AREA == 'admin') { @header("Location: http://" . $host . rtrim(dirname($self), '/\\') . "/install/index.php"); } else { if (!defined('CP_DIRECTORY')) { define('CP_DIRECTORY', 'admin'); } @header("Location: http://" . $host . rtrim(dirname($self), '/\\') . "/" . CP_DIRECTORY . "/install/index.php"); } } /* Switch off dev mode you idjit */ if (!defined('IN_DEV')) { define('IN_DEV', 0); } /* Shell defined? */ if (!defined('IPS_IS_SHELL')) { define('IPS_IS_SHELL', FALSE); } /* If this wasn't defined in the gateway file... */ if (!defined('ALLOW_FURLS')) { define('ALLOW_FURLS', ipsRegistry::$settings['use_friendly_urls'] ? TRUE : FALSE); } if (!defined('IPS_IS_MOBILE_APP')) { define('IPS_IS_MOBILE_APP', false); } /** * File and folder permissions */ if (!defined('IPS_FILE_PERMISSION')) { define('IPS_FILE_PERMISSION', 0777); } if (!defined('IPS_FOLDER_PERMISSION')) { define('IPS_FOLDER_PERMISSION', 0777); } /* Set it again incase a gateway turned it off */ ipsRegistry::$settings['use_friendly_urls'] = ALLOW_FURLS; /* Start timer */ IPSDebug::startTimer(); /* Cookies... */ IPSCookie::$sensitive_cookies = array('session_id', 'admin_session_id', 'member_id', 'pass_hash'); /* INIT DB */ self::$handles['db'] = ips_DBRegistry::instance(); /* Set DB */ self::$handles['db']->setDB(ipsRegistry::$settings['sql_driver']); /* Input set up... */ if (is_array($_POST) and count($_POST)) { foreach ($_POST as $key => $value) { # Skip post arrays if (!is_array($value)) { $_POST[$key] = IPSText::stripslashes($value); } } } //----------------------------------------- // Clean globals, first. //----------------------------------------- IPSLib::cleanGlobals($_GET); IPSLib::cleanGlobals($_POST); IPSLib::cleanGlobals($_COOKIE); IPSLib::cleanGlobals($_REQUEST); # GET first $input = IPSLib::parseIncomingRecursively($_GET, array()); # Then overwrite with POST self::$request = IPSLib::parseIncomingRecursively($_POST, $input); # Fix some notices if (!isset(self::$request['module'])) { self::$request['module'] = ''; } if (!isset(self::$request['section'])) { self::$request['section'] = ''; } # Assign request method self::$request['request_method'] = strtolower(my_getenv('REQUEST_METHOD')); /* Define some constants */ define('IPS_IS_TASK', (isset(self::$request['module']) and self::$request['module'] == 'task' and self::$request['app'] == 'core') ? TRUE : FALSE); define('IPS_IS_AJAX', (isset(self::$request['module']) and self::$request['module'] == 'ajax') ? TRUE : FALSE); /* First pass of app set up. Needs to be BEFORE caches and member are set up */ self::_fUrlInit(); self::_manageIncomingURLs(); /* _manageIncomingURLs MUST be called first!!! */ self::_setUpAppData(); /* Load app / coreVariables.. must be called after app Data */ self::_loadAppCoreVariables(IPS_APP_COMPONENT); /* Must be called after _manageIncomingURLs */ self::$handles['db']->getDB()->setDebugMode(IPS_SQL_DEBUG_MODE ? isset($_GET['debug']) ? intval($_GET['debug']) : 0 : 0); /* Get caches */ self::$handles['caches'] = ips_CacheRegistry::instance(); /* Make sure all is well before we proceed */ try { self::instance()->setUpSettings(); } catch (Exception $e) { print file_get_contents(IPS_CACHE_PATH . 'cache/skin_cache/settingsEmpty.html'); exit; } /* Reset database log file paths to cache path */ self::$handles['db']->resetLogPaths(); /* Just in case they copy a space in the license... */ ipsRegistry::$settings['ipb_reg_number'] = trim(ipsRegistry::$settings['ipb_reg_number']); /* Bah, now let's go over any input cleaning routines that have settings *sighs* */ self::$request = IPSLib::postParseIncomingRecursively(self::$request); /* Set up dummy member class to prevent errors if cache rebuild required */ self::$handles['member'] = ips_MemberRegistryDummy::instance(); /* Build module and application caches */ self::instance()->checkCaches(); /* Set up app specific redirects. Must be called before member/sessions setup */ self::_parseAppResets(); /* Re-assign member */ unset(self::$handles['member']); self::$handles['member'] = ips_MemberRegistry::instance(); /* Load other classes */ $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/class_localization.php', 'class_localization'); self::instance()->setClass('class_localization', new $classToLoad(self::instance())); $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/class_public_permissions.php', 'classPublicPermissions'); self::instance()->setClass('permissions', new $classToLoad(self::instance())); /* Must be called before output initiated */ self::getAppClass(IPS_APP_COMPONENT); if (IPS_AREA == 'admin') { require_once IPS_ROOT_PATH . 'sources/classes/output/publicOutput.php'; /*noLibHook*/ $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/output/adminOutput.php', 'adminOutput'); self::instance()->setClass('output', new $classToLoad(self::instance())); $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . "sources/classes/class_admin_functions.php", 'adminFunctions'); self::instance()->setClass('adminFunctions', new $classToLoad(self::instance())); $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/class_permissions.php', 'class_permissions'); self::instance()->setClass('class_permissions', new $classToLoad(self::instance())); /* Do stuff that needs both adminFunctions and output initiated */ self::instance()->getClass('adminFunctions')->postOutputInit(); } else { $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/output/publicOutput.php', 'output'); self::instance()->setClass('output', new $classToLoad(self::instance(), TRUE)); register_shutdown_function(array('ipsRegistry', '__myDestruct')); } /* Post member processing */ self::$handles['member']->postOutput(); /* Add SEO templates to the output system */ self::instance()->getClass('output')->seoTemplates = self::$_seoTemplates; //----------------------------------------- // Sort out report center early, so counts // and cache is right //----------------------------------------- $memberData =& self::$handles['member']->fetchMemberData(); $memberData['showReportCenter'] = false; $member_group_ids = array($memberData['member_group_id']); $member_group_ids = array_diff(array_merge($member_group_ids, explode(',', $memberData['mgroup_others'])), array('')); $report_center = array_diff(explode(',', ipsRegistry::$settings['report_mod_group_access']), array('')); foreach ($report_center as $groupId) { if (in_array($groupId, $member_group_ids)) { $memberData['showReportCenter'] = true; break; } } if ($memberData['showReportCenter']) { $memberData['access_report_center'] = true; $memberCache = $memberData['_cache']; $reportsCache = self::$handles['caches']->getCache('report_cache'); if (!$memberCache['report_last_updated'] || $memberCache['report_last_updated'] < $reportsCache['last_updated']) { $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('core') . '/sources/classes/reportLibrary.php', 'reportLibrary'); $reports = new $classToLoad(ipsRegistry::instance()); $totalReports = $reports->rebuildMemberCacheArray(); $memberCache['report_num'] = $totalReports; $memberData['_cache'] = $memberCache; } } /* More set up */ self::_finalizeAppData(); /* Finish fURL stuffs */ self::_fUrlComplete(); self::instance()->getClass('class_localization')->loadLanguageFile(array('public_global'), 'core'); if (IPS_AREA == 'admin') { $validationStatus = self::member()->sessionClass()->getStatus(); $validationMessage = self::member()->sessionClass()->getMessage(); if (ipsRegistry::$request['module'] != 'login' and !$validationStatus) { //----------------------------------------- // Force log in //----------------------------------------- if (ipsRegistry::$request['module'] == 'ajax') { @header("Content-type: application/json;charset=" . IPS_DOC_CHAR_SET); print json_encode(array('error' => self::instance()->getClass('class_localization')->words['acp_sessiontimeout'], '__session__expired__log__out__' => 1)); exit; } elseif (ipsRegistry::$settings['logins_over_https'] && (empty($_SERVER['HTTPS']) or $_SERVER['HTTPS'] != 'on')) { /* Bug 38301 */ ipsRegistry::getClass('output')->silentRedirect(str_replace('http://', 'https://', ipsRegistry::$settings['this_url'])); return; } else { ipsRegistry::$request['module'] = 'login'; ipsRegistry::$request['core'] = 'login'; $classToLoad = IPSLib::loadActionOverloader(IPSLib::getAppDir('core') . "/modules_admin/login/manualResolver.php", 'admin_core_login_manualResolver'); $runme = new $classToLoad(self::instance()); $runme->doExecute(self::instance()); exit; } } } else { if (IPS_AREA == 'public') { /* Set up member */ self::$handles['member']->finalizePublicMember(); /* Proper no cache key <update:1> */ ipsRegistry::$settings['noCacheKey'] = md5('$Rev: 12261 $'); /* Are we banned: Via IP Address? */ if (IPSMember::isBanned('ipAddress', self::$handles['member']->ip_address) === TRUE) { self::instance()->getClass('output')->showError('you_are_banned', 2000, true, null, 403); } /* Are we banned: By DB */ if (self::$handles['member']->getProperty('member_banned') == 1 or self::$handles['member']->getProperty('temp_ban')) { /* Don't show this message if we're viewing the warn log */ if (ipsRegistry::$request['module'] != 'ajax' or ipsRegistry::$request['section'] != 'warnings') { self::getClass('class_localization')->loadLanguageFile('public_error', 'core'); $message = ''; if (self::$handles['member']->getProperty('member_banned')) { $message = self::getClass('class_localization')->words['no_view_board_b']; } else { $ban_arr = IPSMember::processBanEntry(self::$handles['member']->getProperty('temp_ban')); /* No longer banned */ if (time() >= $ban_arr['date_end']) { self::DB()->update('members', array('temp_ban' => ''), 'member_id=' . self::$handles['member']->getProperty('member_id')); } else { $message = sprintf(self::getClass('class_localization')->words['account_susp'], self::getClass('class_localization')->getDate($ban_arr['date_end'], 'LONG', 1)); } } /* Get anything? */ if ($message) { $warn = ipsRegistry::DB()->buildAndFetch(array('select' => '*', 'from' => 'members_warn_logs', 'where' => 'wl_member=' . self::$handles['member']->getProperty('member_id') . ' AND wl_suspend<>0 AND wl_suspend<>-2', 'order' => 'wl_date DESC', 'limit' => 1)); if ($warn['wl_id'] and ipsRegistry::$settings['warn_show_own']) { $moredetails = "<a href='javascript:void(0);' onclick='warningPopup( this, {$warn['wl_id']} );'>" . self::getClass('class_localization')->words['warnings_moreinfo'] . "</a>"; } self::instance()->getClass('output')->showError("{$message} {$moredetails}", 1001, true, null, 403); } } } /* Check server load */ if (ipsRegistry::$settings['load_limit'] > 0) { $server_load = IPSDebug::getServerLoad(); if ($server_load) { $loadinfo = explode("-", $server_load); if (count($loadinfo)) { self::$server_load = $loadinfo[0]; if (self::$server_load > ipsRegistry::$settings['load_limit']) { self::instance()->getClass('output')->showError('server_too_busy', 2001); } } } } /* Specific Ajax Check */ if (IPS_IS_AJAX and ipsRegistry::$request['section'] != 'warnings') { if (self::$handles['member']->getProperty('g_view_board') != 1 || ipsRegistry::$settings['board_offline'] && !self::$handles['member']->getProperty('g_access_offline')) { @header("Content-type: application/json;charset=" . IPS_DOC_CHAR_SET); print json_encode(array('error' => 'no_permission', '__board_offline__' => 1)); exit; } } /* Other public check */ if (IPB_THIS_SCRIPT == 'public' and IPS_ENFORCE_ACCESS === FALSE and (ipsRegistry::$request['section'] != 'login' and ipsRegistry::$request['section'] != 'lostpass' and IPS_IS_AJAX === FALSE and ipsRegistry::$request['section'] != 'rss' and ipsRegistry::$request['section'] != 'attach' and ipsRegistry::$request['module'] != 'task' and ipsRegistry::$request['section'] != 'captcha')) { //----------------------------------------- // Permission to see the board? //----------------------------------------- if (self::$handles['member']->getProperty('g_view_board') != 1) { self::getClass('output')->showError('no_view_board', 1000, null, null, 403); } //-------------------------------- // Is the board offline? //-------------------------------- if (ipsRegistry::$settings['board_offline'] == 1 and !IPS_IS_SHELL) { if (self::$handles['member']->getProperty('g_access_offline') != 1) { ipsRegistry::$settings['no_reg'] = 1; self::getClass('output')->showBoardOffline(); } } //----------------------------------------- // Do we have a display name? //----------------------------------------- if (!(ipsRegistry::$request['section'] == 'register' and (ipsRegistry::$request['do'] == 'complete_login' or ipsRegistry::$request['do'] == 'complete_login_do'))) { if (!self::$handles['member']->getProperty('members_display_name')) { $pmember = self::DB()->buildAndFetch(array('select' => '*', 'from' => 'members_partial', 'where' => "partial_member_id=" . self::$handles['member']->getProperty('member_id'))); if (!$pmember['partial_member_id']) { $pmember = array('partial_member_id' => self::$handles['member']->getProperty('member_id'), 'partial_date' => time(), 'partial_email_ok' => self::$handles['member']->getProperty('email') == self::$handles['member']->getProperty('name') . '@' . self::$handles['member']->getProperty('joined') ? 0 : 1); self::DB()->insert('members_partial', $pmember); $pmember['partial_id'] = self::DB()->getInsertId(); } self::instance()->getClass('output')->silentRedirect(ipsRegistry::$settings['base_url'] . 'app=core&module=global§ion=register&do=complete_login&mid=' . self::$handles['member']->getProperty('member_id') . '&key=' . $pmember['partial_date']); } } //-------------------------------- // Is log in enforced? //-------------------------------- if (!(defined('IPS_IS_SHELL') && IPS_IS_SHELL === TRUE) && (!IPS_IS_MOBILE_APP && self::$handles['member']->getProperty('member_group_id') == ipsRegistry::$settings['guest_group'] and ipsRegistry::$settings['force_login'] == 1 && !in_array(ipsRegistry::$request['section'], array('register', 'privacy', 'unsubscribe')))) { if (ipsRegistry::$settings['logins_over_https'] and (!$_SERVER['HTTPS'] or $_SERVER['HTTPS'] != 'on')) { //----------------------------------------- // Set referrer //----------------------------------------- if (!my_getenv('HTTP_REFERER') or stripos(my_getenv('HTTP_REFERER'), ipsRegistry::$settings['board_url']) === false) { $http_referrer = (strtolower($_SERVER['HTTPS']) == 'on' ? "https://" : "http://") . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; } else { $http_referrer = my_getenv('HTTP_REFERER'); } self::instance()->getClass('output')->silentRedirect(str_replace('http://', 'https://', ipsRegistry::$settings['base_url']) . 'app=core&module=global§ion=login&referer=' . urlencode($http_referrer)); } ipsRegistry::$request['app'] = 'core'; ipsRegistry::$request['module'] = 'login'; ipsRegistry::$request['core'] = 'login'; ipsRegistry::$request['referer'] = ipsRegistry::$request['referer'] ? ipsRegistry::$request['referer'] : (strtolower($_SERVER['HTTPS']) == 'on' ? "https://" : "http://") . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; if (is_file(DOC_IPS_ROOT_PATH . '/' . PUBLIC_DIRECTORY . '/style_css/' . ipsRegistry::getClass('output')->skin['_csscacheid'] . '/ipb_login_register.css')) { ipsRegistry::getClass('output')->addToDocumentHead('importcss', ipsRegistry::$settings['css_base_url'] . 'style_css/' . ipsRegistry::getClass('output')->skin['_csscacheid'] . '/ipb_login_register.css'); } $classToLoad = IPSLib::loadActionOverloader(IPSLib::getAppDir('core') . "/modules_public/global/login.php", 'public_core_global_login'); $runme = new $classToLoad(self::instance()); $runme->doExecute(self::instance()); exit; } } /* Have we entered an incorrect FURL that has no match? */ if (ipsRegistry::$settings['use_friendly_urls'] and self::$_noFurlMatch === true) { self::getClass('output')->showError('incorrect_furl', 404, null, null, 404); } else { if (isset(ipsRegistry::$request['act']) and ipsRegistry::$request['act'] == 'rssout') { self::getClass('output')->showError('incorrect_furl', 404, null, null, 404); } } /* Track search engine visits */ if (!IPS_IS_TASK and $_SERVER['HTTP_REFERER']) { seoTracker::track($_SERVER['HTTP_REFERER'], self::$settings['query_string_real'], self::$handles['member']->getProperty('member_id')); } } } IPSDebug::setMemoryDebugFlag("Registry initialized"); }
/** * Action: Issue Warning */ public function save() { //----------------------------------------- // Init //----------------------------------------- $points = 0; $mq = 0; $mq_unit = 'd'; $rpa = 0; $rpa_unit = 'd'; $suspend = 0; $suspend_unit = 'd'; $banGroup = 0; $removePoints = 0; $removePointsUnit = 'd'; //----------------------------------------- // Validate //----------------------------------------- $errors = array(); if ($this->request['reason'] === '') { /* No reason selected */ $errors['reason'] = $this->lang->words['warnings_err_reason']; } else { $reason = intval($this->request['reason']); /* "Other" reason selected */ if (!$reason) { /* Check we're actually allowed to use it */ if (!$this->memberData['g_access_cp'] and !$this->settings['warnings_enable_other']) { /* Nope */ $errors['reason'] = $this->lang->words['warnings_err_reason']; } else { /* If we select "Other", we determine the number of points and when they expire */ $points = floatval($this->request['points']); $removePoints = intval($this->request['remove']); $removePointsUnit = $this->request['remove_unit'] == 'h' ? 'h' : 'd'; } } else { $reason = $this->reasons[$reason]; /* Check it's valid */ if (!$reason['wr_id']) { /* Nope */ $errors['reason'] = $this->lang->words['warnings_err_reason']; } else { /* Can we override the number of points for this reason? */ if ($this->memberData['g_access_cp'] or $reason['wr_points_override']) { // Yes, get value from input $points = floatval($this->request['points']); } else { // No, take whatever the reason has set $points = $reason['wr_points']; } /* Can we override when the points expire? */ if ($this->memberData['g_access_cp'] or $reason['wr_remove_override']) { // Yes, get value from input $removePoints = intval($this->request['remove']); $removePointsUnit = $this->request['remove_unit'] == 'h' ? 'h' : 'd'; } else { // No, take whatever the reason has set $removePoints = intval($reason['wr_remove']); $removePointsUnit = $reason['wr_remove_unit']; } } $reason = $reason['wr_id']; } /* Now let's get the action */ $newPointLevel = floatval($this->_member['warn_level'] + $points); $action = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'members_warn_actions', 'where' => "wa_points<={$newPointLevel}", 'order' => 'wa_points DESC', 'limit' => 1)); if ($action) { /* We have an action. Can we override it's punishment? */ if ($action['wa_override']) { // Yes, get values from input $mq = $this->request['mq_perm'] ? -1 : intval($this->request['mq']); $mq_unit = $this->request['mq_unit']; $rpa = $this->request['rpa_perm'] ? -1 : intval($this->request['rpa']); $rpa_unit = $this->request['rpa_unit']; $suspend = $this->request['suspend_perm'] ? -1 : intval($this->request['suspend']); $suspend_unit = $this->request['suspend_unit']; $banGroup = $this->request['ban_group'] ? intval($this->request['ban_group_id']) : 0; } else { // No, do whatever the action says $mq = intval($action['wa_mq']); $mq_unit = $action['wa_mq_unit']; $rpa = intval($action['wa_rpa']); $rpa_unit = $action['wa_rpa_unit']; $suspend = intval($action['wa_suspend']); $suspend_unit = $action['wa_suspend_unit']; $banGroup = intval($action['wa_ban_group']); } } else { /* We don't have an action - are we allowed to give a custom punishment? */ if ($this->memberData['g_access_cp'] or $this->settings['warning_custom_noaction']) { // Yes, get values from input $mq = $this->request['mq_perm'] ? -1 : intval($this->request['mq']); $mq_unit = $this->request['mq_unit']; $rpa = $this->request['rpa_perm'] ? -1 : intval($this->request['rpa']); $rpa_unit = $this->request['rpa_unit']; $suspend = $this->request['suspend_perm'] ? -1 : intval($this->request['suspend']); $suspend_unit = $this->request['suspend_unit']; $banGroup = $this->request['ban_group'] ? intval($this->request['ban_group_id']) : 0; } else { // We're not allowed to give a punishment so this is a verbal warning only. // The values we set earlier during init are fine } } } if (!empty($errors)) { return $this->form($errors); } //----------------------------------------- // Parse //----------------------------------------- $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite'); $editor = new $classToLoad(); $noteForMember = $editor->process($_POST['note_member']); $noteForMods = $editor->process($_POST['note_mods']); //----------------------------------------- // Save Log //----------------------------------------- /* If our points are going to expire, woprk out exactly when */ $expireDate = 0; if ($removePoints) { IPSTime::setTimestamp(time()); if ($removePointsUnit == 'h') { IPSTime::add_hours($removePoints); } else { IPSTime::add_days($removePoints); } $expireDate = IPSTime::getTimestamp(); } /* Log */ $warning = array('wl_member' => $this->_member['member_id'], 'wl_moderator' => $this->memberData['member_id'], 'wl_date' => time(), 'wl_reason' => $reason, 'wl_points' => $points, 'wl_note_member' => $noteForMember, 'wl_note_mods' => $noteForMods, 'wl_mq' => $mq, 'wl_mq_unit' => $mq_unit, 'wl_rpa' => $rpa, 'wl_rpa_unit' => $rpa_unit, 'wl_suspend' => $suspend, 'wl_suspend_unit' => $suspend_unit, 'wl_ban_group' => $banGroup, 'wl_expire' => $removePoints, 'wl_expire_unit' => $removePointsUnit, 'wl_acknowledged' => $this->settings['warnings_acknowledge'] ? 0 : 1, 'wl_content_app' => trim($this->request['from_app']), 'wl_content_id1' => $this->request['from_id1'], 'wl_content_id2' => $this->request['from_id2'], 'wl_expire_date' => $expireDate); /* Data Hook Location */ $warning['actionData'] = $action; $warning['reasonsData'] = $this->reasons; IPSLib::doDataHooks($warning, 'memberWarningPre'); unset($warning['actionData'], $warning['reasonsData']); $this->DB->insert('members_warn_logs', $warning); $warning['wl_id'] = $this->DB->getInsertId(); /* Data Hook Location */ $warning['actionData'] = $action; $warning['reasonsData'] = $this->reasons; IPSLib::doDataHooks($warning, 'memberWarningPost'); unset($warning['actionData'], $warning['reasonsData']); //----------------------------------------- // Actually do it //----------------------------------------- $update = array(); /* Add Points */ if ($points) { $update['warn_level'] = $this->_member['warn_level'] + $points; } /* Set Punishments */ if ($mq) { $update['mod_posts'] = $mq == -1 ? 1 : IPSMember::processBanEntry(array('unit' => $mq_unit, 'timespan' => $mq)); } if ($rpa) { $update['restrict_post'] = $rpa == -1 ? 1 : IPSMember::processBanEntry(array('unit' => $rpa_unit, 'timespan' => $rpa)); } if ($suspend) { if ($suspend == -1) { $update['member_banned'] = 1; } else { $update['temp_ban'] = IPSMember::processBanEntry(array('unit' => $suspend_unit, 'timespan' => $suspend)); } } if ($banGroup > 0) { if (!$this->caches['group_cache'][$banGroup]['g_access_cp'] and !$this->caches['group_cache'][$banGroup]['g_is_supmod'] and $banGroup != $this->settings['guest_group']) { $update['member_group_id'] = $banGroup; } } if ($this->settings['warnings_acknowledge']) { $update['unacknowledged_warnings'] = 1; } /* Save */ if (!empty($update)) { IPSMember::save($this->_member['member_id'], array('core' => $update)); } //----------------------------------------- // Work out where this warning came from //----------------------------------------- if ($warning['wl_content_app'] and IPSLib::appIsInstalled($warning['wl_content_app'])) { $file = IPSLib::getAppDir($warning['wl_content_app']) . '/extensions/warnings.php'; if (is_file($file)) { $classToLoad = IPSLib::loadLibrary($file, 'warnings_' . $warning['wl_content_app'], $warning['wl_content_app']); if (class_exists($classToLoad) and method_exists($classToLoad, 'getContentUrl')) { $object = new $classToLoad(); $content = $object->getContentUrl($warning); } } } //----------------------------------------- // Send notifications //----------------------------------------- /* Init */ $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications'); $notifyLibrary = new $classToLoad($this->registry); /* Send to member being warned */ if ($this->settings['warnings_acknowledge'] or $noteForMember) { try { $notifyLibrary->setMember($this->_member); $notifyLibrary->setFrom($this->memberData); $notifyLibrary->setNotificationKey('warning'); $notifyLibrary->setNotificationUrl("app=members&module=profile§ion=warnings&member={$this->_member['member_id']}"); $notifyLibrary->setNotificationTitle(sprintf($this->lang->words['warnings_notify'], $this->registry->output->buildUrl("app=members&module=profile§ion=warnings&member={$this->_member['member_id']}"))); $notifyLibrary->setNotificationText(sprintf($this->lang->words['warnings_notify_text'], $this->_member['members_display_name'], $this->memberData['members_display_name'], $reason ? $this->reasons[$reason]['wr_name'] : $this->lang->words['warnings_reasons_other'], $noteForMember ? sprintf($this->lang->words['warnings_notify_member_note'], $noteForMember) : '', $this->settings['warn_show_own'] ? sprintf($this->lang->words['warnings_notify_view_link'], $this->registry->output->buildUrl("app=members&module=profile§ion=warnings&member={$this->_member['member_id']}")) : '')); $notifyLibrary->sendNotification(); } catch (Exception $e) { } } /* And all mods that can warn and are super_mods (split this up because of: @link http://community.invisionpower.com/tracker/issue-36960-bad-warn-query/ */ $mods = array(); $mids = array(); $gids = array(); $canWarnMids = array(); $canWarnGids = array(); $this->DB->build(array('select' => 'member_id, allow_warn', 'from' => 'moderators', 'where' => 'is_group=0')); $this->DB->execute(); while ($row = $this->DB->fetch()) { $mids[$row['member_id']] = $row['member_id']; if ($row['allow_warn']) { $canWarnMids[] = $row['member_id']; } } $this->DB->build(array('select' => 'group_id', 'from' => 'moderators', 'where' => 'is_group=1 AND allow_warn=1')); $this->DB->execute(); while ($row = $this->DB->fetch()) { $gids[] = $row['group_id']; $canWarnGids[] = $row['group_id']; } foreach ($this->caches['group_cache'] as $id => $row) { if ($row['g_is_supmod']) { $gids[] = $row['g_id']; } } /* Limit this because it could go a bit wrong innit */ if (count($gids)) { $this->DB->build(array('select' => 'member_id', 'from' => 'members', 'where' => 'member_group_id IN (' . implode(',', $gids) . ')', 'limit' => array(0, 750))); $this->DB->execute(); while ($row = $this->DB->fetch()) { $mids[$row['member_id']] = $row['member_id']; } } $_mods = IPSMember::load($mids, 'all'); if (count($_mods)) { foreach ($_mods as $id => $row) { if ($row['member_id'] == $this->memberData['member_id']) { continue; } if ($row['g_is_supmod'] or in_array($row['member_id'], $canWarnMids) or in_array($row['member_group_id'], $canWarnGids)) { $mods[$row['member_id']] = $row; } } } if (count($mods)) { $notifyLibrary = new $classToLoad($this->registry); $notifyLibrary->setMultipleRecipients($mods); $notifyLibrary->setFrom($this->memberData); $notifyLibrary->setNotificationKey('warning_mods'); $notifyLibrary->setNotificationUrl("app=members&module=profile§ion=warnings&member={$this->_member['member_id']}"); $notifyLibrary->setNotificationTitle(sprintf($this->lang->words['warnings_notify_mod'], $this->_member['members_display_name'], $this->registry->output->buildUrl("app=members&module=profile§ion=warnings&member={$this->_member['member_id']}"), $this->memberData['members_display_name'])); $notifyLibrary->setNotificationText(sprintf($this->lang->words['warnings_notify_text_mod'], $this->_member['members_display_name'], $this->memberData['members_display_name'], $this->registry->output->buildUrl("app=members&module=profile§ion=warnings&member={$this->_member['member_id']}"))); try { $notifyLibrary->sendNotification(); } catch (Exception $e) { } } //----------------------------------------- // Boink //----------------------------------------- if (empty($content['url'])) { $this->registry->getClass('output')->redirectScreen($this->lang->words['warnings_done'], $this->settings['base_url'] . 'app=members&module=profile&section=warnings&member=' . $this->_member['member_id']); } else { $this->registry->getClass('output')->redirectScreen($this->lang->words['warnings_done'], $content['url']); } }
/** * Main ACP member form * * @param array Member data * @return string HTML */ public function acp_member_form_main($member, $tabID) { $masks = array(); ipsRegistry::DB()->build(array('select' => '*', 'from' => 'forum_perms', 'order' => 'perm_name')); ipsRegistry::DB()->execute(); while ($data = ipsRegistry::DB()->fetch()) { $masks[] = array($data['perm_id'], $data['perm_name']); } $_restrict_tick = ''; $_restrict_timespan = ''; $_restrict_units = ''; $units = array(0 => array('h', $this->lang->words['m_hours']), 1 => array('d', $this->lang->words['m_days'])); if ($member['restrict_post'] == 1) { $_restrict_tick = 'checked="checked"'; } elseif ($member['restrict_post'] > 0) { $rest_arr = IPSMember::processBanEntry($member['restrict_post']); $hours = ceil(($rest_arr['date_end'] - time()) / 3600); if ($hours < 0) { $rest_arr['units'] = ''; $rest_arr['timespan'] = ''; } else { if ($hours > 24 and $hours / 24 == ceil($hours / 24)) { $rest_arr['units'] = 'd'; $rest_arr['timespan'] = $hours / 24; } else { $rest_arr['units'] = 'h'; $rest_arr['timespan'] = $hours; } } } $_restrict_timespan = ipsRegistry::getClass('output')->formSimpleInput('post_timespan', $rest_arr['timespan']); $_restrict_units = ipsRegistry::getClass('output')->formDropdown('post_units', $units, $rest_arr['units']); $_mod_tick = ''; $_mod_timespan = ''; $_mod_units = ''; if ($member['mod_posts'] == 1) { $_mod_tick = 'checked="checked"'; } elseif ($member['mod_posts'] > 0) { $mod_arr = IPSMember::processBanEntry($member['mod_posts']); $hours = ceil(($mod_arr['date_end'] - time()) / 3600); if ($hours < 0) { $mod_arr['units'] = ''; $mod_arr['timespan'] = ''; } else { if ($hours > 24 and $hours / 24 == ceil($hours / 24)) { $mod_arr['units'] = 'd'; $mod_arr['timespan'] = $hours / 24; } else { $mod_arr['units'] = 'h'; $mod_arr['timespan'] = $hours; } } } $_mod_timespan = ipsRegistry::getClass('output')->formSimpleInput('mod_timespan', $mod_arr['timespan']); $_mod_units = ipsRegistry::getClass('output')->formDropdown('mod_units', $units, $mod_arr['units']); $form_override_masks = ipsRegistry::getClass('output')->formMultiDropdown("org_perm_id[]", $masks, explode(",", $member['org_perm_id']), 8, 'org_perm_id'); $form_posts = ipsRegistry::getClass('output')->formInput("posts", $member['posts']); $IPBHTML = ""; $IPBHTML .= <<<EOF \t \t<div id='tab_MEMBERS_{$tabID}_content'> \t\t<table class='ipsTable double_pad'> \t\t\t \t\t\t<tr> \t\t\t\t<th colspan='2'>{$this->lang->words['sm_settings']}</th> \t\t\t</tr> \t\t\t<tr> \t\t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['mem_posts']}</strong></td> \t\t\t\t<td class='field_field'> \t\t\t\t\t<span id='MF__posts'>{$form_posts}</span> \t\t\t\t</td> \t\t\t</tr> \t\t</table> \t \t\t<table class='ipsTable double_pad'> \t\t\t<tr> \t\t\t\t<th colspan='2'>{$this->lang->words['sm_access']}</th> \t\t\t</tr> \t\t\t<tr> \t\t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['m_overrride']}</strong></td> \t\t\t\t<td class='field_field'> \t\t\t\t\t<span id='MF__ogpm'>{$form_override_masks}</span> \t\t\t\t</td> \t\t\t</tr> \t\t\t<tr> \t\t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['m_modprev']}</strong></td> \t\t\t\t<td class='field_field'> \t\t\t\t\t<input type='checkbox' name='mod_indef' id='mod_indef' value='1' {$_mod_tick}> {$this->lang->words['m_modindef']} \t\t\t\t\t<br /> \t\t\t\t\t{$this->lang->words['m_orfor']} \t\t\t\t\t{$_mod_timespan} {$_mod_units} \t\t\t\t</td> \t\t\t</tr> \t\t\t<tr> \t\t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['m_restrict']}</strong></td> \t\t\t\t<td class='field_field'> \t\t\t\t\t<input type='checkbox' name='post_indef' id='post_indef' value='1' {$_restrict_tick}> {$this->lang->words['m_restrictindef']} \t\t\t\t\t<br /> \t\t\t\t\t{$this->lang->words['m_orfor']} \t\t\t\t\t{$_restrict_timespan} {$_restrict_units} \t\t\t\t</td> \t\t\t</tr> \t\t</table> \t</div> EOF; return $IPBHTML; }
/** * Action: Get actions for warning form */ public function getActionsForForm() { //----------------------------------------- // Init //----------------------------------------- $id = intval($this->request['id']); $manuallySetPoints = TRUE; $setPoints = ''; $allowCustomPunishment = $this->settings['warning_custom_noaction']; $setPunishment = $this->lang->words['warnings_verbal_only']; $mq = 0; $mq_unit = 'd'; $rpa = 0; $rpa_unit = 'd'; $suspend = 0; $suspend_unit = 'd'; $banGroup = FALSE; $allowCustomRemovePoints = TRUE; $removePoints = ''; $removePointsUnit = 'd'; //----------------------------------------- // Fetch reason //----------------------------------------- if ($id != 0) { $reason = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'members_warn_reasons', 'where' => "wr_id={$id}")); $manuallySetPoints = $reason['wr_points_override']; $setPoints = is_numeric($this->request['points']) ? intval($this->request['points']) : $reason['wr_points']; $removePoints = $reason['wr_remove']; $removePointsUnit = $reason['wr_remove_unit']; $allowCustomRemovePoints = $reason['wr_remove_override']; } elseif ($this->request['points'] !== '') { $setPoints = $this->request['points']; } //----------------------------------------- // Load Member //----------------------------------------- $member = IPSMember::load(intval($this->request['member'])); if (!$member['member_id']) { $this->returnJsonError("NO_MEMBER"); } //----------------------------------------- // Are they already being punished? //----------------------------------------- $currentPunishments = array(); foreach (array('mq' => 'mod_posts', 'rpa' => 'restrict_post', 'suspend' => 'temp_ban') as $k => $mk) { if ($member[$mk]) { if ($member[$mk] == 1) { $currentPunishments[$k] = sprintf($this->lang->words['warnings_already_' . $k . '_perm'], $member['members_display_name']); } else { $_processed = IPSMember::processBanEntry($member[$mk]); $currentPunishments[$k] = sprintf($this->lang->words['warnings_already_' . $k . '_time'], $member['members_display_name'], $this->lang->getDate($_processed['date_end'], 'SHORT')); } } } //----------------------------------------- // Okay, so do we have an action here? //----------------------------------------- $newPointLevel = floatval($member['warn_level'] + $setPoints); $action = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'members_warn_actions', 'where' => "wa_points<={$newPointLevel}", 'order' => 'wa_points DESC', 'limit' => 1)); if ($action) { $setPunishment = array(); foreach (array('mq', 'rpa', 'suspend') as $k) { if ($action['wa_' . $k]) { if ($action['wa_' . $k] == -1) { $text = sprintf($this->lang->words['warnings_' . $k], $this->lang->words['warnings_permanently']); } else { $text = sprintf($this->lang->words['warnings_' . $k], sprintf($this->lang->words['warnings_for'], $action['wa_' . $k], $this->lang->words['warnings_time_' . $action['wa_' . $k . '_unit']])); } if ($currentPunishments[$k]) { $text .= " <span class='error'>{$currentPunishments[$k]}{$this->lang->words['warnings_already_autochange']}</span>"; } $setPunishment[] = $text; } } $setPunishment = empty($setPunishment) ? $this->lang->words['warnings_verbal_only'] : implode('<br />', $setPunishment); $allowCustomPunishment = $action['wa_override']; $mq = $action['wa_mq']; $mq_unit = $action['wa_mq_unit']; $rpa = $action['wa_rpa']; $rpa_unit = $action['wa_rpa_unit']; $suspend = $action['wa_suspend']; $suspend_unit = $action['wa_suspend_unit']; $banGroup = $action['wa_ban_group']; } $this->returnJsonArray(array('id' => $id, 'manuallySetPoints' => $this->memberData['g_access_cp'] ? TRUE : $manuallySetPoints, 'setPoints' => $setPoints, 'allowCustomPunishment' => $this->memberData['g_access_cp'] ? TRUE : $allowCustomPunishment, 'setPunishment' => $setPunishment, 'allowCustomRemovePoints' => $this->memberData['g_access_cp'] ? TRUE : $allowCustomRemovePoints, 'removePoints' => $removePoints, 'removePointsUnit' => $removePointsUnit, 'mq' => $mq, 'mq_unit' => $mq_unit, 'rpa' => $rpa, 'rpa_unit' => $rpa_unit, 'suspend' => $suspend, 'suspend_unit' => $suspend_unit, 'banGroup' => $banGroup)); }
/** * Checks to see if this member is forced to have their posts * moderated * * @access private * @param string Type of post (new, reply, edit, poll) * @return boolean Whether to PUBLISH this topic or not */ private function _checkPostModeration($type) { /* Does this member have mod_posts enabled? */ if ($this->memberData['mod_posts']) { /* Mod Queue Forever */ if ($this->memberData['mod_posts'] == 1) { return FALSE; } else { /* Do we need to remove the mod queue for this user? */ $mod_arr = IPSMember::processBanEntry($this->memberData['mod_posts']); /* Yes, they are ok now */ if (time() >= $mod_arr['date_end']) { IPSMember::save($this->memberData['member_id'], array('core' => array('mod_posts' => 0))); } else { return FALSE; } } } /* Group can bypass mod queue */ if ($this->memberData['g_avoid_q']) { return TRUE; } /* Is the member's group moderated? */ if ($this->_postClass->checkGroupIsPostModerated($this->memberData) === TRUE) { return FALSE; } /* Check to see if this forum has moderation enabled */ $forum = $this->_postClass->getForumData(); switch (intval($forum['preview_posts'])) { default: case 0: return TRUE; break; case 1: return FALSE; break; case 2: return $type == 'new' ? FALSE : TRUE; break; case 3: return $type == 'reply' ? FALSE : TRUE; break; } /* Our post can be seen! */ return TRUE; }
/** * Adds a new profile comment to the database * * @access public * @param integer $comment_for_id Member id that this comment is for * @param string $comment Text of the comment to create * @return string Error key on failure, blank on success */ public function addCommentToDB($comment_for_id, $comment) { /* Load the member that this comment is for */ $member = IPSMember::load($comment_for_id); /* Make sure we found a member */ if (!$member['member_id']) { return 'error'; } /* Are we allowed to comment? */ if (!$this->memberData['g_reply_other_topics']) { return 'nopermission'; } if ($this->memberData['restrict_post']) { if ($this->memberData['restrict_post'] == 1) { return 'nopermission'; } $post_arr = IPSMember::processBanEntry($this->memberData['restrict_post']); if (time() >= $post_arr['date_end']) { /* Update this member's profile */ IPSMember::save($this->memberData['member_id'], array('core' => array('restrict_post' => 0))); } else { return 'nopermission'; } } /* Does this member have mod_posts enabled? */ $comment_approved = 1; if ($this->memberData['mod_posts']) { if ($this->memberData['mod_posts'] == 1) { $comment_approved = 0; } else { $mod_arr = IPSMember::processBanEntry($this->memberData['mod_posts']); if (time() >= $mod_arr['date_end']) { /* Update this member's profile */ IPSMember::save($this->memberData['member_id'], array('core' => array('mod_posts' => 0))); } else { $comment_approved = 0; } } } /* Format the comment */ $comment = IPSText::truncate($comment, 400); $comment = preg_replace("#(\r\n|\r|\n|<br />|<br>){1,}#s", "\n", $comment); $comment = trim(IPSText::getTextClass('bbcode')->stripBadWords($comment)); /* Make sure we still have a comment */ if (!$comment) { return 'error-no-comment'; } /* Comment requires approval? */ if ($member['pp_setting_moderate_comments'] and $member['member_id'] != $this->memberData['member_id']) { $comment_approved = 0; } /* Member is ignoring you! */ if ($comment_approved) { $_you_are_being_ignored = explode(",", $member['ignored_users']); if (is_array($_you_are_being_ignored) and count($_you_are_being_ignored)) { if (in_array($this->memberData['member_id'], $_you_are_being_ignored)) { $comment_approved = 0; } } } /* Add comment to the DB... */ $this->DB->insert('profile_comments', array('comment_for_member_id' => $comment_for_id, 'comment_by_member_id' => $this->memberData['member_id'], 'comment_date' => time(), 'comment_ip_address' => $this->member->ip_address, 'comment_approved' => $comment_approved, 'comment_content' => nl2br($comment))); $new_id = $this->DB->getInsertId(); /* Send notifications.. */ if (!$comment_approved and $member['pp_setting_notify_comments'] and $member['member_id'] != $this->memberData['member_id']) { IPSText::getTextClass('email')->getTemplate("new_comment_request", $member['language']); IPSText::getTextClass('email')->buildMessage(array('MEMBERS_DISPLAY_NAME' => $member['members_display_name'], 'COMMENT_NAME' => $this->memberData['members_display_name'], 'LINK' => $this->settings['board_url'] . '/index.' . $this->settings['php_ext'] . '?showuser='******'member_id'])); $message = IPSText::getTextClass('email')->message; $subject = IPSText::getTextClass('email')->subject; $to = $member; $from = $this->memberData; $return_msg = 'pp_comment_added_mod'; } else { if ($member['pp_setting_notify_comments'] and $member['member_id'] != $this->memberData['member_id']) { IPSText::getTextClass('email')->getTemplate("new_comment_added", $member['language']); IPSText::getTextClass('email')->buildMessage(array('MEMBERS_DISPLAY_NAME' => $member['members_display_name'], 'COMMENT_NAME' => $this->memberData['members_display_name'], 'LINK' => $this->settings['board_url'] . '/index.' . $this->settings['php_ext'] . '?showuser='******'member_id'])); $message = IPSText::getTextClass('email')->message; $subject = IPSText::getTextClass('email')->subject; $to = $member; $from = $this->memberData; $return_msg = ''; } } /* Got anything to send? */ if ($message and $subject) { /* Email ? */ if ($member['pp_setting_notify_comments'] == 'email' or $member['pp_setting_notify_comments'] and $member['members_disable_pm']) { IPSText::getTextClass('email')->subject = $subject; IPSText::getTextClass('email')->message = $message; IPSText::getTextClass('email')->to = $to['email']; IPSText::getTextClass('email')->sendMail(); } else { if ($member['pp_setting_notify_comments'] != 'none') { require_once IPSLib::getAppDir('members') . '/sources/classes/messaging/messengerFunctions.php'; $this->messengerFunctions = new messengerFunctions($this->registry); try { $this->messengerFunctions->sendNewPersonalTopic($to['member_id'], $from['member_id'], array(), $subject, IPSText::getTextClass('editor')->method == 'rte' ? nl2br($message) : $message, array('origMsgID' => 0, 'fromMsgID' => 0, 'postKey' => md5(microtime()), 'trackMsg' => 0, 'addToSentFolder' => 0, 'hideCCUser' => 0, 'forcePm' => 1, 'isSystem' => 1)); } catch (Exception $error) { $msg = $error->getMessage(); $toMember = IPSMember::load($toMemberID, 'core', 'displayname'); if (strstr($msg, 'BBCODE_')) { $msg = str_replace('BBCODE_', $msg, 10258); $this->registry->output->showError($msg); } else { if (isset($this->lang->words['err_' . $msg])) { $this->lang->words['err_' . $msg] = $this->lang->words['err_' . $msg]; $this->lang->words['err_' . $msg] = str_replace('#NAMES#', implode(",", $this->messengerFunctions->exceptionData), $this->lang->words['err_' . $msg]); $this->lang->words['err_' . $msg] = str_replace('#TONAME#', $toMember['members_display_name'], $this->lang->words['err_' . $msg]); $this->lang->words['err_' . $msg] = str_replace('#FROMNAME#', $this->memberData['members_display_name'], $this->lang->words['err_' . $msg]); $this->registry->output->showError('err_' . $msg, 10259); } else { $_msgString = $this->lang->words['err_UNKNOWN'] . ' ' . $msg; $this->registry->output->showError('err_UNKNOWN', 10260); } } } } } } return $return_msg; }
/** * Process the entries for saving and return * * @author Brandon Farber * @return array Multi-dimensional array (core, extendedProfile) for saving */ public function getForSave() { $return = array('core' => array(), 'extendedProfile' => array()); $return['core']['posts'] = intval(ipsRegistry::$request['posts']); $return['core']['restrict_post'] = ipsRegistry::$request['post_indef'] ? 1 : (ipsRegistry::$request['post_timespan'] > 0 ? IPSMember::processBanEntry(array('timespan' => intval(ipsRegistry::$request['post_timespan']), 'unit' => ipsRegistry::$request['post_units'])) : ''); $return['core']['mod_posts'] = ipsRegistry::$request['mod_indef'] ? 1 : (ipsRegistry::$request['mod_timespan'] > 0 ? IPSMember::processBanEntry(array('timespan' => intval(ipsRegistry::$request['mod_timespan']), 'unit' => ipsRegistry::$request['mod_units'])) : ''); $return['core']['org_perm_id'] = ipsRegistry::$request['org_perm_id'] ? ',' . implode(",", ipsRegistry::$request['org_perm_id']) . ',' : ''; return $return; }
/** * Member editing screen * * @param array Member data * @param array Content * @param string Menu * @param array Notification data * @return string HTML */ public function member_view($member, $content, $menu, $notifications) { // Let's get to work..... :/ $_m_groups = array(); $_m_groups_others = array(); $member['_cache'] = @unserialize($member['members_cache']); foreach (ipsRegistry::cache()->getCache('group_cache') as $id => $data) { // If we are viewing our own profile, don't show non admin groups as a primary group option to prevent the user from // accidentally removing their own ACP access. Groups without ACP access can still be selected as secondary groups. if ($member['member_id'] == $this->memberData['member_id']) { //----------------------------------------- // If we can't access cp via primary group //----------------------------------------- if (!$this->caches['group_cache'][$member['member_group_id']]['g_access_cp']) { //----------------------------------------- // Can this group access cp? //----------------------------------------- if (!$data['g_access_cp']) { $_m_groups[] = array($data['g_id'], $data['g_title']); $_m_groups_others[] = array($data['g_id'], $data['g_title']); } else { $_m_groups_others[] = array($data['g_id'], $data['g_title']); } } else { if (!$data['g_access_cp']) { $_m_groups_others[] = array($data['g_id'], $data['g_title']); } else { $_m_groups[] = array($data['g_id'], $data['g_title']); $_m_groups_others[] = array($data['g_id'], $data['g_title']); } } } else { $_m_groups[] = array($data['g_id'], $data['g_title']); $_m_groups_others[] = array($data['g_id'], $data['g_title']); } } $years = array(array(0, '----')); $months = array(array(0, '--------')); $days = array(array(0, '--')); foreach (range(1, 31) as $_day) { $days[] = array($_day, $_day); } foreach (array_reverse(range(date('Y') - 100, date('Y'))) as $_year) { $years[] = array($_year, $_year); } foreach (range(1, 12) as $_month) { $months[] = array($_month, $this->lang->words['M_' . $_month]); } $time_zones = array(); foreach ($this->lang->words as $k => $v) { if (strpos($k, 'time_') === 0) { if (preg_match("/[\\-0-9]/", substr($k, 5))) { $offset = floatval(substr($k, 5)); $time_zones[] = array($offset, $v); } } } $languages = array(); foreach (ipsRegistry::cache()->getCache('lang_data') as $language) { $languages[] = array($language['lang_id'], $language['lang_title']); } $pm_options = array(0 => array(0, $this->lang->words['mem_edit_pm_no']), 1 => array(1, $this->lang->words['mem_edit_pm_yes']), 2 => array(2, $this->lang->words['mem_edit_pm_yes_really'])); $_skin_list = $this->registry->output->generateSkinDropdown(); array_unshift($_skin_list, array(0, $this->lang->words['sm_skinnone'])); $skinList = ipsRegistry::getClass('output')->formDropdown("skin", $_skin_list, $member['skin']); $sigHtmlChecked = $member['bw_html_sig'] ? 'checked="checked"' : ''; $form_member_group_id = ipsRegistry::getClass('output')->formDropdown("member_group_id", $_m_groups, $member['member_group_id']); $form_mgroup_others = ipsRegistry::getClass('output')->formMultiDropdown("mgroup_others[]", $_m_groups_others, explode(",", $member['mgroup_others']), 8, 'mgroup_others'); $form_title = ipsRegistry::getClass('output')->formInput("title", $member['title']); $form_warn = ipsRegistry::getClass('output')->formInput("warn_level", $member['warn_level']); $_form_year = ipsRegistry::getClass('output')->formDropdown("bday_year", $years, $member['bday_year']); $_form_month = ipsRegistry::getClass('output')->formDropdown("bday_month", $months, $member['bday_month']); $_form_day = ipsRegistry::getClass('output')->formDropdown("bday_day", $days, $member['bday_day']); $form_time_offset = ipsRegistry::getClass('output')->formDropdown("time_offset", $time_zones, $member['time_offset'] ? floatval($member['time_offset']) : 0); $form_auto_dst = ipsRegistry::getClass('output')->formCheckbox("dstCheck", $member['members_auto_dst'], 1, "dst", "onclick='toggle_dst()'"); $form_dst_now = ipsRegistry::getClass('output')->formCheckbox("dstOption", $member['dst_in_use'], 1, "dstManual"); $form_language = ipsRegistry::getClass('output')->formDropdown("language", $languages, $member['language']); $form_allow_admin_mails = ipsRegistry::getClass('output')->formYesNo("allow_admin_mails", $member['allow_admin_mails']); $form_members_disable_pm = ipsRegistry::getClass('output')->formDropdown("members_disable_pm", $pm_options, $member['members_disable_pm']); $form_view_sig = ipsRegistry::getClass('output')->formYesNo("view_sigs", $member['view_sigs']); $form_reputation_points = ipsRegistry::getClass('output')->formInput('pp_reputation_points', $member['pp_reputation_points']); $bw_no_status_update = ipsRegistry::getClass('output')->formYesNo("bw_no_status_update", $member['bw_no_status_update']); $bw_disable_customization = ipsRegistry::getClass('output')->formYesNo("bw_disable_customization", $member['bw_disable_customization']); $form_uploader = ipsRegistry::getClass('output')->formDropdown("member_uploader", array(array('flash', $this->lang->words['mem__flashuploader']), array('default', $this->lang->words['mem__defuploader'])), $member['member_uploader']); $form_popup = ipsRegistry::getClass('output')->formYesNo("show_notification_popup", $member['_cache']['show_notification_popup']); $form_autotrack = ipsRegistry::getClass('output')->formYesNo("auto_track", $member['auto_track'] ? 1 : 0); $form_autotrackmthd = ipsRegistry::getClass('output')->formDropdown("auto_track_method", array(array('none', $this->lang->words['mem__auto_none']), array('immediate', $this->lang->words['mem__auto_immediate']), array('offline', $this->lang->words['mem__auto_delayed']), array('daily', $this->lang->words['mem__auto_daily']), array('weekly', $this->lang->words['mem__auto_weekly'])), $member['auto_track']); $secure_key = ipsRegistry::getClass('adminFunctions')->getSecurityKey(); $ban_member_text = $member['member_banned'] ? $this->lang->words['sm_unban'] : $this->lang->words['sm_ban']; $spam_member_text = $member['bw_is_spammer'] ? $this->lang->words['sm_unspam'] : $this->lang->words['sm_spam']; $bw_disable_tagging = ipsRegistry::getClass('output')->formYesNo("bw_disable_tagging", $member['bw_disable_tagging']); $bw_disable_prefixes = ipsRegistry::getClass('output')->formYesNo("bw_disable_prefixes", $member['bw_disable_prefixes']); //----------------------------------------- // Comments and friends.. //----------------------------------------- $pp_visitors = ipsRegistry::getClass('output')->formYesNo("pp_setting_count_visitors", $member['pp_setting_count_visitors']); $pp_enable_comments = ipsRegistry::getClass('output')->formYesNo("pp_setting_count_comments", $member['pp_setting_count_comments']); $pp_enable_friends = ipsRegistry::getClass('output')->formYesNo("pp_setting_count_friends", $member['pp_setting_count_friends']); $_commentsApprove = array(array('0', $this->lang->words['sm_comments_app_none']), array('1', $this->lang->words['sm_comments_app_on'])); $_friendsApprove = array(array('0', $this->lang->words['sm_friends_app_none']), array('1', $this->lang->words['sm_friends_app_on'])); $pp_comments_approve = ipsRegistry::getClass('output')->formDropdown("pp_setting_moderate_comments", $_commentsApprove, $member['pp_setting_moderate_comments']); $pp_friends_approve = ipsRegistry::getClass('output')->formDropdown("pp_setting_moderate_friends", $_friendsApprove, $member['pp_setting_moderate_friends']); $suspend_date = ''; if ($member['temp_ban']) { $s_ban = IPSMember::processBanEntry($member['temp_ban']); $suspend_date = "<div class='warning'>" . $this->lang->words['member_supsended_til'] . ' ' . ipsRegistry::getClass('class_localization')->getDate($s_ban['date_end'], 'LONG', 1) . "</div>"; } $IPBHTML = ""; $IPBHTML .= <<<HTML <script type="text/javascript" src="{$this->settings['js_main_url']}acp.members.js"></script> <div class='section_title'> \t<h2>{$this->lang->words['editing_member']} {$member['members_display_name']}</h2> \t<ul class='context_menu'> HTML; if (IPSLib::appIsInstalled('nexus')) { $IPBHTML .= <<<HTML \t\t<li> \t\t\t<a href="{$this->settings['base_url']}app=nexus&module=customers&section=view&member_id={$member['member_id']}"> \t\t\t\t<img src='{$this->settings['skin_acp_url']}/images/icon_components/nexus.png' alt='{$this->lang->words['view_customer_data']}' /> \t\t\t\t{$this->lang->words['form_viewcustomer']} \t\t\t</a> \t\t</li> HTML; } if ($this->registry->getClass('class_permissions')->checkPermission('member_login', 'members', 'members')) { if (IPSMember::isInactive($member)) { $IPBHTML .= <<<HTML \t\t<li class='disabled'> \t\t\t<a href="#" onclick='alert("{$this->lang->words['member_login_ban_or_spam']}")'> \t\t\t\t<img src='{$this->settings['skin_acp_url']}/images/icons/key.png' alt='{$this->lang->words['member_login']}' /> \t\t\t\t{$this->lang->words['member_login']} \t\t\t</a> \t\t</li> HTML; } else { $IPBHTML .= <<<HTML \t\t<li> \t\t\t<a href="{$this->settings['base_url']}app=members&module=members&section=members&do=member_login&member_id={$member['member_id']}" target="_blank"> \t\t\t\t<img src='{$this->settings['skin_acp_url']}/images/icons/key.png' alt='{$this->lang->words['member_login']}' /> \t\t\t\t{$this->lang->words['member_login']} \t\t\t</a> \t\t</li> HTML; } } if ($member['member_id'] != $this->memberData['member_id']) { $IPBHTML .= <<<HTML \t\t<li> \t\t\t<a href='#' id='MF__ban2' title='{$this->lang->words['title_ban']}'> \t\t\t\t<img src='{$this->settings['skin_acp_url']}/images/icons/user_warn.png' alt='{$this->lang->words['title_ban']}' /> \t\t\t\t{$ban_member_text} \t\t\t</a> \t\t\t \t\t\t<script type='text/javascript'> \t\t\t\t\$('MF__ban2').observe('click', acp.members.banManager.bindAsEventListener( this, "app=members&module=ajax&section=editform&do=show&name=inline_ban_member&member_id={$member['member_id']}" ) ); \t\t\t</script> \t\t</li> HTML; } $IPBHTML .= <<<HTML \t\t<li> \t\t\t<a href='#' class='ipbmenu' id='member_tasks' title='{$this->lang->words['title_tasks']}'><img src='{$this->settings['skin_acp_url']}/images/icons/cog.png' /> {$this->lang->words['mem_tasks']} <img src='{$this->settings['skin_acp_url']}/images/useropts_arrow.png' /></a> \t\t</li> \t\t<li class='closed'> \t\t\t<a href="#" title='{$this->lang->words['title_delete']}' onclick="return acp.confirmDelete( '{$this->settings['base_url']}app=members&module=members&section=members&do=member_delete&member_id={$member['member_id']}')"> \t\t\t\t<img src='{$this->settings['skin_acp_url']}/images/icons/delete.png' alt='{$this->lang->words['title_delete']}' /> \t\t\t\t{$this->lang->words['form_deletemember']} \t\t\t</a> \t\t</li> \t</ul> </div> <ul class='ipbmenu_content' id='member_tasks_menucontent' style='display: none'> \t<li> \t\t<img src='{$this->settings['skin_acp_url']}/images/icons/flag_red.png' alt='{$spam_member_text}' /> <a style='text-decoration: none' href='{$this->settings['base_url']}&{$this->form_code}&do=toggleSpam&member_id={$member['member_id']}&secure_key={$secure_key}' title='{$this->lang->words['title_spam']}'>{$spam_member_text}</a> \t</li> HTML; if ($member['member_group_id'] == $this->settings['auth_group']) { $IPBHTML .= <<<HTML \t\t<li> \t\t\t<img src='{$this->settings['skin_acp_url']}/images/icons/tick.png' alt='{$this->lang->words['title_validate']}' /> <a style='text-decoration: none' href="{$this->settings['base_url']}app=members&module=members&section=tools&do=do_validating&mid_{$member['member_id']}=1&type=approve&_return={$member['member_id']}" title='{$this->lang->words['title_validate']}'>{$this->lang->words['button_validate']}</a> \t\t</li> HTML; } if (is_array($menu) and count($menu)) { foreach ($menu as $app => $link) { if (is_array($link) and count($link)) { foreach ($link as $alink) { $img = $alink['img'] ? $alink['img'] : $this->settings['skin_acp_url'] . '/images/icons/user.png'; if (stristr($alink['url'], '</a>') && stristr($alink['url'], '<a ')) { $IPBHTML .= <<<HTML \t\t\t\t\t\t<li><img src='{$img}' alt='-' /> {$alink['url']}</li> HTML; } else { $thisLink = $alink['js'] ? 'href="#" onclick="' . $alink['url'] . '"' : "href='{$this->settings['_base_url']}app={$app}&{$alink['url']}&member_id={$member['member_id']}'"; $IPBHTML .= <<<HTML \t\t\t\t\t\t<li><img src='{$img}' alt='-' /> <a {$thisLink} style='text-decoration: none' >{$alink['title']}</a></li> HTML; } } } } } $IPBHTML .= <<<HTML </ul> {$suspend_date} <br style='clear: both' /> HTML; $_public = PUBLIC_DIRECTORY; $IPBHTML .= <<<HTML <div class='acp-box'> <form style='display:block' action='{$this->settings['base_url']}&{$this->form_code}&do=member_edit&member_id={$member['member_id']}&secure_key={$secure_key}' method='post'> <h3>{$this->lang->words['editing_member']}</h3> <div id='tabstrip_members' class='ipsTabBar with_left with_right'> \t<span class='tab_left'>«</span> \t<span class='tab_right'>»</span> \t<ul> \t\t<li id='tab_MEMBERS_1'>{$this->lang->words['mem_tab_basics']}</li> \t\t<li id='tab_MEMBERS_2'>{$this->lang->words['mem_tab_profile']}</li> \t\t<li id='tab_MEMBERS_3'>{$this->lang->words['mem_tab_notifications']}</li> HTML; // Got blocks from other apps? $IPBHTML .= implode("\n", $content['tabs']); if ($this->settings['auth_allow_dnames']) { $display_name = <<<HTML \t\t\t<tr> \t\t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['mem_display_name']}</strong></td> \t\t\t\t<td class='field_field'> \t\t\t\t\t<span class='member_detail' id='MF__member_display_name'>{$member['members_display_name']}</span> \t\t\t\t\t<a class='change_icon' id='MF__member_display_name_popup' href='' style='cursor:pointer' title='{$this->lang->words['title_display_name']}'>{$this->lang->words['mem_change_button']}</a> \t\t\t\t\t \t\t\t\t\t<script type='text/javascript'> \t\t\t\t\t\t\$('MF__member_display_name_popup').observe('click', acp.members.editField.bindAsEventListener( this, 'MF__member_display_name', "{$this->lang->words['sm_display']}", "app=members&module=ajax&section=editform&do=show&name=inline_form_display_name&member_id={$member['member_id']}" ) ); \t\t\t\t\t</script> \t\t\t\t</td> \t\t\t</tr> HTML; } else { $display_name = ''; } /* Facebook doesn't pass a size, so in IPB we get around that by passing * as a width. This confuses the form here, so.. */ $_pp_box_width = ($member['pp_main_width'] == '*' or $member['pp_main_width'] < 100) ? '100' : $member['pp_main_width']; $_pp_max_width = $member['pp_main_width'] == '*' ? ';max-width:100px' : ''; $IPBHTML .= <<<HTML </ul> </div> <div id='tabstrip_members_content' class='ipsTabBar_content'> \t<div id='tab_MEMBERS_1_content' class='row1'> \t\t<div style='float: left; width: 70%'> \t\t\t<table class='ipsTable double_pad'> \t\t\t\t{$display_name} \t\t\t\t<tr> \t\t\t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['mem_login_name']}</strong></td> \t\t\t\t\t<td class='field_field'> \t\t\t\t\t\t<span class='member_detail' id='MF__name'>{$member['name']}</span> \t\t\t\t\t\t<a href='' class='change_icon' style='cursor:pointer' id='MF__name_popup' title='{$this->lang->words['title_login_name']}'>{$this->lang->words['mem_change_button']}</a> \t\t\t\t\t\t<script type='text/javascript'> \t\t\t\t\t\t\t\$('MF__name_popup').observe('click', acp.members.editField.bindAsEventListener( this, 'MF__name', "{$this->lang->words['sm_loginname']}", "app=members&module=ajax&section=editform&do=show&name=inline_form_name&member_id={$member['member_id']}" ) ); \t\t\t\t\t\t</script> \t\t\t\t\t</td> \t\t\t\t</tr> \t\t\t\t<tr> \t\t\t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['mem_password']}</strong></td> \t\t\t\t\t<td class='field_field'> \t\t\t\t\t\t \t\t\t\t\t\t<span class='member_detail' id='MF__password'>************</span> \t\t\t\t\t\t<a href='' class='change_icon' style='cursor:pointer' id='MF__password_popup' title='{$this->lang->words['title_password']}'>{$this->lang->words['mem_change_button']}</a> \t\t\t\t\t\t<script type='text/javascript'> \t\t\t\t\t\t\t\$('MF__password_popup').observe('click', acp.members.editField.bindAsEventListener( this, 'MF__password', "{$this->lang->words['sm_password']}", "app=members&module=ajax&section=editform&do=show&name=inline_password&member_id={$member['member_id']}" ) ); \t\t\t\t\t\t</script> \t\t\t\t\t</td> \t\t\t\t</tr> \t\t\t\t<tr> \t\t\t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['mem_email']}</strong></td> \t\t\t\t\t<td class='field_field'> \t\t\t\t\t\t<span class='member_detail' id='MF__email'>{$member['email']}</span> \t\t\t\t\t\t<a href='' class='change_icon' style='cursor:pointer' id='MF__email_popup' title='{$this->lang->words['title_email']}'>{$this->lang->words['mem_change_button']}</a> \t\t\t\t\t\t<script type='text/javascript'> \t\t\t\t\t\t\t\$('MF__email_popup').observe('click', acp.members.editField.bindAsEventListener( this, 'MF__email', "{$this->lang->words['sm_email']}", "app=members&module=ajax&section=editform&do=show&name=inline_email&member_id={$member['member_id']}" ) ); \t\t\t\t\t\t</script> \t\t\t\t\t</td> \t\t\t\t</tr> \t\t\t\t<tr> \t\t\t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['mem_form_title']}</strong></td> \t\t\t\t\t<td class='field_field'> \t\t\t\t\t\t<span id='MF__title'>{$form_title}</span> \t\t\t\t\t</td> \t\t\t\t</tr> \t\t\t\t<tr> \t\t\t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['mem_p_group']}</strong></td> \t\t\t\t\t<td class='field_field'> \t\t\t\t\t\t<span id='MF__member_group_id'>{$form_member_group_id}</span> \t\t\t\t\t</td> \t\t\t\t</tr> \t\t\t\t<tr> \t\t\t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['mem_s_group']}</strong></td> \t\t\t\t\t<td class='field_field'> \t\t\t\t\t\t<span id='MF__mgroup_others'>{$form_mgroup_others}</span> \t\t\t\t\t</td> \t\t\t\t</tr> \t\t\t\t<tr> \t\t\t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['mem_warn_level']}</strong></td> \t\t\t\t\t<td class='field_field'>\t\t \t\t\t\t\t\t<span id='MF__warn_level'>{$form_warn}</span> <a href='#' onclick="return acp.openWindow('{$this->settings['board_url']}/index.php?app=members&module=profile&section=warnings&member={$member['member_id']}','980','600'); return false;" title='{$this->lang->words['sm_viewnotes']}'><img src='{$this->settings['skin_acp_url']}/images/icons/view.png' alt='{$this->lang->words['sm_viewnotes']}' /></a> \t\t\t\t\t</td> \t\t\t\t </tr> \t\t\t</table> \t\t</div> \t\t<div class='acp-sidebar'> \t\t\t<div style='width:{$_pp_box_width}px; max-width: 125px;' id='MF__pp_photo_container'> \t\t\t\t<img id='MF__pp_photo' src="{$member['pp_main_photo']}" style='{$_pp_max_width};max-width:125px' /> \t\t\t\t<br /> \t\t\t\t<ul class='photo_options'> HTML; if ($member['_has_photo']) { $IPBHTML .= <<<HTML \t\t\t\t<li><a style='float:none;width:auto;text-align:center;cursor:pointer' id='MF__removephoto' title='{$this->lang->words['mem_remove_photo']}'><img src='{$this->settings['skin_acp_url']}/images/picture_delete.png' alt='{$this->lang->words['mem_remove_photo']}' /></a></li> \t\t\t\t<li><a style='float:none;width:auto;text-align:center;cursor:pointer' id='MF__newphoto' title='{$this->lang->words['sm_uploadnew']}'><img src='{$this->settings['skin_acp_url']}/images/picture_add.png' alt='{$this->lang->words['sm_uploadnew']}' /></a></li> HTML; } else { $IPBHTML .= <<<HTML \t\t\t\t<li><a style='float:none;width:auto;text-align:center;cursor:pointer' id='MF__newphoto' title='{$this->lang->words['sm_uploadnew']}'><img src='{$this->settings['skin_acp_url']}/images/picture_add.png' alt='{$this->lang->words['sm_uploadnew']}' /></a></li> HTML; } $IPBHTML .= <<<HTML \t\t\t\t</ul> \t\t\t\t<script type='text/javascript'> \t\t\t\t\t\$('MF__newphoto').observe('click', acp.members.newPhoto.bindAsEventListener( this, "app=members&module=ajax&section=editform&do=show&name=inline_form_new_photo&member_id={$member['member_id']}" ) ); \t\t\t\t</script> \t\t\t</div> \t\t\t \t\t\t<div class='sidebar_box'> \t\t\t\t<ul> \t\t\t\t\t<li><strong>{$this->lang->words['mem_joined']}:</strong> <span>{$member['_joined']}</span></li> \t\t\t\t\t<li><strong>{$this->lang->words['mem_ip_address_f']}:</strong> <span><a href='{$this->settings['base_url']}&module=members&section=tools&do=learn_ip&ip={$member['ip_address']}' title='{$this->lang->words['mem_ip_title']}'>{$member['ip_address']}</a></span></li> \t\t\t\t</ul> \t\t\t</div> \t\t</div> \t\t<div style='clear: both;'></div> \t</div> HTML; $IPBHTML .= <<<HTML \t<!-- PROFILE PANE--> \t<div id='tab_MEMBERS_2_content'> \t<table class='ipsTable double_pad'> \t\t<tr> \t\t\t<th colspan='2'>{$this->lang->words['sm_settings']}</th> \t\t</tr> \t\t<tr> \t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['sm_timeoffset']}</strong></td> \t\t\t<td class='field_field'> \t\t\t\t<span id='MF__time_offset'>{$form_time_offset}</span> \t\t\t\t<div class='ipsPad_top_slimmer'>{$form_auto_dst} <label for='dst'>{$this->lang->words['sm_dst_auto']}</label></div> \t\t\t\t<div class='ipsPad_top_slimmer' id='dst-manual'>{$form_dst_now} <label for='dstManual'>{$this->lang->words['sm_dst_now']}</label></div> \t\t\t</td> \t\t</tr> \t\t<tr> \t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['sm_langchoice']}</strong></td> \t\t\t<td class='field_field'> \t\t\t\t<span id='MF__language'>{$form_language}</span> \t\t\t</td> \t\t</tr> \t\t<tr> \t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['sm_skinchoice']}</strong></td> \t\t\t<td class='field_field'> \t\t\t\t<span id='MF__skin'> \t\t\t\t\t{$skinList} \t\t\t\t</span> \t\t\t</td> \t\t</tr> \t\t<tr> \t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['sm_uploaderchoice']}</strong></td> \t\t\t<td class='field_field'> \t\t\t\t<span id='MF__uploader'> \t\t\t\t\t{$form_uploader} \t\t\t\t</span> \t\t\t</td> \t\t</tr> \t\t<tr> \t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['sm_viewsig']}</strong></td> \t\t\t<td class='field_field'> \t\t\t\t<span id='MF__view_sig'>{$form_view_sig}</span> \t\t\t</td> \t\t</tr> \t\t<tr> \t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['bw_disable_customization']}</strong></td> \t\t\t<td class='field_field'> \t\t\t\t<span>{$bw_disable_customization}</span> \t\t\t\t<div class='ipsPad_top_slimmer'><input type="checkbox" name="removeCustomization" value="1" /> {$this->lang->words['remove_custom_stuff']} \t\t\t</td> \t\t</tr> \t\t<tr> \t\t\t<th colspan='2'>{$this->lang->words['mf_t_tagging']}<!--You're it--></th> \t\t</tr> \t \t<tr> \t \t\t<td class='field_title'><strong class='title'>{$this->lang->words['bw_disable_tagging']}</strong></td> \t \t\t<td class='field_field'> \t \t\t\t{$bw_disable_tagging}<br /> \t\t\t\t<span class='desctext'>{$this->lang->words['bw_disable_tagging_desc']}</span> \t \t\t</td> \t \t</tr> \t \t<tr> \t \t\t<td class='field_title'> \t \t\t\t<strong class='title'>{$this->lang->words['bw_disable_prefixes']}</strong></td> \t \t\t</td> \t \t\t<td class='field_field'> \t \t\t\t{$bw_disable_prefixes}<br /> \t\t\t\t<span class='desctext'>{$this->lang->words['bw_disable_prefixesm_desc']}</span> \t \t\t</td> \t \t</tr> \t\t<tr> \t\t\t<th colspan='2'>{$this->lang->words['sm_profile']}</th> \t\t</tr> \t\t<tr> \t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['sm_bday']}</strong></td> \t\t\t<td class='field_field'> \t\t\t\t<span id='MF__birthday'>{$_form_month} {$_form_day} {$_form_year}</span> \t\t\t</td> \t\t</tr> \t\t<tr> \t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['frm_no_status']}</strong></td> \t\t\t<td class='field_field'> \t\t\t\t<span id='MF__frm_no_status'>{$bw_no_status_update}</span> \t\t\t</td> \t\t</tr> \t\t<tr> \t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['sm_reputation']}</strong></td> \t\t\t<td class='field_field'> \t\t\t\t<span id='MF__pp_reputation_points'> \t\t\t\t\t{$form_reputation_points} \t\t\t\t</span> \t\t\t</td> \t\t</tr> \t\t<tr> \t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['sm_latest_visitors']}</strong></td> \t\t\t<td class='field_field'> \t\t\t\t<span id='MF__visitors'>{$pp_visitors}</span> \t\t\t</td> \t\t</tr> \t\t<tr> \t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['sm_enable_comments']}</strong></td> \t\t\t<td class='field_field'> \t\t\t\t<span id='MF__profile_comments'>{$pp_enable_comments}</span> \t\t\t</td> \t\t</tr> \t\t<tr> \t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['sm_approve_comments']}</strong></td> \t\t\t<td class='field_field'> \t\t\t\t<span id='MF__comments_approve'>{$pp_comments_approve}</span> \t\t\t</td> \t\t</tr> \t\t<tr> \t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['sm_friends_profile']}</strong></td> \t\t\t<td class='field_field'> \t\t\t\t<span id='MF__profile_friends'>{$pp_enable_friends}</span> \t\t\t</td>\t\t\t\t\t\t \t\t</tr> \t\t<tr> \t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['sm_approve_friends']}</strong></td> \t\t\t<td class='field_field'> \t\t\t\t<span id='MF__friends_approve'>{$pp_friends_approve}</span> \t\t\t</td>\t\t\t\t\t\t \t\t</tr> \t</table> HTML; if (is_array($member['custom_fields']) and count($member['custom_fields'])) { $IPBHTML .= <<<HTML \t<table class='ipsTable double_pad'> \t\t<tr> \t\t\t<th colspan='2'>{$this->lang->words['sm_custom']}</th> \t\t</tr> HTML; foreach ($member['custom_fields'] as $_id => $_data) { $IPBHTML .= <<<HTML \t\t<tr> \t\t\t<td class='field_title'><strong class='title'>{$_data['name']}</strong></td> \t\t\t<td class='field_field'> \t\t\t\t<span id='custom_fields_{$_id}'>{$_data['data']}</span> \t\t\t</td> \t\t</tr> HTML; } $IPBHTML .= <<<HTML \t</table> HTML; } $IPBHTML .= <<<HTML \t<!-- / CUSTOM FIELDS PANE --> \t \t<!-- SIGNATURE--> \t<table class='ipsTable double_pad'> \t\t<tr> \t\t\t<th colspan='2'>{$this->lang->words['sm_sigtab']}</th> \t\t</tr> \t\t<tr> \t\t\t<td> \t\t\t\t<div class='tablerow1 has_editor'> \t\t\t\t\t<div class='editor'> \t\t\t\t\t\t{$member['signature_editor']} \t\t\t\t\t\t<br /> \t\t\t\t\t\t<input type="checkbox" name="bw_html_sig" class="input_check" value="1" id='bw_html_sig' {$sigHtmlChecked} /> {$this->lang->words['sig_is_html']} \t\t\t\t\t\t<script type="text/javascript"> \t\t\t\t\t\t\tipb.textEditor.bindHtmlCheckbox( \$('bw_html_sig') ); \t\t\t\t\t\t</script> \t\t\t\t\t</div> \t\t\t\t</div> \t\t\t</td> \t\t</tr> \t</table> \t<!-- / SIGNATURE--> \t\t \t<!-- ABOUT ME--> \t<table class='ipsTable double_pad'> \t\t<tr> \t\t\t<th>{$this->lang->words['sm_abouttab']}</th> \t\t</tr> \t\t<tr> \t\t\t<td> \t\t\t\t<div class='tablerow1 has_editor'> \t\t\t\t\t<div class='editor'> \t\t\t\t\t\t{$member['aboutme_editor']} \t\t\t\t\t</div> \t\t\t\t</div> \t\t\t</td> \t\t</tr> \t</table> \t<!-- / ABOUT ME--> \t \t</div> \t<div id='tab_MEMBERS_3_content'> \t\t<table class='ipsTable double_pad'> \t\t\t<tr> \t\t\t\t<th colspan='2'>{$this->lang->words['memt_privacysettings']}</th> \t\t\t</tr> \t\t\t<tr> \t\t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['sm_allowadmin']}</strong></td> \t\t\t\t<td class='field_field'> \t\t\t\t\t<span id='MF__allow_admin_mails'>{$form_allow_admin_mails}</span> \t\t\t\t</td> \t\t\t</tr> \t\t\t<tr> \t\t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['sm_disablepm']}</strong></td> \t\t\t\t<td class='field_field'> \t\t\t\t\t<span id='MF__members_disable_pm'>{$form_members_disable_pm}</span> \t\t\t\t</td> \t\t\t</tr> \t\t\t<tr> \t\t\t\t<th colspan='2'>{$this->lang->words['memt_boardprefs']}</th> \t\t\t</tr> \t\t\t<tr> \t\t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['show_notification_popup']}</strong></td> \t\t\t\t<td class='field_field'> \t\t\t\t\t<span id='MF__xxx'>{$form_popup}</span> \t\t\t\t</td> \t\t\t</tr> \t\t\t<tr> \t\t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['auto_track']}</strong></td> \t\t\t\t<td class='field_field'> \t\t\t\t\t<span id='MF__xxx'>{$form_autotrack}</span> \t\t\t\t</td> \t\t\t</tr> \t\t\t<tr> \t\t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['auto_track_type']}</strong></td> \t\t\t\t<td class='field_field'> \t\t\t\t\t<span id='MF__xxx'>{$form_autotrackmthd}</span> \t\t\t\t</td> \t\t\t</tr> \t\t</table> HTML; $notifyGroups = array('topics_posts' => array('new_topic', 'new_reply', 'post_quoted'), 'status_updates' => array('reply_your_status', 'reply_any_status', 'friend_status_update'), 'profiles_friends' => array('profile_comment', 'profile_comment_pending', 'friend_request', 'friend_request_pending', 'friend_request_approve'), 'private_msgs' => array('new_private_message', 'reply_private_message', 'invite_private_message')); $IPBHTML .= <<<HTML \t<table class='ipsTable double_pad'> \t\t<tr> \t\t\t<th width='20%'> </th> \t\t\t<th width='20%' style='text-align: center'>{$this->lang->words['notify_type_email']}</th> \t\t\t<th width='20%' style='text-align: center'>{$this->lang->words['notify_type_inline']}</th> \t\t\t<th width='20%' style='text-align: center'>{$this->lang->words['notify_type_mobile']}</th> \t\t</tr> HTML; foreach ($notifyGroups as $groupKey => $group) { $IPBHTML .= <<<HTML \t\t\t<th colspan='4'> \t\t\t\t{$this->lang->words['notifytitle_' . $groupKey]} \t\t\t</th> HTML; foreach ($group as $key) { if ($notifications[$key]) { $IPBHTML .= <<<HTML \t\t\t\t\t<tr> \t\t\t\t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['notify__' . $key]}</strong></td> \t\t\t\t\t\t<td align='center'> HTML; if (isset($notifications[$key]['options']['email'])) { $_disabled = $notifications[$key]['disabled'] ? " disabled='disabled'" : ''; $_selected = (is_array($notifications[$key]['defaults']) and in_array('email', $notifications[$key]['defaults'])) ? " checked='checked'" : ''; $IPBHTML .= <<<HTML \t\t\t\t\t\t\t\t<input type='checkbox' class='input_check' id='email_{$key}' name="config_{$key}[]" value="email"{$_selected}{$_disabled} /> HTML; } else { $IPBHTML .= <<<HTML \t\t\t\t\t\t\t\t<input type='checkbox' class='input_check' name='' disabled='disabled' /> HTML; } $IPBHTML .= <<<HTML \t\t\t\t\t\t</td> \t\t\t\t\t\t<td align='center'> HTML; if (isset($notifications[$key]['options']['inline'])) { $_disabled = $notifications[$key]['disabled'] ? " disabled='disabled'" : ''; $_selected = (is_array($notifications[$key]['defaults']) and in_array('inline', $notifications[$key]['defaults'])) ? " checked='checked'" : ''; $IPBHTML .= <<<HTML \t\t\t\t\t\t\t\t<input type='checkbox' class='input_check' id='inline_{$key}' name="config_{$key}[]" value="inline"{$_selected}{$_disabled} /> HTML; } else { $IPBHTML .= <<<HTML \t\t\t\t\t\t\t\t<input type='checkbox' class='input_check' name='' disabled='disabled' /> HTML; } $IPBHTML .= <<<HTML \t\t\t\t\t\t</td> \t\t\t\t\t\t<td align='center'> HTML; if (isset($notifications[$key]['options']['mobile'])) { $_disabled = $notifications[$key]['disabled'] ? " disabled='disabled'" : ''; $_selected = (is_array($notifications[$key]['defaults']) and in_array('mobile', $notifications[$key]['defaults'])) ? " checked='checked'" : ''; $IPBHTML .= <<<HTML \t\t\t\t\t\t\t\t<input type='checkbox' class='input_check' id='mobile_{$key}' name="config_{$key}[]" value="mobile"{$_selected}{$_disabled} /> HTML; } else { $IPBHTML .= <<<HTML \t\t\t\t\t\t\t\t<input type='checkbox' class='input_check' name='' disabled='disabled' /> HTML; } $IPBHTML .= <<<HTML \t\t\t\t\t\t</td> \t\t\t\t\t</tr> HTML; $notifications[$key]['_done'] = 1; } } } $_lastApp = ''; foreach ($notifications as $key => $_config) { if (!isset($_config['_done']) && $_config['_done'] != 1) { if ($_lastApp != $_config['app']) { $_title = $_config['app'] == 'core' ? $this->lang->words['notifytitle_other'] : IPSLib::getAppTitle($_config['app']); $_lastApp = $_config['app']; $IPBHTML .= <<<HTML \t\t\t<th colspan='4'> \t\t\t\t{$_title} \t\t\t</th> HTML; } $IPBHTML .= <<<HTML \t\t\t\t<tr> \t\t\t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['notify__' . $_config['key']]}</strong></td> \t\t\t\t\t<td align='center'> HTML; if (isset($_config['options']['email'])) { $_disabled = $_config['disabled'] ? " disabled='disabled'" : ''; $_selected = (is_array($_config['defaults']) and in_array('email', $_config['defaults'])) ? " checked='checked'" : ''; $IPBHTML .= <<<HTML \t\t\t\t\t\t\t\t<input type='checkbox' class='input_check' id='email_{$key}' name="config_{$key}[]" value="email"{$_selected}{$_disabled} /> HTML; } else { $IPBHTML .= <<<HTML \t\t\t\t\t\t\t\t<input type='checkbox' class='input_check' name='' disabled='disabled' /> HTML; } $IPBHTML .= <<<HTML \t\t\t\t\t</td> \t\t\t\t\t<td align='center'> HTML; if (isset($_config['options']['inline'])) { $_disabled = $_config['disabled'] ? " disabled='disabled'" : ''; $_selected = (is_array($_config['defaults']) and in_array('inline', $_config['defaults'])) ? " checked='checked'" : ''; $IPBHTML .= <<<HTML \t\t\t\t\t\t\t<input type='checkbox' class='input_check' id='inline_{$key}' name="config_{$key}[]" value="inline"{$_selected}{$_disabled} /> HTML; } else { $IPBHTML .= <<<HTML \t\t\t\t\t\t\t<input type='checkbox' class='input_check' name='' disabled='disabled' /> HTML; } $IPBHTML .= <<<HTML \t\t\t\t\t</td> \t\t\t\t\t<td align='center'> HTML; if (isset($_config['options']['mobile'])) { $_disabled = $_config['disabled'] ? " disabled='disabled'" : ''; $_selected = (is_array($_config['defaults']) and in_array('mobile', $_config['defaults'])) ? " checked='checked'" : ''; $IPBHTML .= <<<HTML \t\t\t\t\t\t\t<input type='checkbox' class='input_check' id='mobile_{$key}' name="config_{$key}[]" value="mobile"{$_selected}{$_disabled} /> HTML; } else { $IPBHTML .= <<<HTML \t\t\t\t\t\t\t<input type='checkbox' class='input_check' name='' disabled='disabled' /> HTML; } $IPBHTML .= <<<HTML \t\t\t\t\t</td> \t\t\t\t</tr> HTML; } } $IPBHTML .= <<<HTML \t</table> </div> HTML; // Got blocks from other apps? $IPBHTML .= implode("\n", $content['area']); $IPBHTML .= <<<HTML </div> \t<div class='acp-actionbar'> \t\t<input class='button primary' type='submit' value='{$this->lang->words['sm_savebutton']}' /> \t</div> </div> <script type='text/javascript'> \tjQ("#tabstrip_members").ipsTabBar({tabWrap: "#tabstrip_members_content"}); </script> </form> </div> <script type='text/javascript'>\t \tif( \$('MF__removephoto') ) \t{ \t\t\$('MF__removephoto').observe( 'click', acp.members.removePhoto.bindAsEventListener( this, '{$member['member_id']}' ) ); \t} </script> <script type="text/javascript"> function toggle_dst() { \tif ( \$( 'dst' ) ) \t{ \t\tif ( \$( 'dst' ).checked ){ \t\t\t\$( 'dst-manual' ).hide(); \t\t} else { \t\t\t\$( 'dst-manual' ).show(); \t\t} \t} } toggle_dst(); </script> HTML; return $IPBHTML; }
/** * Check if a member's posts need to be approved * Note that this only takes into the global mod queue status, individual forums, etc. may * set posts to be moderated and have custom permissions * * @param int|array Member ID or array of data * @return bool|null If TRUE - mod queue post. If FALSE - do not. If NULL - member is banned or restricted from posting and should not be able to post at all. */ public static function isOnModQueue($memberData) { //----------------------------------------- // Get Data //----------------------------------------- if (!is_array($memberData) && $memberData > 0) { $memberData = IPSMember::load($memberData); } //----------------------------------------- // Check we can post at all //----------------------------------------- /* Banned */ if ($memberData['member_banned']) { return NULL; } /* Suspended */ if ($memberData['temp_ban']) { $data = IPSMember::processBanEntry($memberData['temp_ban']); if ($data['date_end']) { if (time() >= $data['date_end']) { IPSMember::save($memberData['member_id'], array('core' => array('temp_ban' => 0))); } else { return NULL; } } else { return NULL; } } /* Restricted from posting */ if ($memberData['restrict_post']) { $data = IPSMember::processBanEntry($memberData['restrict_post']); if ($data['date_end']) { if (time() >= $data['date_end']) { IPSMember::save($memberData['member_id'], array('core' => array('restrict_post' => 0))); } else { return NULL; } } else { return NULL; } } //----------------------------------------- // So are we mod queued? //----------------------------------------- if ($memberData['mod_posts']) { $data = IPSMember::processBanEntry($memberData['mod_posts']); if ($data['date_end']) { if (time() >= $data['date_end']) { IPSMember::save($memberData['member_id'], array('core' => array('mod_posts' => 0))); } else { return TRUE; } } else { return TRUE; } } //----------------------------------------- // How about the group? //----------------------------------------- if ($memberData['g_mod_preview']) { /* Do we only limit for x posts/days? */ if ($memberData['g_mod_post_unit']) { if ($memberData['gbw_mod_post_unit_type']) { /* Days.. .*/ if ($memberData['joined'] > IPS_UNIX_TIME_NOW - 86400 * $memberData['g_mod_post_unit']) { return TRUE; } } else { /* Posts */ if ($memberData['posts'] < $memberData['g_mod_post_unit']) { return TRUE; } } } else { /* No limit, but still checking moderating */ return TRUE; } } //----------------------------------------- // Still here - which means we're fine //----------------------------------------- return FALSE; }
/** * Add a new arn entry * * @access private * @return void [Outputs to screen/redirects] */ private function _doWarn() { //----------------------------------------- // INIT //----------------------------------------- $save = array(); $err = 0; $topicPosts_type = trim($this->request['topicPosts_type']); $topicPosts_topics = intval($this->request['topicPosts_topics']); $topicPosts_replies = intval($this->request['topicPosts_replies']); $topicPosts_lastx = intval($this->request['topicPosts_lastx']); $topicPosts_lastxunits = trim($this->request['topicPosts_lastxunits']); $level_custom = intval($this->request['level_custom']); $ban_indef = intval($this->request['ban_indef']); $member_banned = intval($this->warn_member['member_banned']); $warn_level = intval($this->warn_member['warn_level']); //----------------------------------------- // Load Mod Squad //----------------------------------------- require_once IPSLib::getAppDir('forums') . '/sources/classes/moderate.php'; $moderatorLibrary = new moderatorLibrary($this->registry); //----------------------------------------- // Security checks //----------------------------------------- if ($this->type == 'member') { $this->registry->output->showError('warn_member_notes', 2028); } //----------------------------------------- // Check security fang //----------------------------------------- if ($this->request['key'] != $this->member->form_hash) { $this->registry->output->showError('warn_bad_key', 3020); } //----------------------------------------- // As Celine Dion once squawked, "Show me the reason" //----------------------------------------- if (trim($this->request['reason']) == "") { $this->_showForm('we_no_reason'); return; } //----------------------------------------- // Other checks //----------------------------------------- if (!$this->settings['warn_past_max'] && $this->request['level'] != 'nochange') { if ($this->request['level'] == 'custom') { if ($level_custom > $this->settings['warn_max']) { $err = 1; } else { if ($level_custom < $this->settings['warn_min']) { $err = 2; } } } else { if ($this->request['level'] == 'add') { if ($warn_level >= $this->settings['warn_max']) { $err = 1; } } else { if ($warn_level <= $this->settings['warn_min']) { $err = 2; } } } if ($err) { $this->registry->output->showError($err == 1 ? 'warn_past_max_high' : 'warn_past_max_low', 10251); } } //----------------------------------------- // Plussy - minussy? //----------------------------------------- if ($this->request['level'] == 'nochange') { $save['wlog_type'] = 'nochan'; } else { $save['wlog_type'] = $this->request['level'] == 'custom' ? 'custom' : ($this->request['level'] == 'add' ? 'neg' : 'pos'); } $save['wlog_date'] = time(); //----------------------------------------- // Contacting the member? //----------------------------------------- $test_content = trim(IPSText::br2nl($_POST['contact'])); if ($test_content != "") { if (trim($this->request['subject']) == "") { $this->_showForm('we_no_subject'); return; } unset($test_content); if (IPSText::getTextClass('editor')->method == 'rte') { $this->request['contact'] = IPSText::getTextClass('editor')->processRawPost('contact'); } IPSText::getTextClass('bbcode')->parse_smilies = 1; IPSText::getTextClass('bbcode')->parse_html = 0; IPSText::getTextClass('bbcode')->parse_bbcode = 1; IPSText::getTextClass('bbcode')->parsing_section = 'warn'; $save['wlog_contact'] = $this->request['contactmethod']; $save['wlog_contact_content'] = "<subject>" . $this->request['subject'] . "</subject><content>" . $this->request['contact'] . "</content>"; $save['wlog_contact_content'] = IPSText::getTextClass('bbcode')->preDbParse($save['wlog_contact_content']); if ($this->request['contactmethod'] == 'email') { IPSText::getTextClass('bbcode')->parse_smilies = 0; IPSText::getTextClass('bbcode')->parse_html = 1; IPSText::getTextClass('bbcode')->parse_bbcode = 1; IPSText::getTextClass('bbcode')->parsing_section = 'warn'; IPSText::getTextClass('bbcode')->parsing_mgroup = $this->memberData['member_group_id']; IPSText::getTextClass('bbcode')->parsing_mgroup_others = $this->memberData['mgroup_others']; $this->request['contact'] = IPSText::getTextClass('bbcode')->preDisplayParse(IPSText::getTextClass('bbcode')->preDbParse($this->request['contact'])); //----------------------------------------- // Send the email //----------------------------------------- IPSText::getTextClass('email')->getTemplate("email_member"); IPSText::getTextClass('email')->buildMessage(array('MESSAGE' => IPSText::br2nl($this->request['contact']), 'MEMBER_NAME' => $this->warn_member['members_display_name'], 'FROM_NAME' => $this->memberData['members_display_name'])); IPSText::getTextClass('email')->subject = $this->request['subject']; IPSText::getTextClass('email')->to = $this->warn_member['email']; IPSText::getTextClass('email')->from = $this->settings['email_out']; IPSText::getTextClass('email')->sendMail(); } else { //----------------------------------------- // Grab PM class //----------------------------------------- require_once IPSLib::getAppDir('members') . '/sources/classes/messaging/messengerFunctions.php'; $messengerFunctions = new messengerFunctions($this->registry); try { $messengerFunctions->sendNewPersonalTopic($this->warn_member['member_id'], $this->memberData['member_id'], array(), $this->request['subject'], IPSText::getTextClass('editor')->method == 'rte' ? nl2br($_POST['contact']) : $_POST['contact'], array('origMsgID' => 0, 'fromMsgID' => 0, 'postKey' => md5(microtime()), 'trackMsg' => 0, 'addToSentFolder' => 0, 'hideCCUser' => 0, 'forcePm' => 1)); } catch (Exception $error) { $msg = $error->getMessage(); $toMember = IPSMember::load($this->warn_member['member_id'], 'core'); if (strstr($msg, 'BBCODE_')) { $msg = str_replace('BBCODE_', '', $msg); $this->registry->output->showError($msg, 10252); } else { if (isset($this->lang->words['err_' . $msg])) { $this->lang->words['err_' . $msg] = $this->lang->words['err_' . $msg]; $this->lang->words['err_' . $msg] = str_replace('#NAMES#', implode(",", $messengerFunctions->exceptionData), $this->lang->words['err_' . $msg]); $this->lang->words['err_' . $msg] = str_replace('#TONAME#', $toMember['members_display_name'], $this->lang->words['err_' . $msg]); $this->lang->words['err_' . $msg] = str_replace('#FROMNAME#', $this->memberData['members_display_name'], $this->lang->words['err_' . $msg]); $this->registry->output->showError('err_' . $msg, 10253); } else { if ($msg != 'CANT_SEND_TO_SELF') { $_msgString = $this->lang->words['err_UNKNOWN'] . ' ' . $msg; $this->registry->output->showError($_msgString, 10254); } } } } } } else { unset($test_content); } //----------------------------------------- // Right - is we banned or wha? //----------------------------------------- $restrict_post = ''; $mod_queue = ''; $susp = ''; $_notes = array(); $_notes['content'] = $this->request['reason']; $_notes['mod'] = $this->request['mod_value']; $_notes['post'] = $this->request['post_value']; $_notes['susp'] = $this->request['susp_value']; $_notes['ban'] = $ban_indef; $_notes['topicPosts_type'] = $topicPosts_type; $_notes['topicPosts_topics'] = $topicPosts_topics; $_notes['topicPosts_replies'] = $topicPosts_replies; $_notes['topicPosts_lastx'] = $topicPosts_lastx; $_notes['topicPosts_lastxunits'] = $topicPosts_lastxunits; $save['wlog_notes'] = serialize($_notes); //----------------------------------------- // Member Content //----------------------------------------- if ($topicPosts_type == 'unapprove' or $topicPosts_type == 'approve') { $time = $topicPosts_lastxunits == 'd' ? $topicPosts_lastx * 24 : $topicPosts_lastx; $approve = $topicPosts_type == 'approve' ? TRUE : FALSE; if ($topicPosts_topics and $this->canApproveTopics and ($topicPosts_replies and $this->canApprovePosts)) { $moderatorLibrary->toggleApproveMemberContent($this->warn_member['member_id'], $approve, 'all', $time); } else { if ($topicPosts_topics and $this->canApproveTopics) { $moderatorLibrary->toggleApproveMemberContent($this->warn_member['member_id'], $approve, 'topics', $time); } else { if ($topicPosts_replies and $this->canApprovePosts) { $moderatorLibrary->toggleApproveMemberContent($this->warn_member['member_id'], $approve, 'replies', $time); } } } } else { if ($topicPosts_type == 'delete') { $time = $topicPosts_lastxunits == 'd' ? $topicPosts_lastx * 24 : $topicPosts_lastx; if ($topicPosts_topics and $this->canDeleteTopics and ($topicPosts_replies and $this->canDeletePosts)) { $moderatorLibrary->deleteMemberContent($this->warn_member['member_id'], 'all', $time); } else { if ($topicPosts_topics and $this->canDeleteTopics) { $moderatorLibrary->deleteMemberContent($this->warn_member['member_id'], 'topics', $time); } else { if ($topicPosts_replies and $this->canDeletePosts) { $moderatorLibrary->deleteMemberContent($this->warn_member['member_id'], 'replies', $time); } } } } } //----------------------------------------- // Member Suspension //----------------------------------------- if ($this->canModQueue) { if ($this->request['mod_indef'] == 1) { $mod_queue = 1; } elseif ($this->request['mod_value'] > 0) { $mod_queue = IPSMember::processBanEntry(array('timespan' => intval($this->request['mod_value']), 'unit' => $this->request['mod_unit'])); } } if ($this->canRemovePostAbility) { if ($this->request['post_indef'] == 1) { $restrict_post = 1; } elseif ($this->request['post_value'] > 0) { $restrict_post = IPSMember::processBanEntry(array('timespan' => intval($this->request['post_value']), 'unit' => $this->request['post_unit'])); } } if ($this->canSuspend) { if ($ban_indef) { $member_banned = 1; } else { if ($this->request['susp_value'] > 0) { $susp = IPSMember::processBanEntry(array('timespan' => intval($this->request['susp_value']), 'unit' => $this->request['susp_unit'])); } } /* Were banned but now unticked? */ if (!$ban_indef and $member_banned) { $member_banned = 0; } } $save['wlog_mid'] = $this->warn_member['member_id']; $save['wlog_addedby'] = $this->memberData['member_id']; //----------------------------------------- // Enter into warn loggy poos (eeew - poo) //----------------------------------------- $this->DB->insert('warn_logs', $save); //----------------------------------------- // Update member //----------------------------------------- if ($this->request['level'] != 'nochange') { if ($this->request['level'] == 'custom') { $warn_level = $level_custom; } else { if ($this->request['level'] == 'add') { $warn_level++; } else { $warn_level--; } } if ($warn_level > $this->settings['warn_max']) { $warn_level = $this->settings['warn_max']; } if ($warn_level < intval($this->settings['warn_min'])) { $warn_level = intval($this->settings['warn_min']); } } IPSMember::save($this->warn_member['member_id'], array('core' => array('mod_posts' => $mod_queue, 'restrict_post' => $restrict_post, 'temp_ban' => $susp, 'member_banned' => $member_banned, 'warn_level' => $warn_level, 'warn_lastwarn' => time()))); //----------------------------------------- // Now what? Show success screen, that's what!! //----------------------------------------- $this->lang->words['w_done_te'] = sprintf($this->lang->words['w_done_te'], $this->warn_member['members_display_name']); $tid = intval($this->request['t']); $topic = array(); if ($tid > 0) { $topic = $this->DB->buildAndFetch(array('select' => 't.tid, t.title, t.title_seo', 'from' => array('topics' => 't'), 'where' => "t.tid={$tid}", 'add_join' => array(array('select' => 'f.id, f.name, f.name_seo', 'from' => array('forums' => 'f'), 'where' => 'f.id=t.forum_id', 'type' => 'left')))); } $this->output .= $this->registry->getClass('output')->getTemplate('mod')->warn_success($topic); }
/** * Get fast reply status * * @return string */ public function _getFastReplyData() { /* Hang on, can we post? */ if ($this->memberData['member_id']) { if ($this->memberData['unacknowledged_warnings'] and !$this->memberData['restrict_post']) { //return false; } elseif ($this->memberData['restrict_post']) { $data = IPSMember::processBanEntry($this->memberData['restrict_post']); if ($data['date_end']) { if (time() >= $data['date_end']) { IPSMember::save($this->memberData['member_id'], array('core' => array('restrict_post' => 0))); } else { return false; } } else { return false; } } } /* Init */ $topicData = $this->registry->getClass('topics')->getTopicData(); $forumData = $this->forumClass->getForumById($topicData['forum_id']); $show = false; if ($this->registry->permissions->check('reply', $forumData) == TRUE and ($topicData['state'] != 'closed' or $this->memberData['g_post_closed']) and $topicData['_ppd_ok'] === TRUE and !$topicData['poll_only']) { $show = true; } return $show; }
/** * Shows the edit box * * @access public * @return void */ public function editBoxShow() { //----------------------------------------- // INIT //----------------------------------------- $pid = intval($this->request['p']); $fid = intval($this->request['f']); $tid = intval($this->request['t']); $show_reason = 0; //----------------------------------------- // Check P|T|FID //----------------------------------------- if (!$pid or !$tid or !$fid) { $this->returnString('error'); } if ($this->memberData['member_id']) { if ($this->memberData['restrict_post']) { if ($this->memberData['restrict_post'] == 1) { $this->returnString('nopermission'); } $post_arr = IPSMember::processBanEntry($this->memberData['restrict_post']); if (time() >= $post_arr['date_end']) { //----------------------------------------- // Update this member's profile //----------------------------------------- IPSMember::save($this->memberData['member_id'], array('core' => array('restrict_post' => 0))); } else { $this->returnString('nopermission'); } } } //----------------------------------------- // Get classes //----------------------------------------- if (!is_object($this->postClass)) { require_once IPSLib::getAppDir('forums') . "/sources/classes/post/classPost.php"; require_once IPSLib::getAppDir('forums') . "/sources/classes/post/classPostForms.php"; $this->registry->getClass('class_localization')->loadLanguageFile(array('public_editors'), 'core'); $this->postClass = new classPostForms($this->registry); } # Forum Data $this->postClass->setForumData($this->registry->getClass('class_forums')->forum_by_id[$fid]); # IDs $this->postClass->setTopicID($tid); $this->postClass->setPostID($pid); $this->postClass->setForumID($fid); /* Topic Data */ $this->postClass->setTopicData($this->DB->buildAndFetch(array('select' => 't.*, p.poll_only', 'from' => array('topics' => 't'), 'where' => "t.forum_id={$fid} AND t.tid={$tid}", 'add_join' => array(array('type' => 'left', 'from' => array('polls' => 'p'), 'where' => 'p.tid=t.tid'))))); # Set Author $this->postClass->setAuthor($this->member->fetchMemberData()); # Get Edit form try { $html = $this->postClass->displayAjaxEditForm(); $html = $this->registry->output->replaceMacros($html); $this->returnHtml($html); } catch (Exception $error) { $this->returnString($error->getMessage()); } }
/** * Fetch a status message about post moderation status * * @access public * @param array Array of member data * @param array Array of forum data * @param array Array of topic data * @param string reply/new (Type of message) * @return string */ public function fetchPostModerationStatusMessage($memberData, $forum, $topic, $type = 'reply') { if (is_array($memberData) and is_array($forum) and is_array($topic)) { $group = $this->caches['group_cache'][$memberData['member_group_id']]; /* If our group can avoid the Q... */ if ($group['g_avoid_q']) { return ''; } /* Fetch correct language */ if (!isset($this->lang->words['status_ppd_posts'])) { $this->registry->class_localization->loadLanguageFile(array('public_topic'), 'forums'); } /* First - are we mod queued? */ if ($memberData['mod_posts']) { if ($memberData['mod_posts'] == 1) { return $this->lang->words['ms_mod_q']; } else { /* Do we need to remove the mod queue for this user? */ $mod_arr = IPSMember::processBanEntry($memberData['mod_posts']); /* Yes, they are ok now */ if (time() >= $mod_arr['date_end']) { IPSMember::save($memberData['member_id'], array('core' => array('mod_posts' => 0))); return FALSE; } else { return sprintf($this->lang->words['ms_mod_q'] . ' ' . $this->lang->words['ms_mod_q_until'], $this->lang->getDate($mod_arr['date_end'], 'long')); } } } /* Next, try to see if this is forum specific */ switch (intval($forum['preview_posts'])) { case 1: return $this->lang->words['ms_mod_q']; break; case 2: if ($type == 'new') { return $this->lang->words['ms_mod_q']; } break; case 3: if ($type == 'reply') { return $this->lang->words['ms_mod_q']; } break; } /* Next, see if our group has moderator posties on */ if ($group['g_mod_preview']) { /* Do we only limit for x posts/days? */ if ($group['g_mod_post_unit']) { if ($group['gbw_mod_post_unit_type']) { /* Days.. .*/ if ($memberData['joined'] > time() - 86400 * $group['g_mod_post_unit']) { return sprintf($this->lang->words['ms_mod_q'] . ' ' . $this->lang->words['ms_mod_q_until'], $this->lang->getDate($memberData['joined'] + 86400 * $group['g_mod_post_unit'], 'long')); } } else { /* Posts */ if ($memberData['posts'] < $group['g_mod_post_unit']) { return sprintf($this->lang->words['ms_mod_q'] . ' ' . $this->lang->words['ms_mod_q_until_posts'], $group['g_mod_post_unit'] - $memberData['posts']); } } } else { /* No limit, but still checking moderating */ return $this->lang->words['ms_mod_q']; } } } return ''; }
/** * Main class entry point * * @param object ipsRegistry reference * @return @e void [Outputs to screen] */ public function doExecute(ipsRegistry $registry) { //----------------------------------------- // Load lang file //----------------------------------------- ipsRegistry::getClass('class_localization')->loadLanguageFile(array('public_chat')); ipsRegistry::getClass('class_localization')->loadLanguageFile(array('public_editors'), 'core'); //----------------------------------------- // IPB 3.1 //----------------------------------------- if ($this->settings['ipb_reg_number']) { $this->settings['ipschat_account_key'] = $this->settings['ipb_reg_number']; } //----------------------------------------- // Check that we have the key //----------------------------------------- if (!$this->settings['ipschat_account_key']) { $this->registry->output->showError('no_chat_account_number', 'CHAT-01'); } $this->settings['ipschat_account_key'] = trim($this->settings['ipschat_account_key']); //----------------------------------------- // Can we access? //----------------------------------------- $access_groups = explode(",", $this->settings['ipschat_group_access']); $my_groups = array($this->memberData['member_group_id']); if ($this->memberData['mgroup_others']) { $my_groups = array_merge($my_groups, explode(",", IPSText::cleanPermString($this->memberData['mgroup_others']))); } $access_allowed = false; foreach ($my_groups as $group_id) { if (in_array($group_id, $access_groups)) { $access_allowed = 1; break; } } if (!$access_allowed) { $this->registry->output->showError('no_chat_access', 'CHAT-02'); } //----------------------------------------- // Is this a guest we banned? //----------------------------------------- if (!$this->memberData['member_id'] and IPSCookie::get('chat_blocked')) { $this->registry->output->showError('no_chat_access', 'CHAT-021'); } //----------------------------------------- // Is this a spider? //----------------------------------------- if ($this->member->is_not_human) { $this->registry->output->showError('no_chat_access', 'CHAT-022'); } //----------------------------------------- // Is this a banned member? //----------------------------------------- if ($this->memberData['chat_banned']) { $this->registry->output->showError('no_chat_access', 'CHAT-03'); } //----------------------------------------- // Is it offline? //----------------------------------------- if (!$this->settings['ipschat_online']) { $offline_groups = explode(",", $this->settings['ipschat_offline_groups']); $access_allowed = false; foreach ($my_groups as $group_id) { if (in_array($group_id, $offline_groups)) { $access_allowed = 1; break; } } if (!$access_allowed) { $this->_isOffline(); } } //----------------------------------------- // Chat only online during certain hours of the day //----------------------------------------- if ($this->settings['ipschat_online_start'] and $this->settings['ipschat_online_end']) { $_currentHour = gmstrftime('%H') + ($this->settings['time_offset'] - ($this->memberData['dst_in_use'] ? -1 : 0)); //----------------------------------------- // Rollback if we cross midnight //----------------------------------------- if ($_currentHour < 0) { $_currentHour = 24 + $_currentHour; } //----------------------------------------- // Open 12:00 - 15:00 //----------------------------------------- if ($this->settings['ipschat_online_end'] > $this->settings['ipschat_online_start']) { if (!($_currentHour >= $this->settings['ipschat_online_start']) or !($_currentHour < $this->settings['ipschat_online_end'])) { $this->_isOffline(); } } else { $_open = true; //----------------------------------------- // Only check if we are not past the start time yet // i.e. if at 23:00 we know it's open //----------------------------------------- if (!($_currentHour >= $this->settings['ipschat_online_start'])) { //----------------------------------------- // Now, if we're past end time, it's closed // since we already know it's not past start time //----------------------------------------- if ($_currentHour >= $this->settings['ipschat_online_end']) { $_open = false; } } if (!$_open) { $this->_isOffline(); } } } //----------------------------------------- // Did we request to leave chat? //----------------------------------------- if ($this->request['do'] == 'leave') { $this->_leaveChat(); } //----------------------------------------- // Post restriction or unacknowledged warnings? //----------------------------------------- if ($this->memberData['member_id']) { $message = ''; if ($this->memberData['restrict_post']) { $data = IPSMember::processBanEntry($this->memberData['restrict_post']); if ($data['date_end']) { if (time() >= $data['date_end']) { IPSMember::save($this->memberData['member_id'], array('core' => array('restrict_post' => 0))); } else { $message = sprintf($this->lang->words['warnings_restrict_post_temp'], $this->lang->getDate($data['date_end'], 'JOINED')); } } else { $message = $this->lang->words['warnings_restrict_post_perm']; } if ($this->memberData['unacknowledged_warnings']) { $warn = ipsRegistry::DB()->buildAndFetch(array('select' => '*', 'from' => 'members_warn_logs', 'where' => "wl_member={$this->memberData['member_id']} AND wl_rpa<>0", 'order' => 'wl_date DESC', 'limit' => 1)); if ($warn['wl_id']) { $moredetails = "<a href='javascript:void(0);' onclick='warningPopup( this, {$warn['wl_id']} )'>{$this->lang->words['warnings_moreinfo']}</a>"; } } $this->registry->getClass('output')->showError("{$message} {$moredetails}", '10CHAT126', null, null, 403); } if (empty($message)) { if ($this->memberData['unacknowledged_warnings']) { $unAcknowledgedWarns = ipsRegistry::DB()->buildAndFetch(array('select' => '*', 'from' => 'members_warn_logs', 'where' => "wl_member={$this->memberData['member_id']} AND wl_acknowledged=0", 'order' => 'wl_date DESC', 'limit' => 1)); if ($unAcknowledgedWarns['wl_id']) { $this->registry->getClass('output')->silentRedirect($this->registry->getClass('output')->buildUrl("app=members&module=profile&section=warnings&do=acknowledge&id={$unAcknowledgedWarns['wl_id']}")); } } } } //----------------------------------------- // Moderator permissions //----------------------------------------- $permissions = 0; $private = 0; if ($this->settings['ipschat_mods']) { $mod_groups = explode(",", $this->settings['ipschat_mods']); foreach ($my_groups as $group_id) { if (in_array($group_id, $mod_groups)) { $permissions = 1; break; } } } if ($this->settings['ipschat_private']) { $mod_groups = explode(",", $this->settings['ipschat_private']); foreach ($my_groups as $group_id) { if (in_array($group_id, $mod_groups)) { $private = 1; break; } } } //----------------------------------------- // Agree to rules? //----------------------------------------- if ($this->settings['ipschat_enable_rules']) { if (!$_POST['agree']) { $this->agreeToTerms(); return; } } //----------------------------------------- // Get going! //----------------------------------------- $userId = 0; $userName = $this->cleanUsername($this->memberData['member_id'] ? $this->memberData['members_display_name'] : $this->lang->words['global_guestname']); $roomId = 0; $accessKey = ''; $result = $this->_callServer(self::MASTERSERVER . "gateway31.php?api_key={$this->settings['ipschat_account_key']}&user={$userName}&level={$permissions}"); $results = explode(',', $result); if ($results[0] == 0) { $this->registry->output->showError($this->lang->words['connect_gw_error_' . $results[1]] ? $this->lang->words['connect_gw_error_' . $results[1]] : $this->lang->words['connect_error'], 'CSTART-' . intval($results[1])); } $roomId = intval($results[3]); $serverHost = $results[1]; $serverPath = $results[2]; //----------------------------------------- // This a guest with a chat user id? //----------------------------------------- $_extra = ''; if (!$this->memberData['member_id']) { $_extra = "&userid=" . intval(IPSCookie::get('chat_user_id')); } //----------------------------------------- // Join chat room //----------------------------------------- $result = $this->_callServer("http://{$serverHost}{$serverPath}/join31.php?api_key={$this->settings['ipschat_account_key']}&user={$userName}&level={$permissions}&room={$roomId}&forumid={$this->memberData['member_id']}&forumgroup={$this->memberData['member_group_id']}{$_extra}"); $results = explode(',', $result); if ($results[0] == 0) { $this->registry->output->showError($this->lang->words['connect_error_' . $results[1]] ? $this->lang->words['connect_error_' . $results[1]] : $this->lang->words['connect_error'], 'CJOIN-' . intval($results[1])); } $userId = $results[1]; $accessKey = $results[2]; //----------------------------------------- // Set the options... //----------------------------------------- $options = array('roomId' => $roomId, 'userId' => $userId, 'accessKey' => $accessKey, 'serverHost' => $serverHost, 'serverPath' => $serverPath, 'ourUrl' => urlencode($this->settings['board_url']), 'moderator' => $permissions, 'private' => $private); $this->cache->setCache('chatserver', array('host' => $serverHost, 'path' => $serverPath), array('donow' => 1, 'array' => 1)); //----------------------------------------- // Remember guest so they don't flood the room //----------------------------------------- if (!$this->memberData['member_id']) { IPSCookie::set('chat_user_id', $userId); } //----------------------------------------- // Get online list //----------------------------------------- $online = array(); $memberIds = array(); $result = $this->_callServer("http://{$serverHost}{$serverPath}/list.php?room={$roomId}&user={$userId}&access_key={$accessKey}"); if ($result) { $results = explode("~~||~~", $result); if ($results[0] == 1) { foreach ($results as $k => $v) { if ($k == 0) { continue; } $_thisRecord = explode(',', $v); if (!$_thisRecord[0]) { continue; } $online[] = array('user_id' => $_thisRecord[0], 'user_name' => str_replace('~~#~~', ',', $_thisRecord[1]), 'forum_id' => $_thisRecord[2]); if ($_thisRecord[0] == $userId) { $userName = str_replace('~~#~~', ',', $_thisRecord[1]); } $memberIds[$_thisRecord[2]] = intval($_thisRecord[2]); } } } $members = IPSMember::load($memberIds); $chatters = array(); foreach ($online as $_online) { $_online['member'] = IPSMember::buildDisplayData($members[$_online['forum_id']]); $_online['member']['prefix'] = str_replace('"', '__DBQ__', $_online['member']['prefix']); $_online['member']['suffix'] = str_replace('"', '__DBQ__', $_online['member']['suffix']); $_online['member']['members_display_name'] = $_online['member']['member_id'] ? $_online['member']['members_display_name'] : $this->lang->words['global_guestname'] . "_" . $_online['user_id']; $_online['member']['_canBeIgnored'] = $_online['member']['member_id'] ? $_online['member']['_canBeIgnored'] : 1; $_online['member']['g_id'] = $_online['member']['member_id'] ? $_online['member']['g_id'] : $this->settings['guest_group']; $chatters[$_online['forum_id'] ? strtolower($members[$_online['forum_id']]['members_display_name']) : $_online['user_name']] = $_online; } ksort($chatters); //----------------------------------------- // Add ignored guests to list //----------------------------------------- $_ignored = IPSCookie::get('chat_ignored_guests'); if ($_ignored) { $_userIds = explode(',', IPSText::cleanPermString($_ignored)); foreach ($_userIds as $_userId) { $this->memberData['_ignoredUsers']['g_' . $_userId] = array('ignore_chats' => 1); } } //----------------------------------------- // Output //----------------------------------------- $this->output .= $this->registry->getClass('output')->getTemplate('ipchat')->chatRoom($options, $chatters); //----------------------------------------- // Put us in "chatting" //----------------------------------------- $tmp_cache = $this->cache->getCache('chatting'); $new_cache = array(); if (is_array($tmp_cache) and count($tmp_cache)) { foreach ($tmp_cache as $id => $data) { //----------------------------------------- // Not hit in 2 mins? //----------------------------------------- if ($data['updated'] < time() - 120) { continue; } //----------------------------------------- // This us? //----------------------------------------- if ($data['member_id'] == $this->memberData['member_id']) { $data['updated'] = time(); } //----------------------------------------- // No user id? //----------------------------------------- if (!$data['userid']) { continue; } //----------------------------------------- // Not online according to server? //----------------------------------------- $_isOnlineServer = false; foreach ($online as $_serverOnline) { if ($_serverOnline['user_id'] == $data['userid']) { $_isOnlineServer = true; } } if (!$_isOnlineServer) { continue; } $new_cache[$data['userid']] = $data; } } if (!$new_cache[$userId]) { $new_cache[$userId] = array('updated' => time(), 'userid' => $userId, 'username' => $this->memberData['member_id'] ? $this->memberData['members_display_name'] : $userName, 'member_id' => $this->memberData['member_id']); } //----------------------------------------- // Add any from server that are missing //----------------------------------------- foreach ($online as $_serverOnline) { if (!isset($new_cache[$_serverOnline['user_id']])) { $new_cache[$_serverOnline['user_id']] = array('updated' => time(), 'userid' => $_serverOnline['user_id'], 'username' => $_serverOnline['user_name'], 'member_id' => $_serverOnline['forum_id']); } } //----------------------------------------- // Update cache //----------------------------------------- $this->cache->setCache('chatting', $new_cache, array('donow' => 1, 'array' => 1)); //----------------------------------------- // Add our JS files //----------------------------------------- $this->registry->output->addToDocumentHead('javascript', $this->settings['public_dir'] . 'sounds/soundmanager2-nodebug-jsmin.js'); $this->registry->output->addToDocumentHead('raw', "<script type='text/javascript'>document.observe('dom:loaded', function() { soundManager.url = '{$this->settings['public_dir']}sounds/';soundManager.debugMode=false; });</script>"); //$this->registry->output->addToDocumentHead( 'javascript', $this->settings['public_dir'] . 'js/ips.chat.js' ); $_ie = <<<EOF <!--[if lte IE 7]> \t<link rel="stylesheet" type="text/css" title='ChatIE7' media="screen" href="{$this->settings['public_dir']}style_css/ipchat_ie.css" /> <![endif]--> EOF; $this->registry->output->addToDocumentHead('raw', $_ie); //----------------------------------------- // Show chat.. //----------------------------------------- $this->registry->output->addNavigation(IPSLib::getAppTitle('ipchat'), ''); $this->registry->output->setTitle(IPSLib::getAppTitle('ipchat') . ' - ' . $this->settings['board_name']); if ($this->request['_popup']) { $this->registry->output->popUpWindow($this->output); } else { $this->registry->output->addContent($this->output); $this->registry->output->sendOutput(); } }
/** * Suspend a member [process] * * @access private * @return void [Outputs to screen] */ private function _memberSuspendDo() { $this->request['member_id'] = intval($this->request['member_id']); if (!$this->request['member_id']) { $this->registry->output->showError($this->lang->words['m_specify'], 11232); } $member = IPSMember::load($this->request['member_id']); if (!$member['member_id']) { $this->registry->output->showError($this->lang->words['m_noid'], 11233); } //----------------------------------------- // Allowed to suspend administrators? //----------------------------------------- if ($member['g_access_cp'] and !$this->registry->getClass('class_permissions')->checkPermission('member_suspend_admin')) { $this->registry->output->global_message = $this->lang->words['m_suspadmin']; $this->_memberView(); return; } //----------------------------------------- // Work out end date //----------------------------------------- $this->request['timespan'] = intval($this->request['timespan']); if ($this->request['timespan'] == "") { $new_ban = ""; } else { $new_ban = IPSMember::processBanEntry(array('timespan' => intval($this->request['timespan']), 'unit' => $this->request['units'])); } $show_ban = IPSMember::processBanEntry($new_ban); //----------------------------------------- // Update and show confirmation //----------------------------------------- IPSMember::save($member['member_id'], array('core' => array('temp_ban' => $new_ban))); // I say, did we choose to email 'dis member? if ($this->request['send_email']) { // By golly, we did! $msg = trim(IPSText::stripslashes($_POST['email_contents'])); $msg = str_replace("{membername}", $member['members_display_name'], $msg); $msg = str_replace("{date_end}", ipsRegistry::getClass('class_localization')->getDate($show_ban['date_end'], 'LONG'), $msg); IPSText::getTextClass('email')->message = stripslashes(IPSText::getTextClass('email')->cleanMessage($msg)); IPSText::getTextClass('email')->subject = $this->lang->words['m_acctsusp']; IPSText::getTextClass('email')->to = $member['email']; IPSText::getTextClass('email')->sendMail(); } //----------------------------------------- // Redirect //----------------------------------------- ipsRegistry::getClass('adminFunctions')->saveAdminLog(sprintf($this->lang->words['m_susplog'], $member['members_display_name'])); $this->registry->output->doneScreen($this->lang->words['m_suspended'], $this->lang->words['m_search'], "{$this->form_code}&do=viewmember&member_id={$member['member_id']}", "redirect"); }
/** * Member editing screen * * @access public * @param array Member data * @param array Content * @param string Menu * @return string HTML */ public function member_view($member, $content = array(), $menu) { // Let's get to work..... :/ $_m_groups = array(); $_m_groups_others = array(); foreach (ipsRegistry::cache()->getCache('group_cache') as $id => $data) { // If we are viewing our own profile, don't show non admin groups as a primary group option to prevent the user from // accidentally removing their own ACP access. Groups without ACP access can still be selected as secondary groups. if ($member['member_id'] == $this->memberData['member_id']) { //----------------------------------------- // If we can't access cp via primary group //----------------------------------------- if (!$this->caches['group_cache'][$member['member_group_id']]['g_access_cp']) { //----------------------------------------- // Can this group access cp? //----------------------------------------- if (!$data['g_access_cp']) { $_m_groups[] = array($data['g_id'], $data['g_title']); $_m_groups_others[] = array($data['g_id'], $data['g_title']); } else { $_m_groups_others[] = array($data['g_id'], $data['g_title']); } } else { if (!$data['g_access_cp']) { $_m_groups_others[] = array($data['g_id'], $data['g_title']); } else { $_m_groups[] = array($data['g_id'], $data['g_title']); $_m_groups_others[] = array($data['g_id'], $data['g_title']); } } } else { $_m_groups[] = array($data['g_id'], $data['g_title']); $_m_groups_others[] = array($data['g_id'], $data['g_title']); } } $years = array(array(0, '----')); $months = array(array(0, '--------')); $days = array(array(0, '--')); foreach (range(1, 31) as $_day) { $days[] = array($_day, $_day); } foreach (array_reverse(range(date('Y') - 100, date('Y'))) as $_year) { $years[] = array($_year, $_year); } foreach (range(1, 12) as $_month) { $months[] = array($_month, $this->lang->words['M_' . $_month]); } $time_zones = array(); foreach ($this->lang->words as $k => $v) { if (strpos($k, 'time_') === 0) { if (preg_match("/[\\-0-9]/", substr($k, 5))) { $offset = floatval(substr($k, 5)); $time_zones[] = array($offset, $v); } } } $languages = array(); foreach (ipsRegistry::cache()->getCache('lang_data') as $language) { $languages[] = array($language['lang_id'], $language['lang_title']); } $_skin_list = $this->registry->output->generateSkinDropdown(); array_unshift($_skin_list, array(0, $this->lang->words['sm_skinnone'])); $skinList = ipsRegistry::getClass('output')->formDropdown("skin", $_skin_list, $member['skin']); $form_member_group_id = ipsRegistry::getClass('output')->formDropdown("member_group_id", $_m_groups, $member['member_group_id']); $form_mgroup_others = ipsRegistry::getClass('output')->formMultiDropdown("mgroup_others[]", $_m_groups_others, explode(",", $member['mgroup_others']), 8, 'mgroup_others'); $form_title = ipsRegistry::getClass('output')->formInput("title", $member['title']); $form_warn = ipsRegistry::getClass('output')->formInput("warn_level", $member['warn_level']); $_form_year = ipsRegistry::getClass('output')->formDropdown("bday_year", $years, $member['bday_year']); $_form_month = ipsRegistry::getClass('output')->formDropdown("bday_month", $months, $member['bday_month']); $_form_day = ipsRegistry::getClass('output')->formDropdown("bday_day", $days, $member['bday_day']); $form_time_offset = ipsRegistry::getClass('output')->formDropdown("time_offset", $time_zones, $member['time_offset'] ? floatval($member['time_offset']) : 0); $form_language = ipsRegistry::getClass('output')->formDropdown("language", $languages, $member['language']); $form_hide_email = ipsRegistry::getClass('output')->formYesNo("hide_email", $member['hide_email']); $form_allow_admin_mails = ipsRegistry::getClass('output')->formYesNo("allow_admin_mails", $member['allow_admin_mails']); $form_email_pm = ipsRegistry::getClass('output')->formYesNo("email_pm", $member['email_pm']); $form_members_disable_pm = ipsRegistry::getClass('output')->formYesNo("members_disable_pm", $member['members_disable_pm']); $form_view_sig = ipsRegistry::getClass('output')->formYesNo("view_sigs", $member['view_sigs']); $form_view_pop = ipsRegistry::getClass('output')->formYesNo("view_pop", $member['view_pop']); $form_pp_bio_content = ipsRegistry::getClass('output')->formTextarea("pp_bio_content", $member['pp_bio_content']); $form_identity_url = ipsRegistry::getClass('output')->formInput("identity_url", $member['identity_url']); $form_reputation_points = ipsRegistry::getClass('output')->formInput('pp_reputation_points', $member['pp_reputation_points']); $pp_status = ipsRegistry::getClass('output')->formInput('pp_status', $member['pp_status']); $secure_key = ipsRegistry::getClass('adminFunctions')->getSecurityKey(); $ban_member_css = $member['member_banned'] ? "background-color: #FF0033;font-weight:bold;color:#000;" : ''; $ban_member_text = $member['member_banned'] ? $this->lang->words['sm_unban'] : $this->lang->words['sm_ban']; $spam_member_css = $member['bw_is_spammer'] ? "background-color: #FF0033;font-weight:bold;color:#000;" : ''; $spam_member_text = $member['bw_is_spammer'] ? $this->lang->words['sm_unspam'] : $this->lang->words['sm_spam']; //----------------------------------------- // Comments and friends.. //----------------------------------------- $pp_visitors = ipsRegistry::getClass('output')->formDropdown("pp_setting_count_visitors", array(array(0, 0), array(3, 3), array(5, 5), array(10, 10)), $member['pp_setting_count_visitors']); $pp_enable_comments = ipsRegistry::getClass('output')->formYesNo("pp_setting_count_comments", $member['pp_setting_count_comments']); $pp_enable_friends = ipsRegistry::getClass('output')->formYesNo("pp_setting_count_friends", $member['pp_setting_count_friends']); $_commentsNotify = array(array('none', $this->lang->words['sm_comment_notify_no']), array('email', $this->lang->words['sm_comment_notify_email']), array('pm', $this->lang->words['sm_comment_notify_pm'])); $_friendsNotify = array(array('none', $this->lang->words['sm_friends_notify_no']), array('email', $this->lang->words['sm_friends_notify_email']), array('pm', $this->lang->words['sm_friends_notify_pm'])); $_commentsApprove = array(array('0', $this->lang->words['sm_comments_app_none']), array('1', $this->lang->words['sm_comments_app_on'])); $_friendsApprove = array(array('0', $this->lang->words['sm_friends_app_none']), array('1', $this->lang->words['sm_friends_app_on'])); $pp_comments_notify = ipsRegistry::getClass('output')->formDropdown("pp_setting_notify_comments", $_commentsNotify, $member['pp_setting_notify_comments']); $pp_comments_approve = ipsRegistry::getClass('output')->formDropdown("pp_setting_moderate_comments", $_commentsApprove, $member['pp_setting_moderate_comments']); $pp_friends_notify = ipsRegistry::getClass('output')->formDropdown("pp_setting_notify_friend", $_friendsNotify, $member['pp_setting_notify_friend']); $pp_friends_approve = ipsRegistry::getClass('output')->formDropdown("pp_setting_moderate_friends", $_friendsApprove, $member['pp_setting_moderate_friends']); $suspend_date = ''; if ($member['temp_ban']) { $s_ban = IPSMember::processBanEntry($member['temp_ban']); $suspend_date = "<div style='float:right;'>" . $this->lang->words['member_supsended_til'] . ' ' . ipsRegistry::getClass('class_localization')->getDate($s_ban['date_end'], 'LONG', 1) . "</div>"; } $IPBHTML = ""; $IPBHTML .= <<<HTML <script type="text/javascript" src="{$this->settings['js_main_url']}acp.members.js"></script> <div class='section_title'> \t<h2>{$this->lang->words['editing_member']} <a href='{$this->settings['board_url']}/index.php?showuser={$member['member_id']}'>{$member['members_display_name']}</a></h2> \t<ul class='context_menu'> \t\t<li class='closed'> \t\t\t<a href="#" title='{$this->lang->words['title_delete']}' onclick="return acp.confirmDelete( '{$this->settings['base_url']}app=members&module=members&section=members&do=member_delete&member_id={$member['member_id']}')"> \t\t\t\t<img src='{$this->settings['skin_acp_url']}/_newimages/icons/delete.png' alt='{$this->lang->words['title_delete']}' /> \t\t\t\t{$this->lang->words['form_deletemember']} \t\t\t</a> \t\t</li> \t\t<li> \t\t\t<a id='MF__spam' href='{$this->settings['base_url']}&{$this->form_code}&do=toggleSpam&member_id={$member['member_id']}&secure_key={$secure_key}' title='{$this->lang->words['title_spam']}'><img src='{$this->settings['skin_acp_url']}/_newimages/icons/flag_red.png' alt='{$spam_member_text}' /> {$spam_member_text}</a> \t\t</li> HTML; if ($member['member_group_id'] == $this->settings['auth_group']) { $IPBHTML .= <<<HTML \t\t<li> \t\t\t<a href="{$this->settings['base_url']}app=members&module=members&section=tools&do=do_validating&mid_{$member['member_id']}=1&type=approve&_return={$member['member_id']}" title='{$this->lang->words['title_validate']}'> \t\t\t\t<img src='{$this->settings['skin_acp_url']}/_newimages/icons/tick.png' alt='{$this->lang->words['title_validate']}' /> \t\t\t\t{$this->lang->words['button_validate']} \t\t\t</a> \t\t</li> HTML; } $IPBHTML .= <<<HTML \t\t<li> \t\t\t<a href='#' id='MF__ban2' title='{$this->lang->words['title_ban']}'> \t\t\t\t<img src='{$this->settings['skin_acp_url']}/_newimages/icons/user_warn.png' alt='{$this->lang->words['title_ban']}' /> \t\t\t\t{$ban_member_text} \t\t\t</a> \t\t\t \t\t\t<script type='text/javascript'> \t\t\t\t\$('MF__ban2').observe('click', acp.members.banManager.bindAsEventListener( this, "app=members&module=ajax&section=editform&do=show&name=inline_ban_member&member_id={$member['member_id']}" ) ); \t\t\t</script> \t\t</li> \t\t<li> \t\t\t<a href='#' class='ipbmenu' id='member_tasks' title='{$this->lang->words['title_tasks']}'><img src='{$this->settings['skin_acp_url']}/_newimages/icons/cog.png' /> {$this->lang->words['mem_tasks']} <img src='{$this->settings['skin_acp_url']}/_newimages/useropts_arrow.png' /></a> \t\t</li>\t\t \t</ul> </div> <ul class='ipbmenu_content' id='member_tasks_menucontent' style='display: none'> HTML; if (is_array($menu) and count($menu)) { foreach ($menu as $app => $link) { if (is_array($link) and count($link)) { $apptitle = ucwords($app); foreach ($link as $alink) { $img = $alink['img'] ? $alink['img'] : $this->settings['skin_acp_url'] . '/_newimages/icons/user.png'; $thisLink = $alink['js'] ? 'href="#" onclick="' . $alink['url'] . '"' : "href='{$this->settings['_base_url']}app={$app}&{$alink['url']}&member_id={$member['member_id']}'"; $IPBHTML .= <<<HTML \t\t\t\t\t<li><img src='{$img}' alt='-' /> <a {$thisLink} style='text-decoration: none' >{$alink['title']}</a></li> HTML; } } } } $IPBHTML .= <<<HTML </ul> {$suspend_date} <br style='clear: both' /> HTML; $IPBHTML .= <<<HTML <form style='display:block' action='{$this->settings['base_url']}&{$this->form_code}&do=member_edit&member_id={$member['member_id']}&secure_key={$secure_key}' method='post'> <script type='text/javascript'> \tipb.vars['public_avatar_url'] = "{$this->settings['_original_base_url']}/public/style_avatars/"; </script> \t<script type="text/javascript"> \t//<![CDATA[ \t//_go_go_gadget_editor_hack = true; \t \tdocument.observe("dom:loaded",function() \t{ \tipbAcpTabStrips.register('tab_member'); \t}); \t //]]> \t</script> <ul id='tab_member' class='tab_bar no_title'> \t<li id='tabtab-MEMBERS|1' class=''>{$this->lang->words['mem_tab_basics']}</li> \t<li id='tabtab-MEMBERS|2' class=''>{$this->lang->words['mem_tab_profile']}</li> \t<li id='tabtab-MEMBERS|3' class=''>{$this->lang->words['mem_tab_custom_fields']}</li> \t<li id='tabtab-MEMBERS|4' class=''>{$this->lang->words['sm_sigtab']}</li> \t<li id='tabtab-MEMBERS|5' class=''>{$this->lang->words['sm_abouttab']}</li> HTML; // Got blocks from other apps? $IPBHTML .= implode("\n", $content['tabs']); if ($this->settings['auth_allow_dnames']) { $display_name = <<<HTML \t\t\t<tr> \t\t\t\t<td><strong>{$this->lang->words['mem_display_name']}</strong></td> \t\t\t\t<td> \t\t\t\t\t<span class='member_detail' id='MF__member_display_name'>{$member['members_display_name']}</span> \t\t\t\t\t<a class='change_icon' id='MF__member_display_name_popup' href='' style='cursor:pointer' title='{$this->lang->words['title_display_name']}'>{$this->lang->words['mem_change_button']}</a> \t\t\t\t\t \t\t\t\t\t<script type='text/javascript'> \t\t\t\t\t\t\$('MF__member_display_name_popup').observe('click', acp.members.editField.bindAsEventListener( this, 'MF__member_display_name', "{$this->lang->words['sm_display']}", "app=members&module=ajax&section=editform&do=show&name=inline_form_display_name&member_id={$member['member_id']}" ) ); \t\t\t\t\t</script> \t\t\t\t</td> \t\t\t</tr> HTML; } else { $display_name = ''; } $openIdEnabled = false; $openid = ''; foreach ($this->cache->getCache('login_methods') as $method) { if ($method['login_folder_name'] == 'openid') { $openIdEnabled = true; } } if ($openIdEnabled) { $openid = <<<HTML \t\t\t<tr> \t\t\t\t<td><strong>{$this->lang->words['mem_identity_url']}</strong></td> \t\t\t\t<td> \t\t\t\t\t<span class='member_detail' id='MF__identity_url'>{$form_identity_url}</span> \t\t\t\t</td> \t\t\t</tr> HTML; } /* Facebook doesn't pass a size, so in IPB we get around that by passing * as a width. This confuses the form here, so.. */ $_pp_box_width = ($member['pp_main_width'] == '*' or $member['pp_main_width'] < 100) ? '100' : $member['pp_main_width']; $IPBHTML .= <<<HTML </ul> <div class='acp-box member_form with_bg'> \t<div id='tabpane-MEMBERS|1'> \t\t<div style='float: left; width: 70%'> \t\t\t<table class='alternate_rows double_pad top_align'> \t\t\t\t{$display_name} \t\t\t\t<tr> \t\t\t\t\t<td><strong>{$this->lang->words['mem_login_name']}</strong></td> \t\t\t\t\t<td> \t\t\t\t\t\t<span class='member_detail' id='MF__name'>{$member['name']}</span> \t\t\t\t\t\t<a href='' class='change_icon' style='cursor:pointer' id='MF__name_popup' title='{$this->lang->words['title_login_name']}'>{$this->lang->words['mem_change_button']}</a> \t\t\t\t\t\t<script type='text/javascript'> \t\t\t\t\t\t\t\$('MF__name_popup').observe('click', acp.members.editField.bindAsEventListener( this, 'MF__name', "{$this->lang->words['sm_loginname']}", "app=members&module=ajax&section=editform&do=show&name=inline_form_name&member_id={$member['member_id']}" ) ); \t\t\t\t\t\t</script> \t\t\t\t\t</td> \t\t\t\t</tr> \t\t\t\t<tr> \t\t\t\t\t<td><strong>{$this->lang->words['mem_password']}</strong></td> \t\t\t\t\t<td> \t\t\t\t\t\t \t\t\t\t\t\t<span class='member_detail' id='MF__password'>************</span> \t\t\t\t\t\t<a href='' class='change_icon' style='cursor:pointer' id='MF__password_popup' title='{$this->lang->words['title_password']}'>{$this->lang->words['mem_change_button']}</a> \t\t\t\t\t\t<script type='text/javascript'> \t\t\t\t\t\t\t\$('MF__password_popup').observe('click', acp.members.editField.bindAsEventListener( this, 'MF__password', "{$this->lang->words['sm_password']}", "app=members&module=ajax&section=editform&do=show&name=inline_password&member_id={$member['member_id']}" ) ); \t\t\t\t\t\t</script> \t\t\t\t\t</td> \t\t\t\t</tr> \t\t\t\t<tr> \t\t\t\t\t<td><strong>{$this->lang->words['mem_email']}</strong></td> \t\t\t\t\t<td> \t\t\t\t\t\t<span class='member_detail' id='MF__email'>{$member['email']}</span> \t\t\t\t\t\t<a href='' class='change_icon' style='cursor:pointer' id='MF__email_popup' title='{$this->lang->words['title_email']}'>{$this->lang->words['mem_change_button']}</a> \t\t\t\t\t\t<script type='text/javascript'> \t\t\t\t\t\t\t\$('MF__email_popup').observe('click', acp.members.editField.bindAsEventListener( this, 'MF__email', "{$this->lang->words['sm_email']}", "app=members&module=ajax&section=editform&do=show&name=inline_email&member_id={$member['member_id']}" ) ); \t\t\t\t\t\t</script> \t\t\t\t\t</td> \t\t\t\t</tr> \t\t\t\t{$openid} \t\t\t\t<tr> \t\t\t\t\t<td><strong>{$this->lang->words['mem_form_title']}</strong></td> \t\t\t\t\t<td> \t\t\t\t\t\t<span id='MF__title'>{$form_title}</span> \t\t\t\t\t</td> \t\t\t\t</tr> \t\t\t\t<tr> \t\t\t\t\t<td><strong>{$this->lang->words['mem_p_group']}</strong></td> \t\t\t\t\t<td> \t\t\t\t\t\t<span id='MF__member_group_id'>{$form_member_group_id}</span> \t\t\t\t\t</td> \t\t\t\t</tr> \t\t\t\t<tr> \t\t\t\t\t<td><strong>{$this->lang->words['mem_s_group']}</strong></td> \t\t\t\t\t<td> \t\t\t\t\t\t<span id='MF__mgroup_others'>{$form_mgroup_others}</span> \t\t\t\t\t</td> \t\t\t\t</tr> \t\t\t\t<tr> \t\t\t\t\t<td><strong>{$this->lang->words['mem_warn_level']}</strong></td> \t\t\t\t\t<td> \t\t\t\t\t\t\t\t \t\t\t\t\t\t<span id='MF__warn_level'>{$form_warn}</span> <a href='#' onclick="return acp.openWindow('{$this->settings['board_url']}/index.php?app=members&module=warn&section=warn&mid={$member['member_id']}&do=view&popup=1','980','600'); return false;" title='{$this->lang->words['sm_viewnotes']}'><img src='{$this->settings['skin_acp_url']}/_newimages/icons/view.png' alt='{$this->lang->words['sm_viewnotes']}' /></a> \t\t\t\t\t\t <a href='#' onclick="return acp.openWindow('{$this->settings['board_url']}/index.php?app=members&module=warn&section=warn&mid={$member['member_id']}&do=add_note&popup=1','500','450'); return false;" title='{$this->lang->words['sm_addnote']}'><img src='{$this->settings['skin_acp_url']}/images/note_add.png' alt='{$this->lang->words['sm_addnote']}' /></a> \t\t\t\t\t</td> \t\t\t\t </tr> \t\t\t</table> \t\t</div> \t\t<div style='float: left; width: 30%' class='acp-sidebar'> \t\t\t<div style='border:1px solid #369;background:#FFF;width:{$_pp_box_width}px; padding:5px; margin: 10px auto;' id='MF__pp_photo_container'> \t\t\t\t<img id='MF__pp_photo' src="{$member['pp_main_photo']}" width='{$member['pp_main_width']}' height='{$member['pp_main_height']}' /> \t\t\t\t<br /> \t\t\t\t<ul class='photo_options'> HTML; if ($member['_has_photo']) { $IPBHTML .= <<<HTML \t\t\t\t<li><a class='' style='float:none;width:auto;text-align:center;cursor:pointer' id='MF__removephoto' title='{$this->lang->words['mem_remove_photo']}'><img src='{$this->settings['skin_acp_url']}/images/picture_delete.png' alt='{$this->lang->words['mem_remove_photo']}' /></a></li> \t\t\t\t<li><a class='' style='float:none;width:auto;text-align:center;cursor:pointer' id='MF__newphoto' title='{$this->lang->words['sm_uploadnew']}'><img src='{$this->settings['skin_acp_url']}/images/picture_add.png' alt='{$this->lang->words['sm_uploadnew']}' /></a></li> HTML; } else { $IPBHTML .= <<<HTML \t\t\t\t<li><a class='' style='float:none;width:auto;text-align:center;cursor:pointer' id='MF__newphoto' title='{$this->lang->words['sm_uploadnew']}'><img src='{$this->settings['skin_acp_url']}/images/picture_add.png' alt='{$this->lang->words['sm_uploadnew']}' /></a></li> HTML; } $IPBHTML .= <<<HTML \t\t\t\t</ul> \t\t\t\t<script type='text/javascript'> \t\t\t\t\t\$('MF__newphoto').observe('click', acp.members.newPhoto.bindAsEventListener( this, "app=members&module=ajax&section=editform&do=show&name=inline_form_new_photo&member_id={$member['member_id']}" ) ); \t\t\t\t</script> \t\t\t</div> \t\t\t \t\t\t<div class='sidebar_box'> \t\t\t\t<strong>{$this->lang->words['mem_joined']}:</strong> {$member['_joined']}<br /><br /> \t\t\t\t<strong>{$this->lang->words['mem_ip_address_f']}:</strong> <a href='{$this->settings['base_url']}&module=members&section=tools&do=learn_ip&ip={$member['ip_address']}' title='{$this->lang->words['mem_ip_title']}'>{$member['ip_address']}</a> \t\t\t</div> \t\t</div> \t\t<div style='clear: both;'></div> \t</div> HTML; $IPBHTML .= <<<HTML \t<!-- PROFILE PANE--> \t<div id='tabpane-MEMBERS|2' class='tablerow1'> \t<table class='alternate_rows double_pad' cellspacing='0'> \t \t\t\t\t\t<tr> \t\t\t\t\t\t<th colspan='2'>{$this->lang->words['sm_settings']}</th> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>{$this->lang->words['sm_timeoffset']}</strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t\t<span id='MF__time_offset'>{$form_time_offset}</span> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>{$this->lang->words['sm_langchoice']}</strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t\t<span id='MF__language'>{$form_language}</span> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>{$this->lang->words['sm_skinchoice']}</strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t\t<span id='MF__skin'> \t\t\t\t\t\t\t\t{$skinList} \t\t\t\t\t\t\t</span> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>{$this->lang->words['sm_hideemail']}</strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t\t<span id='MF__hide_email'>{$form_hide_email}</span> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>{$this->lang->words['sm_allowadmin']}</strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t\t<span id='MF__allow_admin_mails'>{$form_allow_admin_mails}</span> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>{$this->lang->words['sm_emailpm']}</strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t\t<span id='MF__email_pm'>{$form_email_pm}</span> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>{$this->lang->words['sm_disablepm']}</strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t\t<span id='MF__members_disable_pm'>{$form_members_disable_pm}</span> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>{$this->lang->words['sm_viewsig']}</strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t\t<span id='MF__view_sig'>{$form_view_sig}</span> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>{$this->lang->words['sm_viewpm']}</strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t\t<span id='MF__view_pop'>{$form_view_pop}</span> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t \t\t\t\t\t<tr> \t\t\t\t\t\t<th colspan='2'>{$this->lang->words['sm_profile']}</th> \t\t\t\t\t</tr> \t\t\t\t \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>{$this->lang->words['sm_bday']}</strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t\t<span id='MF__birthday'>{$_form_month} {$_form_day} {$_form_year}</span> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>{$this->lang->words['sm_status']}</strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t\t<span id='MF__status'>{$pp_status}</span> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>{$this->lang->words['sm_statement']}</strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t\t<span id='MF__pp_bio_content'>{$form_pp_bio_content}</span> \t\t\t\t\t\t</td>\t\t\t\t\t\t \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>{$this->lang->words['sm_reputation']}</strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t\t<span id='MF__pp_reputation_points'> \t\t\t\t\t\t\t\t{$form_reputation_points} \t\t\t\t\t\t\t\t<a href='#' onclick="return acp.openWindow('{$this->settings['base_url']}{$this->form_code}&do=view_rep&id={$this->request['member_id']}&type=received','750','550'); return false;" title='{$this->lang->words['sm_rep_view_r']}'><img src='{$this->settings['skin_acp_url']}/_newimages/icons/rep_received.png' alt='{$this->lang->words['sm_rep_view_r']}' /></a> \t\t\t\t\t\t\t\t<a href='#' onclick="return acp.openWindow('{$this->settings['base_url']}{$this->form_code}&do=view_rep&id={$this->request['member_id']}&type=given','750','550'); return false;" title='{$this->lang->words['sm_rep_view_g']}'><img src='{$this->settings['skin_acp_url']}/_newimages/icons/rep_given.png' alt='{$this->lang->words['sm_rep_view_g']}' /></a> \t\t\t\t\t\t\t</span> \t\t\t\t\t\t</td>\t\t\t\t\t\t \t\t\t\t\t</tr> \t\t\t\t\t \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>{$this->lang->words['sm_latest_visitors']}</strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t\t<span id='MF__visitors'>{$pp_visitors}</span> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>{$this->lang->words['sm_enable_comments']}</strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t\t<span id='MF__profile_comments'>{$pp_enable_comments}</span> \t\t\t\t\t\t</td>\t\t\t\t\t\t \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>{$this->lang->words['sm_comment_notify']}</strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t\t<span id='MF__comments_notify'>{$pp_comments_notify}</span> \t\t\t\t\t\t</td>\t\t\t\t\t\t \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>{$this->lang->words['sm_approve_comments']}</strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t\t<span id='MF__comments_approve'>{$pp_comments_approve}</span> \t\t\t\t\t\t</td>\t\t\t\t\t\t \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>{$this->lang->words['sm_friends_profile']}</strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t\t<span id='MF__profile_friends'>{$pp_enable_friends}</span> \t\t\t\t\t\t</td>\t\t\t\t\t\t \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>{$this->lang->words['sm_friends_notify']}</strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t\t<span id='MF__friends_notify'>{$pp_friends_notify}</span> \t\t\t\t\t\t</td>\t\t\t\t\t\t \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>{$this->lang->words['sm_approve_friends']}</strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t\t<span id='MF__friends_approve'>{$pp_friends_approve}</span> \t\t\t\t\t\t</td>\t\t\t\t\t\t \t\t\t\t\t</tr> \t\t\t\t</table> \t</div> \t<!-- / PROFILE PANE --> \t\t \t<!-- SIGNATURE--> \t<div id='tabpane-MEMBERS|4' class='tablerow1 has_editor'> \t\t<div class='editor'> \t\t\t{$member['signature_editor']} \t\t</div> \t</div> \t<!-- / SIGNATURE--> \t\t \t<!-- ABOUT ME--> \t<div id='tabpane-MEMBERS|5' class='tablerow1 has_editor'> \t\t<div class='editor'> \t\t\t{$member['aboutme_editor']} \t\t</div> \t</div> \t<!-- / ABOUT ME--> \t \t<!-- CUSTOM FIELDS PANE--> \t<div id='tabpane-MEMBERS|3' class='tablerow1'> HTML; if (is_array($member['custom_fields']) and count($member['custom_fields'])) { $IPBHTML .= <<<HTML \t\t<table class='alternate_rows double_pad' cellspacing='0'> \t\t\t<tr> \t\t\t\t<th colspan='2'>{$this->lang->words['sm_custom']}</th> \t\t\t</tr> HTML; foreach ($member['custom_fields'] as $_id => $_data) { $IPBHTML .= <<<HTML \t\t\t\t<tr> \t\t\t\t\t<td><strong>{$_data['name']}</strong></td> \t\t\t\t\t<td> \t\t\t\t\t\t<span id='custom_fields_{$_id}'>{$_data['data']}</span> \t\t\t\t\t</td> \t\t\t\t</tr> HTML; } $IPBHTML .= <<<HTML \t\t</table> HTML; } else { $IPBHTML .= <<<HTML \t\t<div>{$this->lang->words['sm_nofields']}</div> HTML; } $IPBHTML .= <<<HTML \t\t \t\t \t\t \t</div> \t<!-- / CUSTOM FIELDS PANE --> HTML; // Got blocks from other apps? $IPBHTML .= implode("\n", $content['area']); $IPBHTML .= <<<HTML <div class='acp-actionbar'><input class='button primary' type='submit' value=' {$this->lang->words['sm_savebutton']} ' /></div> </div> </form> <script type='text/javascript'> \ttry { \t\t/*\$('tabpane-MEMBERS|2').hide(); \t\t\$('tabpane-MEMBERS|3').hide(); \t\t\$('tabpane-MEMBERS|4').hide(); \t\t\$('tabpane-MEMBERS|5').hide();*/ \t} catch(err ){ \t\tDebug.write( err ); \t} \t \tif( \$('MF__removephoto') ) \t{ \t\t\$('MF__removephoto').observe( 'click', acp.members.removePhoto.bindAsEventListener( this, '{$member['member_id']}' ) ); \t} </script> HTML; return $IPBHTML; }
/** * Check for mod posts or restricted posts or ignored * * @param array [Array of author data, uses getAuthor if none] * @param array [Array of status owner information uses $this->_internalData['StatusOwner'] if none] * @return bool */ protected function _okToPost($author = null, $owner = null) { $author = $author === null ? $this->getAuthor() : $author; $owner = $owner === null ? $this->_internalData['StatusOwner'] : $owner; /* Restricted Posting */ if ($author['restrict_post']) { if ($author['restrict_post'] == 1) { return FALSE; } $post_arr = IPSMember::processBanEntry($author['restrict_post']); if (time() >= $post_arr['date_end']) { /* Update this member's profile */ IPSMember::save($author['member_id'], array('core' => array('restrict_post' => 0))); } else { return FALSE; } } /* Moderated Posting */ if ($author['mod_posts']) { if ($author['mod_posts'] == 1) { return FALSE; } else { $mod_arr = IPSMember::processBanEntry($author['mod_posts']); if (time() >= $mod_arr['date_end']) { /* Update this member's profile */ IPSMember::save($author['member_id'], array('core' => array('mod_posts' => 0))); } else { return FALSE; } } } /* Member is ignoring you! */ if (IPSMember::checkIgnoredStatus($author['member_id'], $owner['member_id'], 'messages')) { return false; } return TRUE; }
/** * Main ACP member form * * @access public * @param array Member data * @return string HTML */ public function acp_member_form_main($member) { $masks = array(); ipsRegistry::DB()->build(array('select' => '*', 'from' => 'forum_perms', 'order' => 'perm_name')); ipsRegistry::DB()->execute(); while ($data = ipsRegistry::DB()->fetch()) { $masks[] = array($data['perm_id'], $data['perm_name']); } $_restrict_tick = ''; $_restrict_timespan = ''; $_restrict_units = ''; $units = array(0 => array('h', $this->lang->words['m_hours']), 1 => array('d', $this->lang->words['m_days'])); if ($member['restrict_post'] == 1) { $_restrict_tick = 'checked="checked"'; } elseif ($member['restrict_post'] > 0) { $mod_arr = IPSMember::processBanEntry($member['restrict_post']); $hours = ceil(($mod_arr['date_end'] - time()) / 3600); if ($hours < 0) { $mod_arr['units'] = ''; $mod_arr['timespan'] = ''; } else { if ($hours > 24 and $hours / 24 == ceil($hours / 24)) { $mod_arr['units'] = 'd'; $mod_arr['timespan'] = $hours / 24; } else { $mod_arr['units'] = 'h'; $mod_arr['timespan'] = $hours; } } } $_restrict_timespan = ipsRegistry::getClass('output')->formSimpleInput('post_timespan', $mod_arr['timespan']); $_restrict_units = ipsRegistry::getClass('output')->formDropdown('post_units', $units, $mod_arr['units']); $_mod_tick = ''; $_mod_timespan = ''; $_mod_units = ''; if ($member['mod_posts'] == 1) { $_mod_tick = 'checked="checked"'; } elseif ($member['mod_posts'] > 0) { $mod_arr = IPSMember::processBanEntry($member['mod_posts']); $hours = ceil(($mod_arr['date_end'] - time()) / 3600); if ($hours < 0) { $mod_arr['units'] = ''; $mod_arr['timespan'] = ''; } else { if ($hours > 24 and $hours / 24 == ceil($hours / 24)) { $mod_arr['units'] = 'd'; $mod_arr['timespan'] = $hours / 24; } else { $mod_arr['units'] = 'h'; $mod_arr['timespan'] = $hours; } } } $_mod_timespan = ipsRegistry::getClass('output')->formSimpleInput('mod_timespan', $mod_arr['timespan']); $_mod_units = ipsRegistry::getClass('output')->formDropdown('mod_units', $units, $mod_arr['units']); $form_override_masks = ipsRegistry::getClass('output')->formMultiDropdown("org_perm_id[]", $masks, explode(",", $member['org_perm_id']), 8, 'org_perm_id'); $form_posts = ipsRegistry::getClass('output')->formInput("posts", $member['posts']); $form_view_avs = ipsRegistry::getClass('output')->formYesNo("view_avs", $member['view_avs']); $form_view_img = ipsRegistry::getClass('output')->formYesNo("view_img", $member['view_img']); $IPBHTML = ""; $IPBHTML .= <<<EOF \t \t<div class='tablerow1' id='tabpane-MEMBERS|6'> \t\t<table class='alternate_rows double_pad' cellspacing='0'> \t\t\t \t\t\t<tr> \t\t\t\t<th colspan='2'>{$this->lang->words['sm_settings']}</th> \t\t\t</tr> \t\t\t<tr> \t\t\t\t<td><strong>Avatar</strong></td> \t\t\t\t<td> \t\t\t\t\t{$member['_avatar']} \t\t\t\t\t<br /><br /> \t\t\t\t\t<input type='button' class='button' id='MF__avatarremove' value='{$this->lang->words['mem_remove_avatar']}' /> \t\t\t\t\t<input type='button' class='button' id='MF__avatarchange' value='{$this->lang->words['m_changeav']}' /> \t\t\t\t\t \t\t\t\t\t<script type='text/javascript'> \t\t\t\t\t\t\$('MF__avatarremove').observe('click', acp.members.removeAvatar.bindAsEventListener( this, {$member['member_id']} ) ); \t\t\t\t\t\t\$('MF__avatarchange').observe('click', acp.members.changeAvatar.bindAsEventListener( this, "app=forums&module=ajax&section=member_editform&do=show&name=inline_avatar&member_id={$member['member_id']}" ) ); \t\t\t\t\t</script> \t\t\t\t</td> \t\t\t</tr> \t\t\t<tr> \t\t\t\t<td><strong>{$this->lang->words['mem_posts']}</strong></td> \t\t\t\t<td> \t\t\t\t\t<span id='MF__posts'>{$form_posts}</span> \t\t\t\t</td> \t\t\t</tr> \t\t\t<tr> \t\t\t\t<td><strong>{$this->lang->words['m_viewavs']}</strong></td> \t\t\t\t<td> \t\t\t\t\t<span id='MF__view_avs'>{$form_view_avs}</span> \t\t\t\t</td> \t\t\t</tr> \t\t\t<tr> \t\t\t\t<td><strong>{$this->lang->words['m_viewimgs']}</strong></td> \t\t\t\t<td> \t\t\t\t\t<span id='MF__view_img'>{$form_view_img}</span> \t\t\t\t</td> \t\t\t</tr> \t\t</table> \t</div> \t<div class='tablerow1' id='tabpane-MEMBERS|7'> \t\t<table class='alternate_rows double_pad' cellspacing='0'> \t\t\t<tr> \t\t\t\t<th colspan='2'>{$this->lang->words['sm_access']}</th> \t\t\t</tr> \t\t\t<tr> \t\t\t\t<td style='width: 35%'><strong>{$this->lang->words['m_overrride']}</strong></td> \t\t\t\t<td> \t\t\t\t\t<span id='MF__ogpm'>{$form_override_masks}</span> \t\t\t\t</td> \t\t\t</tr> \t\t\t<tr> \t\t\t\t<td><strong>{$this->lang->words['m_modprev']}</strong></td> \t\t\t\t<td> \t\t\t\t\t<input type='checkbox' name='mod_indef' id='mod_indef' value='1' {$_mod_tick}> {$this->lang->words['m_modindef']} \t\t\t\t\t<br /> \t\t\t\t\t{$this->lang->words['m_orfor']} \t\t\t\t\t{$_mod_timespan} {$_mod_units} \t\t\t\t</td> \t\t\t</tr> \t\t\t<tr> \t\t\t\t<td><strong>{$this->lang->words['m_restrict']}</strong></td> \t\t\t\t<td> \t\t\t\t\t<input type='checkbox' name='post_indef' id='post_indef' value='1' {$_restrict_tick}> {$this->lang->words['m_restrictindef']} \t\t\t\t\t<br /> \t\t\t\t\t{$this->lang->words['m_orfor']} \t\t\t\t\t{$_restrict_timespan} {$_restrict_units} \t\t\t\t</td> \t\t\t</tr> \t\t</table> \t</div> EOF; return $IPBHTML; }
function warnForm($member, $errors = '', $modque = false, $postque = false, $ban = false, $editor_html = '') { $IPBHTML = ""; if (IPSLib::locationHasHooks('skin_modcp', $this->_funcHooks['warnForm'])) { $count_571a68c2d8894723c2cc2d545530e8e6 = is_array($this->functionData['warnForm']) ? count($this->functionData['warnForm']) : 0; $this->functionData['warnForm'][$count_571a68c2d8894723c2cc2d545530e8e6]['member'] = $member; $this->functionData['warnForm'][$count_571a68c2d8894723c2cc2d545530e8e6]['errors'] = $errors; $this->functionData['warnForm'][$count_571a68c2d8894723c2cc2d545530e8e6]['modque'] = $modque; $this->functionData['warnForm'][$count_571a68c2d8894723c2cc2d545530e8e6]['postque'] = $postque; $this->functionData['warnForm'][$count_571a68c2d8894723c2cc2d545530e8e6]['ban'] = $ban; $this->functionData['warnForm'][$count_571a68c2d8894723c2cc2d545530e8e6]['editor_html'] = $editor_html; } $mod_arr = array('timespan' => 0, 'days' => 0, 'hours' => 0); $mhours = 0; if ($member['mod_posts'] > 0 and $member['mod_posts'] != 1) { $mod_arr = IPSMember::processBanEntry($member['mod_posts']); if ($mod_arr['date_end'] > time()) { $mhours = ceil(($mod_arr['date_end'] - time()) / 3600); } } $post_arr = array('timespan' => 0, 'hours' => 0, 'days' => 0); $phours = 0; if ($member['restrict_post'] > 0 and $member['restrict_post'] != 1) { $post_arr = IPSMember::processBanEntry($member['restrict_post']); if ($post_arr['date_end'] > time()) { $phours = ceil(($post_arr['date_end'] - time()) / 3600); } } $ban_arr = array('timespan' => 0, 'days' => 0, 'hours' => 0); $hours = 0; if ($member['temp_ban'] and $member['temp_ban'] != 1) { $ban_arr = IPSMember::processBanEntry($member['temp_ban']); if ($ban_arr['date_end'] > time()) { $hours = ceil(($ban_arr['date_end'] - time()) / 3600); } } $IPBHTML .= "" . $this->registry->getClass('output')->addJSModule("profile", "0") . "\n<script type='text/javascript'>\n\tipb.profile.viewingProfile = {$member['member_id']};\n</script>\n" . ($errors ? "\n\t<h2>{$this->lang->words['errors_found']}</h2>\n\t<p class='message error'>{$errors}</p>\n\t<br />\n" : "") . "\n<form method=\"post\" action='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&module=modcp&section=editmember&do=dowarn&mid={$member['member_id']}", "public", ''), "", "") . "' id='postingform'>\n<input type=\"hidden\" name=\"key\" value=\"{$this->member->form_hash}\" />\n<input type=\"hidden\" name=\"type\" value=\"{$this->request['type']}\" />\n<input type=\"hidden\" name=\"_st\" value=\"{$this->request['_st']}\" />\n<input type=\"hidden\" name=\"t\" value=\"{$this->request['t']}\" />\n<input type=\"hidden\" name=\"pf\" value=\"{$this->request['pf']}\" />\n<div class='post_form'>\n<h2 class='ipsType_subtitle'>{$this->lang->words['warn_logs_for']} <a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("showuser={$member['member_id']}", "public", ''), "{$member['members_seo_name']}", "showuser") . "' title='{$this->lang->words['view_profile']}'>{$member['members_display_name']}</a></h2>\n<div class='generic_bar'></div>\n<div class='general_box'>\n<fieldset class='with_subhead'>\n\t<h3 class='bar noTopBorder'>{$this->lang->words['warn_member_details']}</h3>\n\t<h4>\n\t\t<img class=\"ipsUserPhoto ipsUserPhoto_large\" src='{$member['pp_thumb_photo']}' alt=\"" . sprintf($this->lang->words['users_photo'], $member['members_display_name']) . "\" />\n\t</h4>\n\t<ul>\n\t\t<li class='field'>\n\t\t\t" . $this->registry->getClass('output')->getReplacement("find_topics_link") . " <a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&module=search&do=user_activity&mid={$member['member_id']}", "public", ''), "", "") . "'>{$this->lang->words['gbl_find_my_content']}</a>\n\t\t</li>\n\t\t" . ($this->memberData['g_mem_info'] && $this->settings['auth_allow_dnames'] ? "\n\t\t\t<li class='field' id='dname_history'>\n\t\t\t\t" . $this->registry->getClass('output')->getReplacement("display_name") . " <a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&module=profile&section=dname&id={$member['member_id']}", "public", ''), "", "") . "' title='{$this->lang->words['view_dname_history']}'>{$this->lang->words['display_history']}</a>\n\t\t\t</li>\n\t\t" : "") . "\n\t\t" . ($this->settings['reputation_enabled'] ? "<li class='field'>\n\t\t\t\t" . ($member['pp_reputation_points'] > 0 ? "\n\t\t\t\t\t<div class='reputation positive' style='min-width: 150px; text-align: center'>\n\t\t\t\t" : "") . "\n\t\t\t\t" . ($member['pp_reputation_points'] < 0 ? "\n\t\t\t\t\t<div class='reputation negative' style='min-width: 150px; text-align: center'>\n\t\t\t\t" : "") . "\n\t\t\t\t" . ($member['pp_reputation_points'] == 0 ? "\n\t\t\t\t\t<div class='reputation zero' style='min-width: 150px; text-align: center'>\n\t\t\t\t" : "") . "\n\t\t\t\t\t<span class='number'>{$member['pp_reputation_points']}</span>\n\t\t\t\t\t" . ($member['author_reputation'] && $member['author_reputation']['text'] ? "\n\t\t\t\t\t\t<p class='title'>{$member['author_reputation']['text']}</p>\n\t\t\t\t\t" : "") . "\n\t\t\t\t\t" . ($member['author_reputation'] && $member['author_reputation']['image'] ? "\n\t\t\t\t\t\t<p class='image'>{$member['author_reputation']['image']}</p>\n\t\t\t\t\t" : "") . "\n\t\t\t\t</div>\n\t\t\t</li>" : "") . "\n\t</ul>\n</fieldset>\n<fieldset class='with_subhead'>\n\t<h3 class='bar'>{$this->lang->words['warn_details']}</h3>\n\t<h4>{$this->lang->words['w_adjust_level']}<br /><span class='desc'>{$this->lang->words['warn_current_level']} {$member['warn_level']}/{$this->settings['warn_max']}</span></h4>\n\t<ul>\n <li class='field checkbox'>\n <input type=\"radio\" name=\"level\" id=\"nochange\" class=\"input_radio\" value=\"nochange\" " . (($this->request['type'] == 'nochange' or !$this->request['type']) ? "checked='checked'" : "") . " />\n <label for='nochange'>{$this->lang->words['w_nochange']}</label>\n </li>\n\t\t<li class='field checkbox negative'>\n\t\t\t<input type=\"radio\" name=\"level\" id=\"add\" class=\"input_radio\" value=\"add\" " . ($this->request['type'] == 'add' ? "checked='checked'" : "") . " />\n\t\t\t<label for='add'>{$this->lang->words['w_add']}</label>\n\t\t</li>\n\t\t<li class='field checkbox positive'>\n\t\t\t<input type=\"radio\" name=\"level\" id=\"minus\" class=\"input_radio\" value=\"remove\" " . ($this->request['type'] == 'minus' ? "checked='checked'" : "") . " />\n\t\t\t<label for='minus'>{$this->lang->words['w_remove']}</label>\n\t\t</li>\t\n\t\t" . ($this->memberData['g_is_supmod'] ? "<li class='field checkbox custom'>\n\t\t\t\t<input type=\"radio\" name=\"level\" id=\"custom\" class=\"input_radio\" value=\"custom\" " . ($this->request['type'] == 'custom' ? "checked='checked'" : "") . " />\n\t\t\t\t<label for='level_custom'>" . sprintf($this->lang->words['w_change_custom'], $this->settings['warn_max']) . "</label>\n\t\t\t\t <input type='text' id='level_custom' name='level_custom' value='" . (isset($this->request['customLevel']) ? "{$this->request['customLevel']}" : "{$member['warn_level']}") . "' size='3' />\n\t\t\t</li>" : "") . "\n\t</ul>\n\t<h4>{$this->lang->words['w_reason']}<br /><span class='desc'>{$this->lang->words['w_reason2']}</span></h4>\n\t<ul>\n\t\t<li class='field'>\n\t\t\t<textarea rows=\"6\" cols=\"50\" class=\"input_text\" name=\"reason\">" . IPSText::br2nl($this->request['reason']) . "</textarea>\n\t\t</li>\n\t</ul>\n</fieldset>\n<fieldset class='with_subhead'>\n\t<h3 class='bar'>{$this->lang->words['member_suspension']}</h3>\n\t" . ($modque == true ? "\t\t<h4>{$this->lang->words['w_modq']}</h4>\n\t\t<ul>\n\t\t\t<li class='field checkbox'>\n\t\t\t\t<input class='input_check' id='modq' type=\"checkbox\" name=\"mod_indef\" value=\"1\" " . ($member['mod_posts'] == 1 ? "checked='checked'" : "") . " />\n\t\t\t\t<label for='modq'>{$this->lang->words['w_modq_i']}</label>\n\t\t\t</li>\n\t\t\t<li class='field checkbox'>\n\t\t\t\t<label for='mod_value'>{$this->lang->words['w_orfor']}</label>\n\t\t\t\t<input class='input_text' type=\"text\" id='mod_value' name=\"mod_value\" value=\"" . (($mhours >= 24 and $mhours / 24 == ceil($mhours / 24) and $timespan = $mhours / 24) ? "{$timespan}" : "{$mhours}") . "\" size=\"5\" /> \n\t\t\t\t<select name=\"mod_unit\" class='input_select'>\n\t\t\t\t\t<option value=\"d\" " . (($mhours >= 24 and $mhours / 24 == ceil($mhours / 24)) ? "selected='selected'" : "") . ">{$this->lang->words['w_day']}</option>\n\t\t\t\t\t<option value=\"h\" " . (($mhours < 24 or $mhours / 24 != ceil($mhours / 24)) ? "selected='selected'" : "") . ">{$this->lang->words['w_hour']}</option>\n\t\t\t\t</select>\n\t\t\t\t" . ($mhours > 0 ? "\n\t\t\t\t\t<span class='desc'>{$this->lang->words['w_restricted']}</span>\n\t\t\t\t" : "") . "\n\t\t\t</li>\n\t\t</ul>" : "") . "\n\t" . ($postque == true ? "\t\t<h4>{$this->lang->words['w_resposts']}</h4>\n\t\t<ul>\n\t\t\t<li class='field checkbox'>\n\t\t\t\t<input class='input_check' id='restrict_posts' type=\"checkbox\" name=\"post_indef\" value=\"1\" " . ($member['restrict_post'] == 1 ? "checked='checked'" : "") . " />\n\t\t\t\t<label for='restrict_posts'>{$this->lang->words['w_resposts_i']}</label>\n\t\t\t</li>\n\t\t\t<li class='field checkbox'>\n\t\t\t\t<label for='post_value'>{$this->lang->words['w_orfor']}</label>\n\t\t\t\t<input class='input_text' type=\"text\" id='post_value' name=\"post_value\" value=\"" . (($phours >= 24 and $phours / 24 == ceil($phours / 24) and $timespan = $phours / 24) ? "{$timespan}" : "{$phours}") . "\" size=\"5\" /> \n\t\t\t\t<select name=\"post_unit\" class='input_select'>\n\t\t\t\t\t<option value=\"d\" " . (($phours >= 24 and $phours / 24 == ceil($phours / 24)) ? "selected='selected'" : "") . ">{$this->lang->words['w_day']}</option>\n\t\t\t\t\t<option value=\"h\" " . (($phours < 24 or $phours / 24 != ceil($phours / 24)) ? "selected='selected'" : "") . ">{$this->lang->words['w_hour']}</option>\n\t\t\t\t</select>\n\t\t\t\t" . ($phours > 0 ? "\n\t\t\t\t\t<span class='desc'>{$this->lang->words['w_restricted']}</span>\n\t\t\t\t" : "") . "\n\t\t\t</li>\n\t\t</ul>" : "") . "\n\t" . ($ban == true ? "\t\t<h4>{$this->lang->words['w_suspend']}</h4>\n\t\t<ul>\n\t\t\t<li class='field checkbox'>\n\t\t\t\t<input class='input_check' id='suspend_member' type=\"checkbox\" name=\"ban_indef\" value=\"1\" " . ($member['member_banned'] == 1 ? "checked='checked'" : "") . " />\n\t\t\t\t<label for='suspend_member'>{$this->lang->words['w_ban_indef']}</label>\n\t\t\t</li>\n\t\t\t<li class='field checkbox'>\n\t\t\t\t<label for='susp_value'>{$this->lang->words['w_suspend_or']}</label>\n\t\t\t\t<input type=\"text\" id='susp_value' class='input_text' name=\"susp_value\" value=\"" . (($hours >= 24 and $hours / 24 == ceil($hours / 24) and $timespan = $hours / 24) ? "{$timespan}" : "{$hours}") . "\" size=\"5\" />\n\t\t\t\t<select name=\"susp_unit\" class='input_select'>\n\t\t\t\t\t<option value=\"d\" " . (($hours >= 24 and $hours / 24 == ceil($hours / 24)) ? "selected='selected'" : "") . ">{$this->lang->words['w_day']}</option>\n\t\t\t\t\t<option value=\"h\" " . (($hours < 24 or $hours / 24 != ceil($hours / 24)) ? "selected='selected'" : "") . ">{$this->lang->words['w_hour']}</option>\n\t\t\t\t</select>\n\t\t\t\t" . ($member['temp_ban'] ? "\n\t\t\t\t\t<span class='desc'>{$this->lang->words['w_restricted']}</span>\n\t\t\t\t" : "") . "\n\t\t\t</li>\n\t\t</ul>" : "") . "\n</fieldset>\n<fieldset class='with_subhead'>\n\t<h3 class='bar'>{$this->lang->words['warn_mem_content']}</h3>\n\t<h4>{$this->lang->words['warn_posts_topics']}</h4>\n\t<ul>\n\t\t<li class='field checkbox'>\n\t\t\t<select name=\"topicPosts_type\" class='input_select'>\n\t\t\t\t<option value='unapprove' " . ($this->request['topicPosts_type'] == 'unapprove' ? "selected='selected'" : "") . ">{$this->lang->words['warn_stuff_unapprove']}</option>\n\t\t\t\t<option value='approve' " . ($this->request['topicPosts_type'] == 'approve' ? "selected='selected'" : "") . ">{$this->lang->words['warn_stuff_approve']}</option>\n\t\t\t</select>\n\t\t</li>\n\t\t<li class='field checkbox'>\n\t\t\t<input type=\"checkbox\" id='topicPosts_topics' class='input_check' name=\"topicPosts_topics\" value=\"1\" />\n\t\t\t<label for='topicPosts_topics'>{$this->lang->words['warn_stuff_alltopics']}</label>\n\t\t</li>\n\t\t<li class='field checkbox'>\n\t\t\t<input type=\"checkbox\" id='topicPosts_replies' class='input_check' name=\"topicPosts_replies\" value=\"1\" />\n\t\t\t<label for='topicPosts_replies'>{$this->lang->words['warn_stuff_allposts']}</label>\n\t\t</li>\n\t\t<li class='field checkbox'>\n\t\t\t<label for='topicPosts_lastx'>{$this->lang->words['warn_stuff_datecutoff']}</label>\n\t\t\t<input type=\"text\" id='topicPosts_lastx' class='input_text' name=\"topicPosts_lastx\" value=\"\" size=\"5\" />\n\t\t\t<select name=\"topicPosts_lastxunits\" class='input_select'>\n\t\t\t\t<option value=\"d\">{$this->lang->words['w_day']}</option>\n\t\t\t\t<option value=\"h\">{$this->lang->words['w_hour']}</option>\n\t\t\t</select>\n\t\t</li>\n\t</ul>\n</fieldset>\n<fieldset>\n\t<h3 class='bar'>{$this->lang->words['warn_contact_member']}</h3>\n\t<ul>\n\t\t<li class='field'>\n\t\t\t<label for='subj'>{$this->lang->words['w_c_subj']}</label>\n\t\t\t<input id='subj' class='input_text' type=\"text\" name=\"subject\" value=\"{$this->request['subject']}\" size=\"30\" />\n\t\t</li>\n\t\t<li class='field'>\n\t\t\t<label for='method'>{$this->lang->words['w_c']}</label>\n\t\t\t<select id='method' name=\"contactmethod\" class='input_select'>\n\t\t\t\t" . ($member['members_disable_pm'] != 1 ? "\n\t\t\t\t\t<option value=\"pm\">{$this->lang->words['w_c_p']}</option>\n\t\t\t\t" : "") . "\n\t\t\t\t<option value=\"email\">{$this->lang->words['w_c_e']}</option>\n\t\t\t</select>\n\t\t</li>\n\t\t<li class='ipsPad'>\n\t\t\t{$editor_html}\n\t\t</li>\n\t</ul>\n</fieldset>\n<fieldset class='submit'>\n\t<input type=\"submit\" class='input_submit' value=\"{$this->lang->words['w_submit']}\" tabindex='0'/>\n</fieldset>\n</div>\n</div>\n</form>"; return $IPBHTML; }
/** * Execute plugin * * @param array $permissions Moderator permissions * @return @e string */ public function executePlugin($permissions) { //----------------------------------------- // Check permissions //----------------------------------------- if (!$this->canView($permissions)) { return ''; } /* Add some CSS.. */ $this->registry->output->addToDocumentHead('importcss', "{$this->settings['css_base_url']}style_css/{$this->registry->output->skin['_csscacheid']}/ipb_mlist.css"); //----------------------------------------- // Get 10 members on suspension //----------------------------------------- $st = intval($this->request['st']); $total = $this->DB->buildAndFetch(array('select' => 'count(*) as members', 'from' => 'members', 'where' => "temp_ban!=0 AND temp_ban!='' AND temp_ban " . $this->DB->buildIsNull(false))); $members = array(); $this->DB->build(array('select' => 'm.*', 'from' => array('members' => 'm'), 'order' => 'm.joined DESC', 'limit' => array($st, 10), 'where' => "m.temp_ban!=0 AND m.temp_ban!='' AND m.temp_ban " . $this->DB->buildIsNull(false), 'add_join' => array(array('select' => 'pp.*', 'from' => array('profile_portal' => 'pp'), 'where' => 'm.member_id=pp.pp_member_id', 'type' => 'left')))); $outer = $this->DB->execute(); while ($r = $this->DB->fetch($outer)) { $mod_arr = IPSMember::processBanEntry($r['temp_ban']); if ($mod_arr['date_end'] and $mod_arr['date_end'] < time()) { IPSMember::save($r['member_id'], array('core' => array('temp_ban' => 0))); continue; } if ($mod_arr['date_start'] == 1) { $r['_language'] = $this->lang->words['modcp_modq_indef']; } else { $r['_language'] = $this->registry->getClass('class_localization')->getDate($mod_arr['date_end'], 'SHORT'); } $members[] = IPSMember::buildDisplayData($r); } //----------------------------------------- // Page links //----------------------------------------- $pages = $this->registry->output->generatePagination(array('totalItems' => $total['members'], 'itemsPerPage' => 10, 'currentStartValue' => $st, 'baseUrl' => "app=core&module=modcp&fromapp=members&tab=suspended")); return $this->registry->output->getTemplate('modcp')->membersList('suspended', $members, $pages); }
/** * Shows the editor * print $editor->show( 'message', 'reply-topic-1244' ); * @param string Field * @param array Options: Auto save key, a unique key for the page. If supplied, editor will auto-save at regular intervals. Works for logged in members only * @param string Optional content */ public function show($fieldName, $options = array(), $content = '') { $showEditor = TRUE; /* Have we forced RTE? */ if (!empty($this->request['isRte'])) { $options['isRte'] = intval($this->request['isRte']); } $_autoSaveKeyOrig = !empty($options['autoSaveKey']) ? $options['autoSaveKey'] : ''; $options['editorName'] = !empty($options['editorName']) ? $options['editorName'] : $this->_fetchEditorName(); $options['autoSaveKey'] = $_autoSaveKeyOrig && $this->memberData['member_id'] ? $this->_generateAutoSaveKey($_autoSaveKeyOrig) : ''; $options['type'] = !empty($options['type']) && $options['type'] == 'mini' ? 'mini' : 'full'; $options['minimize'] = intval($options['minimize']); $options['height'] = intval($options['height']); $options['isTypingCallBack'] = !empty($options['isTypingCallBack']) ? $options['isTypingCallBack'] : ''; $options['noSmilies'] = !empty($options['noSmilies']) ? true : false; $options['delayInit'] = !empty($options['delayInit']) ? 1 : 0; $options['smilies'] = $this->fetchEmoticons(); $options['bypassCKEditor'] = !empty($options['bypassCKEditor']) ? 1 : ($this->getRteEnabled() ? 0 : 1); $options['legacyMode'] = !empty($options['legacyMode']) ? $options['legacyMode'] : 'on'; $html = ''; /* Fetch disabled tags */ $parser = $this->_newParserObject(); $options['disabledTags'] = $parser->getDisabledTags(); $this->setLegacyMode($options['legacyMode'] == 'on' ? true : false); if (isset($options['recover'])) { $content = $_POST['Post']; } /* Try and sniff out entered HTML */ if (IN_ACP and empty($options['isHtml'])) { $options['isHtml'] = intval($this->_tryAndDetermineHtmlStatusTheHackyWay($content ? $content : $this->getContent())); } if (!empty($options['isHtml'])) { $this->setIsHtml(true); if (IN_ACP) { $options['type'] = 'ipsacp'; } } else { if ($this->getIsHtml()) { $options['isHtml'] = 1; } } /* inline content */ if ($content) { $this->setContent($this->getLegacyMode() ? str_replace('\\\'', '\'', $content) : $content); } /* Is this legacy bbcode? If we are using RTE, we need to send HTML. @link http://community.invisionpower.com/resources/bugs.html/_/ip-board/old-style-image-links-do-not-parse-in-editor-r42078 */ if ($parser->isBBCode($this->getContent())) { $this->setContent($parser->htmlToEditor($this->getContent())); } /* Store last editor ID in case calling scripts need it */ $this->settings['_lastEditorId'] = $options['editorName']; if (IN_ACP) { $html = $this->registry->getClass('output')->global_template->editor($fieldName, $this->getContent(), $options, $this->getAutoSavedContent($_autoSaveKeyOrig)); } else { $warningInfo = ''; $acknowledge = FALSE; //----------------------------------------- // Warnings //----------------------------------------- if (isset($options['warnInfo']) and $this->memberData['member_id']) { $message = ''; /* Have they been restricted from posting? */ if ($this->memberData['restrict_post']) { $data = IPSMember::processBanEntry($this->memberData['restrict_post']); if ($data['date_end']) { if (time() >= $data['date_end']) { IPSMember::save($this->memberData['member_id'], array('core' => array('restrict_post' => 0))); } else { $message = sprintf($this->lang->words['warnings_restrict_post_temp'], $this->lang->getDate($data['date_end'], 'JOINED')); } } else { $message = $this->lang->words['warnings_restrict_post_perm']; } if ($this->memberData['unacknowledged_warnings']) { $warn = ipsRegistry::DB()->buildAndFetch(array('select' => '*', 'from' => 'members_warn_logs', 'where' => "wl_member={$this->memberData['member_id']} AND wl_rpa<>0", 'order' => 'wl_date DESC', 'limit' => 1)); if ($warn['wl_id']) { $moredetails = "<a href='javascript:void(0);' onclick='warningPopup( this, {$warn['wl_id']} )'>{$this->lang->words['warnings_moreinfo']}</a>"; } } if ($options['warnInfo'] == 'full') { $this->registry->getClass('output')->showError("{$message} {$moredetails}", 103126, null, null, 403); } else { $showEditor = FALSE; } } /* Nope? - Requires a new if in case time restriction got just removed */ if (empty($message)) { /* Do they have any warnings they have to acknowledge? */ if ($this->memberData['unacknowledged_warnings']) { $unAcknowledgedWarns = ipsRegistry::DB()->buildAndFetch(array('select' => '*', 'from' => 'members_warn_logs', 'where' => "wl_member={$this->memberData['member_id']} AND wl_acknowledged=0", 'order' => 'wl_date DESC', 'limit' => 1)); if ($unAcknowledgedWarns['wl_id']) { if ($options['warnInfo'] == 'full') { $this->registry->getClass('output')->silentRedirect($this->registry->getClass('output')->buildUrl("app=members&module=profile&section=warnings&do=acknowledge&id={$unAcknowledgedWarns['wl_id']}")); } else { $this->lang->loadLanguageFile('public_profile', 'members'); $acknowledge = $unAcknowledgedWarns['wl_id']; } } } /* No? Are they on mod queue? */ if ($this->memberData['mod_posts']) { $data = IPSMember::processBanEntry($this->memberData['mod_posts']); if ($data['date_end']) { if (time() >= $data['date_end']) { IPSMember::save($this->memberData['member_id'], array('core' => array('mod_posts' => 0))); } else { $message = sprintf($this->lang->words['warnings_modqueue_temp'], $this->lang->getDate($data['date_end'], 'JOINED')); } } else { $message = $this->lang->words['warnings_modqueue_perm']; } if ($message) { $warn = ipsRegistry::DB()->buildAndFetch(array('select' => '*', 'from' => 'members_warn_logs', 'where' => "wl_member={$this->memberData['member_id']} AND wl_mq<>0", 'order' => 'wl_date DESC', 'limit' => 1)); if ($warn['wl_id']) { if ($this->registry->output->getAsMobileSkin()) { $moredetails = "<a href='{$this->registry->getClass('output')->buildUrl("app=members&module=profile&section=warnings")}'>{$this->lang->words['warnings_moreinfo']}</a>"; } else { $moredetails = "<a href='javascript:void(0);' onclick='warningPopup( this, {$warn['wl_id']} )'>{$this->lang->words['warnings_moreinfo']}</a>"; } } } } /* How about our group? - Requires a new if in case mod queue restriction got just removed */ if (empty($message) && $this->memberData['g_mod_preview']) { /* Do we only limit for x posts/days? */ if ($this->memberData['g_mod_post_unit']) { if ($this->memberData['gbw_mod_post_unit_type']) { /* Days.. .*/ if ($this->memberData['joined'] > time() - 86400 * $this->memberData['g_mod_post_unit']) { $message = sprintf($this->lang->words['ms_mod_q'] . ' ' . $this->lang->words['ms_mod_q_until'], $this->lang->getDate($this->memberData['joined'] + 86400 * $this->memberData['g_mod_post_unit'], 'long')); } } else { /* Posts */ if ($this->memberData['posts'] < $this->memberData['g_mod_post_unit']) { $message = sprintf($this->lang->words['ms_mod_q'] . ' ' . $this->lang->words['ms_mod_q_until_posts'], $this->memberData['g_mod_post_unit'] - $this->memberData['posts']); } } } else { /* No limit, but still checking moderating */ $message = $this->lang->words['ms_mod_q']; } } elseif ($options['modAll'] and !$this->memberData['g_avoid_q']) { $message = $this->lang->words['ms_mod_q']; } } if ($message) { $warningInfo = "{$message} {$moredetails}"; } } //----------------------------------------- // Show the editor //----------------------------------------- $parser = new class_text_parser_legacy(); $this->passSettings($parser); /* Mobile skin / app? */ if ($this->_canWeRte(true) !== true || $this->registry->output->getAsMobileSkin()) { $content = $this->toPlainTextArea($this->getContent()); } else { /* CKEditor decodes HTML entities */ $content = str_replace('&', '&', $this->getContent()); /* Take a stab at fixing up manually entered CODE tag */ //$content = $this->_fixManuallyEnteredCodeBoxesIntoRte( $content ); /* Convert to BBCode for non JS peoples */ $content = $parser->htmlToEditor($content); } $bbcodeVersion = ''; if ($content) { $bbcodeVersion = $this->toPlainTextArea($parser->postEditor($content)); } $html = $this->registry->getClass('output')->getTemplate('editors')->editor($fieldName, $content, $options, $this->getAutoSavedContent($_autoSaveKeyOrig), $warningInfo, $acknowledge, $bbcodeVersion, $showEditor); } return $html; }
function warnForm($member, $tid = 0, $st = 0, $errors = '', $modque = false, $postque = false, $ban = false, $editor_html = '') { $IPBHTML = ""; $mod_arr = array('timespan' => 0, 'days' => 0, 'hours' => 0); $mhours = 0; if ($member['mod_posts'] > 0 and $member['mod_posts'] != 1) { $mod_arr = IPSMember::processBanEntry($member['mod_posts']); $mhours = ceil(($mod_arr['date_end'] - time()) / 3600); } $post_arr = array('timespan' => 0, 'hours' => 0, 'days' => 0); $phours = 0; if ($member['restrict_post'] > 0 and $member['restrict_post'] != 1) { $post_arr = IPSMember::processBanEntry($member['restrict_post']); $phours = ceil(($post_arr['date_end'] - time()) / 3600); } $ban_arr = array('timespan' => 0, 'days' => 0, 'hours' => 0); $hours = 0; if ($member['temp_ban'] and $member['temp_ban'] != 1) { $ban_arr = IPSMember::processBanEntry($member['temp_ban']); $hours = ceil(($ban_arr['date_end'] - time()) / 3600); } $IPBHTML .= "" . $this->registry->getClass('output')->addJSModule("profile", "0") . "\n<script type='text/javascript'>\n\tipb.profile.viewingProfile = {$member['member_id']};\n</script>\n" . ($errors ? "\n\t<h2>{$this->lang->words['errors_found']}</h2>\n\t<p class='message error'>{$errors}</p>\n\t<br />\n" : "") . "\n<!-- SKINNOTE: form validation -->\n<form method=\"post\" action='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&module=warn&section=warn&do=dowarn&mid={$member['member_id']}&t={$tid}&st={$st}&type={$this->request['type']}", 'public', ''), "", "") . "' id='postingform'>\n<input type=\"hidden\" name=\"key\" value=\"{$this->member->form_hash}\" />\n<div class='post_form'>\n<h2 class='maintitle'>{$this->lang->words['warn_logs_for']} <a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("showuser={$member['member_id']}", 'public', ''), "{$member['members_display_name']}", "showuser") . "' title='{$this->lang->words['view_profile']}'>{$member['members_display_name']}</a></h2>\n<div class='generic_bar'></div>\n<fieldset class='with_subhead'>\n\t<h3 class='bar'>{$this->lang->words['warn_member_details']}</h3>\n\t<h4>\n\t\t<img class=\"photo\" src='{$member['pp_main_photo']}' alt=\"{$member['members_display_name']}{$this->lang->words['users_photo']}\" />\n\t</h4>\n\t<ul>\n\t\t<li class='field'>\n\t\t\t" . $this->registry->getClass('output')->getReplacement("find_posts_link") . " <a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&module=search&do=user_posts&mid={$member['member_id']}" . (!in_array($this->settings['search_method'], array('traditional', 'sphinx')) ? "&search_filter_app[forums]=1" : "") . "", 'public', ''), "", "") . "'>{$this->lang->words['find_posts']}</a>\n\t\t</li>\n\t\t<li class='field'>\n\t\t\t" . $this->registry->getClass('output')->getReplacement("find_topics_link") . " <a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&module=search&do=user_posts&mid={$member['member_id']}&search_filter_app[forums]=1&view_by_title=1", 'public', ''), "", "") . "'>{$this->lang->words['find_topics']}</a>\n\t\t</li>\n\t\t" . ($this->memberData['g_mem_info'] && $this->settings['auth_allow_dnames'] ? "\n\t\t\t<li class='field' id='dname_history'>\n\t\t\t\t" . $this->registry->getClass('output')->getReplacement("display_name") . " <a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&module=profile&section=dname&id={$member['member_id']}", 'public', ''), "", "") . "' title='{$this->lang->words['view_dname_history']}'>{$this->lang->words['display_history']}</a>\n\t\t\t</li>\n\t\t" : "") . "\n\t\t" . ($this->settings['reputation_enabled'] ? "<li class='field'>\n\t\t\t\t{$this->lang->words['warn_rep']} {$member['pp_reputation_points']}\n\t\t\t\t" . ($member['author_reputation'] && $member['author_reputation']['text'] ? "\n\t\t\t\t\t<p class='title'>{$member['author_reputation']['text']}</p>\n\t\t\t\t" : "") . "\n\t\t\t\t" . ($member['author_reputation'] && $member['author_reputation']['image'] ? "\n\t\t\t\t\t<p class='image'>{$member['author_reputation']['image']}</p>\n\t\t\t\t" : "") . "\n\t\t\t</li>" : "") . "\n\t</ul>\n</fieldset>\n<fieldset class='with_subhead'>\n\t<h3 class='bar'>{$this->lang->words['warn_details']}</h3>\n\t<h4>{$this->lang->words['w_adjust_level']}<br /><span class='desc'>{$this->lang->words['warn_current_level']} {$member['warn_level']}/{$this->settings['warn_max']}</span></h4>\n\t<ul>\n\t\t<li class='field checkbox negative'>\n\t\t\t<input type=\"radio\" name=\"level\" id=\"add\" class=\"input_radio\" value=\"add\" " . ($this->request['type'] == 'add' ? "checked='checked'" : "") . " />\n\t\t\t<label for='add'>{$this->lang->words['w_add']}</label>\n\t\t</li>\n\t\t<li class='field checkbox positive'>\n\t\t\t<input type=\"radio\" name=\"level\" id=\"minus\" class=\"input_radio\" value=\"remove\" " . ($this->request['type'] == 'minus' ? "checked='checked'" : "") . " />\n\t\t\t<label for='minus'>{$this->lang->words['w_remove']}</label>\n\t\t</li>\t\n\t\t" . ($this->memberData['g_is_supmod'] ? "<li class='field checkbox custom'>\n\t\t\t\t<input type=\"radio\" name=\"level\" id=\"custom\" class=\"input_radio\" value=\"custom\" " . ($this->request['type'] == 'custom' ? "checked='checked'" : "") . " />\n\t\t\t\t<label for='level_custom'>" . sprintf($this->lang->words['w_change_custom'], $this->settings['warn_max']) . "</label>\n\t\t\t\t <input type='text' id='level_custom' name='level_custom' value='" . (isset($this->request['customLevel']) ? "{$this->request['customLevel']}" : "{$member['warn_level']}") . "' size='3' />\n\t\t\t</li>" : "") . "\n\t\t<li class='field checkbox'>\n\t\t\t<input type=\"radio\" name=\"level\" id=\"nochange\" class=\"input_radio\" value=\"nochange\" " . ($this->request['type'] == 'nochange' ? "checked='checked'" : "") . " />\n\t\t\t<label for='nochange'>{$this->lang->words['w_nochange']}</label>\n\t\t</li>\t\t\n\t</ul>\n\t<h4>{$this->lang->words['w_reason']}<br /><span class='desc'>{$this->lang->words['w_reason2']}</span></h4>\n\t<ul>\n\t\t<li class='field'>\n\t\t\t<textarea rows=\"6\" cols=\"70\" class=\"input_text\" name=\"reason\">" . IPSText::br2nl($this->request['reason']) . "</textarea>\n\t\t</li>\n\t</ul>\n</fieldset>\n<fieldset class='with_subhead'>\n\t<h3 class='bar'>{$this->lang->words['member_suspension']}</h3>\n\t" . ($modque == true ? "\t\t<h4>{$this->lang->words['w_modq']}</h4>\n\t\t<ul>\n\t\t\t<li class='field checkbox'>\n\t\t\t\t<input class='input_check' id='modq' type=\"checkbox\" name=\"mod_indef\" value=\"1\" " . ($member['mod_posts'] == 1 ? "checked='checked'" : "") . " />\n\t\t\t\t<label for='modq'>{$this->lang->words['w_modq_i']}</label>\n\t\t\t</li>\n\t\t\t<li class='field checkbox'>\n\t\t\t\t<label for='mod_value'>{$this->lang->words['w_orfor']}</label>\n\t\t\t\t<input class='input_text' type=\"text\" id='mod_value' name=\"mod_value\" value=\"" . (($mhours > 24 and $mhours / 24 == ceil($mhours / 24) and $timespan = $mhours / 24) ? "{$timespan}" : "{$mhours}") . "\" size=\"5\" /> \n\t\t\t\t<select name=\"mod_unit\" class='input_select'>\n\t\t\t\t\t<option value=\"d\" " . (($mhours > 24 and $mhours / 24 == ceil($mhours / 24)) ? "selected='selected'" : "") . ">{$this->lang->words['w_day']}</option>\n\t\t\t\t\t<option value=\"h\" " . (($mhours < 24 or $mhours / 24 != ceil($mhours / 24)) ? "selected='selected'" : "") . ">{$this->lang->words['w_hour']}</option>\n\t\t\t\t</select>\n\t\t\t\t" . ($mhours > 0 ? "\n\t\t\t\t\t<span class='desc'>{$this->lang->words['w_restricted']}</span>\n\t\t\t\t" : "") . "\n\t\t\t</li>\n\t\t</ul>" : "") . "\n\t" . ($postque == true ? "\t\t<h4>{$this->lang->words['w_resposts']}</h4>\n\t\t<ul>\n\t\t\t<li class='field checkbox'>\n\t\t\t\t<input class='input_check' id='restrict_posts' type=\"checkbox\" name=\"post_indef\" value=\"1\" " . ($member['restrict_post'] == 1 ? "checked='checked'" : "") . " />\n\t\t\t\t<label for='restrict_posts'>{$this->lang->words['w_resposts_i']}</label>\n\t\t\t</li>\n\t\t\t<li class='field checkbox'>\n\t\t\t\t<label for='post_value'>{$this->lang->words['w_orfor']}</label>\n\t\t\t\t<input class='input_text' type=\"text\" id='post_value' name=\"post_value\" value=\"" . (($phours > 24 and $phours / 24 == ceil($phours / 24) and $timespan = $phours / 24) ? "{$timespan}" : "{$phours}") . "\" size=\"5\" /> \n\t\t\t\t<select name=\"post_unit\" class='input_select'>\n\t\t\t\t\t<option value=\"d\" " . (($phours > 24 and $phours / 24 == ceil($phours / 24)) ? "selected='selected'" : "") . ">{$this->lang->words['w_day']}</option>\n\t\t\t\t\t<option value=\"h\" " . (($phours < 24 or $phours / 24 != ceil($phours / 24)) ? "selected='selected'" : "") . ">{$this->lang->words['w_hour']}</option>\n\t\t\t\t</select>\n\t\t\t\t" . ($phours > 0 ? "\n\t\t\t\t\t<span class='desc'>{$this->lang->words['w_restricted']}</span>\n\t\t\t\t" : "") . "\n\t\t\t</li>\n\t\t</ul>" : "") . "\n\t" . ($ban == true ? "\t\t<h4>{$this->lang->words['w_suspend']}</h4>\n\t\t<ul>\n\t\t\t<li class='field checkbox'>\n\t\t\t\t<input class='input_check' id='suspend_member' type=\"checkbox\" name=\"ban_indef\" value=\"1\" " . ($member['member_banned'] == 1 ? "checked='checked'" : "") . " />\n\t\t\t\t<label for='suspend_member'>{$this->lang->words['w_ban_indef']}</label>\n\t\t\t</li>\n\t\t\t<li class='field checkbox'>\n\t\t\t\t<label for='susp_value'>{$this->lang->words['w_suspend_or']}</label>\n\t\t\t\t<input type=\"text\" id='susp_value' class='input_text' name=\"susp_value\" value=\"" . (($hours > 24 and $hours / 24 == ceil($hours / 24) and $timespan = $hours / 24) ? "{$timespan}" : "{$hours}") . "\" size=\"5\" />\n\t\t\t\t<select name=\"susp_unit\" class='input_select'>\n\t\t\t\t\t<option value=\"d\" " . (($hours > 24 and $hours / 24 == ceil($hours / 24)) ? "selected='selected'" : "") . ">{$this->lang->words['w_day']}</option>\n\t\t\t\t\t<option value=\"h\" " . (($hours < 24 or $hours / 24 != ceil($hours / 24)) ? "selected='selected'" : "") . ">{$this->lang->words['w_hour']}</option>\n\t\t\t\t</select>\n\t\t\t\t" . ($member['temp_ban'] ? "\n\t\t\t\t\t<span class='desc'>{$this->lang->words['w_restricted']}</span>\n\t\t\t\t" : "") . "\n\t\t\t</li>\n\t\t</ul>" : "") . "\n</fieldset>\n<fieldset class='with_subhead'>\n\t<h3 class='bar'>{$this->lang->words['warn_mem_content']}</h3>\n\t<h4>{$this->lang->words['warn_posts_topics']}</h4>\n\t<ul>\n\t\t<li class='field checkbox'>\n\t\t\t<select name=\"topicPosts_type\" class='input_select'>\n\t\t\t\t<option value='unapprove' " . ($this->request['topicPosts_type'] == 'unapprove' ? "selected='selected'" : "") . ">{$this->lang->words['warn_stuff_unapprove']}</option>\n\t\t\t\t<option value='approve' " . ($this->request['topicPosts_type'] == 'approve' ? "selected='selected'" : "") . ">{$this->lang->words['warn_stuff_approve']}</option>\n\t\t\t</select>\n\t\t</li>\n\t\t<li class='field checkbox'>\n\t\t\t<input type=\"checkbox\" id='topicPosts_topics' class='input_check' name=\"topicPosts_topics\" value=\"1\" />\n\t\t\t<label for='topicPosts_topics'>{$this->lang->words['warn_stuff_alltopics']}</label>\n\t\t</li>\n\t\t<li class='field checkbox'>\n\t\t\t<input type=\"checkbox\" id='topicPosts_replies' class='input_check' name=\"topicPosts_replies\" value=\"1\" />\n\t\t\t<label for='topicPosts_replies'>{$this->lang->words['warn_stuff_allposts']}</label>\n\t\t</li>\n\t\t<li class='field checkbox'>\n\t\t\t<label for='topicPosts_lastx'>{$this->lang->words['warn_stuff_datecutoff']}</label>\n\t\t\t<input type=\"text\" id='topicPosts_lastx' class='input_text' name=\"topicPosts_lastx\" value=\"\" size=\"5\" />\n\t\t\t<select name=\"topicPosts_lastxunits\" class='input_select'>\n\t\t\t\t<option value=\"d\">{$this->lang->words['w_day']}</option>\n\t\t\t\t<option value=\"h\">{$this->lang->words['w_hour']}</option>\n\t\t\t</select>\n\t\t</li>\n\t</ul>\n</fieldset>\n<fieldset>\n\t<h3 class='bar'>{$this->lang->words['warn_contact_member']}</h3>\n\t<ul>\n\t\t<li class='field'>\n\t\t\t<label for='subj'>{$this->lang->words['w_c_subj']}</label>\n\t\t\t<input id='subj' class='input_text' type=\"text\" name=\"subject\" value=\"{$this->request['subject']}\" size=\"30\" />\n\t\t</li>\n\t\t<li class='field'>\n\t\t\t<label for='method'>{$this->lang->words['w_c']}</label>\n\t\t\t<select id='method' name=\"contactmethod\" class='input_select'>\n\t\t\t\t" . ($member['members_disable_pm'] != 1 ? "\n\t\t\t\t\t<option value=\"pm\">{$this->lang->words['w_c_p']}</option>\n\t\t\t\t" : "") . "\n\t\t\t\t<option value=\"email\">{$this->lang->words['w_c_e']}</option>\n\t\t\t</select>\n\t\t</li>\n\t\t<li>\n\t\t\t{$editor_html}\n\t\t</li>\n\t</ul>\n</fieldset>\n<fieldset class='submit'>\n\t<input type=\"submit\" class='input_submit' value=\"{$this->lang->words['w_submit']}\" tabindex='0'/> {$this->lang->words['or']} <a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("showtopic={$tid}&st={$st}", 'public', ''), "", "") . "' title='{$this->lang->words['cancel']}' class='cancel' tabindex='0'>{$this->lang->words['cancel']}</a>\n</fieldset>\n\t\n</div>\n</form>"; return $IPBHTML; }