Ejemplo n.º 1
0
function jQuery_migrate_init()
{
    global $thisfile_GSJQM, $SITEURL;
    i18n_merge($thisfile_GSJQM) || i18n_merge($thisfile_GSJQM, GSDEFAULTLANG);
    # register plugin
    register_plugin($thisfile_GSJQM, i18n_r($thisfile_GSJQM . '/GSJQMigrate_TITLE'), '1.0', 'GetSimpleCMS', 'http://get-simple.info', i18n_r($thisfile_GSJQM . '/GSJQMigrate_DESC'), '', '');
    $asset = isDebug() ? 'jquery-migrate-1.2.1.js' : 'jquery-migrate-1.2.1.min.js';
    // when debug is on, migrate will output to console with deprecated notices.
    $url = $SITEURL . 'plugins/' . $thisfile_GSJQM . '/assets/js/' . $asset;
    register_script('jquerymigrate', $url, '', FALSE);
    queue_script('jquerymigrate', GSBACK);
}
Ejemplo n.º 2
0
<?php

/** FusionForge Bazaar plugin
 *
 * Copyright 2009, Roland Mas
 *
 * This file is part of FusionForge.
 *
 * FusionForge 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 2 of the License,
 * or (at your option) any later version.
 * 
 * FusionForge 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 FusionForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 * USA
 */
global $gfplugins;
require_once $gfplugins . 'scmbzr/common/BzrPlugin.class.php';
$BzrPluginObject = new BzrPlugin();
register_plugin($BzrPluginObject);
// Local Variables:
// mode: php
// c-file-style: "bsd"
// End:
Ejemplo n.º 3
0
<?php

/*
Plugin Name: Faker data
Plugin URI: https://github.com/atmoner
Description: This is a faker data 
Version: 1.0
Author: Atmoner
Author URI: https://github.com/atmoner
*/
//set plugin id as file name of plugin
$plugin_id = basename(__FILE__);
//some plugin data
$data['name'] = "Faker data";
$data['author'] = "Atmoner";
$data['url'] = "https://github.com/atmoner";
//register plugin data
register_plugin($plugin_id, $data);
//plugin function
function fakerdata()
{
    global $hook;
}
function addnewadminmenu_faker()
{
    global $hook;
    $hook->add_admin_menu('addmensssu', 'Faker data', 'admincp/fakerdata', 5);
}
add_hook('admin_action', 'addnewadminmenu_faker');
add_hook('new_admin_page', 'fakerdata');
add_hook('install', 'installSql');
Ejemplo n.º 4
0
 *  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, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 *  USA.
 *
 *  $Id$
 */
function NodeStats($id, $dt)
{
    global $DB;
    if ($stats = $DB->GetRow('SELECT SUM(download) AS download, SUM(upload) AS upload 
			    FROM stats WHERE nodeid=? AND dt>?', array($id, time() - $dt))) {
        list($result['download']['data'], $result['download']['units']) = setunits($stats['download']);
        list($result['upload']['data'], $result['upload']['units']) = setunits($stats['upload']);
        $result['downavg'] = $stats['download'] * 8 / 1000 / $dt;
        $result['upavg'] = $stats['upload'] * 8 / 1000 / $dt;
    }
    return $result;
}
$nodeid = $_GET['id'];
$nodestats['hour'] = NodeStats($nodeid, 60 * 60);
$nodestats['day'] = NodeStats($nodeid, 60 * 60 * 24);
$nodestats['month'] = NodeStats($nodeid, 60 * 60 * 24 * 30);
$SMARTY->assign('nodestats', $nodestats);
register_plugin('nodes-infobox-end', '../modules/traffic/templates/nodetraffic.html');
Ejemplo n.º 5
0
function check_access_key($resource, $key)
{
    # Verify a supplied external access key
    # Option to plugin in some extra functionality to check keys
    if (hook("check_access_key", "", array($resource, $key)) === true) {
        return true;
    }
    $keys = sql_query("select user,usergroup,expires from external_access_keys where resource='{$resource}' and access_key='{$key}' and (expires is null or expires>now())");
    if (count($keys) == 0) {
        return false;
    } else {
        # "Emulate" the user that e-mailed the resource by setting the same group and permissions
        $user = $keys[0]["user"];
        $expires = $keys[0]["expires"];
        # Has this expired?
        if ($expires != "" && strtotime($expires) < time()) {
            global $lang;
            ?>
			<script type="text/javascript">
			alert("<?php 
            echo $lang["externalshareexpired"];
            ?>
");
			history.go(-1);
			</script>
			<?php 
            exit;
        }
        global $usergroup, $userpermissions, $userrequestmode, $userfixedtheme, $usersearchfilter;
        $groupjoin = "u.usergroup=g.ref";
        if ($keys[0]["usergroup"] != "") {
            # Select the user group from the access key instead.
            $groupjoin = "g.ref='" . escape_check($keys[0]["usergroup"]) . "'";
        }
        $userinfo = sql_query("select g.ref usergroup,g.permissions,g.fixed_theme,g.search_filter from user u join usergroup g on {$groupjoin} where u.ref='{$user}'");
        if (count($userinfo) > 0) {
            $usergroup = $userinfo[0]["usergroup"];
            # Older mode, where no user group was specified, find the user group out from the table.
            $userpermissions = explode(",", $userinfo[0]["permissions"]);
            $usersearchfilter = $userinfo[0]["search_filter"];
            if (trim($userinfo[0]["fixed_theme"]) != "") {
                $userfixedtheme = $userinfo[0]["fixed_theme"];
            }
            # Apply fixed theme also
            if (hook("modifyuserpermissions")) {
                $userpermissions = hook("modifyuserpermissions");
            }
            $userrequestmode = 0;
            # Always use 'email' request mode for external users
            # Load any plugins specific to the group of the sharing user, but only once as may be checking multiple keys
            global $emulate_plugins_set;
            if ($emulate_plugins_set !== true) {
                global $plugins;
                $enabled_plugins = sql_query("SELECT name,enabled_groups, config, config_json FROM plugins WHERE inst_version>=0 AND length(enabled_groups)>0  ORDER BY priority");
                foreach ($enabled_plugins as $plugin) {
                    $s = explode(",", $plugin['enabled_groups']);
                    if (in_array($usergroup, $s)) {
                        include_plugin_config($plugin['name'], $plugin['config'], $plugin['config_json']);
                        register_plugin($plugin['name']);
                        $plugins[] = $plugin['name'];
                    }
                }
                for ($n = count($plugins) - 1; $n >= 0; $n--) {
                    register_plugin_language($plugins[$n]);
                }
                $emulate_plugins_set = true;
            }
        }
        # Special case for anonymous logins.
        # When a valid key is present, we need to log the user in as the anonymous user so they will be able to browse the public links.
        global $anonymous_login;
        if (isset($anonymous_login)) {
            global $username, $baseurl;
            if (is_array($anonymous_login)) {
                foreach ($anonymous_login as $key => $val) {
                    if ($baseurl == $key) {
                        $anonymous_login = $val;
                    }
                }
            }
            $username = $anonymous_login;
        }
        # Set the 'last used' date for this key
        sql_query("update external_access_keys set lastused=now() where resource='{$resource}' and access_key='{$key}'");
        return true;
    }
}
Ejemplo n.º 6
0
        $uploadMode = 1 << 3;
        // code for "it came from web upload"
        $userId = Auth::getUserId();
        $groupId = Auth::getGroupId();
        $uploadId = JobAddUpload($userId, $groupId, $originalFileName, $originalFileName, $description, $uploadMode, $folderId, $publicPermission);
        if (empty($uploadId)) {
            return array(false, _("Failed to insert upload record"), $description);
        }
        try {
            $uploadedTempFile = $uploadedFile->move($uploadedFile->getPath(), $uploadedFile->getFilename() . '-uploaded')->getPathname();
        } catch (FileException $e) {
            return array(false, _("Could not save uploaded file"), $description);
        }
        $projectGroup = $GLOBALS['SysConf']['DIRECTORIES']['PROJECTGROUP'] ?: 'fossy';
        $wgetAgentCall = "{$MODDIR}/wget_agent/agent/wget_agent -C -g {$projectGroup} -k {$uploadId} '{$uploadedTempFile}' -c '{$SYSCONFDIR}'";
        $wgetOutput = array();
        exec($wgetAgentCall, $wgetOutput, $wgetReturnValue);
        unlink($uploadedTempFile);
        if ($wgetReturnValue != 0) {
            $message = implode(' ', $wgetOutput);
            if (empty($message)) {
                $message = _("File upload failed.  Error:") . $wgetReturnValue;
            }
            return array(false, $message, $description);
        }
        $message = $this->postUploadAddJobs($request, $originalFileName, $uploadId);
        return array(true, $message, $description);
    }
}
register_plugin(new UploadFilePage());
Ejemplo n.º 7
0
 * 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, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 ***********************************************************/
use Fossology\Lib\Plugin\AgentPlugin;
class ReadMeOssAgentPlugin extends AgentPlugin
{
    public function __construct()
    {
        $this->Name = "agent_readmeoss";
        $this->Title = _("ReadMeOSS generation");
        $this->AgentName = "readmeoss";
        parent::__construct();
    }
    function preInstall()
    {
        // no AgentCheckBox
    }
    public function uploadsAdd($uploads)
    {
        if (count($uploads) == 0) {
            return '';
        }
        return '--uploadsAdd=' . implode(',', array_keys($uploads));
    }
}
register_plugin(new ReadMeOssAgentPlugin());
Ejemplo n.º 8
0
        $this->highlightTypeToStringMap = array(Highlight::ECC => 'Export Restriction');
        $this->typeToHighlightTypeMap = array('ecc' => Highlight::ECC);
        $this->xptext = 'export restriction';
        parent::__construct(self::NAME, array(self::TITLE => _("View Export Control and Customs Analysis")));
    }
    /**
     * \brief Customize submenus.
     */
    function RegisterMenus()
    {
        $itemId = GetParm("item", PARM_INTEGER);
        $textFormat = $this->microMenu->getFormatParameter($itemId);
        $pageNumber = GetParm("page", PARM_INTEGER);
        $this->microMenu->addFormatMenuEntries($textFormat, $pageNumber);
        // For all other menus, permit coming back here.
        $uploadId = GetParm("upload", PARM_INTEGER);
        if (!empty($itemId) && !empty($uploadId)) {
            $menuText = "ECC";
            $tooltipText = "Export Control Classification";
            $menuPosition = 56;
            $URI = EccView::NAME . Traceback_parm_keep(array("show", "format", "page", "upload", "item"));
            $this->microMenu->insert(MicroMenu::TARGET_DEFAULT, $menuText, $menuPosition, $this->getName(), $URI, $tooltipText);
        }
        $licId = GetParm("lic", PARM_INTEGER);
        if (!empty($licId)) {
            $this->NoMenu = 1;
        }
    }
}
register_plugin(new EccView());
Ejemplo n.º 9
0
        $editedTotalLicenseCount = 0;
        $tableData = array();
        foreach ($realLicNames as $licenseShortName) {
            $count = 0;
            if (array_key_exists($licenseShortName, $scannerLics)) {
                $count = $scannerLics[$licenseShortName]['unique'];
                $rfId = $scannerLics[$licenseShortName]['rf_pk'];
            } else {
                $rfId = $editedLics[$licenseShortName]['rf_pk'];
            }
            $editedCount = array_key_exists($licenseShortName, $editedLics) ? $editedLics[$licenseShortName]['count'] : 0;
            $totalScannerLicenseCount += $count;
            $editedTotalLicenseCount += $editedCount;
            $scannerCountLink = $count > 0 ? "<a href='{$licListUri}&lic=" . urlencode($licenseShortName) . "'>{$count}</a>" : "0";
            $editedLink = $editedCount > 0 ? $editedCount : "0";
            $tableData[] = array($scannerCountLink, $editedLink, array($licenseShortName, $rfId));
        }
        return array($tableData, $totalScannerLicenseCount, $editedTotalLicenseCount);
    }
    /**
     * @param string $templateName
     * @param array $vars
     * @return string
     */
    public function renderString($templateName, $vars)
    {
        return $this->renderer->loadTemplate($templateName)->render($vars);
    }
}
register_plugin(new ui_browse_license());
Ejemplo n.º 10
0
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * version 2 as published by the Free Software Foundation.
 *
 * 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, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 ***********************************************************/
use Fossology\Lib\Plugin\AgentPlugin;
class MonkAgentPlugin extends AgentPlugin
{
    public function __construct()
    {
        $this->Name = "agent_monk";
        $this->Title = _("Monk License Analysis, scanning for licenses performing a text comparison");
        $this->AgentName = "monk";
        parent::__construct();
    }
    function AgentHasResults($uploadId = 0)
    {
        return CheckARS($uploadId, $this->AgentName, "monk agent", "monk_ars");
    }
}
register_plugin(new MonkAgentPlugin());
Ejemplo n.º 11
0
 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, write to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
***********************************************************/
use Fossology\Lib\Plugin\AgentPlugin;
class UnpackAgentPlugin extends AgentPlugin
{
    public function __construct()
    {
        $this->Name = "agent_unpack";
        $this->Title = _("Schedule an Unpack");
        $this->AgentName = "ununpack";
        parent::__construct();
    }
    function AgentHasResults($uploadId = 0)
    {
        return CheckARS($uploadId, "ununpack", "Archive unpacker", "ununpack_ars");
    }
    public function AgentAdd($jobId, $uploadId, &$errorMsg, $dependencies = array(), $arguments = null)
    {
        $jobQueueId = \IsAlreadyScheduled($jobId, $this->AgentName, $uploadId);
        if ($jobQueueId != 0) {
            return $jobQueueId;
        }
        return $this->doAgentAdd($jobId, $uploadId, $errorMsg, $dependencies, $uploadId, '');
    }
}
register_plugin(new UnpackAgentPlugin());
/*
Plugin Name: Dynamic Text Replacment
Description: Replaces text with GD generated imaged
Version: 0.1
Author: Rob Antonishen
Author URI: http://ffaat.poweredbyclear.com/
Usage is [DTR]Text to Render[/DTR]
full syntax is [DTR font=xxx; color=rrggbb; aa=[on]|off; 
bgcolor=rrggbb; transbg=on|[off]; align=[left]|center|right;
size=zzz; maxwidth=yyy;]Text to Render[/DTR]
If maxwidth set to 0 then it will dynamically calculate the width [default]
*/
# get correct id for plugin
$thisfile = basename(__FILE__, ".php");
# register plugin
register_plugin($thisfile, 'Dynamic Text Replacement', '0.1', 'Rob Antonishen', 'http://ffaat.poweredbyclear.com', 'Replaces text with GD generated imaged', 'plugins', 'dtr_config');
# activate filter
add_action('plugins-sidebar', 'createSideMenu', array($thisfile, 'Dynamic Text Replacement'));
add_filter('content', 'dtr_display');
# global vars
$dtr_conf = dtr_loadconf();
/* frontend contant replacement */
function dtr_display($contents)
{
    $preg_flags = 'ei';
    $output = preg_replace("'\\[DTR\\s*([^\\]]*)]([^\\/]*)\\[/DTR]'{$preg_flags}", "dtr_main('\\2', trim('\\1'))", $contents);
    return $output;
}
/* returns the dtr page code */
function dtr_main($text, $params)
{
Ejemplo n.º 13
0
<?php

/*
Plugin Name: Disqus
Description: Provides Discus comments support on pages
Version: 0.2
Author: Rob Antonishen
Author URI: http://ffaat.poweredbyclear.com/
*/
# get correct id for plugin
$thisfile = basename(__FILE__, ".php");
# register plugin
register_plugin($thisfile, 'Disqus Comments', '0.2', 'Rob Antonishen', 'http://ffaat.poweredbyclear.com', 'Provides Disqus Commenting', 'plugins', 'disqus_config');
# activate filter
add_action('plugins-sidebar', 'createSideMenu', array($thisfile, 'Disqus'));
add_filter('content', 'disqus_display');
# global vars
$disqus_conf = disqus_loadconf();
/* frontend contant replacement */
function disqus_display($contents)
{
    $tmp_content = $contents;
    $location = stripos($tmp_content, "(% disqus %)");
    if ($location !== FALSE) {
        $tmp_content = str_replace("(% disqus %)", "", $tmp_content);
        $start_content = substr($tmp_content, 0, $location);
        $end_content = substr($tmp_content, $location, strlen($tmp_content) - $location);
        $tmp_content = $start_content . return_disqus() . $end_content;
    }
    // build page
    return $tmp_content;
Ejemplo n.º 14
0
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 ***********************************************************/
namespace Fossology\UI\Page;

use Fossology\Lib\Auth\Auth;
use Fossology\Lib\Plugin\DefaultPlugin;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
class AdminLicenseToCSV extends DefaultPlugin
{
    const NAME = "admin_license_to_csv";
    function __construct()
    {
        parent::__construct(self::NAME, array(self::TITLE => "Admin License CSV Export", self::MENU_LIST => "Admin::License Admin::CSV Export", self::REQUIRES_LOGIN => true, self::PERMISSION => Auth::PERM_ADMIN));
    }
    /**
     * @param Request $request
     * @return Response
     */
    protected function handle(Request $request)
    {
        $licenseCsvExport = new \Fossology\Lib\Application\LicenseCsvExport($this->getObject('db.manager'));
        $content = $licenseCsvExport->createCsv(intval($request->get('rf')));
        $headers = array('Content-type' => 'text/csv', 'Pragma' => 'no-cache', 'Cache-Control' => 'no-cache, must-revalidate, maxage=1, post-check=0, pre-check=0', 'Expires' => 'Expires: Thu, 19 Nov 1981 08:52:00 GMT');
        return new Response($content, Response::HTTP_OK, $headers);
    }
}
register_plugin(new AdminLicenseToCSV());
Ejemplo n.º 15
0
 *
 * Portions Copyright 2004 (c) Roland Mas <99.roland.mas @nospam@ aist.enst.fr>
 * Portions Copyright 2004 (c) Francisco Gimeno <kikov @nospam@ kikov.org>
 * The rest Copyright 2005 (c) Daniel Perez <*****@*****.**>
 *
 * @version $Id$
 *
 * This file is part of GForge-plugin-fckeditor
 *
 * GForge-plugin-fckeditor 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 2 of
 * the License, or (at your option) any later version.
 *
 * GForge-plugin-fckeditor 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 GForge-plugin-fckeditor; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  US
 */
global $gfplugins;
require_once $gfplugins . 'fckeditor/common/fckeditorPlugin.class.php';
$fckeditorPluginObject = new fckeditorPlugin();
register_plugin($fckeditorPluginObject);
// Local Variables:
// mode: php
// c-file-style: "bsd"
// End:
Ejemplo n.º 16
0
 You should have received a copy of the GNU General Public License along
 with this program; if not, write to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 ***********************************************************/
use Fossology\Lib\Plugin\AgentPlugin;
class PkgAgentPlugin extends AgentPlugin
{
    public function __construct()
    {
        $this->Name = "agent_pkgagent";
        $this->Title = _("Package Analysis (Parse package headers)");
        $this->AgentName = "pkgagent";
        parent::__construct();
    }
    function AgentHasResults($uploadId = 0)
    {
        return CheckARS($uploadId, $this->AgentName, "package meta data scanner", "pkgagent_ars");
    }
    function preInstall()
    {
        $dbManager = $GLOBALS['container']->get('db.manager');
        $latestPkgAgent = $dbManager->getSingleRow("SELECT agent_enabled FROM agent WHERE agent_name=\$1 ORDER BY agent_ts LIMIT 1", array('pkgagent'));
        if (isset($latestPkgAgent) && !$dbManager->booleanFromDb($latestPkgAgent['agent_enabled'])) {
            return 0;
        }
        menu_insert("Agents::" . $this->Title, 0, $this->Name);
    }
}
register_plugin(new PkgAgentPlugin());
Ejemplo n.º 17
0
<?php

/*
Plugin Name: News Manager
Description: A blog/news plugin for GetSimple
Version: 3.2.2
Original author: Rogier Koppejan
Updated by: Carlos Navarro
*/
# plugin version
define('NMVERSION', '3.2.2');
# get correct id for plugin
$thisfile = basename(__FILE__, '.php');
# register plugin
register_plugin($thisfile, 'News Manager', NMVERSION, 'Rogier Koppejan, Carlos Navarro', 'http://newsmanager.c1b.org/', 'A blog/news plugin for GetSimple', 'pages', 'nm_admin');
# includes
require_once GSPLUGINPATH . 'news_manager/inc/common.php';
# language
if (basename($_SERVER['PHP_SELF']) != 'index.php') {
    // back end only
    i18n_merge('news_manager') || i18n_merge('news_manager', nm_get_fallback_lang());
}
# hooks
add_action('pages-sidebar', 'createSideMenu', array($thisfile, i18n_r('news_manager/PLUGIN_NAME')));
add_action('header', 'nm_header_include');
add_action('index-pretemplate', 'nm_frontend_init');
add_action('theme-header', 'nm_restore_page_title');
//add_filter('content', 'nm_site'); // deprecated
if (!function_exists('generate_sitemap')) {
    add_action('sitemap-additem', 'nm_sitemap_include');
    // GetSimple 3.0
Ejemplo n.º 18
0
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
 version 2 as published by the Free Software Foundation.

 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, write to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 ***********************************************************/
use Fossology\Lib\Plugin\AgentPlugin;
class NomosAgentPlugin extends AgentPlugin
{
    public function __construct()
    {
        $this->Name = "agent_nomos";
        $this->Title = _("Nomos License Analysis, scanning for licenses using regular expressions");
        $this->AgentName = "nomos";
        parent::__construct();
    }
    function AgentHasResults($uploadId = 0)
    {
        return CheckARS($uploadId, $this->AgentName, "license scanner", "nomos_ars");
    }
}
register_plugin(new NomosAgentPlugin());
Ejemplo n.º 19
0
#  - parameters: $id, $language, $creationDate, $publicationDate, $score
#                (dates are UNIX timestamps, score is an integer)
#  - should return an object of a class extending I18nSearchResultItem
define('I18N_FILTER_SEARCH_ITEM', 'search-item');
# filter search results (vetoed items are removed from results)
#  - parameters: $item (of type I18nSearchResultItem or I18nSearchResultPage)
#  - must return true, if item should not be included in search results
define('I18N_FILTER_VETO_SEARCH_ITEM', 'search-veto');
# filter to display a search item
#  - parameters: $item, $showLanguage, $showDate, $dateFormat, $numWords
#                (item is of type I18nSearchResultItem, dateFormat for strftime)
#  - if the function handles the item, it must output the HTML
#  - must return true, if item was handled, false otherwise
define('I18N_FILTER_DISPLAY_ITEM', 'search-display');
# register plugin
register_plugin($thisfile, 'I18N Search', '2.12', 'Martin Vlcek', 'http://mvlcek.bplaced.net', 'Search (I18N enabled!)', 'plugins', 'i18n_search_configure');
# load i18n texts
if (basename($_SERVER['PHP_SELF']) != 'index.php') {
    // back end only
    i18n_merge('i18n_search', substr($LANG, 0, 2));
    i18n_merge('i18n_search', 'en');
}
# ===== BACKEND =====
add_action('changedata-save', 'delete_i18n_search_index');
add_action('page-delete', 'delete_i18n_search_index');
// GetSimple 3.0+
add_action('plugins-sidebar', 'createSideMenu', array($thisfile, i18n_r('i18n_search/CONFIGURE')));
# ===== FRONTEND =====
add_action('index-pretemplate', 'i18n_search_pretemplate_for_rss');
add_action('index-pretemplate', 'i18n_search_pretemplate_for_mark');
add_action('theme-header', 'i18n_search_header_for_rss');
 * Uncomment to enable full error reporting
 **********************************************************************/
// error_reporting(E_ALL);
// ini_set("display_errors", "on");
/**
 *  Gets the plugin "id"
 **********************************************************************/
$thisfile = basename(__FILE__, ".php");
/**
 *  Include the plugin installer class
 **********************************************************************/
require_once $thisfile . "/PluginInstaller.class.php";
/**
 *  Register the plugin
 **********************************************************************/
register_plugin($thisfile, 'GS Plugin Installer', '1.4.8', 'Helge Sverre', 'https://helgesverre.com/', 'Let\'s you browse, install and uninstall plugins from your administration area.', 'plugins', 'gs_plugin_installer_init');
/**
 *  Add link to plugin in sidebar
 **********************************************************************/
add_action('plugins-sidebar', 'createSideMenu', array($thisfile, "Plugin Installer"));
// Only queue scripts when we are actually executing this plugin
if (isset($_GET['id']) && $_GET['id'] === $thisfile) {
    /**
     *  Register scripts
     **********************************************************************/
    register_script('datatables_js', '//cdn.datatables.net/1.10.7/js/jquery.dataTables.min.js', '1.0');
    register_script('gs_plugin_installer_js', $SITEURL . 'plugins/gs_plugin_installer/js/script.js', '0.1');
    /**
     *  Register the styles
     **********************************************************************/
    register_style('datatables_css', '//cdn.datatables.net/1.10.7/css/jquery.dataTables.min.css', '1.0', 'screen');
Ejemplo n.º 21
0
<?php

global $gfplugins;
require_once $gfplugins . 'eirc/include/EIRCPlugin.class.php';
$EIRCPluginObject = new EIRCPlugin();
register_plugin($EIRCPluginObject);
// Local Variables:
// mode: php
// c-file-style: "bsd"
// End:
Ejemplo n.º 22
0
Author: PyC
Author URI: http://profileyourcity.com
Modified Version Of Mvlcek's Plugin
*/
# get correct id for plugin
$thisfile = basename(__FILE__, ".php");
if (file_exists('ITEMSFILE')) {
    $item_manager_file = getXML(GSDATAOTHERPATH . 'item_manager.xml');
    global $item_title;
    $item_title = $item_manager_file->item->title;
} else {
    global $item_title;
    $item_title = "Item";
}
# register plugin
register_plugin($thisfile, 'Custom Fields For Items', '1.0', 'PYC', 'http://profileyourcity.com/', 'Manages Custom Fields For The Items Manager - Modified Version of Mvlcek\'s Plugin', 'pages', 'items_customfields_configure');
i18n_merge('items') || i18n_merge('items', 'en_US');
add_action('header', 'items_customfields_header');
// add hook to create styles for custom field editor.
require_once GSPLUGINPATH . 'items/common.php';
$im_customfield_def = null;
function items_customfields_header()
{
    if (!file_exists(GSDATAOTHERPATH . 'plugincustomfields.xml')) {
        $xml = new SimpleXMLExtended('<?xml version="1.0" encoding="UTF-8"?><channel></channel>');
        $xml->asXML(GSDATAOTHERPATH . 'plugincustomfields.xml');
        return true;
    }
    ?>
  <style type="text/css">
    form #metadata_window table.formtable td .cke_editor td:first-child { padding: 0; }
Ejemplo n.º 23
0
$LMS = new LMS($DB, $AUTH, $CONFIG);
$LMS->ui_lang = $_ui_language;
$LMS->lang = $_language;
$SMARTY->assignByRef('_LANG', $_LANG);
$SMARTY->assignByRef('LANGDEFS', $LANGDEFS);
$SMARTY->assignByRef('_ui_language', $LMS->ui_lang);
$SMARTY->assignByRef('_language', $LMS->lang);
$SMARTY->assign('_dochref', is_dir('doc/html/' . $LMS->ui_lang) ? 'doc/html/' . $LMS->ui_lang . '/' : 'doc/html/en/');
$SMARTY->assign('_config', $CONFIG);
$layout['logname'] = $AUTH->logname;
$layout['lmsdbv'] = $DB->_version;
$layout['smarty_version'] = $SMARTY->_version;
$layout['hostname'] = hostname();
$layout['lmsv'] = '1.11-cvs';
$layout['lmsvr'] = $LMS->_revision;
$layout['dberrors'] =& $DB->errors;
$layout['popup'] = isset($_GET['popup']) ? true : false;
$SMARTY->assignByRef('layout', $layout);
$SMARTY->assign('_module', $ExecStack->module);
$SMARTY->assign('_action', $ExecStack->action);
header('X-Powered-By: LMS/' . $layout['lmsv']);
$error = NULL;
// initialize error variable needed for (almost) all modules
if ($AUTH->islogged !== TRUE) {
    $SMARTY->assign('error', $AUTH->error);
    $SMARTY->display('../modules/core/templates/login.html');
    die;
}
// core plugins
register_plugin('menu-menuend', '../modules/core/templates/logout.html');
Ejemplo n.º 24
0
        $language = $defaultlanguage;
    } else {
        $language = 'en';
    }
}
# Always include the english pack (in case items have not yet been translated)
include dirname(__FILE__) . "/../languages/en.php";
if ($language != "en") {
    if (substr($language, 2, 1) == '-' && substr($language, 0, 2) != 'en') {
        @(include dirname(__FILE__) . "/../languages/" . safe_file_name(substr($language, 0, 2)) . ".php");
    }
    @(include dirname(__FILE__) . "/../languages/" . safe_file_name($language) . ".php");
}
# Register all plugins
for ($n = 0; $n < count($plugins); $n++) {
    register_plugin($plugins[$n]);
}
# Set character set.
if ($pagename != "download" && $pagename != "graph") {
    header("Content-Type: text/html; charset=UTF-8");
}
// Make sure we're using UTF-8.
#------------------------------------------------------
# Pre-load all text for this page.
$site_text = array();
$results = sql_query("select language,name,text from site_text where (page='{$pagename}' or page='all') and (specific_to_group is null or specific_to_group=0)");
for ($n = 0; $n < count($results); $n++) {
    $site_text[$results[$n]["language"] . "-" . $results[$n]["name"]] = $results[$n]["text"];
}
# Blank the header insert
$headerinsert = "";
Ejemplo n.º 25
0
        if (!empty($scheduled)) {
            return array($scheduled['job_pk'], $scheduled['jq_pk']);
        }
        $jobId = JobAddJob($userId, $groupId, $upload->getFilename(), $uploadId);
        $error = "";
        $jobQueueId = $spdxTwoAgent->AgentAdd($jobId, $uploadId, $error, array(), $jqCmdArgs);
        if ($jobQueueId < 0) {
            throw new Exception(_("Cannot schedule") . ": " . $error);
        }
        return array($jobId, $jobQueueId);
    }
    protected function getUpload($uploadId, $groupId)
    {
        if ($uploadId <= 0) {
            throw new Exception(_("parameter error: {$uploadId}"));
        }
        /* @var $uploadDao UploadDao */
        $uploadDao = $this->getObject('dao.upload');
        if (!$uploadDao->isAccessible($uploadId, $groupId)) {
            throw new Exception(_("permission denied"));
        }
        /** @var Upload */
        $upload = $uploadDao->getUpload($uploadId);
        if ($upload === null) {
            throw new Exception(_('cannot find uploadId'));
        }
        return $upload;
    }
}
register_plugin(new SpdxTwoGeneratorUi());
Ejemplo n.º 26
0
        if ($nowplaying == 0) {
            if ($played_sec < 30) {
                doPrint("lastfm: song must have been played for at least 30 seconds, this one has: " . $played_sec);
                return 1;
            }
        }
        if ($length < 30) {
            doPrint("lastfm: songs have to be at least 30 seconds long, this one has: " . $length);
            return 1;
        }
        if ($nowplaying == 0) {
            doPrint("lastfm: sending last played song");
            $cmd = $this->command . ' --album ' . escapeshellarg($album) . ' --artist ' . escapeshellarg($artist) . ' --title ' . escapeshellarg($title) . ' --length ' . escapeshellarg($length) . ' 2>&1';
            //.' --time '    .escapeshellarg($time)
            exec($cmd, $output = array(), $return);
            if ($return != 0) {
                doPrint("lastfm: {$cmd}");
                doPrint($output);
                doPrint($return);
                return 1;
            }
        } else {
            doPrint("lastfm: sending current playing song not implemented yet");
        }
    }
}
#################################################################
# initialize this plugin and register it globally
$lastfm = new webmp3PluginLastFMSubmit();
register_plugin("lastfmsubmit", $lastfm);
#doPrint("lastfm: plugin loaded", "DEBUG");
Ejemplo n.º 27
0
     **/
    public function AgentAdd($jobId, $uploadId, &$errorMsg, $dependencies = array(), $arguments = null)
    {
        if ($this->AgentHasResults($uploadId) == 1) {
            return 0;
        }
        $jobQueueId = \IsAlreadyScheduled($jobId, $this->AgentName, $uploadId);
        if ($jobQueueId != 0) {
            return $jobQueueId;
        }
        if (!$this->isAgentIncluded($dependencies, 'agent_unpack')) {
            $dependencies[] = "agent_unpack";
        }
        $args = is_array($arguments) ? '' : $arguments;
        return $this->doAgentAdd($jobId, $uploadId, $errorMsg, $dependencies, $uploadId, $args);
    }
    protected function isAgentIncluded($dependencies, $agentName)
    {
        foreach ($dependencies as $dependency) {
            if ($dependency == $agentName) {
                return true;
            }
            if (is_array($dependency) && $agentName == $dependency['name']) {
                return true;
            }
        }
        return false;
    }
}
register_plugin(new Adj2nestAgentPlugin());
Ejemplo n.º 28
0
 * Uncomment to enable full error reporting
 **********************************************************************/
error_reporting(E_ALL);
ini_set("display_errors", "on");
/**
 *  Gets the plugin "id"
 **********************************************************************/
$thisfile = basename(__FILE__, ".php");
/**
 *  Include the plugin installer class
 **********************************************************************/
require_once $thisfile . "/EventManager.class.php";
/**
 *  Register the plugin
 **********************************************************************/
register_plugin($thisfile, 'GS Event Manager', '1.0.0', 'Helge Sverre', 'https://helgesverre.com/', 'Create, edit and manage events in GetSimple, comes with an API and calendar', 'plugins', 'gs_events_init');
/**
 *  Add link to plugin in sidebar
 **********************************************************************/
add_action('plugins-sidebar', 'createSideMenu', array($thisfile, "Event Manager"));
// Only queue scripts when we are actually executing this plugin
if (isset($_GET['id']) && $_GET['id'] === $thisfile) {
    /**
     *  Register scripts
     **********************************************************************/
    register_script('moment_js', $SITEURL . 'plugins/gs-events/js/moment.min.js', '0.1');
    register_script('fullcalendar_js', $SITEURL . 'plugins/gs-events/js/fullcalendar.min.js', '0.1');
    register_script('gs_events_js', $SITEURL . 'plugins/gs-events/js/script.js', '0.1');
    register_script('gcal_js', $SITEURL . 'plugins/gs-events/js/gcal.js', '0.1');
    register_script('lang_all_js', $SITEURL . 'plugins/gs-events/js/lang-all.js', '0.1');
    /**
Ejemplo n.º 29
0
        $V .= "<td bgcolor='blue'>&nbsp;</td>";
        $V .= "<td bgcolor='blue'>&nbsp;</td>";
        $V .= "<td bgcolor='white'>&nbsp;</td>";
        $V .= "</tr><tr>";
        $V .= "<td bgcolor='white'>&nbsp;</td>";
        $V .= "<td bgcolor='white'>&nbsp;</td>";
        $V .= "<td bgcolor='white'>&nbsp;</td>";
        $V .= "<td bgcolor='white'>&nbsp;</td>";
        $V .= "<td bgcolor='white'>&nbsp;</td>";
        $V .= "<td bgcolor='blue'>&nbsp;</td>";
        $text = _("Remote web or FTP server");
        $V .= "<td bgcolor='white' align='center'><a href='{$Uri}?mod=upload_url'>{$text}</a></td>";
        $V .= "<td bgcolor='blue'>&nbsp;</td>";
        $V .= "<td bgcolor='white'>&nbsp;</td>";
        $V .= "</tr><tr>";
        $V .= "<td bgcolor='white'>&nbsp;</td>";
        $V .= "<td bgcolor='white'>&nbsp;</td>";
        $V .= "<td bgcolor='white'>&nbsp;</td>";
        $V .= "<td bgcolor='white'>&nbsp;</td>";
        $V .= "<td bgcolor='white'>&nbsp;</td>";
        $V .= "<td bgcolor='blue'>&nbsp;</td>";
        $V .= "<td bgcolor='blue'>&nbsp;</td>";
        $V .= "<td bgcolor='blue'>&nbsp;</td>";
        $V .= "<td bgcolor='white'>&nbsp;</td>";
        $V .= "</tr>";
        $V .= "</table>\n";
        return $V;
    }
}
register_plugin(new UploadInstructions());
Ejemplo n.º 30
0
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
 version 2 as published by the Free Software Foundation.

 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, write to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
***********************************************************/
use Fossology\Lib\Plugin\AgentPlugin;
class CopyrightAgentPlugin extends AgentPlugin
{
    public function __construct()
    {
        $this->Name = "agent_copyright";
        $this->Title = _("Copyright/Email/URL/Author Analysis");
        $this->AgentName = "copyright";
        parent::__construct();
    }
    function AgentHasResults($uploadId = 0)
    {
        return CheckARS($uploadId, $this->AgentName, "copyright scanner", "copyright_ars");
    }
}
register_plugin(new CopyrightAgentPlugin());