Public feed #722711

ini user system

public text v1 · immutable
Raw Edit
·published 2007-10-02 07:51 UTC
rendered paste body
on *:TEXT:.*:%my.chan: {
  set %auth.nick $nick
  set %auth.command $1-
  whois $nick
}


raw 330:*: {
  set %auth.user $3
  if (%auth_add.user == 1) {
    writeini data.ini users %auth.user %auth_add.level
    notice %auth_add.nick %skin.start User(s) %skin.mid $3 $+ ( $+ %auth.nick $+ ) has been added with access %auth_add.level %skin.end
    set %auth_add.user 0
  } 
  elseif (%auth_del.user == 1) {
    set %auth.level $readini(data.ini,users,%auth.user)
    if (%auth.level >= %auth_del.level) { 
      notice %auth_add.nick %skin.start User(s) %skin.mid $3 $+ ( $+ %auth.nick $+ ) has not been deleted, your access is to low %skin.end
      set %auth_del.user 0
    } 
    else {
      writeini data.ini users %auth.user 0
      notice %auth_add.nick %skin.start User(s) %skin.mid $3 $+ ( $+ %auth.nick $+ ) has been removed %skin.end
      set %auth_del.user 0
    }
  }
  elseif (%auth_axs.status == 1) {
    set %auth_axs.status 0
    set %auth.level $readini(data.ini,users,%auth.user)
    notice %auth.nick %skin.start User(s) %skin.mid %auth_axs.nick2 has %auth.level access to Me(4 $+ $me $+ 15) %skin.end
  }
  else {
    auth_stuff2
  }
}


raw 401:*: {
  set %auth.user Not Authed
}



alias auth_stuff2 {
  set %auth.level $readini(data.ini,users,%auth.user)
  auth_commands %auth.command
}




alias auth_commands {
  if ($1 == .add) && (%auth.level >= 499) {
    if ($2 == quote) {
      write quotes.txt $3-
      notice %auth.nick %skin.start Quote %skin.mid " $+ $3- $+ " added to quotes %skin.end
    }
    if ($2 == user) && ($4 < %auth.level) {
      set %auth_add.user 1
      set %auth_add.nick %auth.nick
      set %auth.nick $3
      set %auth_add.level $4
      whois %auth.nick
    }
  }
  if ($1 == .a) {
    if ($2) {
      set %auth_axs.status 1
      set %auth_axs.nick %auth.nick
      set %auth_axs.nick2 $2
      whois $2
    } 
    else { 
      notice %auth.nick %skin.start User(s) %skin.mid You have %auth.level access to Me(4 $+ $me $+ 15) %skin.end
    }
  }
  if ($1 == .del) {
    if ($2 == user) {
      set %auth_del.user 1
      set %auth_del.nick %auth.nick
      set %auth_del.level %auth.level
      set %auth.nick $3
      whois %auth.nick
    }
  }
}