Пример #1
0
 public function AddIPCacheInfo($displayname)
 {
     global $info, $contentopts;
     if (isset($info["sso_login_modules"]) && isset($info["sso_login_modules"]["sso_recaptcha"])) {
         $info2 = $this->GetInfo();
         $num = $info["sso_login_modules"]["sso_recaptcha"]["logins"];
         $contentopts["fields"][] = array("title" => BB_Translate("%s - reCAPTCHA - Login/Recovery Attempts", $displayname), "type" => "custom", "value" => BB_Translate("%d login/recovery attempt" . ($num == 1 ? "" : "s") . " since %s.  Limit %d before showing reCAPTCHA.", $num, BB_FormatTimestamp("M j, Y @ g:i A", CSDB::ConvertFromDBTime($info["sso_login_modules"]["sso_ratelimit"]["ts"])), $info2["login_attempts"]));
     } else {
         $contentopts["fields"][] = array("title" => BB_Translate("%s - reCAPTCHA Information", $displayname), "type" => "custom", "value" => "<i>" . htmlspecialchars(BB_Translate("Undefined (No information found)")) . "</i>");
     }
 }
Пример #2
0
             BB_SetPageMessage("error", "Please specify an IP address or pattern.");
         }
         $ts = time();
         $result = $sso_db->Query("SELECT", array("*", "FROM" => "?", "WHERE" => "created >= ?", "ORDER BY" => "created DESC"), $sso_db_ipcache, CSDB::ConvertToDBTime(time() - 2 * 24 * 60 * 60));
         while ($row = $result->NextRow()) {
             $ipaddr = IPAddr::NormalizeIP($row->ipaddr);
             $info = unserialize($row->info);
             $spammer = false;
             if (isset($info["spaminfo"])) {
                 foreach ($sso_providers as $provider => &$instance) {
                     if (isset($info["spaminfo"][$provider]) && $info["spaminfo"][$provider]["spammer"]) {
                         $spammer = true;
                     }
                 }
             }
             $rows[] = array(htmlspecialchars($ipaddr["ipv4"] != "" ? $ipaddr["ipv4"] : $ipaddr["shortipv6"]), htmlspecialchars(BB_Translate($spammer ? "Yes" : "No")), BB_FormatTimestamp("M j, Y @ g:i A", CSDB::ConvertFromDBTime($row->created)), "<a href=\"" . BB_GetRequestURLBase() . "?action=viewipaddr&id=" . $row->id . "&sec_t=" . BB_CreateSecurityToken("viewipaddr") . "\">" . htmlspecialchars(BB_Translate("View")) . "</a>");
         }
         $table = array("title" => "Last 48 Hours", "type" => "table", "cols" => array("IP Address", "Spammer?", "Created", "Options"), "rows" => $rows, "desc" => "New IP addresses in the last 48 hours.");
     }
     $contentopts = array("desc" => "Manage the IP address cache.", "htmldesc" => $desc, "nonce" => "action", "hidden" => array("action" => "manageipcache"), "fields" => array($table, "split", array("title" => "Find IP Address", "type" => "text", "name" => "ipaddr", "value" => BB_GetValue("ipaddr", ""), "desc" => "Enter an IP address or IP address pattern to search for.  (e.g. '10.0.0-15,17.*')")), "submit" => "Search", "focus" => false);
     BB_GeneratePage("Manage IP Cache", $sso_menuopts, $contentopts);
 } else {
     if ($sso_site_admin && isset($_REQUEST["action"]) && $_REQUEST["action"] == "resetsessions") {
         $sso_db->Query("TRUNCATE TABLE", array($sso_db_user_sessions));
         $sso_db->Query("TRUNCATE TABLE", array($sso_db_temp_sessions));
         BB_RedirectPage("success", "Successfully reset all sessions.");
     } else {
         $contentopts = array("desc" => "Pick an option from the menu.");
         BB_GeneratePage("Home", $sso_menuopts, $contentopts);
     }
 }
Пример #3
0
                                                                                                                                                                            ?>
);
</script>
<?php 
                                                                                                                                                                            BB_RunPluginAction("post_bb_main_edit_site_opt_delete_translation_notification");
                                                                                                                                                                        } else {
                                                                                                                                                                            if ($_REQUEST["bb_action"] == "bb_main_edit_site_opt_view_translation_notifications") {
                                                                                                                                                                                BB_RunPluginAction("pre_bb_main_edit_site_opt_view_translation_notifications");
                                                                                                                                                                                require_once "translate.php";
                                                                                                                                                                                $rows = array();
                                                                                                                                                                                $urlbase = BB_GetRequestURLBase();
                                                                                                                                                                                foreach ($bb_translate_notify as $num => $entry) {
                                                                                                                                                                                    if (!file_exists($entry[2] . "/" . $entry[3] . "_" . $entry[5] . "_page.php")) {
                                                                                                                                                                                        unset($bb_translate_notify[$num]);
                                                                                                                                                                                    } else {
                                                                                                                                                                                        $rows[] = array(BB_FormatTimestamp($entry[1]), "<a href=\"" . $urlbase . "?bb_action=bb_main_edit&lang=" . urlencode($entry[4]) . "&notify=" . $num . "\" target=\"_blank\">" . htmlspecialchars(BB_Translate(BB_GetIANADesc($entry[4], true, true))) . "</a>", "<a href=\"" . $urlbase . "?bb_action=bb_main_edit&lang=" . urlencode($entry[5]) . "&notify=" . $num . "\" target=\"_blank\">" . htmlspecialchars(BB_Translate(BB_GetIANADesc($entry[5], true, true))) . "</a>", htmlspecialchars($entry[6]), BB_CreatePropertiesLink(BB_Translate("Delete"), "bb_main_edit_site_opt_delete_translation_notification", array("notify" => $num)));
                                                                                                                                                                                    }
                                                                                                                                                                                }
                                                                                                                                                                                BB_RunPluginAction("bb_main_edit_site_opt_view_translation_notifications_active");
                                                                                                                                                                                BB_SaveTranslationNotifications();
                                                                                                                                                                                if (!count($rows)) {
                                                                                                                                                                                    BB_PropertyFormLoadError("No notifications found.");
                                                                                                                                                                                }
                                                                                                                                                                                $options = array("title" => "View Notifications", "desc" => "View and manage translation notifications.", "fields" => array(array("type" => "table", "cols" => array("Timestamp", "Source", "Target", "Reason", "Options"), "rows" => $rows)));
                                                                                                                                                                                BB_RunPluginAction("bb_main_edit_site_opt_view_translation_notifications_options");
                                                                                                                                                                                BB_PropertyForm($options);
                                                                                                                                                                                BB_RunPluginAction("post_bb_main_edit_site_opt_view_translation_notifications");
                                                                                                                                                                            } else {
                                                                                                                                                                                if ($_REQUEST["bb_action"] == "bb_main_edit_site_opt_profile_submit") {
                                                                                                                                                                                    BB_RunPluginAction("pre_bb_main_edit_site_opt_profile_submit");
                                                                                                                                                                                    $pass = $_REQUEST["oldpass"];
Пример #4
0
 public function AddIPCacheInfo($displayname)
 {
     global $info, $contentopts;
     if (isset($info["sso_login_modules"]) && isset($info["sso_login_modules"]["sso_ratelimit"])) {
         $info2 = $this->GetInfo();
         $num = $info["sso_login_modules"]["sso_ratelimit"]["sysreq"];
         $contentopts["fields"][] = array("title" => BB_Translate("%s - Rate Limit - System Requests", $displayname), "type" => "custom", "value" => BB_Translate("%d system request" . ($num == 1 ? "" : "s") . " since %s.  Limit %d.", $num, BB_FormatTimestamp("M j, Y @ g:i A", CSDB::ConvertFromDBTime($info["sso_login_modules"]["sso_ratelimit"]["ts"])), $info2["system_requests"]));
         $num = $info["sso_login_modules"]["sso_ratelimit"]["logins"];
         $contentopts["fields"][] = array("title" => BB_Translate("%s - Rate Limit - Login/Recovery Attempts", $displayname), "type" => "custom", "value" => BB_Translate("%d login/recovery attempt" . ($num == 1 ? "" : "s") . " since %s.  Limit %d.", $num, BB_FormatTimestamp("M j, Y @ g:i A", CSDB::ConvertFromDBTime($info["sso_login_modules"]["sso_ratelimit"]["ts2"])), $info2["login_attempts"]));
         $num = $info["sso_login_modules"]["sso_ratelimit"]["register"];
         $contentopts["fields"][] = array("title" => BB_Translate("%s - Rate Limit - Registrations", $displayname), "type" => "custom", "value" => BB_Translate("%d registration" . ($num == 1 ? "" : "s") . " since %s.  Limit %d.", $num, BB_FormatTimestamp("M j, Y @ g:i A", CSDB::ConvertFromDBTime($info["sso_login_modules"]["sso_ratelimit"]["ts3"])), $info2["register_num"]));
     } else {
         $contentopts["fields"][] = array("title" => BB_Translate("%s - Rate Limiting Information", $displayname), "type" => "custom", "value" => "<i>" . htmlspecialchars(BB_Translate("Undefined (No information found)")) . "</i>");
     }
 }