mirror of
https://github.com/anope/anope.git
synced 2026-06-26 02:46:38 +02:00
Return references instead of pointers from the config system.
We used to return NULL from these methods but now we return an empty block so this can never actually be null now.
This commit is contained in:
+3
-3
@@ -835,14 +835,14 @@ Anope::string User::Mask() const
|
||||
|
||||
bool User::BadPassword()
|
||||
{
|
||||
if (!Config->GetBlock("options")->Get<unsigned int>("badpasslimit"))
|
||||
if (!Config->GetBlock("options").Get<unsigned int>("badpasslimit"))
|
||||
return false;
|
||||
|
||||
if (Config->GetBlock("options")->Get<time_t>("badpasstimeout") > 0 && this->invalid_pw_time > 0 && this->invalid_pw_time < Anope::CurTime - Config->GetBlock("options")->Get<time_t>("badpasstimeout"))
|
||||
if (Config->GetBlock("options").Get<time_t>("badpasstimeout") > 0 && this->invalid_pw_time > 0 && this->invalid_pw_time < Anope::CurTime - Config->GetBlock("options").Get<time_t>("badpasstimeout"))
|
||||
this->invalid_pw_count = 0;
|
||||
++this->invalid_pw_count;
|
||||
this->invalid_pw_time = Anope::CurTime;
|
||||
if (this->invalid_pw_count >= Config->GetBlock("options")->Get<unsigned int>("badpasslimit"))
|
||||
if (this->invalid_pw_count >= Config->GetBlock("options").Get<unsigned int>("badpasslimit"))
|
||||
{
|
||||
this->Kill(Me, "Too many invalid passwords");
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user