<?php
/*******************************************************************************

    Author ......... Jimmy Conner
    Contact ........ jimmy@sqmail.org
    Home Site ...... http://www.sqmail.org/
    Program ........ Address Add
    Version ........ 2.1
    Purpose ........ Allows you to add the From address to the address book

*******************************************************************************/

global $address;
include_once(SM_PATH . 'functions/addressbook.php');
include_once(SM_PATH . 'functions/mime.php');
include_once(SM_PATH . 'plugins/address_add/includes/functions.php');

// open address book, trash errors, skip LDAP
$address = addressbook_init(false, true);
if ($address->localbackend == 0)
   return;

$add = new Address_Add;
$add->Init();

class Address_Add {

   var $froms = "";
   var $nick = "";
   var $first = "";
   var $last = "";
   var $decodedfrom = "";
   var $duplicate = false;

   function Init () {
      include('../plugins/address_add/classes/init.php');
   }

   function GetEmail () {
      include('../plugins/address_add/classes/getemail.php');
   }

   function ParseEmail ($str) {
      include('../plugins/address_add/classes/parseemail.php');
   }

   function CheckforDuplicate () {
      include('../plugins/address_add/classes/checkforduplicate.php');
   }

   function GetName () {
      include('../plugins/address_add/classes/getname.php');
   }

   function ShowLink () {
      include('../plugins/address_add/classes/showlink.php');
   }
}

?>