BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => 0.2.x Custom/Unofficial Modules => Topic started by: stonybg on March 11, 2006, 12:31:06 pm

Title: Password set command for websits acces
Post by: stonybg on March 11, 2006, 12:31:06 pm
If some other web master need make dinamic access to him web for members in org can use this plugin for members can set him password (sory for bad english)

Code: [Select]
<?
  /*
   * password.php - Set password for webmasters
   *
   *
   * Copyright (C) 2004 Stony
   *
   *
   * Special thanks to Khalem (RK1) for support.
   *
   * File last changed at $LastChangedDate: 2006-03-11 01:41:32 +0100 (Wed, 29 Dec 2004) $
   * Revision: $Id: password.php 8 2006-03-11 00:41:32Z blondengy $
   */

  /*
  Prepare MySQL database
  */
  $db -> query("CREATE TABLE IF NOT EXISTS password
              (id INT NOT NULL PRIMARY KEY, name VARCHAR(30),
              password VARCHAR(255))");


  $password = new password($bot);

  $commands["tell"]["password"] = &$password;

  /*
    The Class itself...
  */
  class password
  {
    var $bot;
    var $last_log;
    var $start;



    /*
      Constructor:
        Hands over a referance to the "Bot" class.
    */
    function password (&$bot)
    {
      $this -> bot = &$bot;
      $this -> last_log = array();
    }



    /*
      This gets called on a tell with the command
    */
    function tell($name, $msg)
    {
      if (preg_match("/^" . $this -> bot -> commpre . "password (.+)/i", $msg, $info))
        $this -> bot -> send_tell($name, $this -> set_msg($name, $info[1]));
      else
      $this -> bot -> send_help($name);
    }


function set_msg($name, $message)
{
if ($this -> bot -> is_member($name) == 1)
{
$id = $this -> bot -> aoc -> get_uid($name);

$message = str_replace("'", "", $message);

$this -> bot -> db -> query("DELETE FROM password WHERE id = " . $id);
$this -> bot -> db -> query("INSERT INTO password (id, password, name) VALUES ($id,'$message', '$name')");
  return "Thankyou " . $name . ". Your web password  has been set.";
}
else
return "You must be a member to set a password.";
}
  }
?>

for set your password use command:

!password (your password)
for more webmasters know how to use password tabele for him web sites
SimplePortal 2.3.7 © 2008-2024, SimplePortal