C:\$Recycle.Bin\S-1-5-21-3967099092-2644009230-141905953-500\$R30CG93\tcpro\loglevel.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<?php
/**
 * loglevel.php
 * 
 * Displays and runs the log level page
 * 
 * @package TeamCalPro
 * @version 3.3.001 
 * @author George Lewe
 * @copyright Copyright (c) 2004-2010 by George Lewe
 * @link http://www.lewe.com
 * @license http://www.lewe.com/tcpro/doc/license.txt Extended GNU Public License
 */

//echo "<script type=\"text/javascript\">alert(\"Debug: \");</script>";

/**
 * Set parent flag to control access to child scripts 
 */
define'_VALID_TCPRO');

/**
 * Includes 
 */
require ("config.tcpro.php");
require_once (
"includes/functions.tcpro.php");
getOptions();
if (
strlen($CONF['options']['lang'])) require ("includes/lang/" $CONF['options']['lang'] . ".tcpro.php");
else                                  require (
"includes/lang/english.tcpro.php");

require_once(
"includes/tcconfig.class.php");
require_once(
"includes/tclogin.class.php" );
require_once(
"includes/tclog.class.php" );
require_once(
"includes/tcuser.class.php" );
require_once(
"includes/tcusergroup.class.php" );
require_once(
"includes/tcuseroption.class.php" );

$C = new tcConfig;
$L  = new tcLogin
$LOG = new tcLog
$U  = new tcUser;
$UG = new tcUserGroup;
$UO = new tcUserOption;

$error false;

$monthnames $CONF['monthnames'];
$today getdate();
$curryear $today['year']; // numeric value, 4 digits
$currmonth $today['mon']; // numeric value

/**
 * Check if allowed 
 */
if (!checkAuth("admin")) {
   
// Not authorized. Get outta here
   
jsReload("index.php");
}

/**
 * Set Loglevel 
 */
if ( isset($_POST['btn_loglevel_set']) ) {
   
   if ( 
$_POST['chkLogAbsence'] ) $C->saveConfig("logAbsence","1"); else $C->saveConfig("logAbsence","0");
   if ( 
$_POST['chkLogAnnouncement'] ) $C->saveConfig("logAnnouncement","1"); else $C->saveConfig("logAnnouncement","0");
   if ( 
$_POST['chkLogConfig'] ) $C->saveConfig("logConfig","1");  else $C->saveConfig("logConfig","0");
   if ( 
$_POST['chkLogDatabase'] ) $C->saveConfig("logDatabase","1"); else $C->saveConfig("logDatabase","0");
   if ( 
$_POST['chkLogDaynote'] ) $C->saveConfig("logDaynote","1"); else $C->saveConfig("logDaynote","0");
   if ( 
$_POST['chkLogGroup'] ) $C->saveConfig("logGroup","1"); else $C->saveConfig("logGroup","0");
   if ( 
$_POST['chkLogHoliday'] ) $C->saveConfig("logHoliday","1"); else $C->saveConfig("logHoliday","0");
   if ( 
$_POST['chkLogLogin'] ) $C->saveConfig("logLogin","1"); else $C->saveConfig("logLogin","0");
   if ( 
$_POST['chkLogLoglevel'] ) $C->saveConfig("logLoglevel","1"); else $C->saveConfig("logLoglevel","0");
   if ( 
$_POST['chkLogMonth'] ) $C->saveConfig("logMonth","1"); else $C->saveConfig("logMonth","0");
   if ( 
$_POST['chkLogHoliday'] ) $C->saveConfig("logHoliday","1"); else $C->saveConfig("logHoliday","0");
   if ( 
$_POST['chkLogUser'] ) $C->saveConfig("logUser","1"); else $C->saveConfig("logUser","0");
   if ( 
$_POST['chkLogRegion'] ) $C->saveConfig("logRegion","1"); else $C->saveConfig("logRegion","0");
   if ( 
$_POST['chkLogRegistration'] ) $C->saveConfig("logRegistration","1"); else $C->saveConfig("logRegistration","0");
   
/**
    * Log this event
    */
   
$LOG->log("logLoglevel",$L->checkLogin(),"Loglevel options updated");

/**
 * Declination Management 
 */
}

/**
 * Show HTML header
 * Use this file to adjust your meta tags and such
 */
require("includes/header.html.inc.php");

echo 
"<body>\r\n";
echo 
"<div id=\"overDiv\" style=\"position:absolute; visibility:hidden; z-index:1000;\"></div>\r\n";

/**
 * Show application header
 * This is the file to change in order to put different images at the top
 * of the main page.
 */
require("includes/header.application.inc.php");

/**
 * Show menu header
 * This is the file containing the TeamCal menu
 */
require("includes/menu.inc.php");

/**
 * Show error message
 * If any error occurred so far, show it now.
 */
if ($error)
   echo (
"<script type=\"text/javascript\">alert(\"" $errmsg "\")</script>");
?>
   <table width="100%">
      <tr>
         <td valign="top">
            <form class="form" name="form-loglevel" method="POST" action="<?=$_SERVER['PHP_SELF']."?lang=".$CONF['options']['lang']?>">
            
            <!--  LOGLEVEL ==================================================== -->
            <table class="dlg" cellpadding="0" cellspacing="0">
               <tr>
                  <td class="dlg-header" colspan="4">
                     <?php printDialogTop($LANG['admin_loglevel_title'],"manage_system_log.html","ico_log.png"); ?>
                  </td>
               </tr>
            </table>
            <table class="dlg" cellpadding="0" cellspacing="0">
               <tr>
                  <td class="dlg-caption" colspan="4"><?=$LANG['admin_loglevel']?></td>
               </tr>
               <tr>
                  <td class="dlg-help" colspan="4">
                     <table>
                        <tr>
                           <td><input name="chkLogAbsence" id="chkLogAbsence" type="checkbox" value="chkLogAbsence" <?=(($C->readConfig("logAbsence"))?"CHECKED":"")?>></td>
                           <td style="padding-right: 20px;"><?=$LANG['admin_loglevel_absence']?></td>
                           <td><input name="chkLogAnnouncement" id="chkLogAnnouncement" type="checkbox" value="chkLogAnnouncement" <?=(($C->readConfig("logAnnouncement"))?"CHECKED":"")?>></td>
                           <td><?=$LANG['admin_loglevel_announcement']?></td>
                        </tr>
                        <tr>
                           <td><input name="chkLogConfig" id="chkLogConfig" type="checkbox" value="chkLogConfig" <?=(($C->readConfig("logConfig"))?"CHECKED":"")?>></td>
                           <td><?=$LANG['admin_loglevel_config']?></td>
                           <td><input name="chkLogDatabase" id="chkLogDatabase" type="checkbox" value="chkLogDatabase" <?=(($C->readConfig("logDatabase"))?"CHECKED":"")?>></td>
                           <td><?=$LANG['admin_loglevel_database']?></td>
                        </tr>
                        <tr>
                           <td><input name="chkLogDaynote" id="chkLogDaynote" type="checkbox" value="chkLogDaynote" <?=(($C->readConfig("logDaynote"))?"CHECKED":"")?>></td>
                           <td><?=$LANG['admin_loglevel_daynote']?></td>
                           <td><input name="chkLogGroup" id="chkLogGroup" type="checkbox" value="chkLogGroup" <?=(($C->readConfig("logGroup"))?"CHECKED":"")?>></td>
                           <td><?=$LANG['admin_loglevel_group']?></td>
                        </tr>
                        <tr>
                           <td><input name="chkLogHoliday" id="chkLogHoliday" type="checkbox" value="chkLogHoliday" <?=(($C->readConfig("logHoliday"))?"CHECKED":"")?>></td>
                           <td><?=$LANG['admin_loglevel_holiday']?></td>
                           <td><input name="chkLogLogin" id="chkLogLogin" type="checkbox" value="chkLogLogin" <?=(($C->readConfig("logLogin"))?"CHECKED":"")?>></td>
                           <td><?=$LANG['admin_loglevel_login']?></td>
                        </tr>
                        <tr>
                           <td><input name="chkLogLoglevel" id="chkLogLoglevel" type="checkbox" value="chkLogLoglevel" <?=(($C->readConfig("logLoglevel"))?"CHECKED":"")?>></td>
                           <td><?=$LANG['admin_loglevel_loglevel']?></td>
                           <td><input name="chkLogMonth" id="chkLogMonth" type="checkbox" value="chkLogMonth" <?=(($C->readConfig("logMonth"))?"CHECKED":"")?>></td>
                           <td><?=$LANG['admin_loglevel_month']?></td>
                        </tr>
                        <tr>
                           <td><input name="chkLogUser" id="chkLogUser" type="checkbox" value="chkLogUser" <?=(($C->readConfig("logUser"))?"CHECKED":"")?>></td>
                           <td><?=$LANG['admin_loglevel_user']?></td>
                           <td><input name="chkLogRegion" id="chkLogRegion" type="checkbox" value="chkLogRegion" <?=(($C->readConfig("logRegion"))?"CHECKED":"")?>></td>
                           <td><?=$LANG['admin_loglevel_region']?></td>
                        </tr>
                        <tr>
                           <td><input name="chkLogRegistration" id="chkLogRegistration" type="checkbox" value="chkLogRegistration" <?=(($C->readConfig("logRegistration"))?"CHECKED":"")?>></td>
                           <td><?=$LANG['admin_loglevel_registration']?></td>
                           <td>&nbsp;</td>
                           <td>&nbsp;</td>
                        </tr>
                     </table>
                  </td>
               </tr>
               <tr>
                  <td class="dlg-menu" colspan="4" style="text-align: left; width: 100%;">
                     &nbsp;<input name="btn_loglevel_set" type="submit" class="button" value="<?=$LANG['btn_update']?>" onmouseover="this.className='button-over';" onmouseout="this.className='button';">
                  </td>
               </tr>
            </table>
            </form>
            <br>
         </td>
      </tr>
   </table>
    
<?php
require("includes/footer.html.inc.php");
?>