'".self::$time_overdue."' AND user_actiontime='0"; } else if (self::$status == 8 && fusion_get_settings('enable_deactivation') == 1) { self::$usr_mysql_status = "0' AND user_lastvisit<'".self::$time_overdue."' AND user_actiontime='0"; } self::$exit_link = FUSION_SELF.fusion_get_aidlink()."&sortby=".self::$sortby."&status=".self::$status."&rowstart=".self::$rowstart; $base_url = FUSION_SELF.fusion_get_aidlink(); self::$status_uri = [ self::USER_MEMBER => $base_url."&status=".self::USER_MEMBER, self::USER_UNACTIVATED => $base_url."&status=".self::USER_UNACTIVATED, self::USER_BAN => $base_url."&status=".self::USER_BAN, self::USER_SUSPEND => $base_url."&status=".self::USER_SUSPEND, self::USER_SECURITY_BAN => $base_url."&status=".self::USER_SECURITY_BAN, self::USER_CANCEL => $base_url."&status=".self::USER_CANCEL, self::USER_ANON => $base_url."&status=".self::USER_ANON, self::USER_DEACTIVATE => $base_url."&status=".self::USER_DEACTIVATE, 'add_user' => $base_url.'&ref=add', 'view' => $base_url.'&ref=view&lookup=', 'edit' => $base_url.'&ref=edit&lookup=', 'delete' => $base_url.'&ref=delete&lookup=', 'inactive' => $base_url.'&ref=inactive', 'resend' => $base_url.'&ref=resend&lookup=', 'activate' => $base_url.'&ref=activate&lookup=', ]; self::$user_id = (isset($_GET['lookup']) && dbcount('(user_id)', DB_USERS, 'user_id=:user_id', [':user_id' => isnum($_GET['lookup']) ? $_GET['lookup'] : 0]) ? $_GET['lookup'] : 0); if (dbcount("(user_id)", DB_USERS, "user_id=:user_id AND user_level<:user_level", [ ':user_id' => self::$user_id, ':user_level' => USER_LEVEL_MEMBER, ]) > 0 ) { self::$is_admin = TRUE; } else { self::$is_admin = FALSE; } } public static function getInstance() { if (self::$instance == NULL) { pageAccess('M'); self::$instance = new static(); } return self::$instance; } public function display_admin() { if (isset($_POST['cancel'])) { redirect(self::$exit_link); } BreadCrumbs::getInstance()->addBreadCrumb(['link' => ADMIN.'members.php'.fusion_get_aidlink(), 'title' => self::$locale['ME_400']]); if (isset($_GET['ref'])) { switch ($_GET['ref']) { case 'log': // Show Logs if (!self::$is_admin) { display_suspend_log(self::$user_id, "all", self::$rowstart); } break; case 'inactive': if (!self::$user_id && fusion_get_settings('enable_deactivation') && self::$is_admin) { $inactive = dbcount("(user_id)", DB_USERS, "user_status='0' AND user_level>".USER_LEVEL_SUPER_ADMIN." AND user_lastvisit <:last_visited AND user_actiontime=:action_time", [ ':last_visited' => self::$time_overdue, ':action_time' => 0, ] ); $button = self::$locale['ME_502'].format_word($inactive, self::$locale['fmt_user']); if (!$inactive) { addNotice('success', self::$locale['ME_460']); redirect(FUSION_SELF.fusion_get_aidlink()); } if (isset($_POST['deactivate_users']) && \defender::safe()) { require_once INCLUDES."sendmail_include.php"; $result = dbquery("SELECT user_id, user_name, user_email, user_password FROM ".DB_USERS." WHERE user_level>".USER_LEVEL_SUPER_ADMIN." AND user_lastvisit<'".self::$time_overdue."' AND user_actiontime='0' AND user_status='0' LIMIT 0,50 "); $rows = dbrows($result); if ($rows != '0') { while ($data = dbarray($result)) { $message = strtr(self::$locale['email_deactivate_message'], [ '[CODE]' => md5(self::$response_required.$data['user_password']), '[SITENAME]' => self::$settings['sitename'], '[SITEUSERNAME]' => self::$settings['siteusername'], '[USER_NAME]' => $data['user_name'], '[USER_ID]' => $data['user_id'], ] ); if (sendemail($data['user_name'], $data['user_email'], self::$settings['siteusername'], self::$settings['siteemail'], self::$locale['email_deactivate_subject'], $message)) { dbquery("UPDATE ".DB_USERS." SET user_status='7', user_actiontime='".self::$response_required."' WHERE user_id='".$data['user_id']."'"); suspend_log($data['user_id'], self::USER_DEACTIVATE, self::$locale['ME_468']); } } addNotice('success', sprintf(self::$locale['ME_461'], format_word($rows, self::$locale['fmt_user']))); redirect(FUSION_SELF.fusion_get_aidlink()); } } // Put this into view. BreadCrumbs::getInstance()->addBreadCrumb(['link' => self::$status_uri['inactive'], 'title' => self::$locale['ME_462']]); opentable(self::$locale['ME_462']); if ($inactive > 50) { addNotice('info', sprintf(self::$locale['ME_463'], floor($inactive / 50))); } echo "