コード例 #1
0
ファイル: install.php プロジェクト: milk54/geeklog-japan
/**
* Default data
*/
$DEFVALUES = array();
/**
* Security Feature(s) to add
*/
$NEWFEATURE = array();
$NEWFEATURE['dataproxy.admin'] = 'dataproxy Admin';
/**
* Only let Root users access this page
*/
if (!SEC_inGroup('Root')) {
    // Someone is trying to illegally access this page
    COM_errorLog("Someone has tried to illegally access the dataproxy install/uninstall page.  User id: {$_USER['uid']}, Username: {$_USER['username']}, IP: {$_SERVER['REMOTE_ADDR']}", 1);
    $display = COM_siteHeader() . COM_startBlock(DPXY_str('access_denied')) . DPXY_str('access_denied_msg') . COM_endBlock() . COM_siteFooter();
    echo $display;
    exit;
}
/**
* Puts the datastructures for this plugin into the Geeklog database
*
* Note: Corresponding uninstall routine is in functions.inc
* 
* @return   boolean True if successful False otherwise
*/
function plugin_install_dataproxy()
{
    global $pi_name, $pi_version, $gl_version, $pi_url, $NEWTABLE, $DEFVALUES, $NEWFEATURE, $_TABLES, $_CONF;
    COM_errorLog("Attempting to install the {$pi_name} Plugin", 1);
    // Create the Plugins Tables
コード例 #2
0
ファイル: index.php プロジェクト: milk54/geeklog-japan
// +---------------------------------------------------------------------------+
require_once '../../../lib-common.php';
/**
* Only let admin users access this page
*/
if (!SEC_hasRights('dataproxy.admin')) {
    // Someone is trying to illegally access this page
    COM_errorLog("Someone has tried to illegally access the dataproxy Admin page.  User id: {$_USER['uid']}, Username: {$_USER['username']}, IP: {$_SERVER['REMOTE_ADDR']}", 1);
    $display = COM_siteHeader() . COM_startBlock(DPXY_str('access_denied')) . DPXY_str('access_denied_msg') . COM_endBlock() . COM_siteFooter();
    echo $display;
    exit;
}
/**
* Main 
*/
if (!defined('XHTML')) {
    define('XHTML', '');
}
$display = COM_siteHeader();
$T = new Template($_CONF['path'] . 'plugins/dataproxy/templates');
$T->set_file('admin', 'admin.thtml');
$T->set_var('xhtml', XHTML);
$T->set_var('site_url', $_CONF['site_url']);
$T->set_var('site_admin_url', $_CONF['site_admin_url']);
$T->set_var('icon_url', $_CONF['site_admin_url'] . '/plugins/dataproxy/images/dataproxy.gif');
$T->set_var('header', DPXY_str('admin'));
$T->set_var('plugin', 'dataproxy');
// put your code here
$T->parse('output', 'admin');
$display .= $T->finish($T->get_var('output')) . COM_siteFooter();
echo $display;