Bookoo of the Nine Situations Group posted an SQL injection exploit for glFusion that also works with Geeklog. This issue allowed an attacker to extract the password hash for any account and is fixed with this release.
+
+
+
Fernando Muñoz reported a possible XSS in the query form on most admin panels that we are fixing with this release.
The minimum PHP version required by Geeklog is now PHP 4.3.0. Given that the PHP team ended support for PHP 4 in August 2008, you should be
looking into upgrading to PHP 5 anyway.
Bookoo of the Nine Situations Group posted an SQL injection exploit for glFusion that also works with Geeklog. This issue allowed an attacker to extract the password hash for any account and is fixed with this release.
diff -r 81f6adbf7687 -r f588d8d5c7c0 public_html/docs/history
--- a/public_html/docs/history Wed Apr 01 15:21:52 2009 -0500
+++ b/public_html/docs/history Sat Apr 04 20:22:02 2009 +0200
@@ -1,6 +1,6 @@
Geeklog History/Changes:
-Mar ??, 2009 (1.6.0)
+Apr ??, 2009 (1.6.0)
------------
Geeklog 1.6.0 incorporates the following projects implemented during
@@ -130,6 +130,16 @@
every other plugin and built-in function does (bug #0000644) [Dirk]
+Apr 4, 2009 (1.5.2sr2)
+-----------
+
+This release addresses the following security issue:
+
+Bookoo of the Nine Situations Group posted an SQL injection exploit for glFusion
+that also works with Geeklog. This issue allowed an attacker to extract the
+password hash for any account and is fixed with this release.
+
+
Mar 30, 2009 (1.5.2sr1)
------------
diff -r 81f6adbf7687 -r f588d8d5c7c0 system/lib-sessions.php
--- a/system/lib-sessions.php Wed Apr 01 15:21:52 2009 -0500
+++ b/system/lib-sessions.php Sat Apr 04 20:22:02 2009 +0200
@@ -2,13 +2,13 @@
/* Reminder: always indent with 4 spaces (no tabs). */
// +---------------------------------------------------------------------------+
-// | Geeklog 1.5 |
+// | Geeklog 1.6 |
// +---------------------------------------------------------------------------+
// | lib-sessions.php |
// | |
// | Geeklog session library. |
// +---------------------------------------------------------------------------+
-// | Copyright (C) 2000-2008 by the following authors: |
+// | Copyright (C) 2000-2009 by the following authors: |
// | |
// | Authors: Tony Bibbs - tony AT tonybibbs DOT com |
// | Mark Limburg - mlimburg AT users DOT sourceforge DOT net |
@@ -29,8 +29,6 @@
// | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
// | |
// +---------------------------------------------------------------------------+
-//
-// $Id: lib-sessions.php,v 1.47 2008/09/21 08:37:12 dhaun Exp $
/**
* This is the session management library for Geeklog. Some of this code was
@@ -397,7 +395,7 @@
if ($md5_based == 1) {
$sql = "UPDATE {$_TABLES['sessions']} SET start_time=$newtime WHERE (md5_sess_id = '$sessid')";
} else {
- $sql = "UPDATE {$_TABLES['sessions']} SET start_time=$newtime WHERE (sess_id = $sessid)";
+ $sql = "UPDATE {$_TABLES['sessions']} SET start_time=$newtime WHERE (sess_id = '$sessid')";
}
$result = DB_query($sql);
From geeklog-cvs at lists.geeklog.net Sat Apr 4 15:49:27 2009
From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net)
Date: Sat, 04 Apr 2009 15:49:27 -0400
Subject: [geeklog-cvs] geeklog: Geeklog 2 -> AptitudeCMS
Message-ID:
details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/9715b970abbb
changeset: 6891:9715b970abbb
user: Dirk Haun
date: Sat Apr 04 20:31:05 2009 +0200
description:
Geeklog 2 -> AptitudeCMS
diffstat:
1 file changed, 5 insertions(+), 7 deletions(-)
public_html/docs/index.html | 12 +++++-------
diffs (24 lines):
diff -r f588d8d5c7c0 -r 9715b970abbb public_html/docs/index.html
--- a/public_html/docs/index.html Sat Apr 04 20:22:02 2009 +0200
+++ b/public_html/docs/index.html Sat Apr 04 20:31:05 2009 +0200
@@ -113,15 +113,13 @@
Geeklog was originally developed for the Security Geeks web site and was
originally authored by Jason Whittenburg. In early 2001, Jason decided it
was time to devote his time to other things and handed the project over to
-Tony Bibbs who uses Geeklog to run Iowa
-Outdoors. Tony is currently focusing on getting the next generation
-Geeklog, dubbed GL2, off the ground, while Dirk Haun is now maintaining the
-1.x branch.
+Tony Bibbs. Tony is now focusing on getting AptitudeCMS (formerly Geeklog 2), a next generation CMS, off
+the ground, while Dirk Haun is now acting as the Geeklog maintainer.
Geeklog is bona fide open-source software and has been released under the
-GNU GPLv2 for use by
-others. Configuring Geeklog is meant to be an easy process though it will
-require you to have access to several components of your system.
+GNU GPLv2
+for use by others. Configuring Geeklog is meant to be an easy process though it
+will require you to have access to several components of your system.
This document is still evolving, so there may be unintended omissions or
various steps may be over or under explained. It's assumed that you have
From geeklog-cvs at lists.geeklog.net Sat Apr 4 15:49:27 2009
From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net)
Date: Sat, 04 Apr 2009 15:49:27 -0400
Subject: [geeklog-cvs] geeklog: Geeklog 2 -> AptitudeCMS
Message-ID:
details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/9715b970abbb
changeset: 6891:9715b970abbb
user: Dirk Haun
date: Sat Apr 04 20:31:05 2009 +0200
description:
Geeklog 2 -> AptitudeCMS
diffstat:
1 file changed, 5 insertions(+), 7 deletions(-)
public_html/docs/index.html | 12 +++++-------
diffs (24 lines):
diff -r f588d8d5c7c0 -r 9715b970abbb public_html/docs/index.html
--- a/public_html/docs/index.html Sat Apr 04 20:22:02 2009 +0200
+++ b/public_html/docs/index.html Sat Apr 04 20:31:05 2009 +0200
@@ -113,15 +113,13 @@
Geeklog was originally developed for the Security Geeks web site and was
originally authored by Jason Whittenburg. In early 2001, Jason decided it
was time to devote his time to other things and handed the project over to
-Tony Bibbs who uses Geeklog to run Iowa
-Outdoors. Tony is currently focusing on getting the next generation
-Geeklog, dubbed GL2, off the ground, while Dirk Haun is now maintaining the
-1.x branch.
+Tony Bibbs. Tony is now focusing on getting AptitudeCMS (formerly Geeklog 2), a next generation CMS, off
+the ground, while Dirk Haun is now acting as the Geeklog maintainer.
Geeklog is bona fide open-source software and has been released under the
-GNU GPLv2 for use by
-others. Configuring Geeklog is meant to be an easy process though it will
-require you to have access to several components of your system.
+GNU GPLv2
+for use by others. Configuring Geeklog is meant to be an easy process though it
+will require you to have access to several components of your system.
This document is still evolving, so there may be unintended omissions or
various steps may be over or under explained. It's assumed that you have
From geeklog-cvs at lists.geeklog.net Sun Apr 5 03:44:50 2009
From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net)
Date: Sun, 05 Apr 2009 03:44:50 -0400
Subject: [geeklog-cvs] geeklog: Wrong function name: STORY_doDeleteStoryNow
-> STORY_do...
Message-ID:
details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/f2425e08ba4c
changeset: 6892:f2425e08ba4c
user: Dirk Haun
date: Sun Apr 05 09:34:05 2009 +0200
description:
Wrong function name: STORY_doDeleteStoryNow -> STORY_doDeleteThisStoryNow
diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
system/lib-story.php | 2 +-
diffs (12 lines):
diff -r 9715b970abbb -r f2425e08ba4c system/lib-story.php
--- a/system/lib-story.php Sat Apr 04 20:31:05 2009 +0200
+++ b/system/lib-story.php Sun Apr 05 09:34:05 2009 +0200
@@ -1336,7 +1336,7 @@
}
}
- STORY_doDeleteStoryNow($sid);
+ STORY_doDeleteThisStoryNow($sid);
$output = COM_refresh($_CONF['site_admin_url'] . '/story.php?msg=10');
From geeklog-cvs at lists.geeklog.net Sun Apr 5 12:53:47 2009
From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net)
Date: Sun, 05 Apr 2009 12:53:47 -0400
Subject: [geeklog-cvs] geeklog: When upgrading,
we can now rely on the 'database_versio...
Message-ID:
details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/1677c239fcc6
changeset: 6893:1677c239fcc6
user: Dirk Haun
date: Sun Apr 05 15:38:29 2009 +0200
description:
When upgrading, we can now rely on the 'database_version' field to identify the db version.
diffstat:
1 file changed, 30 insertions(+), 14 deletions(-)
public_html/admin/install/lib-upgrade.php | 44 +++++++++++++++++++----------
diffs (107 lines):
diff -r f2425e08ba4c -r 1677c239fcc6 public_html/admin/install/lib-upgrade.php
--- a/public_html/admin/install/lib-upgrade.php Sun Apr 05 09:34:05 2009 +0200
+++ b/public_html/admin/install/lib-upgrade.php Sun Apr 05 15:38:29 2009 +0200
@@ -491,7 +491,7 @@
/**
* Get the current installed version of Geeklog
*
- * @return Geeklog version in x.x.x format
+ * @return string Geeklog version in x.x.x format
*
*/
function INST_identifyGeeklogVersion()
@@ -499,6 +499,25 @@
global $_TABLES, $_DB, $_DB_dbms;
$_DB->setDisplayError(true);
+
+ $version = '';
+
+ /**
+ * First check for 'database_version' in gl_vars. If that exists, assume
+ * it's the correct version. Else, try some heuristics (below).
+ * Note: Need to handle 'sr1' etc. appendices.
+ */
+ $db_v = DB_getItem($_TABLES['vars'], 'value', "name = 'database_version'");
+ if (! empty($db_v)) {
+ $v = explode('.', $db_v);
+ if (count($v) == 3) {
+ $v[2] = (int) $v[2];
+ $version = implode('.', $v);
+
+ return $version;
+ }
+ }
+
// simple tests for the version of the database:
// "DESCRIBE sometable somefield", ''
@@ -509,13 +528,11 @@
// Should always include a test for the current version so that we can
// warn the user if they try to run the update again.
-
switch ($_DB_dbms) {
case 'mysql':
$test = array(
- '1.5.2' => array("SELECT value FROM {$_TABLES['vars']} WHERE name = 'database_version'", '1.5.2'),
- '1.5.1' => array("SELECT name FROM {$_TABLES['vars']} WHERE name = 'database_version'", 'database_version'),
+ // as of 1.5.1, we should have the 'database_version' entry
'1.5.0' => array("DESCRIBE {$_TABLES['storysubmission']} bodytext",''),
'1.4.1' => array("SELECT ft_name FROM {$_TABLES['features']} WHERE ft_name = 'syndication.edit'", 'syndication.edit'),
'1.4.0' => array("DESCRIBE {$_TABLES['users']} remoteusername",''),
@@ -537,8 +554,7 @@
case 'mssql':
$test = array(
- '1.5.2' => array("SELECT value FROM {$_TABLES['vars']} WHERE name = 'database_version'", '1.5.2'),
- '1.5.1' => array("SELECT name FROM {$_TABLES['vars']} WHERE name = 'database_version'", 'database_version'),
+ // as of 1.5.1, we should have the 'database_version' entry
'1.5.0' => array("SELECT c.name FROM syscolumns c JOIN sysobjects o ON o.id = c.id WHERE c.name='bodytext' AND o.name='{$_TABLES['storysubmission']}'",'bodytext'),
'1.4.1' => array("SELECT ft_name FROM {$_TABLES['features']} WHERE ft_name = 'syndication.edit'", 'syndication.edit')
// 1.4.1 was the first version with MS SQL support
@@ -553,8 +569,6 @@
break;
}
-
- $version = '';
foreach ($test as $v => $qarray) {
$result = DB_query($qarray[0], 1);
@@ -660,11 +674,12 @@
*
* Note: Needed for upgrades from old versions - don't remove.
*
-* @return 0 = not installed,
-* 1 = original plugin,
-* 2 = version by Phill or Tom,
-* 3 = v1.3 (center block, etc.),
-* 4 = v1.4 ('in block' flag)
+* @return int indicates which version of the plugin we're dealing with:
+* - 0 = not installed,
+* - 1 = original plugin,
+* - 2 = version by Phill or Tom,
+* - 3 = v1.3 (center block, etc.),
+* - 4 = v1.4 ('in block' flag)
*
*/
function get_SP_ver()
@@ -699,7 +714,7 @@
/**
* Run all the database queries from the update file.
*
- * @param array $_SQL Array of queries
+ * @param array $_SQL Array of queries to perform
*
*/
function INST_updateDB($_SQL)
@@ -787,6 +802,7 @@
* process!
*
* @param boolean $migration whether the upgrade is part of a site migration
+* @param array $old_conf old $_CONF values before the migration
* @return int number of failed plugin updates (0 = everything's fine)
*
*/
From geeklog-cvs at lists.geeklog.net Sun Apr 5 12:53:47 2009
From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net)
Date: Sun, 05 Apr 2009 12:53:47 -0400
Subject: [geeklog-cvs] geeklog: Zip::extract() returns an array on success
and 0 on fai...
Message-ID:
details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/4b8a086e07af
changeset: 6894:4b8a086e07af
user: Dirk Haun
date: Sun Apr 05 18:16:08 2009 +0200
description:
Zip::extract() returns an array on success and 0 on failure
diffstat:
1 file changed, 9 insertions(+), 3 deletions(-)
system/classes/unpacker.class.php | 12 +++++++++---
diffs (28 lines):
diff -r 1677c239fcc6 -r 4b8a086e07af system/classes/unpacker.class.php
--- a/system/classes/unpacker.class.php Sun Apr 05 15:38:29 2009 +0200
+++ b/system/classes/unpacker.class.php Sun Apr 05 18:16:08 2009 +0200
@@ -382,9 +382,15 @@
} else {
if (is_array($item_array) === true) {
- return $this->archive->extract(array('add_path' => $target_path, 'by_name' => $item_array));
+ $result = $this->archive->extract(array('add_path' => $target_path, 'by_name' => $item_array));
} else {
- return $this->archive->extract(array('add_path' => $target_path));
+ $result = $this->archive->extract(array('add_path' => $target_path));
+ }
+ // extract() returns an array on success and 0 on failure
+ if ($result === 0) {
+ return false;
+ } else {
+ return true;
}
}
@@ -470,4 +476,4 @@
}
}
-?>
\ No newline at end of file
+?>
From geeklog-cvs at lists.geeklog.net Sun Apr 5 12:53:48 2009
From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net)
Date: Sun, 05 Apr 2009 12:53:48 -0400
Subject: [geeklog-cvs] geeklog: Use our new unpacker class to unpack plugin
tarballs an...
Message-ID:
details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/72931c2ab9fe
changeset: 6895:72931c2ab9fe
user: Dirk Haun
date: Sun Apr 05 18:35:52 2009 +0200
description:
Use our new unpacker class to unpack plugin tarballs and ZIP files
diffstat:
1 file changed, 30 insertions(+), 48 deletions(-)
public_html/admin/plugins.php | 78 +++++++++++++++--------------------------
diffs (163 lines):
diff -r 4b8a086e07af -r 72931c2ab9fe public_html/admin/plugins.php
--- a/public_html/admin/plugins.php Sun Apr 05 18:16:08 2009 +0200
+++ b/public_html/admin/plugins.php Sun Apr 05 18:35:52 2009 +0200
@@ -33,6 +33,15 @@
// | |
// +---------------------------------------------------------------------------+
+/**
+* This is the plugin administration page. Here you can install, uninstall,
+* enable, disable, and upload plugins.
+*
+*/
+
+/**
+* Geeklog common function library
+*/
require_once '../lib-common.php';
require_once 'auth.inc.php';
@@ -158,9 +167,9 @@
}
/**
-* Toggle status of a plugin from enabled to disabled and back
+* Toggle plugin status from enabled to disabled and back
*
-* @param string $pi_name name of the plugin
+* @param array $pi_name_arr array of plugin states
* @return void
*
*/
@@ -239,7 +248,7 @@
/**
* Creates list of uninstalled plugins (if any) and offers install link to them.
*
-* @param strint $token security token to use in list
+* @param string $token Security token to use in list
* @return string HTML containing list of uninstalled plugins
*
*/
@@ -329,8 +338,8 @@
/**
* Updates a plugin (call its upgrade function).
*
-* @param pi_name string name of the plugin to uninstall
-* @return string HTML for error or success message
+* @param string $pi_name name of the plugin to uninstall
+* @return string HTML for error or success message
*
*/
function do_update($pi_name)
@@ -366,8 +375,8 @@
/**
* Uninstall a plugin (call its uninstall function).
*
-* @param pi_name string name of the plugin to uninstall
-* @return string HTML for error or success message
+* @param string $pi_name name of the plugin to uninstall
+* @return string HTML for error or success message
*
*/
function do_uninstall($pi_name)
@@ -398,10 +407,11 @@
/**
* List available plugins
*
-* @return string formatted list of plugins
+* @param string $token Security token
+* @return string formatted list of plugins
*
*/
-function listplugins ($token)
+function listplugins($token)
{
global $_CONF, $_TABLES, $LANG32, $LANG_ADMIN, $_IMAGE_TYPE;
@@ -519,7 +529,8 @@
/**
* Display upload form
*
-* @return string HTML for the upload form
+* @param string $token Security token
+* @return string HTML for the upload form
*
*/
function plugin_show_uploadform($token)
@@ -572,22 +583,13 @@
} else {
+ require_once $_CONF['path_system'] . 'classes/unpacker.class.php';
+
$plugin_file = $_CONF['path_data'] . $_FILES['plugin']['name']; // Name the plugin file
- if ($_FILES['plugin']['type'] == 'application/zip') {
-
- // Zip
- require_once 'Archive/Zip.php'; // import Archive_Zip library
- $archive = new Archive_Zip($_FILES['plugin']['tmp_name']); // Use PEAR's Archive_Zip to extract the package
-
- } else {
-
- // Tarball
- require_once 'Archive/Tar.php'; // import Archive_Tar library
- $archive = new Archive_Tar($_FILES['plugin']['tmp_name']); // Use PEAR's Archive_Tar to extract the package
-
- }
- $tmp = $archive->listContent(); // Grab the contents of the tarball to see what the plugin name is
+ $archive = new unpacker($_FILES['plugin']['tmp_name'],
+ $_FILES['plugin']['type']);
+ $tmp = $archive->getlist(); // Grab the contents of the tarball to see what the plugin name is
$dirname = preg_replace('/\/.*$/', '', $tmp[0]['filename']);
if (empty($dirname)) { // If $dirname is blank it's probably because the user uploaded a non Tarball file.
@@ -650,18 +652,8 @@
*/
// Extract the tarball to data so we can get the $pi_name name from admin/install.php
- if ($_FILES['plugin']['type'] == 'application/zip') {
-
- // Zip
- $archive->extract(array('add_path' => $_CONF['path'] . 'data/',
- 'by_name' => $dirname . '/admin/install.php'));
-
- } else {
-
- // Tarball
- $archive->extractList(array($dirname . '/admin/install.php'), $_CONF['path'] . 'data/');
-
- }
+ $archive->unpack($_CONF['path'] . 'data/',
+ array($dirname . '/admin/install.php'));
$plugin_inst = $_CONF['path'] . 'data/' . $dirname . '/admin/install.php';
$fdata = '';
$fhandle = @fopen($plugin_inst, 'r');
@@ -705,17 +697,7 @@
}
// Extract the uploaded archive to the plugins directory
- if ($_FILES['plugin']['type'] == 'application/zip') {
-
- // Zip
- $upload_success = $archive->extract(array('add_path' => $_CONF['path'] . 'plugins/'));
-
- } else {
-
- // Tarball
- $upload_success = $archive->extract($_CONF['path'] . 'plugins/');
-
- }
+ $upload_success = $archive->unpack($_CONF['path'] . 'plugins/');
$plg_path = $_CONF['path'] . 'plugins/' . $pi_name . '/';
if ($upload_success) {
@@ -890,7 +872,7 @@
* Do the actual plugin auto install
*
* @param string $plugin Plugin name
-* @param array $inst_parm Installation parameters for the plugin
+* @param array $inst_parms Installation parameters for the plugin
* @param boolean $verbose true: enable verbose logging
* @return boolean true on success, false otherwise
*
From geeklog-cvs at lists.geeklog.net Sun Apr 5 12:53:48 2009
From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net)
Date: Sun, 05 Apr 2009 12:53:48 -0400
Subject: [geeklog-cvs] geeklog: Cosmetics - no code changes
Message-ID:
details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/d3735195c25d
changeset: 6896:d3735195c25d
user: Dirk Haun
date: Sun Apr 05 18:44:34 2009 +0200
description:
Cosmetics - no code changes
diffstat:
1 file changed, 79 insertions(+), 80 deletions(-)
system/classes/unpacker.class.php | 159 ++++++++++++++++++-------------------
diffs (truncated from 369 to 300 lines):
diff -r 72931c2ab9fe -r d3735195c25d system/classes/unpacker.class.php
--- a/system/classes/unpacker.class.php Sun Apr 05 18:35:52 2009 +0200
+++ b/system/classes/unpacker.class.php Sun Apr 05 18:44:34 2009 +0200
@@ -1,48 +1,47 @@
+ * @author Justin Carlson, justin DOT carlson AT gmail DOT com
*
*/
class unpacker {
-
+
// mime types ( these are not very reliable, varies browser to browser )
// for the best results, pass the real filename as well as the mime type
var $mime_def = array('application/zip' => 'zip',
@@ -57,7 +56,7 @@
'application/octet-stream' => 'tar',
'application/x-compress' => 'tar',
'application/x-compressed' => 'tar');
-
+
var $file = null; // archive name
var $filesize = null; // archive size (in bytes)
var $ext = null; // archive ext
@@ -70,7 +69,7 @@
var $type = null; // archive type
var $comp = null; // archive compression type (private)
-
+
/**
* Constructor
*
@@ -86,33 +85,33 @@
} else {
$this->d_sep = '/';
}
-
+
// if the file doesn't have it's path, assume local
if (! strstr($file, $this->d_sep)) {
$file = getcwd() . $this->d_sep . $file;
}
-
+
// make sure the file exists
if (file_exists($file)) {
-
+
// copy vars
$this->file = $file;
$this->filesize = filesize($file);
$this->ext = strtolower(substr($file, - 4));
-
+
// if the type is passed, store it
if ($mime_type != null) {
-
+
if (isset($this->mime_def[$mime_type])) {
$this->type = $this->mime_def[$mime_type];
} else {
return $this->setError('400', 'Invalid MIME Type');
}
-
+
}
-
+
if ($this->type == null || $this->type == 'other') {
-
+
// if a known mime type was not provided, expect real filename
// mime types are not reliable so this is the reccommended way
// for example: unpacker($_FILES['foo']['name'],$type);
@@ -126,21 +125,21 @@
} else {
$this->type = str_replace('.', '', $this->ext);
}
-
+
// see if we know of a mime type for this ext
if (in_array($this->type, $this->mime_def) === false) {
return $this->setError('400', 'Invalid File Extension');
}
}
-
+
// call the load wrapper, return result
return $this->load_file();
-
+
} else {
// file did not exist
return false;
}
-
+
}
/**
@@ -191,24 +190,23 @@
function load_zip() {
if (function_exists('zip_open')) {
-
+
// Use PECL ZIP
$this->archive = new ZipArchive();
$result = $this->archive->open($this->file);
if ($result === false) {
return $this->setError($result, 'ZipArchive Error');
}
-
+
} else {
-
+
// use Pear Archive_Zip
require_once 'Archive/Zip.php';
$this->archive = new Archive_Zip($this->file);
// unfortunately, we can't tell if it succeeded
-
}
-
+
// return resource handle or result
return true;
}
@@ -223,10 +221,10 @@
// use Pear Archive_Tar
require_once 'Archive/Tar.php';
$this->archive = new Archive_Tar($this->file, $this->comp);
-
+
// unfortunately, we can't tell if it succeeded
return ($this->archive);
-
+
}
/**
@@ -240,7 +238,7 @@
if (is_array($this->contents)) {
return $this->contents;
}
-
+
// not cached, load and cache the content list
$handler = 'list_' . $this->type;
if (method_exists($this, $handler)) {
@@ -249,7 +247,7 @@
} else {
return $this->setError('405', 'Unpacker called getlist ' . 'with unknown handler.');
}
-
+
}
/**
@@ -261,37 +259,37 @@
// using PECL::ZipArchive
if (function_exists('zip_open')) {
-
+
// catch empty archive
if ($this->archive->numFiles < 1) {
return $this->setError('411', 'Archive is empty.');
}
-
+
// reset cache
$this->contents = array();
for ($i = 0; $i < $this->archive->numFiles; $i ++) {
-
+
// Make ZipArchive's info look like Archive_Zip's
$zip_entry = $this->archive->statIndex($i);
$this->contents[$i]['filename'] = $zip_entry['name'];
$this->contents[$i]['size'] = $zip_entry['size'];
$this->contents[$i]['compressed'] = $zip_entry['comp_size'];
$this->contents[$i]['method'] = $zip_entry['comp_method'];
-
+
}
// return the contents list
return $this->contents;
-
+
// using PEAR::Archive_Zip
} else {
-
+
$this->contents = $this->archive->listContent();
if (is_array($this->contents)) {
return $this->contents;
} else {
return $this->setError('411', 'Archive is empty.');
}
-
+
}
}
@@ -323,12 +321,12 @@
if (is_writable($target_path) === false) {
return $this->setError('403', 'Permission denied writing to path.');
}
-
+
// make sure target ends with slash
if (substr($target_path, - 1) != $this->d_sep) {
$target_path .= $this->d_sep;
}
-
+
$handler = 'unpack_' . $this->type;
if (method_exists($this, $handler)) {
return $this->$handler($target_path, $item_array);
@@ -348,39 +346,39 @@
// using PECL::ZipArchive
if (function_exists('zip_open')) {
-
+
if ($this->archive) {
-
+
From geeklog-cvs at lists.geeklog.net Wed Apr 8 18:36:52 2009
From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net)
Date: Wed, 08 Apr 2009 18:36:52 -0400
Subject: [geeklog-cvs] geeklog: Changed form target to admin_site_url as
$_SERVER['PHP_...
Message-ID:
details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/a5e15a4ba045
changeset: 6897:a5e15a4ba045
user: jcarlson
date: Wed Apr 08 17:36:00 2009 -0500
description:
Changed form target to admin_site_url as $_SERVER['PHP_SELF'] is not reliable in all environments.
diffstat:
1 file changed, 132 insertions(+), 132 deletions(-)
public_html/admin/auth.inc.php | 264 ++++++++++++++++++++--------------------
diffs (268 lines):
diff -r d3735195c25d -r a5e15a4ba045 public_html/admin/auth.inc.php
--- a/public_html/admin/auth.inc.php Sun Apr 05 18:44:34 2009 +0200
+++ b/public_html/admin/auth.inc.php Wed Apr 08 17:36:00 2009 -0500
@@ -1,132 +1,132 @@
- 0) {
- COM_displayMessageAndAbort($LANG04[112], '', 403, 'Access denied');
-}
-
-$uid = '';
-if (!empty($_POST['loginname']) && !empty($_POST['passwd'])) {
- if ($_CONF['user_login_method']['standard']) {
- $status = SEC_authenticate(COM_applyFilter($_POST['loginname']),
- $_POST['passwd'], $uid);
- } else {
- $status = '';
- }
-} else {
- $status = '';
-}
-$display = '';
-
-if ($status == USER_ACCOUNT_ACTIVE) {
- DB_change($_TABLES['users'], 'pwrequestid', "NULL", 'uid', $uid);
- $_USER = SESS_getUserDataFromId($uid);
- $sessid = SESS_newSession($_USER['uid'], $_SERVER['REMOTE_ADDR'],
- $_CONF['session_cookie_timeout'], $_CONF['cookie_ip']);
- SESS_setSessionCookie($sessid, $_CONF['session_cookie_timeout'],
- $_CONF['cookie_session'], $_CONF['cookie_path'],
- $_CONF['cookiedomain'], $_CONF['cookiesecure']);
- PLG_loginUser($_USER['uid']);
-
- // Now that we handled session cookies, handle longterm cookie
-
- if (!isset($_COOKIE[$_CONF['cookie_name']])) {
-
- // Either their cookie expired or they are new
-
- $cooktime = COM_getUserCookieTimeout();
-
- if (!empty($cooktime)) {
-
- // They want their cookie to persist for some amount of time so set it now
-
- setcookie($_CONF['cookie_name'], $_USER['uid'],
- time() + $cooktime, $_CONF['cookie_path'],
- $_CONF['cookiedomain'], $_CONF['cookiesecure']);
- }
- }
- if (!SEC_hasRights('story.edit,block.edit,topic.edit,user.edit,plugin.edit,syndication.edit','OR')) {
- $display .= COM_refresh($_CONF['site_admin_url'] . '/moderation.php');
- } else {
- $display .= COM_refresh($_CONF['site_url'] . '/index.php');
- }
- echo $display;
- exit;
-} else if (!SEC_hasRights('story.edit,block.edit,topic.edit,user.edit,plugin.edit,user.mail,syndication.edit','OR') && (count(PLG_getAdminOptions()) == 0)) {
- COM_updateSpeedlimit('login');
-
- $display .= COM_siteHeader('menu');
- $display .= COM_startBlock($LANG20[1]);
-
- if (!$_CONF['user_login_method']['standard']) {
- $display .= '