collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18363
  • stats Total Topics: 2500
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: Password set command for websits acces  (Read 1652 times)

0 Members and 1 Guest are viewing this topic.

Offline stonybg

  • BeBot User
  • **
  • Posts: 23
  • Karma: +0/-0
Password set command for websits acces
« 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
« Last Edit: March 11, 2006, 12:46:34 pm by stonybg »

 

* Recent Posts
[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm]


0.8.x updates for AoC by bitnykk
[January 30, 2024, 11:16:08 pm]


0.8.x updates for AO by bitnykk
[January 30, 2024, 11:15:37 pm]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am]


Bebot and Rasberry by bitnykk
[November 29, 2023, 11:04:14 pm]

* Who's Online
  • Dot Guests: 685
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal