summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/modules/mysql/db_mysql_execute.cpp3
-rw-r--r--src/users.cpp17
2 files changed, 16 insertions, 4 deletions
diff --git a/src/modules/mysql/db_mysql_execute.cpp b/src/modules/mysql/db_mysql_execute.cpp
index 4e4e859cb..572dd2917 100644
--- a/src/modules/mysql/db_mysql_execute.cpp
+++ b/src/modules/mysql/db_mysql_execute.cpp
@@ -52,6 +52,7 @@ class FakeUser : public User
NickCore *Account() const { return nc; }
const bool IsIdentified(bool) const { return nc ? true : false; }
+ const bool IsRecognized(bool) const { return true; }
} SQLUser;
class SQLTimer : public Timer
@@ -155,7 +156,7 @@ class DBMySQLExecute : public DBMySQL
~DBMySQLExecute()
{
- TimerManager::DelTimer(_SQLTimer);
+ delete _SQLTimer;
}
};
diff --git a/src/users.cpp b/src/users.cpp
index 3e367ef47..b01862479 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -192,7 +192,7 @@ void User::SetRealname(const std::string &srealname)
this->realname = sstrdup(srealname.c_str());
NickAlias *na = findnick(this->nick);
- if (na && (this->IsIdentified(true) || (!na->nc->HasFlag(NI_SECURE) && this->IsRecognized())))
+ if (na && (this->IsIdentified(true) || this->IsRecognized(true)))
{
if (na->last_realname)
delete [] na->last_realname;
@@ -477,10 +477,21 @@ const bool User::IsIdentified(bool CheckNick) const
}
/** Check if the user is recognized for their nick (on the nicks access list)
+ * @param CheckSecure Only returns true if the user has secure off
* @return true or false
*/
-const bool User::IsRecognized() const
+const bool User::IsRecognized(bool CheckSecure) const
{
+ if (CheckSecure && OnAccess)
+ {
+ NickAlias *na = findnick(this->nick);
+
+ if (!na || !na->nc->HasFlag(NI_SECURE))
+ {
+ return false;
+ }
+ }
+
return OnAccess;
}
@@ -497,7 +508,7 @@ void User::UpdateHost()
if (na)
OnAccess = is_on_access(this, na->nc);
- if (na && (this->IsIdentified(true) || (!na->nc->HasFlag(NI_SECURE) && this->IsRecognized())))
+ if (na && (this->IsIdentified(true) || this->IsRecognized(true)))
{
if (na->last_usermask)
delete [] na->last_usermask;