#!/usr/bin/php
<?php
/*
$Id: unlock.php 83 2007-08-09 06:25:32Z randomperson83 $
Obsessive Web Statistics
Copyright (C) 2007 Dustin Spicuzza <hide@address.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
This forces an unlock.
*/
$base = realpath(dirname(__FILE__) . '/../include/');
require "$base/base.inc.php";
require "$base/analysis.inc.php";
require_cli();
if ($argc < 2 || in_array($argv[1], array('--help', '-help', '-h', '-?'))){
echo wordwrap("Usage: " . $argv[0] . " [domain] | ['all' for all tables]\n\nThis script unlocks the lock used when uploading files.\n");
die;
}
$website = $argv[1];
if ($website == 'all'){
foreach (get_website_names() as $site)
unlock($site);
}else{
if (validate_website($website))
unlock($website);
}
function unlock($website){
$lock = new AnalysisLock($website);
$lock->Unlock();
}
?>