summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlezvous.ca>2008-06-22 14:04:37 -0400
committerEvan Prodromou <evan@controlezvous.ca>2008-06-22 14:04:37 -0400
commitd758c117843dec04b061263095baeea7697b05a4 (patch)
tree5a5ebdc416f86449948f223a769c108e86711022 /classes
parenta69dbe7cd541ca054fea6239efce098a7111416a (diff)
disallow nicknames on a blacklist
darcs-hash:20080622180437-34904-4b6313f6fd8845232031663c5c2df00dff725183.gz
Diffstat (limited to 'classes')
-rw-r--r--classes/User.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/classes/User.php b/classes/User.php
index 0e7fd5447..e735457f9 100644
--- a/classes/User.php
+++ b/classes/User.php
@@ -83,4 +83,12 @@ class User extends DB_DataObject
' WHERE id = ' . $this->id;
return $this->query($qry);
}
+
+ function allowed_nickname($nickname) {
+ # XXX: should already be validated for size, content, etc.
+ static $blacklist = array('rss', 'xrds', 'doc', 'main',
+ 'settings', 'notice', 'user');
+ $merged = array_merge($blacklist, common_config('nickname', 'blacklist'));
+ return !in_array($nickname, $merged);
+ }
}