[geeklog-cvs] geeklog-1.3/public_html/admin/plugins/spamx index.php,NONE,1.1 install.html,NONE,1.1 install.php,NONE,1.1

tony at iowaoutdoors.org tony at iowaoutdoors.org
Fri Sep 3 15:59:58 EDT 2004


Update of /var/cvs/geeklog-1.3/public_html/admin/plugins/spamx
In directory www:/tmp/cvs-serv3542/public_html/admin/plugins/spamx

Added Files:
	index.php install.html install.php 
Log Message:
Spamx is officially part of Geeklog.  All should work fine minus the upgrade file...I'm still missing some key data that I will add yet this weekend


--- NEW FILE: install.html ---
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
	<title>SpamX Comment Spam Plugin</title>
</head>

<body>
<h1>SpamX Comment Spam Plugin Install Instructions</h1>
 
Tom Willett    tomw at pigstye.net<br>
Unionville, Indiana, USA<br>
June 13, 2004<p>

Install/Uninstall instruction for the Geeklog SpamX plugin.<p>

INSTALL:<p>

Step 1:  Back up your Geeklog Database.  <p>

Step 2: Uncompress the SpamX plugin archive while in the <geeklog_dir>/plugins directory.  The archive will 
create a directory called spamx in the plugins directory.<p>

Step 3:  Create the public_html and admin directories.  Under your html directory (usually public_html) 
create a directory called spamx.  Under your admin/plugins/ directory create a directory called spamx.<p>

Step 4:  Change to your <geeklog_dir>/plugins/spamx/ directory.  Copy the files in the admin directory 
to the admin/plugins/spamx/ directory your created in step 3.  Copy the files and directories in the 
public_html directory to the public_html/spamx/ directory your created in step 3.<p>

Step 5: Make the files spamx_action.php, spamx_examine.php, blacklist.php and mtblacklist.php in the 
public_html/spamx directory writable by you webserver.  Either chmod 766 or preferably chown the files 
to the user the webserver runs under eg nobody or apache.  If you do not do this you will not be able 
to use the admin interface.<p>

Step 6:  Log in to your Geeklog as a root user and run install.php in your admin/plugins/SpamX/ directory 
or run the plugin app in the admin interface and install from there. The install page will tell you if the 
install was successful or not.  If not examine Geeklog system errorlog for possible problems.<p>

Step 7: The final thing you must do is edit your comment.php (in public_html directory) and change the 
function savecomment name to savecomment1.  The SpamX plugin should now be installed and functioning.  
Clicking on the SpamX Icon will take you to the admin page.  <p>

Step 7: Set up security.  On install only the root users have access to SpamX administration.  
You can delegate control for admin through the user and group editors.<p>

UNINSTALL:<p>

Step 1:  Run the install.php page in your admin/plugins/SpamX directory.  This will remove all the data from 
your database.<p>

Step 2: Rename savecomment1 in comment.php back to savecomment.<p>

Step 3:  Delete the three plugin directories created in the install process:  <geeklog-dir>plugins/SpamX/ 
<public_html>/SpamX/ and <admin>/plugins/SpamX/<p>

Thats it.
</body>
</html>
--- NEW FILE: install.php ---
<?php

// +---------------------------------------------------------------------------+
// | Universal Plugin 1.0 for Geeklog - The Ultimate Weblog                    |
// +---------------------------------------------------------------------------+
// | install.php for spamx plugin                                              |
// |                                                                           |
// | This file installs and removes the data structures for the                |
// | plugin for Geeklog.                                                       |
// | This is a complete functioning install routine.  All you have to do is    |
// | remove the sample data from the arrays and fill in the $NEWTABLE,         |
// | $DEFVALUES, and $NEWFEATURE arrays with your data.  Then replace all      |
// | occurances of spamx with the name of your plugin and you will have a   |
// | functioning install page for your plugin.  Then customize the install     |
// | display language in english.php and you are ready to distribute your      |
// | plugin.                                                                   |
// | Simply put here is what this install does:                                |
// | 1) It creates the tables                                                  |
// | 2) It creates an admin security group for you plugin                      |
[...2106 lines suppressed...]
}

if (DB_count($_TABLES['plugins'], 'pi_name', 'spamx') == 0) {
    $T->set_var('installmsg2', $LANG_SX00['uninstalled']);
    $T->set_var('readme', $LANG_SX00['readme']);
    $T->set_var('installdoc', $LANG_SX00['installdoc']);
	$T->set_var('btnmsg', $LANG_SX00['install']);
	$T->set_var('action','install');
} else {
    $T->set_var('installmsg2', $LANG_SX00['installed']);
	$T->set_var('btnmsg', $LANG_SX00['uninstall']);
	$T->set_var('action','uninstall');
}
$T->parse('output','install');
$display .= $T->finish($T->get_var('output'));
$display .= COM_siteFooter(true);

echo $display;

?>
--- NEW FILE: index.php ---
<?php

// +---------------------------------------------------------------------------+
// | Universal Geeklog Plugin 1.0                                              |
// +---------------------------------------------------------------------------+
// | admin/index.php                                                           |
// | Administration page.                                                      |
// |                                                                           |
// +---------------------------------------------------------------------------+
// | Copyright (C) 2002 by the following authors:                              |
// |                                                                           |
// | Author:                                                                   |
// | Constructed with the Universal Plugin                                     |
// | Copyright (C) 2002 by the following authors:                              |
// | Tom Willett                 -    twillett at users.sourceforge.net           |
// | Blaine Lang                 -    langmail at sympatico.ca                    |
// | The Universal Plugin is based on prior work by:                           |
// | Tony Bibbs                  -    tony at tonybibbs.com                       |
// +---------------------------------------------------------------------------+
// |                                                                           |
// | This program 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.                    |
// |                                                                           |
// | 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.           |
// |                                                                           |
// +---------------------------------------------------------------------------+
//

require_once('../../../lib-common.php');


// Only let admin users access this page
if (!SEC_hasRights('spamx.admin')) {
    // Someone is trying to illegally access this page
    COM_errorLog("Someone has tried to illegally access the spamx Admin page.  User id: {$_USER['uid']}, Username: {$_USER['username']}, IP: $REMOTE_ADDR",1);
    $display = COM_siteHeader();
    $display .= COM_startBlock($LANG_SX00['access_denied']);
    $display .= $LANG_SX00['access_denied_msg'];
    $display .= COM_endBlock();
    $display .= COM_siteFooter(true);
    echo $display;
    exit;
}
 
/**
* Main 
*/


$display = COM_siteHeader();
$T = new Template($_CONF['path'] . 'plugins/spamx/templates');
$T->set_file('admin', 'admin.thtml');
$T->set_var('site_url',$_CONF['site_url']);
$T->set_var('site_admin_url', $_CONF['site_admin_url']);
$T->set_var('header', $LANG_SX00['admin']);
$T->set_var('plugin','spamx');
$T->parse('output','admin');
$display .= $T->finish($T->get_var('output'));
$display .= '<p>';
$files = array();
if ($dir = @opendir($_CONF['path'] . 'plugins/spamx/')) {
    while(($file = readdir($dir)) !== false) {
        if (is_file($_CONF['path'] . 'plugins/spamx/' . $file)) 
        { 
        	if (substr($file,-16) == '.Admin.class.php') {
	        	$tmp = str_replace(".Admin.class.php","",$file);
	        	array_push($files,$tmp); 
	        }
        }
    }
    closedir($dir);
}
$display .= '<p><b>' . $LANG_SX00['adminc'] . '</b></p><ul>';
foreach($files as $file){
require_once($_CONF['path'] . 'plugins/spamx/' . $file . '.Admin.class.php');
$CM = new $file;
$display .= '<li><a href="' . $_CONF['site_admin_url'] . '/plugins/spamx/index.php?command=' . $file . '">' . $CM->link() . '</a></li>';
}
$display .= '</ul>';
if (isset($_REQUEST['command'])) {
	$CM = new $_REQUEST['command'];
	$display.=$CM->display();
}
$display .= COM_siteFooter(true);

echo $display;
?>



More information about the geeklog-cvs mailing list