summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatarWilliam Heimbigner <william.heimbigner@gmail.com>2007-06-28 21:53:01 +0000
committerLibravatarWilliam Heimbigner <william.heimbigner@gmail.com>2007-06-28 21:53:01 +0000
commit638d9eae9e63755e26f9843985597e6f1c7c5f8e (patch)
tree5a47866dd4422b09af43e22cf156e3006d3a1f74
parent8731d29c1ff810c1bb467e678dfe7e75d8ec83c8 (diff)
added user management commands, which clears the TODO list, for now
-rw-r--r--TODO2
-rw-r--r--config-default/commands.xml42
-rw-r--r--config-default/users.xml14
3 files changed, 50 insertions, 8 deletions
diff --git a/TODO b/TODO
index 2c8a0a8..20574b5 100644
--- a/TODO
+++ b/TODO
@@ -1 +1 @@
-- add users / modify user flags
+nothing, for now! :)
diff --git a/config-default/commands.xml b/config-default/commands.xml
index f3a5f17..b86783e 100644
--- a/config-default/commands.xml
+++ b/config-default/commands.xml
@@ -7,6 +7,48 @@
$conn->privmsg($event->{to}->[0], "$result results found.");
]]>
</command>
+ <command cmd="^;user add (\S+) ?(\S*)$" flag="d">
+ <![CDATA[
+ my $nick = lc $1;
+ my $host = $2;
+ if ($host eq '') { $host = 'IDENTIFY'; }
+ $::xusers->{$nick} = { 'host' => $host };
+ $::users->{person} = $::xusers;
+ writeUsers();
+ $conn->privmsg($event->{to}->[0], "Hiya $nick");
+ ]]>
+ </command>
+ <command cmd="^;user flags set (\S+) ?(\S*)$" flag="d">
+ <![CDATA[
+ my $nick = lc $1;
+ my $flags = $2;
+ if ($flags eq '') { delete($::xusers->{$nick}->{flags}); } else {
+ $::xusers->{$nick}->{flags} = $flags;
+ }
+ $::users->{person} = $::xusers;
+ writeUsers();
+ $conn->privmsg($event->{to}->[0], "Flags for $nick set to $flags");
+ ]]>
+ </command>
+ <command cmd="^;user del (\S+)$" flag="d">
+ <![CDATA[
+ my $nick = lc $1;
+ delete($::xusers->{$nick});
+ $::users->{person} = $::xusers;
+ writeUsers();
+ $conn->privmsg($event->{to}->[0], "Byebye $nick");
+ ]]>
+ </command>
+ <command cmd="^;user flags show (\S+)$" flag="d">
+ <![CDATA[
+ my $nick = lc $1;
+ if (defined($::xusers->{$nick}->{flags})) {
+ $conn->privmsg($event->{to}->[0], "Flags for $nick: $::xusers->{$nick}->{flags}");
+ } else {
+ $conn->privmsg($event->{to}->[0], "$nick has no flags");
+ }
+ ]]>
+ </command>
<command cmd="^;autoban (\S+)$" flag="a">
<![CDATA[
my $chan = $1;
diff --git a/config-default/users.xml b/config-default/users.xml
index 9bdfed3..dc2046a 100644
--- a/config-default/users.xml
+++ b/config-default/users.xml
@@ -1,11 +1,11 @@
<people>
<person id="afterdeath" flags="odat" host="IDENTIFY" />
+ <person id="cchan" flags="odat" host="IDENTIFY" />
+ <person id="dmcdevit" flags="oat" host="IDENTIFY" />
<person id="filiated" flags="odat" host="IDENTIFY" />
- <person id="wildpikachu" host="about/linux/staff/wildpikachu" flags="odat" />
- <person id="slowking_man" host="IDENTIFY" flags="ot" />
- <person id="cchan" host="IDENTIFY" flags="odat" />
- <person id="mark_ryan" host="wikimedia/mark" flags="ot" />
- <person id="dmcdevit" host="IDENTIFY" flags="oat" />
- <person id="seanw" host="freenode/staff/wikimedia.sean-whitton" flags="oat" />
- <person id="st47" host="IDENTIFY" flags="oat" />
+ <person id="mark_ryan" flags="ot" host="wikimedia/mark" />
+ <person id="seanw" flags="oat" host="freenode/staff/wikimedia.sean-whitton" />
+ <person id="slowking_man" flags="ot" host="IDENTIFY" />
+ <person id="st47" flags="oat" host="IDENTIFY" />
+ <person id="wildpikachu" flags="odat" host="about/linux/staff/wildpikachu" />
</people>