Password Identifier

By nfield38 on Jan 29, 2007

This is both a command and an identifier. As a command, you can easily add, change, and remove passwords according to network and nickname:

/password [ADD|DEL] [NETWORK] [NICKNAME] [PASSWORD]

These passwords are stored into passwords.ini. You can then retrieve the password as an identifier:

$password(NETWORK,NICKNAME)[.md5]

If you specify the md5 property, the password is returned in md5 encryption.

alias password {
  if ($isid) return $iif($prop == md5, $md5($readini(passwords.ini,$1,$2)), $readini(passwords.ini,$1,$2))
  elseif ($1 == add) {
    if (!$4) echo $color(info) -10tsq * /password: insufficient parameters
    elseif ($chr(91) isin $2-3) || ($chr(93) isin $2-3) echo $color(info) -10tsq * /password: passwords may not contain brackets
    else {
      if ($readini(passwords.ini,$2,$3)) echo $color(info) -10tsq * Updated password for $3
      else echo $color(info) -10tsq * Added password for $3
      writeini passwords.ini $2-4
    }
  }
  elseif ($1 == del) {
    if (!$3) echo $color(info) -10tsq * /password: insufficient parameters
    elseif (!$readini(passwords.ini,$2,$3)) echo $color(info) -10tsq * /password: nonexistant password
    else {
      echo $color(info) -10tsq * Removed password for $3
      remini passwords.ini $2-3
    }
  }
  else echo $color(info) -10ts * /password: insufficient parameters
}

on *:UNLOAD:if ($isfile(passwords.ini)) remove passwords.ini

Comments

Sign in to comment.
DarthReven   -  Jan 29, 2007

you may want to add a condition that will check to see if $1- exists so that if the user doesn\'t give the proper amount of information they are notified

 Respond  
Lindrian   -  Jan 29, 2007

I havent tried it, but it looks good. But id acually rather stay to the function mIRC got built in :p.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.