if(!preg_match('/^[a-zA-Z0-9\-\_\.]{1,64}$/',$db_table))$app->error('Invalid table name '.$db_table);
if(!preg_match('/^[a-zA-Z0-9\-\_]{1,64}$/',$primary_field))$app->error('Invalid primary field '.$primary_field.' in table '.$db_table);
global$app;
$primary_id=intval($primary_id);
// Insert backticks only for incomplete table names.
if(stristr($db_table,'.')){
$escape='';
}else{
$escape='`';
}
if($force_update==true){
//* We force a update even if no record has changed
...
...
@@ -625,12 +697,13 @@ class db {
if($diff_num>0){
//print_r($diff_num);
//print_r($diffrec_full);
$diffstr=serialize($diffrec_full);
if(isset($_SESSION)){
$username=$_SESSION['s']['user']['username'];
}else{
$username='admin';
}
$dbidx=$primary_field.':'.$primary_id;
if(trim($username)=='')$username='none';
if($action=='INSERT')$action='i';
if($action=='UPDATE')$action='u';
...
...
@@ -732,13 +805,20 @@ class db {
returntrue;
}
//** Deletes a record and saves the changes into the datalog
publicfunctiondatalogError($errormsg){
global$app;
if(isset($app->modules->current_datalog_id)&&$app->modules->current_datalog_id>0)$this->query("UPDATE sys_datalog set error = ? WHERE datalog_id = ?",$errormsg,$app->modules->current_datalog_id);
returntrue;
}
//* get the current datalog status for the specified login (or currently logged in user)
publicfunctiondatalogStatus($login=''){
global$app;
$return=array('count'=>0,'entries'=>array());
//if($_SESSION['s']['user']['typ'] == 'admin') return $return; // these information should not be displayed to admin users
// removed in favor of new non intrusive datalogstatus notification header
if($login==''&&isset($_SESSION['s']['user'])){
$login=$_SESSION['s']['user']['username'];
...
...
@@ -747,14 +827,24 @@ class db {
$result=$this->queryAllRecords("SELECT COUNT( * ) AS cnt, sys_datalog.action, sys_datalog.dbtable FROM sys_datalog, server WHERE server.server_id = sys_datalog.server_id AND sys_datalog.user = ? AND sys_datalog.datalog_id > server.updated GROUP BY sys_datalog.dbtable, sys_datalog.action",$login);
foreach($resultas$row){
if(!$row['dbtable']||in_array($row['dbtable'],array('aps_instances','aps_instances_settings','mail_access','mail_content_filter')))continue;// ignore some entries, maybe more to come
<labelclass="checkbox-inline"for="dbssl"><inputtype="checkbox"id="dbssl"value="1"name="dbssl"<tmpl_ifname='dbssl'op='=='value='true'>checked</tmpl_if>/> Use SSL</label>