diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..de0222a --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +config.inc.php +css/override.css \ No newline at end of file diff --git a/admin/header.php b/admin/header.php index 2b19577..8bb8074 100644 --- a/admin/header.php +++ b/admin/header.php @@ -3,6 +3,8 @@ echo "\n"; echo "\n"; +if(file_exists(__DIR__ . '/../css/override.css') ) + echo "\n"; echo "\n"; echo "\n"; diff --git a/admin/header_colorpick.php b/admin/header_colorpick.php index 5ffda2e..3821bbc 100644 --- a/admin/header_colorpick.php +++ b/admin/header_colorpick.php @@ -3,6 +3,8 @@ echo "\n"; echo "\n"; +if(file_exists(__DIR__ . '/../css/override.css') ) + echo "\n"; echo "\n"; echo "\n"; echo "\n"; diff --git a/admin/header_date.php b/admin/header_date.php index 8234e3c..6b12d21 100644 --- a/admin/header_date.php +++ b/admin/header_date.php @@ -3,6 +3,8 @@ echo "\n"; echo "\n"; +if(file_exists(__DIR__ . '/../css/override.css') ) + echo "\n"; echo "\n"; echo "\n"; echo "\n"; diff --git a/admin/header_get.php b/admin/header_get.php index 48c27f8..cdce0c0 100644 --- a/admin/header_get.php +++ b/admin/header_get.php @@ -3,6 +3,8 @@ echo "\n"; echo "\n"; +if(file_exists(__DIR__ . '/../css/override.css') ) + echo "\n"; echo "\n"; echo "\n"; echo "\n"; diff --git a/admin/header_get_sysedit.php b/admin/header_get_sysedit.php index 0fc9280..123535d 100644 --- a/admin/header_get_sysedit.php +++ b/admin/header_get_sysedit.php @@ -3,6 +3,8 @@ echo "\n"; echo "\n"; +if(file_exists(__DIR__ . '/../css/override.css') ) + echo "\n"; echo "\n"; echo "\n"; echo "\n"; diff --git a/admin/header_post.php b/admin/header_post.php index 416df1b..3263b99 100644 --- a/admin/header_post.php +++ b/admin/header_post.php @@ -3,6 +3,8 @@ echo "\n"; echo "\n"; +if(file_exists(__DIR__ . '/../css/override.css') ) + echo "\n"; echo "\n"; echo "\n"; echo "\n"; diff --git a/admin/header_post_sysedit.php b/admin/header_post_sysedit.php index af69404..498d213 100644 --- a/admin/header_post_sysedit.php +++ b/admin/header_post_sysedit.php @@ -3,6 +3,8 @@ echo "\n"; echo "\n"; +if(file_exists(__DIR__ . '/../css/override.css') ) + echo "\n"; echo "\n"; echo "\n"; echo "\n"; diff --git a/admin/timeadd.php b/admin/timeadd.php index 5077747..36cc079 100644 --- a/admin/timeadd.php +++ b/admin/timeadd.php @@ -656,17 +656,6 @@ $user = ""; } - // configure current time to insert for audit log - - $time = time(); - $time_hour = gmdate('H', $time); - $time_min = gmdate('i', $time); - $time_sec = gmdate('s', $time); - $time_month = gmdate('m', $time); - $time_day = gmdate('d', $time); - $time_year = gmdate('Y', $time); - $time_tz_stamp = mktime($time_hour, $time_min, $time_sec, $time_month, $time_day, $time_year); - // this needs to be changed later $post_why = ""; @@ -680,11 +669,11 @@ if (strtolower($ip_logging) == "yes") { $query2 = "insert into " . $db_prefix . "audit (modified_by_ip, modified_by_user, modified_when, modified_from, modified_to, modified_why, user_modified) values - ('" . $connecting_ip . "', '" . $user . "', '" . $time_tz_stamp . "', '0', '" . $timestamp . "', '" . $post_why . "', '" . $post_username . "')"; + ('" . $connecting_ip . "', '" . $user . "', UNIX_TIMESTAMP(), '0', '" . $timestamp . "', '" . $post_why . "', '" . $post_username . "')"; $result2 = mysql_query($query2); } else { $query2 = "insert into " . $db_prefix . "audit (modified_by_user, modified_when, modified_from, modified_to, modified_why, user_modified) values - ('" . $user . "', '" . $time_tz_stamp . "', '0', '" . $timestamp . "', '" . $post_why . "', '" . $post_username . "')"; + ('" . $user . "', UNIX_TIMESTAMP(), '0', '" . $timestamp . "', '" . $post_why . "', '" . $post_username . "')"; $result2 = mysql_query($query2); } diff --git a/admin/timedelete.php b/admin/timedelete.php index c0b1d78..4dc0850 100644 --- a/admin/timedelete.php +++ b/admin/timedelete.php @@ -182,7 +182,7 @@ $tmp_get_user = "" . $row['empfullname'] . ""; } if (!isset($tmp_get_user)) { - echo "Something is fishy here.\n"; + echo "Error: User not found.\n"; exit; } } @@ -194,7 +194,7 @@ $tmp_username = "" . $row['empfullname'] . ""; } if (!isset($tmp_username)) { - echo "Something is fishy here.\n"; + echo "Error: User not found.\n"; exit; } } @@ -206,7 +206,7 @@ $tmp_post_displayname = "" . $row['displayname'] . ""; } if (!isset($tmp_post_displayname)) { - echo "Something is fishy here.\n"; + echo "Error: User and display name not found.\n"; exit; } } @@ -278,22 +278,30 @@ // begin post validation // - if (empty($post_date)) { + if (empty($post_date)) + { $evil_post = '1'; echo " \n"; echo " \n"; echo " \n"; echo "
A valid Date is required.
\n"; - } elseif (preg_match('/' . "^([0-9]{1,2})[-,/,.]([0-9]{1,2})[-,/,.](([0-9]{2})|([0-9]{4}))$" . '/i', $post_date, $date_regs)) { - if ($calendar_style == "amer") { - if (isset($date_regs)) { - $month = $date_regs[1]; - $day = $date_regs[2]; - $year = $date_regs[3]; - } - if ($month > 12 || $day > 31) { + } + + else + { + $date_regs = explode('/', $post_date); + + if ($calendar_style == "amer") + { + $month = $date_regs[0]; + $day = $date_regs[1]; + $year = $date_regs[2]; + + if ($month > 12 || $day > 31) + { $evil_post = '1'; + if (!isset($evil_post)) { echo " \n"; echo " \n"; @@ -302,15 +310,20 @@ echo "
\n"; } } - } elseif ($calendar_style == "euro") { - if (isset($date_regs)) { - $month = $date_regs[2]; - $day = $date_regs[1]; - $year = $date_regs[3]; - } - if ($month > 12 || $day > 31) { + } + + elseif ($calendar_style == "euro") + { + $month = $date_regs[1]; + $day = $date_regs[0]; + $year = $date_regs[2]; + + if ($month > 12 || $day > 31) + { $evil_post = '1'; - if (!isset($evil_post)) { + + if (!isset($evil_post)) + { echo " \n"; echo " \n"; echo "
@@ -390,85 +403,29 @@ // determine who the authenticated user is for audit log - if (isset($_SESSION['valid_user'])) { + if (isset($_SESSION['valid_user'])) + { $user = $_SESSION['valid_user']; - } elseif (isset($_SESSION['time_admin_valid_user'])) { - $user = $_SESSION['time_admin_valid_user']; - } else { - $user = ""; } - // configure current time to insert for audit log + elseif (isset($_SESSION['time_admin_valid_user'])) + { + $user = $_SESSION['time_admin_valid_user']; + } - $time = time(); - $time_hour = gmdate('H', $time); - $time_min = gmdate('i', $time); - $time_sec = gmdate('s', $time); - $time_month = gmdate('m', $time); - $time_day = gmdate('d', $time); - $time_year = gmdate('Y', $time); - $time_tz_stamp = mktime($time_hour, $time_min, $time_sec, $time_month, $time_day, $time_year); + else { + $user = ""; + } // this needs to be changed later $post_why = ""; for ($x = 0; $x < $final_num_rows; $x++) { - // begin post validation // - - $final_username[$x] = stripslashes($final_username[$x]); - $tmp_username = stripslashes($tmp_username); - - $final_username[$x] = stripslashes($final_username[$x]); - if ($final_username[$x] != $tmp_username) { - echo "Something is fishy here.\n"; - exit; - } - //if ((strlen($final_mysql_timestamp[$x]) != "10") || (!is_integer($final_mysql_timestamp[$x]))) {echo "Something is fishy here.\n"; exit;} - - $query_sel = "select * from " . $db_prefix . "punchlist where punchitems = '" . $final_inout[$x] . "'"; - $result_sel = mysql_query($query_sel); - - while ($row = mysql_fetch_array($result_sel)) { - $punchitems = "" . $row['punchitems'] . ""; - } - mysql_free_result($result_sel); - if (!isset($punchitems)) { - echo "Something is fishy here.\n"; - exit; - } - - $final_notes[$x] = ereg_replace("[^[:alnum:] \,\.\?-]", "", $final_notes[$x]); - $final_username[$x] = addslashes($final_username[$x]); - - $query5 = "select * from " . $db_prefix . "info where (fullname = '" . $final_username[$x] . "') and (timestamp = '" . $final_mysql_timestamp[$x] . "') and - (`inout` = '" . $final_inout[$x] . "') and (notes = '" . $final_notes[$x] . "')"; - $result5 = mysql_query($query5); - @$tmp_num_rows = mysql_num_rows($result5); - - if ((isset($tmp_num_rows)) && (@$tmp_num_rows != '1')) { - echo "Something is fishy here.\n"; - exit; - } - - // end post validation // - $row_color = ($row_count % 2) ? $color1 : $color2; if (@$delete_time_checkbox[$x] == '1') { - // begin post validation // - - $tmp_time[$x] = date("$timefmt", $final_mysql_timestamp[$x] + $tzo); - if ($tmp_time[$x] != $final_time[$x]) { - echo "Something is fishy here.\n"; - exit; - } - - // end post validation // - - //if (!get_magic_quotes_gpc()) {$final_username[$x] = addslashes($final_username[$x]);} - $query = "select * from " . $db_prefix . "employees where empfullname = '" . $final_username[$x] . "'"; $result = mysql_query($query); @@ -504,11 +461,11 @@ if (strtolower($ip_logging) == "yes") { $query6 = "insert into " . $db_prefix . "audit (modified_by_ip, modified_by_user, modified_when, modified_from, modified_to, modified_why, user_modified) values - ('" . $connecting_ip . "', '" . $user . "', '" . $time_tz_stamp . "', '" . $final_mysql_timestamp[$x] . "', '0', '" . $post_why . "', '" . $final_username[$x] . "')"; + ('" . $connecting_ip . "', '" . $user . "', UNIX_TIMESTAMP(), '" . $final_mysql_timestamp[$x] . "', '0', '" . $post_why . "', '" . $final_username[$x] . "')"; $result6 = mysql_query($query6); } else { $query6 = "insert into " . $db_prefix . "audit (modified_by_user, modified_when, modified_from, modified_to, modified_why, user_modified) values - ('" . $user . "', '" . $time_tz_stamp . "', '" . $final_mysql_timestamp[$x] . "', '0', '" . $post_why . "', '" . $final_username[$x] . "')"; + ('" . $user . "', UNIX_TIMESTAMP(), '" . $final_mysql_timestamp[$x] . "', '0', '" . $post_why . "', '" . $final_username[$x] . "')"; $result6 = mysql_query($query6); } @@ -534,17 +491,17 @@ // begin post validation // if ($_POST['tmp_var'] != '1') { - echo "Something is fishy here.\n"; + echo "Something is fishy here E.\n"; exit; } $tmp_calc = intval($calc); $tmp_timestamp = intval($timestamp); if ((strlen($tmp_calc) != "10") || (!is_integer($tmp_calc))) { - echo "Something is fishy here.\n"; + echo "Something is fishy here F.\n"; exit; } if ((strlen($tmp_timestamp) != "10") || (!is_integer($tmp_timestamp))) { - echo "Something is fishy here.\n"; + echo "Something is fishy here G.\n"; exit; } @@ -635,18 +592,9 @@ } else { - // configure timestamp to insert/update // - - if ($calendar_style == "euro") { - // $post_date = "$day/$month/$year"; - @$post_date = "$month/$day/$year"; - } elseif ($calendar_style == "amer") { - @$post_date = "$month/$day/$year"; - } - + $post_date = "$month/$day/$year"; $row_count = '0'; - $timestamp = strtotime($post_date) - @$tzo; - //$calc = $timestamp + 86400 - @$tzo; + $timestamp = strtotime($post_date); $calc = $timestamp + 86400; $post_username = stripslashes($post_username); $post_displayname = stripslashes($post_displayname); diff --git a/admin/timeedit.php b/admin/timeedit.php index b10f39e..5ed8bc7 100644 --- a/admin/timeedit.php +++ b/admin/timeedit.php @@ -587,17 +587,6 @@ $user = ""; } - // configure current time to insert for audit log - - $time = time(); - $time_hour = gmdate('H', $time); - $time_min = gmdate('i', $time); - $time_sec = gmdate('s', $time); - $time_month = gmdate('m', $time); - $time_day = gmdate('d', $time); - $time_year = gmdate('Y', $time); - $time_tz_stamp = mktime($time_hour, $time_min, $time_sec, $time_month, $time_day, $time_year); - // this needs to be changed later $post_why = ""; @@ -654,12 +643,12 @@ if (strtolower($ip_logging) == "yes") { $query4 = "insert into " . $db_prefix . "audit (modified_by_ip, modified_by_user, modified_when, modified_from, modified_to, modified_why, user_modified) values - ('" . $connecting_ip . "', '" . $user . "', '" . $time_tz_stamp . "', '" . $final_mysql_timestamp[$x] . "', '" . $new_tstamp[$x] . "', '" . $post_why . "', + ('" . $connecting_ip . "', '" . $user . "', UNIX_TIMESTAMP(), '" . $final_mysql_timestamp[$x] . "', '" . $new_tstamp[$x] . "', '" . $post_why . "', '" . $final_username[$x] . "')"; $result4 = mysql_query($query4); } else { $query4 = "insert into " . $db_prefix . "audit (modified_by_user, modified_when, modified_from, modified_to, modified_why, user_modified) values - ('" . $user . "', '" . $time_tz_stamp . "', '" . $final_mysql_timestamp[$x] . "', '" . $new_tstamp[$x] . "', '" . $post_why . "', '" . $final_username[$x] . "')"; + ('" . $user . "', UNIX_TIMESTAMP(), '" . $final_mysql_timestamp[$x] . "', '" . $new_tstamp[$x] . "', '" . $post_why . "', '" . $final_username[$x] . "')"; $result4 = mysql_query($query4); } diff --git a/config.inc.php b/config.example.inc.php similarity index 99% rename from config.inc.php rename to config.example.inc.php index bd0d2a1..a649205 100644 --- a/config.inc.php +++ b/config.example.inc.php @@ -325,7 +325,7 @@ $use_server_tz = "no"; -/* If you are using PHP 5.1+ and do not have access to chance your php.ini config file then +/* If you are using PHP 5.1+ and do not have access to change your php.ini config file then uncomment the following line and change it to the correct time zone. */ //date_default_timezone_set("America/St_Johns"); diff --git a/header.php b/header.php index c3692aa..fa52a34 100644 --- a/header.php +++ b/header.php @@ -69,6 +69,8 @@ echo "\n"; echo "\n"; +if(file_exists(__DIR__ . '/css/override.css') ) + echo "\n"; // set refresh rate for each page // diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..0b81861 --- /dev/null +++ b/install.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +cd `dirname "$0"` + +cp config.example.inc.php config.inc.php \ No newline at end of file diff --git a/leftmain.php b/leftmain.php index 5b6f994..2230711 100644 --- a/leftmain.php +++ b/leftmain.php @@ -469,17 +469,6 @@ class=misc_items style='padding-left:0px;padding-right:0px;' tabindex=5>\n"; @@ -539,15 +528,15 @@ class=misc_items style='padding-left:0px;padding-right:0px;' tabindex=5>\n"; diff --git a/reports/header_get_reports.php b/reports/header_get_reports.php index be02c7c..82d67f2 100644 --- a/reports/header_get_reports.php +++ b/reports/header_get_reports.php @@ -3,6 +3,8 @@ echo "\n"; echo "\n"; +if(file_exists(__DIR__ . '/../css/override.css') ) + echo "\n"; echo "\n"; echo "\n"; echo "\n"; diff --git a/reports/header_post_reports.php b/reports/header_post_reports.php index 7e1fe31..abecd8e 100644 --- a/reports/header_post_reports.php +++ b/reports/header_post_reports.php @@ -3,6 +3,8 @@ echo "\n"; echo "\n"; +if(file_exists(__DIR__ . '/../css/override.css') ) + echo "\n"; echo "\n"; echo "\n"; echo "\n";