1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 04:10:38 +02:00

Work on issue #90 - Log plugin

This commit is contained in:
Tijn Kuyper
2013-02-04 01:03:08 +01:00
parent 724a648706
commit 89b44c13ac
2 changed files with 36 additions and 34 deletions

View File

@@ -24,7 +24,7 @@ require_once(e_ADMIN.'auth.php');
require_once(e_HANDLER.'userclass_class.php'); require_once(e_HANDLER.'userclass_class.php');
$frm = e107::getForm(); $frm = e107::getForm();
$emessage = eMessage::getInstance(); $mes = e107::getMessage();
define('LogFlagFile', 'LogFlag.php'); define('LogFlagFile', 'LogFlag.php');
@@ -201,14 +201,15 @@ if(IsSet($_POST['wipeSubmit']))
} }
$admin_log->log_event('STAT_01',ADSTAT_L81.$logStr,''); $admin_log->log_event('STAT_01',ADSTAT_L81.$logStr,'');
$message = ADSTAT_L25; // TODO:$emessage //$message = ADSTAT_L25; // TODO:$emessage
$mes->addSuccess(LAN_UPDATED);
} }
if(!is_writable(e_LOG)) if(!is_writable(e_LOG))
{ {
$message = "<b>".ADSTAT_L38."</b>"; // TODO:$emessage //$message = "<b>".ADSTAT_L38."</b>";
$mes->addError(ADSTAT_L28);
} }
if (isset($_POST['updatesettings'])) if (isset($_POST['updatesettings']))
@@ -241,15 +242,16 @@ if (isset($_POST['updatesettings']))
file_put_contents(e_LOG.LogFlagFile, "<?php\n\$logEnable={$pref['statActivate']};\n?>\n"); // Logging task uses to see if logging enabled file_put_contents(e_LOG.LogFlagFile, "<?php\n\$logEnable={$pref['statActivate']};\n?>\n"); // Logging task uses to see if logging enabled
$admin_log->log_event('STAT_02',ADSTAT_L82.$logStr,''); $admin_log->log_event('STAT_02',ADSTAT_L82.$logStr,'');
//$message = ADSTAT_L17; //$message = ADSTAT_L17;
$emessage->add(ADSTAT_L17, E_MESSAGE_SUCCESS); // FIX: seems not functional //$mes->addSuccess(LAN_SETSAVED); // replaced by save_prefs();
} }
/*
if (isset($message)) if (isset($message))
{ {
$ns->tablerender('', "<div style='text-align:center'><b>".$message."</b></div>"); $ns->tablerender('', "<div style='text-align:center'><b>".$message."</b></div>");
} }
*/
$ns->tablerender($caption, $mes->render() . $text);
function gen_select($prompt,$name,$value) function gen_select($prompt,$name,$value)
{ {
@@ -283,35 +285,35 @@ switch ($action)
<form method='post' action='".e_SELF."'> <form method='post' action='".e_SELF."'>
<table class='table adminform'> <table class='table adminform'>
<colgroup> <colgroup>
<col style='width:50%' /> <col style='width:50%' />
<col style='width:50%' /> <col style='width:50%' />
</colgroup> </colgroup>
<tr> <tr>
<td>".ADSTAT_L4."</td> <td>".ADSTAT_L4."</td>
<td> <td>
<input type='radio' name='statActivate' value='1'".($pref['statActivate'] ? " checked='checked'" : "")." /> ".ADSTAT_ON."&nbsp;&nbsp; <input type='radio' name='statActivate' value='1'".($pref['statActivate'] ? " checked='checked'" : "")." /> ".ADSTAT_ON."&nbsp;&nbsp;
<input type='radio' name='statActivate' value='0'".(!$pref['statActivate'] ? " checked='checked'" : "")." /> ".ADSTAT_OFF." <input type='radio' name='statActivate' value='0'".(!$pref['statActivate'] ? " checked='checked'" : "")." /> ".ADSTAT_OFF."
</td> </td>
</tr> </tr>
<tr> <tr>
<td>".ADSTAT_L18."</td> <td>".ADSTAT_L18."</td>
<td>".r_userclass("statUserclass", $pref['statUserclass'],'off','public, member, admin, classes')."</td> <td>".r_userclass("statUserclass", $pref['statUserclass'],'off','public, member, admin, classes')."</td>
</tr> </tr>
<tr> <tr>
<td>".ADSTAT_L20."</td> <td>".ADSTAT_L20."</td>
<td> <td>
<input type='radio' name='statCountAdmin' value='1'".($pref['statCountAdmin'] ? " checked='checked'" : "")." /> ".ADSTAT_ON."&nbsp;&nbsp; <input type='radio' name='statCountAdmin' value='1'".($pref['statCountAdmin'] ? " checked='checked'" : "")." /> ".ADSTAT_ON."&nbsp;&nbsp;
<input type='radio' name='statCountAdmin' value='0'".(!$pref['statCountAdmin'] ? " checked='checked'" : "")." /> ".ADSTAT_OFF." <input type='radio' name='statCountAdmin' value='0'".(!$pref['statCountAdmin'] ? " checked='checked'" : "")." /> ".ADSTAT_OFF."
</td> </td>
</tr> </tr>
<tr> <tr>
<td>".ADSTAT_L21."</td> <td>".ADSTAT_L21."</td>
<td> <td>
<input class='tbox' type='text' name='statDisplayNumber' size='8' value='".$pref['statDisplayNumber']."' maxlength='3' /> <input class='tbox' type='text' name='statDisplayNumber' size='8' value='".$pref['statDisplayNumber']."' maxlength='3' />
</td> </td>
</tr> </tr>
@@ -333,29 +335,29 @@ switch ($action)
<tr> <tr>
<td>".ADSTAT_L78."</td> <td>".ADSTAT_L78."</td>
<td> <td>
<input type='checkbox' name='statPrevMonth' value='1'".(varset($pref['statPrevMonth'],0) ? " checked='checked'" : "")." /><span class='field-help'>".ADSTAT_L79."</span> ".$frm->checkbox('statPrevMonth', 1, varset($pref['statPrevMonth'],0))."<span class='field-help'>".ADSTAT_L79."</span>
</td></tr> </td>
</tr>
<tr> <tr>
<td>".ADSTAT_L12."</td> <td>".ADSTAT_L12."</td>
<td> <td>
<input type='checkbox' name='wipe[statWipePage]' value='1' /> ".ADSTAT_L14."<br /> ".$frm->checkbox('wipe[statWipePage]', 1)." ".ADSTAT_L14."<br />
<input type='checkbox' name='wipe[statWipeBrowser]' value='1' /> ".ADSTAT_L6."<br /> ".$frm->checkbox('wipe[statWipeBrowser]', 1)." ".ADSTAT_L6."<br />
<input type='checkbox' name='wipe[statWipeOs]' value='1' /> ".ADSTAT_L7."<br /> ".$frm->checkbox('wipe[statWipeOs]', 1)." ".ADSTAT_L7."<br />
<input type='checkbox' name='wipe[statWipeScreen]' value='1' /> ".ADSTAT_L8."<br /> ".$frm->checkbox('wipe[statWipeScreen]', 1)." ".ADSTAT_L8."<br />
<input type='checkbox' name='wipe[statWipeDomain]' value='1' /> ".ADSTAT_L9."<br /> ".$frm->checkbox('wipe[statWipeDomain]', 1)." ".ADSTAT_L9."<br />
<input type='checkbox' name='wipe[statWipeRefer]' value='1' /> ".ADSTAT_L10."<br /> ".$frm->checkbox('wipe[statWipeRefer]', 1)." ".ADSTAT_L10."<br />
<input type='checkbox' name='wipe[statWipeQuery]' value='1' /> ".ADSTAT_L11."<br /> ".$frm->checkbox('wipe[statWipeQuery]', 1)." ".ADSTAT_L11."<br />
<br /> <br />
".$frm->admin_button('wipeSubmit', ADSTAT_L12, 'delete')." ".$frm->admin_button('wipeSubmit', LAN_RESET, 'delete')."<span class='field-help'>".ADSTAT_L13."</span>
<span class='field-help'>".ADSTAT_L13."</span>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>".ADSTAT_L26."<br /><span class='smalltext'>".ADSTAT_L27."</span></td> <td>".ADSTAT_L26."</td>
<td><input class='button' type='submit' name='openRemPageD' value='".ADSTAT_L28."' /> <td><input class='button' type='submit' name='openRemPageD' value='".ADSTAT_L28."' /><span class='field-help'>".ADSTAT_L27."</span>
</td> </td>
</tr> </tr>
"; ";

View File

@@ -26,9 +26,9 @@ define("ADSTAT_L11", "Search queries");
define("ADSTAT_L12", "Reset stats"); define("ADSTAT_L12", "Reset stats");
define("ADSTAT_L13", "This will erase the all-time stats - careful! Deletes stats to the end of yesterday. There is a separate menu option to delete selected historical data"); // TODO: Condense this help field (minimize) define("ADSTAT_L13", "This will erase the all-time stats - careful! Deletes stats to the end of yesterday. There is a separate menu option to delete selected historical data"); // TODO: Condense this help field (minimize)
define("ADSTAT_L14", "Page counts"); define("ADSTAT_L14", "Page counts");
define("ADSTAT_L15", "Update Statistic Settings"); //define("ADSTAT_L15", "Update Statistic Settings");
define("ADSTAT_L16", "Site Statistic Settings"); define("ADSTAT_L16", "Site Statistic Settings");
define("ADSTAT_L17", "Statistic settings updated"); //define("ADSTAT_L17", "Statistic settings updated");
define("ADSTAT_L18", "Allow access to main statistics page to ..."); define("ADSTAT_L18", "Allow access to main statistics page to ...");
define("ADSTAT_L19", "Recent visitors"); define("ADSTAT_L19", "Recent visitors");
define("ADSTAT_L20", "Count admin visits"); define("ADSTAT_L20", "Count admin visits");