Ignore:
Timestamp:
Oct 19, 2006, 2:41:07 AM (18 years ago)
Author:
rvelices
Message:

feature 564: logs in the history table each user login
feature 562: possibility to log page visits for any combination of
administrators/users/guests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/configuration.php

    r1250 r1565  
    4747  $page['section'] = $_GET['section'];
    4848}
    49 //------------------------------------------------------ $conf reinitialization
    50 $result = pwg_query('SELECT param,value FROM '.CONFIG_TABLE);
    51 while ($row = mysql_fetch_array($result))
    52 {
    53   $conf[$row['param']] = $row['value'];
    54   // if the parameter is present in $_POST array (if a form is submited), we
    55   // override it with the submited value
    56   if (isset($_POST[$row['param']]))
    57   {
    58     $conf[$row['param']] = $_POST[$row['param']];
    59     if ( 'page_banner'==$row['param'] )
    60     { // should we do it for all ?
    61       $conf[$row['param']] = stripslashes( $conf[$row['param']] );
    62     }
    63   }
    64 }
    6549//------------------------------ verification and registration of modifications
    6650if (isset($_POST['submit']))
     
    7559        array_push($page['errors'], $lang['conf_gallery_url_error']);
    7660      }
     61      $_POST['log'] = empty($_POST['log'])?'false':'true';
     62      $_POST['history_admin'] = empty($_POST['history_admin'])?'false':'true';
     63      $_POST['history_guest'] = empty($_POST['history_guest'])?'false':'true';
     64      $_POST['login_history'] = empty($_POST['login_history'])?'false':'true';
    7765      break;
    7866    }
     
    120108  if (count($page['errors']) == 0)
    121109  {
    122 //    echo '<pre>'; print_r($_POST); echo '</pre>';
     110    //echo '<pre>'; print_r($_POST); echo '</pre>';
    123111    $result = pwg_query('SELECT * FROM '.CONFIG_TABLE);
    124112    while ($row = mysql_fetch_array($result))
     
    148136}
    149137
     138//------------------------------------------------------ $conf reinitialization
     139$result = pwg_query('SELECT param,value FROM '.CONFIG_TABLE);
     140while ($row = mysql_fetch_array($result))
     141{
     142  $conf[$row['param']] = $row['value'];
     143}
     144
    150145//----------------------------------------------------- template initialization
    151146$template->set_filenames( array('config'=>'admin/configuration.tpl') );
     
    172167    $html_check='checked="checked"';
    173168
    174     $history_yes = ($conf['log']=='true')?'checked="checked"':'';
    175     $history_no  = ($conf['log']=='false')?'checked="checked"':'';
    176169    $lock_yes = ($conf['gallery_locked']=='true')?'checked="checked"':'';
    177170    $lock_no = ($conf['gallery_locked']=='false')?'checked="checked"':'';
     171    $history_users = ($conf['log']=='true')?$html_check:'';
     172    $history_admin = ($conf['history_admin']=='true')?$html_check:'';
     173    $history_guest = ($conf['history_guest']=='true')?$html_check:'';
     174    $login_history = ($conf['login_history']=='true')?$html_check:'';
    178175
    179176    $template->assign_block_vars(
    180177      'general',
    181178      array(
    182         'HISTORY_YES'=>$history_yes,
    183         'HISTORY_NO'=>$history_no,
     179        'HISTORY_USERS'=>$history_users,
     180        'HISTORY_ADMIN'=>$history_admin,
     181        'HISTORY_GUEST'=>$history_guest,
     182        'LOGIN_HISTORY'=>$login_history,
    184183        'GALLERY_LOCKED_YES'=>$lock_yes,
    185184        'GALLERY_LOCKED_NO'=>$lock_no,
Note: See TracChangeset for help on using the changeset viewer.