Beispiel #1
0
$PLUGIN_NAME = "Youtube Connect";
// Start Page
$consoleObj = new ConsoleOption($mysqli);
$cID = $consoleObj->findConsoleIDByName("Plugin Manager");
$consoleObj->select($cID);
$consoleInfo = $consoleObj->get_info_filtered();
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$pluginObj = new btPlugin($mysqli);
// Check Login
$LOGIN_FAIL = true;
if ($member->authorizeLogin($_SESSION['btPassword']) && $member->hasAccess($consoleObj)) {
    $countErrors = 0;
    $dispError = array();
    // Check if installed
    if (!in_array($_POST['pluginDir'], $pluginObj->getPlugins("filepath"))) {
        $countErrors++;
        $dispError[] = "The selected plugin is not installed!";
    }
    // Start Uninstall
    $sql = "DROP TABLE `" . $PLUGIN_TABLE_NAME . "`";
    $sql2 = "DROP TABLE `" . $dbprefix . "youtube_videos`";
    if ($mysqli->query($sql) && $mysqli->query($sql2)) {
        // Remove Plugin from plugin table
        $pluginID = array_search($_POST['pluginDir'], $pluginObj->getPlugins("filepath"));
        $pluginObj->select($pluginID);
        $checkDeletePlugin = $pluginObj->delete();
        // Remove Console Option
        $ytConnectCID = $consoleObj->findConsoleIDByName($PLUGIN_NAME);
        if ($ytConnectCID !== false) {
            $consoleObj->select($ytConnectCID);
Beispiel #2
0
$arrAPIKeys = array('consumerKey' => "", 'consumerSecret' => "", 'widgetID' => "");
// Start Page
$consoleObj = new ConsoleOption($mysqli);
$cID = $consoleObj->findConsoleIDByName("Plugin Manager");
$consoleObj->select($cID);
$consoleInfo = $consoleObj->get_info_filtered();
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$pluginObj = new btPlugin($mysqli);
// Check Login
$LOGIN_FAIL = true;
if ($member->authorizeLogin($_SESSION['btPassword']) && $member->hasAccess($consoleObj)) {
    $countErrors = 0;
    $dispError = array();
    // Check if already installed
    if (in_array($_POST['pluginDir'], $pluginObj->getPlugins("filepath"))) {
        $countErrors++;
        $dispError[] = "The selected plugin is already installed!";
    }
    // Check if plugin table name interferes with other tables
    $result = $mysqli->query("SHOW TABLES");
    while ($row = $result->fetch_array()) {
        if ($row[0] == $PLUGIN_TABLE_NAME) {
            $countErrors++;
            $dispError[] = "There is database table that conflicts with this plugin.";
        }
    }
    if ($countErrors == 0) {
        $sql = "\n\t\t\n\t\tCREATE TABLE IF NOT EXISTS `" . $dbprefix . "twitter` (\n\t\t  `twitter_id` int(11) NOT NULL AUTO_INCREMENT,\n\t\t  `member_id` int(11) NOT NULL,\n\t\t  `oauth_token` varchar(255) NOT NULL,\n\t\t  `oauth_tokensecret` varchar(255) NOT NULL,\n\t\t  `username` varchar(20) NOT NULL,\n\t\t  `name` varchar(255) NOT NULL,\n\t\t  `description` text NOT NULL,\n\t\t  `followers` int(11) NOT NULL,\n\t\t  `following` int(11) NOT NULL,\n\t\t  `tweets` int(11) NOT NULL,\n\t\t  `profilepic` text NOT NULL,\n\t\t  `lasttweet_id` varchar(255) NOT NULL,\n\t\t  `lasttweet_html` text NOT NULL,\n\t\t  `showfeed` int(11) NOT NULL,\n\t\t  `embedtweet` int(11) NOT NULL,\n\t\t  `infocard` int(11) NOT NULL,\n\t\t  `allowlogin` int(11) NOT NULL,\n\t\t  `lastupdate` int(11) NOT NULL,\n\t\t  `loginhash` varchar(32) NOT NULL,\n\t\t  PRIMARY KEY (`twitter_id`)\n\t\t) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;\n\t\n\t\t";
        if ($mysqli->query($sql)) {
            $jsonAPIKey = json_encode($arrAPIKeys);
Beispiel #3
0
    $cID = $consoleObj->findConsoleIDByName("Plugin Manager");
    $consoleObj->select($cID);
    $member = new Member($mysqli);
    $member->select($_SESSION['btUsername']);
    if (!$member->authorizeLogin($_SESSION['btPassword']) || !$member->hasAccess($consoleObj)) {
        exit;
    }
    $pluginObj = new btPlugin($mysqli);
}
echo "\n<table class='formTable' style='margin-top: 0px; border-spacing: 0px'>\n\t";
$dispPlugins = "";
$pluginsDir = scandir($prevFolder . "plugins");
$addCSS = "";
$x = 0;
foreach ($pluginsDir as $dir) {
    if (is_dir($prevFolder . "plugins/" . $dir) && $dir != "." && $dir != ".." && !in_array($dir, $pluginObj->getPlugins("filepath")) && (file_exists($prevFolder . "plugins/" . $dir . "/install.php") || file_exists($prevFolder . "plugins/" . $dir . "/install_setup.php"))) {
        if ($x == 0) {
            $x = 1;
            $addCSS = "";
        } else {
            $x = 0;
            $addCSS = " alternateBGColor";
        }
        $pluginName = file_get_contents($prevFolder . "plugins/" . $dir . "/PLUGINNAME.txt");
        if ($pluginName === false) {
            $pluginName = ucfirst($dir);
        }
        $installJSData = "";
        if (file_exists(BASE_DIRECTORY . "plugins/" . $dir . "/install_setup.php")) {
            $installJSData = " data-install='1'";
        }