#!/usr/bin/perl



 #
 # Copyright (c) 2016-2017 Barchampas Gerasimos <http://makbox.co.nf/>
 # Makbox is a personal (staas) cloud.
 #
 # Makbox is free software: you can redistribute it and/or modify
 # it under the terms of the GNU Affero General Public License as
 # published by the Free Software Foundation, either version 3 of the
 # License, or (at your option) any later version.
 #
 #
 # Makbox is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 # GNU Affero General Public License for more details.
 #
 # You should have received a copy of the GNU Affero General Public License, version 3,
 # along with this program.  If not, see <http://www.gnu.org/licenses/>
 #
 #



print "---------------------------------------------------\n";
print "MAKBOX DELETE ACCOUNT :\n";
print "---------------------------------------------------\n";

print "Give your username:";
$username =  <STDIN>;
chomp ($username);


print "Give your password:";
$pass =  <STDIN>;
chomp ($pass);


use Digest::MD5 qw(md5 md5_hex md5_base64);

my $password = $pass;

my $encpass = md5_hex($password);



my @chars = ("a".."z", "0".."9");
my $cookies;
$cookies .= $chars[rand @chars] for 1..32;


use DBI;

my $driver = "mysql"; 
my $db = "";
my $link = "DBI:$driver:database=$db";
my $user = "";
my $pass = "";

my $conn = DBI->connect($link, $user, $pass ) or die $DBI::errstr;



my $sth = $conn->prepare("delete from login
                          where username = '$username' and password='$encpass'");


$sth->execute();
$sth->finish();

;
