1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 12:48:24 +01:00

Add admin logging to public uploads

This commit is contained in:
e107steved 2008-12-06 23:00:25 +00:00
parent c902bdebb1
commit 3641d9501e
4 changed files with 35 additions and 20 deletions

View File

@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_admin/image.php,v $
| $Revision: 1.6 $
| $Date: 2008-12-06 15:48:16 $
| $Revision: 1.7 $
| $Date: 2008-12-06 23:00:19 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
@ -94,7 +94,6 @@ if (isset($_POST['avdelete']))
if (isset($_POST['update_options']))
{
unset($temp);
$changes = array();
$temp['image_post'] = intval($_POST['image_post']);
$temp['resize_method'] = $_POST['resize_method'];
$temp['im_path'] = trim($tp->toDB($_POST['im_path']));
@ -111,7 +110,6 @@ if (isset($_POST['update_options']))
{
$message = IMALAN_20;
}
unset($changes);
}

View File

@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_admin/upload.php,v $
| $Revision: 1.7 $
| $Date: 2008-11-29 15:27:55 $
| $Revision: 1.8 $
| $Date: 2008-12-06 23:00:19 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
@ -56,6 +56,7 @@ if ($action == "dis" && isset($_POST['updelete']['upload_'.$id]) )
unlink(e_FILE."public/".$row['upload_ss']);
}
$message = ($sql->db_Delete("upload", "upload_id='".intval($id)."'")) ? UPLLAN_1 : LAN_DELETED_FAILED;
$admin_log->log_event('UPLOAD_01',$row['upload_file'],E_LOG_INFORMATIVE,'');
}
if ($action == "dlm")
@ -75,7 +76,8 @@ if ($action == "dl")
{
$id = str_replace("%20", " ", $id);
if (preg_match("/Binary\s(.*?)\/.*/", $id, $result)) {
if (preg_match("/Binary\s(.*?)\/.*/", $id, $result))
{
$bid = $result[1];
$result = @mysql_query("SELECT * FROM ".MPREFIX."rbinary WHERE binary_id='$bid' ");
$binary_data = @mysql_result($result, 0, "binary_data");
@ -87,7 +89,9 @@ if ($action == "dl")
header("Content-Description: PHP Generated Data");
echo $binary_data;
exit;
} else {
}
else
{
header("location:".e_FILE."public/".str_replace("dl.", "", e_QUERY));
exit;
}
@ -107,22 +111,30 @@ if (!is_object($e_userclass)) { $e_userclass = new user_class; }
if (isset($_POST['optionsubmit']))
{
$pref['upload_storagetype'] = $_POST['upload_storagetype'];
$pref['upload_maxfilesize'] = $_POST['upload_maxfilesize'];
$pref['upload_class'] = $_POST['upload_class'];
$pref['upload_enabled'] = (FILE_UPLOADS ? $_POST['upload_enabled'] : 0);
if ($pref['upload_enabled'] && !$sql->db_Select("links", "*", "link_url='upload.php' "))
$temp = array();
$temp['upload_storagetype'] = $_POST['upload_storagetype'];
$temp['upload_maxfilesize'] = $_POST['upload_maxfilesize'];
$temp['upload_class'] = $_POST['upload_class'];
$temp['upload_enabled'] = (FILE_UPLOADS ? $_POST['upload_enabled'] : 0);
if ($temp['upload_enabled'] && !$sql->db_Select("links", "*", "link_url='upload.php' "))
{
$sql->db_Insert("links", "0, '".UPLLAN_44."', 'upload.php', '', '', 1,0,0,0,0");
}
if (!$pref['upload_enabled'] && $sql->db_Select("links", "*", "link_url='upload.php' "))
if (!$temp['upload_enabled'] && $sql->db_Select("links", "*", "link_url='upload.php' "))
{
$sql->db_Delete("links", "link_url='upload.php' ");
}
save_prefs();
$message = UPLLAN_2;
if ($admin_log->logArrayDiffs($temp, $pref, 'UPLOAD_02'))
{
save_prefs(); // Only save if changes
$message = UPLLAN_2;
}
else
{
$message = UPLLAN_4;
}
}
if (isset($message))

View File

@ -1,6 +1,6 @@
<?php
// e107 Language File.
// $Id: lan_log_messages.php,v 1.29 2008-12-06 22:14:37 e107steved Exp $
// $Id: lan_log_messages.php,v 1.30 2008-12-06 23:00:25 e107steved Exp $
/*
The definitions in this file are for standard 'explanatory' messages which might be entered
@ -285,5 +285,10 @@ define('LAN_AL_MENU_08', 'Menu - move down');
define('LAN_AL_MENU_09', '');
define('LAN_AL_MENU_10', '');
// Public Uploads
//---------------
define('LAN_AL_UPLOAD_01','Uploaded file deleted');
define('LAN_AL_UPLOAD_02','Upload prefs changed');
?>

View File

@ -4,15 +4,15 @@
| e107 website system - Language File.
|
| $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_upload.php,v $
| $Revision: 1.3 $
| $Date: 2008-04-22 20:32:49 $
| $Revision: 1.4 $
| $Date: 2008-12-06 23:00:25 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
define("UPLLAN_1", "Upload removed from list.");
define("UPLLAN_2", "Settings saved in database");
define("UPLLAN_3", "Upload ID");
define('UPLLAN_4', 'Nothing changed - not updated');
define("UPLLAN_5", "Poster");
define("UPLLAN_6", "Email");
define("UPLLAN_7", "Website");