Esempio n. 1
0
 function testGetActivePlugins()
 {
     $dao = new PluginDAO($this->db, $this->logger);
     $plugins = $dao->getActivePlugins();
     $this->assertTrue(count($plugins) == 2);
     $this->assertTrue($plugins[0]->name == "Twitter");
     $this->assertTrue($plugins[0]->folder_name == "twitter");
 }
Esempio n. 2
0
 public static function getInstance($gitHubFacade = null)
 {
     if (!self::$instance) {
         self::$instance = new PluginDAO($gitHubFacade);
     }
     return self::$instance;
 }
Esempio n. 3
0
require_once 'class.LongUrlAPIAccessor.php';
require_once 'class.FlickrAPIAccessor.php';
require_once 'class.PluginHook.php';
require_once 'class.Crawler.php';
require_once 'class.Utils.php';
require_once 'class.Captcha.php';
require_once 'class.Session.php';
require_once 'class.Plugin.php';
require_once 'OAuth.php';
require_once 'class.LoggerSlowSQL.php';
# crawler only
require_once 'class.Logger.php';
# webapp only
require_once 'class.Follow.php';
require_once 'class.Webapp.php';
require_once 'config.inc.php';
require_once $THINKTANK_CFG['smarty_path'] . 'Smarty.class.php';
require_once 'class.SmartyThinkTank.php';
$webapp = new Webapp();
$crawler = new Crawler();
// Instantiate global database variable
$db = new Database($THINKTANK_CFG);
$conn = $db->getConnection();
/* Start plugin-specific configuration handling */
$pdao = new PluginDAO($db);
$active_plugins = $pdao->getActivePlugins();
foreach ($active_plugins as $ap) {
    foreach (glob($THINKTANK_CFG['source_root_path'] . 'common/plugins/' . $ap->folder_name . "/*.php") as $includefile) {
        require_once $includefile;
    }
}
Esempio n. 4
0
<?php

chdir("..");
require_once "common/init.php";
session_start();
$session = new Session();
if (!$session->isLoggedIn()) {
    header("Location: ../index.php");
}
$pid = $_GET["pid"];
$a = $_GET["a"];
if ($a != 1) {
    $a = 0;
}
$pd = new PluginDAO($db);
$pd->setActive($pid, $a);
$db->closeConnection($conn);
Esempio n. 5
0
<?php

try {
    if (sizeof($_POST) > 0) {
        require_once './inc/Config.php';
        require_once './inc/autoloader.php';
        $gitHub = new GitHubFacade($_POST['username'], $_POST['password'], $_POST['repo']);
        if ($gitHub->login()) {
            $pluginDAO = PluginDAO::getInstance($gitHub);
            $pluginDAO->addVersions($_POST['username'], $_POST['repo'], $gitHub->getRepoTags($_POST['hash']));
            header("Location: /{$_POST['username']}/{$_POST['repo']}");
        }
    }
} catch (Exception $e) {
    define('ERROR_MESSAGE', $e->getMessage());
}
?>

<!DOCTYPE html> 
 
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6 jquery"> <![endif]-->
<!--[if IE 7 ]>    <html lang="en" class="no-js ie7 jquery"> <![endif]-->
<!--[if IE 8 ]>    <html lang="en" class="no-js ie8 jquery"> <![endif]-->
<!--[if IE 9 ]>    <html lang="en" class="no-js ie9 jquery"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js jquery"> <!--<![endif]-->
<head> 

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

<title>jQuery: The Write Less, Do More, JavaScript Library</title> 
Esempio n. 6
0
if ($owner->is_admin) {
    $owners = $od->getAllOwners();
    foreach ($owners as $o) {
        $instances = $id->getByOwner($o, true);
        $o->setInstances($instances);
    }
    $s->assign('owners', $owners);
}
/* Begin plugin-specific configuration handling */
$cmi = $webapp->getConfigMenu();
$s->assign('config_menu', $cmi);
if (!isset($_GET['m']) && isset($_GET['p'])) {
    $active_plugin = $_GET['p'];
} else {
    if (isset($_GET['m']) && $_GET['m'] == 'manage') {
        $pld = new PluginDAO($db);
        $installed_plugins = $pld->getInstalledPlugins($THINKTANK_CFG["source_root_path"]);
        $s->assign('installed_plugins', $installed_plugins);
    } else {
        //default to the first plugin on the stack
        $active_plugin = $cmi[0][0];
    }
}
if (isset($active_plugin)) {
    $webapp->configuration($active_plugin);
    array_push($s->template_dir, 'plugins/' . $active_plugin);
    $s->assign('body', $THINKTANK_CFG['source_root_path'] . 'common/plugins/' . $active_plugin . '/templates/' . $active_plugin . '.account.index.tpl');
}
/* End plugin-specific configuration handling */
# clean up
$db->closeConnection($conn);
Esempio n. 7
0
$s->assign('instance', $i);
if ($owner->is_admin) {
    $owners = $od->getAllOwners();
    foreach ($owners as $o) {
        $instances = $id->getByOwner($o, true);
        $o->setInstances($instances);
    }
    $s->assign('owners', $owners);
}
$s->assign('instances', $id->getByOwner($owner));
/* Begin plugin-specific configuration handling */
if (!isset($_GET['m']) && isset($_GET['p'])) {
    $active_plugin = $_GET['p'];
} else {
    if (isset($_GET['m']) && $_GET['m'] == 'manage') {
        $pld = new PluginDAO($db);
        $installed_plugins = $pld->getInstalledPlugins($config->getValue("source_root_path"));
        $s->assign('installed_plugins', $installed_plugins);
    } else {
        //default to the first plugin on the stack
        $active_plugin = $cmi[0][0];
    }
}
if (isset($active_plugin)) {
    $pobj = $webapp->getPluginObject($active_plugin);
    $p = new $pobj();
    $s->assign('body', $p->renderConfiguration($owner));
}
/* End plugin-specific configuration handling */
# clean up
$db->closeConnection($conn);