View Single Post
Old 02-02-2006, 10:36 AM  
iXi
Senior Member
 
Join Date: Nov 2002
Posts: 220
Default [mod] ioB 2.0 r1 ioMASTER.itcl

another 3th party addon for ioB 2.0 r1.. base on iojM by jeza all credits belongs to him!

go into your ioFTPD\scripts\ioBanana\ dir
create file called ioMASTER.itcl and insert the following code:
PHP Code:
#########################################################################################
# all credits belongs to jeza!                                #
# orginal script:                                    #
# http://www.inicom.net/pages/en.ioftpd-scripts.php?did=15                #
# modded for ioB 2.0 r1 to have an announce @ admin chan while add/remove a master!     #
#                                            #
# copy ioMASTER.itcl to ..\scripts\ioBanana [or where u want]                #
#                                                 #
# in ioFTPD.ini add                                    #
#                                                  #
# [FTP_Custom_Commands]                                  #
# addmaster    = TCL ..\scripts\ioBanana\ioMASTER.itcl    add                #
# delmaster    = TCL ..\scripts\ioBanana\ioMASTER.itcl    del                #
#                                                  #
# [FTP_Command_Permissions]                                #
# addmaster    = M                                    #
# delmaster    = M                                                                     #
#                                                  #
# restart/rehash ioFTPD                                    #
#                                                  #
#########################################################################################
###; Path to SysOp.log
set ioM(syslog"../logs/SysOp.log"
#########################################################################################
# STOP HERE                                                                             #
#########################################################################################
proc putsyslog {text} {
global 
ioM
set now 
[clock format [clock seconds] -format {%m-%d-%%H:%M:%S}]
set syslog [open $ioM(sysloga+]; puts $syslog "$now $text."close $syslog
return 0
}
proc ioMASTER:main arg } {
  
  global 
ioMASTER ioerror muid ioM
  
  set muid 
[resolve user [lindex $arg 1]]
  
  if { 
$muid == -} {
    
iputs -nobuffer "[lindex $arg 1]: Not found. "
    
set ioerror 2
    
return 1
  
}
  
  if { [
userfile open [lindex $arg 1]]== } {
    
    
userfile lock
    set uf 
[split [userfile bin2ascii] \n]
    
    if {[
set fn [lsearch $uf {flags *}]] != -1} {
    
      
set flg [lindex $uf $fn]
      
set flg [lrange $flg 1 end]
    
      if { [
string tolower [lindex $arg 0]] == "add" } {
    
putsyslog "Adding Master Flag to [lindex $arg 1]"
        
iputs -nobuffer "Adding Master Flag to [lindex $arg 1]"
        
set rf "M"
        
set rf [concat $rf$flg]
        
set uf [lreplace $uf $fn $fn "flags $rf"]
      }
    
      if { [
string tolower [lindex $arg 0]] == "del" } {
          
putsyslog "Removing Master Flag from [lindex $arg 1]"
        
iputs -nobuffer "Removing Master Flag from [lindex $arg 1]"
        
regsub -all -- "M" $flg "" flg;
        
set rf $flg
        set uf 
[lreplace $uf $fn $fn "flags $rf"]
      }
    
    }
    
    
set nuf {}
    foreach 
line $uf {
      
set nuf "${nuf}$line\n"
    
}
    
    
userfile ascii2bin $nuf
    userfile unlock
    
  
} else {
    
iputs -nobuffer "Cant open UserFile!"
  
}
  
  return 
0
  
}

proc ioMASTER:help {} {

  
iputs -nobuffer " Syntax:"
  
iputs -nobuffer " site addmaster <name>"
  
iputs -nobuffer " site delmaster <name>"
  
  
return
  
}

if { ([
info exists args]) && ([llength $args] == 2) } { ioMASTER:main "$args} else { ioMASTER:help 
it will announce @ staff/admin chan add/del of masters on your site.
thats all..
iXi is offline   Reply With Quote