65 |
|
|
66 |
# Checks $handle for $flags, $channel is optional. |
# Checks $handle for $flags, $channel is optional. |
67 |
proc ::tcldrop::users::arraydb::matchattr {handle flags {channel {}}} { |
proc ::tcldrop::users::arraydb::matchattr {handle flags {channel {}}} { |
68 |
switch -- $flags { |
switch -exact -- $flags { |
69 |
{+|+} - {*|*} - {+} - {*} { |
{*} - {+} - {*|*} - {+|+} { |
70 |
# * or + means anybody, return 1. |
# * or + means anybody, return 1. |
71 |
return 1 |
return 1 |
72 |
} |
} |
351 |
proc ::tcldrop::users::arraydb::addbot {handle {address {}} {hostmask {}}} { |
proc ::tcldrop::users::arraydb::addbot {handle {address {}} {hostmask {}}} { |
352 |
if {![validuser $handle]} { |
if {![validuser $handle]} { |
353 |
setuser $handle |
setuser $handle |
354 |
setuser $lowerhandle hosts $hostmask |
setuser $handle hosts $hostmask |
355 |
set addr [lindex [split $address :] 0] |
set addr [lindex [split $address :] 0] |
356 |
set botport [lindex [split $address :/] 1 |
set botport [lindex [split $address :/] 1] |
357 |
set userport [lindex [split $address /] end] |
set userport [lindex [split $address /] end] |
358 |
setuser $lowerhandle botaddr [list $addr $botport $userport] |
chattr $handle +b |
359 |
|
setuser $handle botaddr [list $addr $botport $userport] |
360 |
return 1 |
return 1 |
361 |
} else { |
} else { |
362 |
return 0 |
return 0 |
427 |
} |
} |
428 |
} |
} |
429 |
|
|
|
# Encrypts $password: |
|
|
# Note, most of the comments in this proc are by Papillon@EFNet. |
|
|
proc ::tcldrop::users::arraydb::encpass {password} { |
|
|
# FixMe: This should return the password as a crypt. |
|
|
# Well here we have several possible solutions, we can load the base64 lib, or we can source |
|
|
# the md5.tcl file .... or we have to make a blowfish module ;) --- Papillon |
|
|
# With base64 encoding we can decode it later if wanted |
|
|
# set password [::base64::encode -maxlen 53 -wrapchar j $password] |
|
|
# with md5 we can't decode it.. but then again.. anyone else will have a hard time decoding it aswell ;) |
|
|
# set password [::md5::hmac $password $password] |
|
|
return $password |
|
|
} |
|
430 |
|
|
431 |
# Saves the user database to the hard disk: |
# Saves the user database to the hard disk: |
432 |
# The default is to write it in the background (nonblocking). |
# The default is to write it in the background (nonblocking). |