<?php 
##
#	Project: PHPDISK File Storage Solution
#	This is NOT a freeware, use is subject to license terms.
#
#	Site: http://www.phpdisk.com
#
#	$Id: install.inc.php 160 2015-10-03 07:03:08Z along $
#
#	Copyright (C) 2008-2016 PHPDisk Team. All Rights Reserved.
#
##
if(!defined('IN_PHPDISK')) {
	exit('[PHPDisk] Access Denied');
}

function install_plugin(){	
	global $db,$tpf,$db_charset;
	$sql = "CREATE TABLE IF NOT EXISTS `{$tpf}sso` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `subject` varchar(100) NOT NULL,
  `site_url` varchar(200) NOT NULL,
  `site_key` varchar(20) NOT NULL,
  `site_status` tinyint(1) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=$db_charset ;";	
	$db->query($sql);
	
	$sql = "CREATE TABLE IF NOT EXISTS `{$tpf}sso_log` (
  `intime` int(10) unsigned NOT NULL DEFAULT '0',
  `site` varchar(255) NOT NULL,
  `action` varchar(50) NOT NULL,
  `param` text NOT NULL,
  `ip` varchar(15) NOT NULL,
  KEY `intime` (`intime`)
) ENGINE=MyISAM DEFAULT CHARSET=$db_charset ;";	
	$db->query($sql);
	return true;
}
function uninstall_plugin(){
	global $db,$tpf,$db_charset;
	$db->query("DROP TABLE IF EXISTS `{$tpf}sso`;");
	$db->query("DROP TABLE IF EXISTS `{$tpf}sso_log`;");
	return true;
}
?>