Changeset 1011
- Timestamp:
- 02/19/08 22:56:29
(8 months ago)
- Author:
- rats
- Message:
* Fixed #816: [fedora anymaybe others] fastcgi_ispcp.conf not copied causes ispcp-setup to stop
* Updated Makefiles
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r1009 |
r1011 |
|
| 24 | 24 | rm -rf ${INST_PREF} |
|---|
| 25 | 25 | |
|---|
| 26 | | |
|---|
| 27 | 26 | uninstall: |
|---|
| 28 | 27 | cd ./tools && $(MAKE) uninstall |
|---|
| … | … | |
| 39 | 38 | rm -rf $(SYSTEM_APACHE_BACK_LOG) |
|---|
| 40 | 39 | rm -rf ./*~ |
|---|
| | 40 | |
|---|
| | 41 | clean: |
|---|
| | 42 | |
|---|
| | 43 | cd ./tools/daemon && $(MAKE) clean |
|---|
| r1010 |
r1011 |
|
| 1 | 1 | ispCP ω 1.0.0 Changelog |
|---|
| 2 | 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| | 3 | |
|---|
| | 4 | 2008-02-19 Benedikt Heintel |
|---|
| | 5 | - DISTS: |
|---|
| | 6 | * Fixed #816: [fedora anymaybe others] fastcgi_ispcp.conf not copied causes ispcp-setup to stop |
|---|
| | 7 | * Updated Makefiles |
|---|
| 3 | 8 | |
|---|
| 4 | 9 | 2008-02-19 Christian Hernmarck |
|---|
| r967 |
r1011 |
|
| 45 | 45 | $(SYSTEM_MAKE_DIRS) $(SYSTEM_MAIL_VIRTUAL) |
|---|
| 46 | 46 | $(SYSTEM_MAKE_DIRS) $(SYSTEM_APACHE_BACK_LOG) |
|---|
| 47 | | $(SYSTEM_MAKE_DIRS) $(ROOT_APACHE_CONF)/ispcp |
|---|
| | 47 | $(SYSTEM_MAKE_DIRS) $(ROOT_APACHE_CONF)/ispcp |
|---|
| 48 | 48 | |
|---|
| 49 | 49 | cd ./configs && $(MAKE) install & |
|---|
| … | … | |
| 70 | 70 | #rm -rf ./*~ |
|---|
| 71 | 71 | |
|---|
| 72 | | .PHONY: install uninstall |
|---|
| | 72 | clean: |
|---|
| | 73 | |
|---|
| | 74 | cd ./tools/daemon && $(MAKE) clean |
|---|
| | 75 | |
|---|
| | 76 | .PHONY: install uninstall clean |
|---|
| r995 |
r1011 |
|
| 65 | 65 | rm -rf ./*~ |
|---|
| 66 | 66 | |
|---|
| | 67 | clean: |
|---|
| | 68 | |
|---|
| | 69 | cd ./tools/daemon && $(MAKE) clean |
|---|
| | 70 | |
|---|
| 67 | 71 | .PHONY: install uninstall |
|---|
| r1009 |
r1011 |
|
| 16 | 16 | SYSTEM_MAKE_DIRS=/bin/mkdir -p |
|---|
| 17 | 17 | |
|---|
| 18 | | .PHONY: install uninstall |
|---|
| | 18 | .PHONY: install uninstall clean |
|---|
| r969 |
r1011 |
|
| 65 | 65 | rm -rf ./*~ |
|---|
| 66 | 66 | |
|---|
| 67 | | .PHONY: install uninstall |
|---|
| | 67 | clean: |
|---|
| | 68 | |
|---|
| | 69 | cd ./tools/daemon && $(MAKE) clean |
|---|
| | 70 | |
|---|
| | 71 | .PHONY: install uninstall clean |
|---|
| r969 |
r1011 |
|
| 73 | 73 | rm -rf ./*~ |
|---|
| 74 | 74 | |
|---|
| 75 | | .PHONY: install uninstall |
|---|
| | 75 | clean: |
|---|
| | 76 | |
|---|
| | 77 | cd ./tools/daemon && $(MAKE) clean |
|---|
| | 78 | |
|---|
| | 79 | .PHONY: install uninstall clean |
|---|
| r658 |
r1011 |
|
| 26 | 26 | SYSTEM_MAKE_DIRS=/bin/mkdir -p |
|---|
| 27 | 27 | |
|---|
| 28 | | .PHONY: install uninstall |
|---|
| | 28 | .PHONY: install uninstall clean |
|---|
| r974 |
r1011 |
|
| 65 | 65 | rm -rf ./*~ |
|---|
| 66 | 66 | |
|---|
| 67 | | .PHONY: install uninstall |
|---|
| | 67 | clean: |
|---|
| | 68 | |
|---|
| | 69 | cd ./tools/daemon && $(MAKE) clean |
|---|
| | 70 | |
|---|
| | 71 | .PHONY: install uninstall clean |
|---|
| r969 |
r1011 |
|
| 65 | 65 | rm -rf ./*~ |
|---|
| 66 | 66 | |
|---|
| 67 | | .PHONY: install uninstall |
|---|
| | 67 | clean: |
|---|
| | 68 | |
|---|
| | 69 | cd ./tools/daemon && $(MAKE) clean |
|---|
| | 70 | |
|---|
| | 71 | .PHONY: install uninstall clean |
|---|
| r969 |
r1011 |
|
| 65 | 65 | rm -rf ./*~ |
|---|
| 66 | 66 | |
|---|
| 67 | | .PHONY: install uninstall |
|---|
| | 67 | clean: |
|---|
| | 68 | |
|---|
| | 69 | cd ./tools/daemon && $(MAKE) clean |
|---|
| | 70 | |
|---|
| | 71 | .PHONY: install uninstall clean |
|---|
| r969 |
r1011 |
|
| 21 | 21 | cp ./httpd.conf $(SYSTEM_CONF)/apache/parts/ispcp_base.tpl |
|---|
| 22 | 22 | |
|---|
| | 23 | cp ./fastcgi.conf $(SYSTEM_CONF)/apache/working/fastcgi_ispcp.conf |
|---|
| | 24 | cp ./fastcgi.conf $(SYSTEM_CONF)/apache/conf.d/fastcgi_ispcp.conf |
|---|
| | 25 | |
|---|
| 23 | 26 | uninstall: |
|---|
| 24 | 27 | |
|---|
| 25 | 28 | rm -rf $(SYSTEM_CONF)/apache |
|---|
| 26 | | rm -rf $(ROOT_APACHE_CONF)/ispcp.conf |
|---|
| 27 | | rm -rf ${ROOT_APACHE_CONF}/conf.d/fastcgi_ispcp.conf |
|---|
| | 29 | rm -rf $(APACHE_SITES_DIR)/ispcp.conf |
|---|
| | 30 | rm -rf $(APACHE_SITES_DIR)/00_master.conf |
|---|
| | 31 | rm -rf $(APACHE_SITES_DIR)/01_awstats.conf |
|---|
| | 32 | rm -rf $(APACHE_MODS_DIR)/fastcgi_ispcp.conf |
|---|
| r1007 |
r1011 |
|
| 23 | 23 | cp ./httpd.conf $(SYSTEM_CONF)/apache/parts/ispcp_base.tpl |
|---|
| 24 | 24 | |
|---|
| 25 | | cp ./httpd.conf ./parts/ispcp_base.tpl |
|---|
| | 25 | cp ./httpd.conf ./parts/ispcp_base.tpl |
|---|
| 26 | 26 | |
|---|
| 27 | 27 | # Ubuntu 7.04? |
|---|
| r789 |
r1011 |
|
| 4 | 4 | * |
|---|
| 5 | 5 | * @copyright 2001-2006 by moleSoftware GmbH |
|---|
| 6 | | * @copyright 2006-2007 by ispCP | http://isp-control.net |
|---|
| | 6 | * @copyright 2006-2008 by ispCP | http://isp-control.net |
|---|
| 7 | 7 | * @version SVN: $ID$ |
|---|
| 8 | 8 | * @link http://isp-control.net |
|---|
| 9 | | * @author ispCP Team (2007) |
|---|
| | 9 | * @author ispCP Team |
|---|
| 10 | 10 | * |
|---|
| 11 | 11 | * @license |
|---|
| … | … | |
| 19 | 19 | */ |
|---|
| 20 | 20 | |
|---|
| 21 | | |
|---|
| 22 | 21 | require '../include/ispcp-lib.php'; |
|---|
| 23 | 22 | |
|---|
| … | … | |
| 25 | 24 | |
|---|
| 26 | 25 | $tpl = new pTemplate(); |
|---|
| 27 | | $tpl->define_dynamic('page', $cfg['ADMIN_TEMPLATE_PATH'].'/admin_log.tpl'); |
|---|
| | 26 | $tpl->define_dynamic('page', $cfg['ADMIN_TEMPLATE_PATH'] . '/admin_log.tpl'); |
|---|
| 28 | 27 | $tpl->define_dynamic('page_message', 'page'); |
|---|
| 29 | 28 | $tpl->define_dynamic('log_row', 'page'); |
|---|
| … | … | |
| 38 | 37 | |
|---|
| 39 | 38 | $tpl->assign( |
|---|
| 40 | | array( |
|---|
| 41 | | 'TR_ADMIN_ADMIN_LOG_PAGE_TITLE' => tr('ispCP - Admin/Admin Log'), |
|---|
| 42 | | 'THEME_COLOR_PATH' => "../themes/$theme_color", |
|---|
| 43 | | 'THEME_CHARSET' => tr('encoding'), |
|---|
| 44 | | 'ISP_LOGO' => get_logo($_SESSION['user_id']), |
|---|
| 45 | | 'ISPCP_LICENSE' => $cfg['ISPCP_LICENSE'] |
|---|
| 46 | | ) |
|---|
| 47 | | ); |
|---|
| 48 | | |
|---|
| 49 | | |
|---|
| | 39 | array( |
|---|
| | 40 | 'TR_ADMIN_ADMIN_LOG_PAGE_TITLE' => tr('ispCP - Admin/Admin Log'), |
|---|
| | 41 | 'THEME_COLOR_PATH' => "../themes/$theme_color", |
|---|
| | 42 | 'THEME_CHARSET' => tr('encoding'), |
|---|
| | 43 | 'ISP_LOGO' => get_logo($_SESSION['user_id']), |
|---|
| | 44 | 'ISPCP_LICENSE' => $cfg['ISPCP_LICENSE'] |
|---|
| | 45 | ) |
|---|
| | 46 | ); |
|---|
| 50 | 47 | |
|---|
| 51 | 48 | function generate_page (&$tpl) { |
|---|
| 52 | | |
|---|
| 53 | | global $sql,$cfg; |
|---|
| | 49 | global $sql, $cfg; |
|---|
| 54 | 50 | |
|---|
| 55 | 51 | $start_index = 0; |
|---|
| … | … | |
| 59 | 55 | $start_index = intval($_GET['psi']); |
|---|
| 60 | 56 | |
|---|
| 61 | | |
|---|
| 62 | | $count_query = <<<SQL_QUERY |
|---|
| | 57 | $count_query = <<<SQL_QUERY |
|---|
| 63 | 58 | SELECT |
|---|
| 64 | 59 | COUNT(log_id) AS cnt |
|---|
| … | … | |
| 67 | 62 | SQL_QUERY; |
|---|
| 68 | 63 | |
|---|
| 69 | | |
|---|
| 70 | | $query = <<<SQL_QUERY |
|---|
| | 64 | $query = <<<SQL_QUERY |
|---|
| 71 | 65 | SELECT |
|---|
| 72 | 66 | DATE_FORMAT(log_time,'%Y-%m-%d %H:%i') AS dat, log_message |
|---|
| … | … | |
| 79 | 73 | SQL_QUERY; |
|---|
| 80 | 74 | |
|---|
| 81 | | $rs = exec_query($sql, $count_query); |
|---|
| 82 | | |
|---|
| 83 | | $records_count = $rs -> fields['cnt']; |
|---|
| | 75 | $rs = exec_query($sql, $count_query); |
|---|
| | 76 | |
|---|
| | 77 | $records_count = $rs->fields['cnt']; |
|---|
| 84 | 78 | |
|---|
| 85 | 79 | $rs = exec_query($sql, $query, array($start_index, $rows_per_page)); |
|---|
| 86 | 80 | |
|---|
| 87 | | |
|---|
| 88 | | if ($rs->RowCount() == 0) { |
|---|
| 89 | | |
|---|
| 90 | | // set_page_message(tr('Log is empty!')); |
|---|
| 91 | | $tpl->assign( |
|---|
| 92 | | array( |
|---|
| 93 | | 'LOG_ROW' => '', |
|---|
| 94 | | 'PAG_MESSAGE' => tr('Log is empty!'), |
|---|
| 95 | | 'USERS_LIST' => '', |
|---|
| 96 | | 'SCROLL_PREV' => '', |
|---|
| 97 | | 'SCROLL_NEXT' => '', |
|---|
| 98 | | 'CLEAR_LOG' => '' |
|---|
| 99 | | ) |
|---|
| 100 | | ); |
|---|
| 101 | | } else { |
|---|
| 102 | | |
|---|
| | 81 | if ($rs->RowCount() == 0) { |
|---|
| | 82 | // set_page_message(tr('Log is empty!')); |
|---|
| | 83 | $tpl->assign( |
|---|
| | 84 | array( |
|---|
| | 85 | 'LOG_ROW' => '', |
|---|
| | 86 | 'PAG_MESSAGE' => tr('Log is empty!'), |
|---|
| | 87 | 'USERS_LIST' => '', |
|---|
| | 88 | 'SCROLL_PREV' => '', |
|---|
| | 89 | 'SCROLL_NEXT' => '', |
|---|
| | 90 | 'CLEAR_LOG' => '' |
|---|
| | 91 | ) |
|---|
| | 92 | ); |
|---|
| | 93 | } else { |
|---|
| 103 | 94 | $prev_si = $start_index - $rows_per_page; |
|---|
| 104 | 95 | |
|---|
| 105 | 96 | if ($start_index == 0) { |
|---|
| 106 | | |
|---|
| 107 | | $tpl->assign('SCROLL_PREV', ''); |
|---|
| 108 | | |
|---|
| | 97 | $tpl->assign('SCROLL_PREV', ''); |
|---|
| 109 | 98 | } else { |
|---|
| 110 | | |
|---|
| | 99 | $tpl->assign( |
|---|
| | 100 | array( |
|---|
| | 101 | 'SCROLL_PREV_GRAY' => '', |
|---|
| | 102 | 'PREV_PSI' => $prev_si |
|---|
| | 103 | ) |
|---|
| | 104 | ); |
|---|
| | 105 | } |
|---|
| | 106 | |
|---|
| | 107 | $next_si = $start_index + $rows_per_page; |
|---|
| | 108 | |
|---|
| | 109 | if ($next_si + 1 > $records_count) { |
|---|
| | 110 | $tpl->assign('SCROLL_NEXT', ''); |
|---|
| | 111 | } else { |
|---|
| | 112 | $tpl->assign( |
|---|
| | 113 | array( |
|---|
| | 114 | 'SCROLL_NEXT_GRAY' => '', |
|---|
| | 115 | 'NEXT_PSI' => $next_si |
|---|
| | 116 | ) |
|---|
| | 117 | ); |
|---|
| | 118 | } |
|---|
| | 119 | |
|---|
| | 120 | $tpl->assign( |
|---|
| | 121 | array( |
|---|
| | 122 | 'PAGE_MESSAGE' => '' |
|---|
| | 123 | ) |
|---|
| | 124 | ); |
|---|
| | 125 | |
|---|
| | 126 | $row = 1; |
|---|
| | 127 | |
|---|
| | 128 | while (!$rs->EOF) { |
|---|
| | 129 | if ($row++ % 2 == 0) { |
|---|
| 111 | 130 | $tpl->assign( |
|---|
| 112 | | array( |
|---|
| 113 | | 'SCROLL_PREV_GRAY' => '', |
|---|
| 114 | | 'PREV_PSI' => $prev_si |
|---|
| 115 | | ) |
|---|
| 116 | | ); |
|---|
| 117 | | |
|---|
| | 131 | array( |
|---|
| | 132 | 'ROW_CLASS' => 'content', |
|---|
| | 133 | ) |
|---|
| | 134 | ); |
|---|
| | 135 | } else { |
|---|
| | 136 | $tpl->assign( |
|---|
| | 137 | array( |
|---|
| | 138 | 'ROW_CLASS' => 'content2', |
|---|
| | 139 | ) |
|---|
| | 140 | ); |
|---|
| | 141 | } |
|---|
| | 142 | $log_message = $rs->fields['log_message']; |
|---|
| | 143 | $replaces = array( |
|---|
| | 144 | '/[^a-zA-Z](delete)[^a-zA-Z]/i' => ' <strong style="color:#FF0000">\\1</strong> ', |
|---|
| | 145 | '/[^a-zA-Z](add)[^a-zA-Z]/i' => ' <strong style="color:#33CC66">\\1</strong> ', |
|---|
| | 146 | '/[^a-zA-Z](change)[^a-zA-Z]/i' => ' <strong style="color:#3300FF">\\1</strong> ', |
|---|
| | 147 | '/[^a-zA-Z](edit)[^a-zA-Z]/i' => ' <strong style="color:#33CC66">\\1</strong> ', |
|---|
| | 148 | '/[^a-zA-Z](unknown)[^a-zA-Z]/i' => ' <strong style="color:#CC00FF">\\1</strong> ', |
|---|
| | 149 | '/[^a-zA-Z](logged)[^a-zA-Z]/i' => ' <strong style="color:#336600">\\1</strong> ', |
|---|
| | 150 | '/(bad password login data)/i' => ' <strong style="color:#FF0000">\\1</strong> ' |
|---|
| | 151 | ); |
|---|
| | 152 | |
|---|
| | 153 | foreach ($replaces as $pattern => $replacement) { |
|---|
| | 154 | $log_message = preg_replace($pattern, $replacement, $log_message); |
|---|
| | 155 | } |
|---|
| | 156 | |
|---|
| | 157 | $date_formt = $cfg['DATE_FORMAT'] . " H:i"; |
|---|
| | 158 | $tpl->assign( |
|---|
| | 159 | array( |
|---|
| | 160 | 'MESSAGE' => $log_message, |
|---|
| | 161 | 'DATE' => date($date_formt, strtotime($rs->fields['dat'])), |
|---|
| | 162 | ) |
|---|
| | 163 | ); |
|---|
| | 164 | |
|---|
| | 165 | $tpl->parse('LOG_ROW', '.log_row'); |
|---|
| | 166 | |
|---|
| | 167 | $rs->MoveNext(); |
|---|
| | 168 | } //while |
|---|
| | 169 | } |
|---|
| | 170 | } |
|---|
| | 171 | |
|---|
| | 172 | function clear_log() { |
|---|
| | 173 | global $sql; |
|---|
| | 174 | |
|---|
| | 175 | if (isset($_POST['uaction']) && $_POST['uaction'] === 'clear_log') { |
|---|
| | 176 | $query = null; |
|---|
| | 177 | $msg = ''; |
|---|
| | 178 | |
|---|
| | 179 | switch ($_POST['uaction_clear']) { |
|---|
| | 180 | case 0: |
|---|
| | 181 | $query = <<<SQL_QUERY |
|---|
| | 182 | delete |
|---|
| | 183 | from |
|---|
| | 184 | log |
|---|
| | 185 | SQL_QUERY; |
|---|
| | 186 | $msg = tr('%s deleted the full admin log!', $_SESSION['user_logged']); |
|---|
| | 187 | break; |
|---|
| | 188 | |
|---|
| | 189 | case 2: |
|---|
| | 190 | // 2 Weeks |
|---|
| | 191 | $query = <<<SQL_QUERY |
|---|
| | 192 | delete |
|---|
| | 193 | from |
|---|
| | 194 | log |
|---|
| | 195 | where |
|---|
| | 196 | DATE_SUB(CURDATE(), INTERVAL 14 DAY) |
|---|
| | 197 | >= log_time |
|---|
| | 198 | |
|---|
| | 199 | SQL_QUERY; |
|---|
| | 200 | $msg = tr('%s deleted the admin log older than two weeks!', $_SESSION['user_logged']); |
|---|
| | 201 | |
|---|
| | 202 | break; |
|---|
| | 203 | |
|---|
| | 204 | case 4: |
|---|
| | 205 | $query = <<<SQL_QUERY |
|---|
| | 206 | delete |
|---|
| | 207 | from |
|---|
| | 208 | log |
|---|
| | 209 | where |
|---|
| | 210 | DATE_SUB(CURDATE(), INTERVAL 1 MONTH) |
|---|
| | 211 | >= log_time |
|---|
| | 212 | SQL_QUERY; |
|---|
| | 213 | $msg = tr('%s deleted the admin log older than one month!', $_SESSION['user_logged']); |
|---|
| | 214 | |
|---|
| | 215 | break; |
|---|
| | 216 | |
|---|
| | 217 | case 12: |
|---|
| | 218 | $query = <<<SQL_QUERY |
|---|
| | 219 | delete |
|---|
| | 220 | from |
|---|
| | 221 | log |
|---|
| | 222 | where |
|---|
| | 223 | DATE_SUB(CURDATE(), INTERVAL 3 MONTH) |
|---|
| | 224 | >= log_time |
|---|
| | 225 | SQL_QUERY; |
|---|
| | 226 | $msg = tr('%s deleted the admin log older than three months!', $_SESSION['user_logged']); |
|---|
| | 227 | break; |
|---|
| | 228 | |
|---|
| | 229 | case 26: |
|---|
| | 230 | $query = <<<SQL_QUERY |
|---|
| | 231 | delete |
|---|
| | 232 | from |
|---|
| | 233 | log |
|---|
| | 234 | where |
|---|
| | 235 | DATE_SUB(CURDATE(), INTERVAL 6 MONTH) |
|---|
| | 236 | >= log_time |
|---|
| | 237 | SQL_QUERY; |
|---|
| | 238 | $msg = tr('%s deleted the admin log older than six months!', $_SESSION['user_logged']); |
|---|
| | 239 | break; |
|---|
| | 240 | |
|---|
| | 241 | case 52; |
|---|
| | 242 | $query = <<<SQL_QUERY |
|---|
| | 243 | delete |
|---|
| | 244 | from |
|---|
| | 245 | log |
|---|
| | 246 | where |
|---|
| | 247 | DATE_SUB(CURDATE(), INTERVAL 1 YEAR) |
|---|
| | 248 | >= log_time |
|---|
| | 249 | SQL_QUERY; |
|---|
| | 250 | $msg = tr('%s deleted the admin log older than one year!', $_SESSION['user_logged']); |
|---|
| | 251 | |
|---|
| | 252 | break; |
|---|
| | 253 | default: |
|---|
| | 254 | system_message(tr('Invalid time period!')); |
|---|
| | 255 | break; |
|---|
| 118 | 256 | } |
|---|
| 119 | 257 | |
|---|
| 120 | | $next_si = $start_index + $rows_per_page; |
|---|
| 121 | | |
|---|
| 122 | | if ($next_si + 1 > $records_count) { |
|---|
| 123 | | |
|---|
| 124 | | $tpl->assign('SCROLL_NEXT', ''); |
|---|
| 125 | | |
|---|
| 126 | | } else { |
|---|
| 127 | | |
|---|
| 128 | | $tpl->assign( |
|---|
| 129 | | array( |
|---|
| 130 | | 'SCROLL_NEXT_GRAY' => '', |
|---|
| 131 | | 'NEXT_PSI' => $next_si |
|---|
| 132 | | ) |
|---|
| 133 | | ); |
|---|
| 134 | | |
|---|
| 135 | | } |
|---|
| 136 | | |
|---|
| 137 | | |
|---|
| 138 | | $tpl->assign( |
|---|
| 139 | | array( |
|---|
| 140 | | 'PAGE_MESSAGE' => '' |
|---|
| 141 | | ) |
|---|
| 142 | | ); |
|---|
| 143 | | |
|---|
| 144 | | $row = 1; |
|---|
| 145 | | |
|---|
| 146 | | while (!$rs->EOF) { |
|---|
| 147 | | |
|---|
| 148 | | if ($row++ % 2 == 0) { |
|---|
| 149 | | $tpl->assign( |
|---|
| 150 | | array( |
|---|
| 151 | | 'ROW_CLASS' => 'content', |
|---|
| 152 | | ) |
|---|
| 153 | | ); |
|---|
| 154 | | } |
|---|
| 155 | | else{ |
|---|
| 156 | | $tpl->assign( |
|---|
| 157 | | array( |
|---|
| 158 | | 'ROW_CLASS' => 'content2', |
|---|
| 159 | | ) |
|---|
| 160 | | ); |
|---|
| 161 | | } |
|---|
| 162 | | $log_message = $rs->fields['log_message']; |
|---|
| 163 | | $replaces = array( |
|---|
| 164 | | '/[^a-zA-Z](delete)[^a-zA-Z]/i' => ' <strong style="color:#FF0000">\\1</strong> ', |
|---|
| 165 | | '/[^a-zA-Z](add)[^a-zA-Z]/i' => ' <strong style="color:#33CC66">\\1</strong> ', |
|---|
| 166 | | '/[^a-zA-Z](change)[^a-zA-Z]/i' => ' <strong style="color:#3300FF">\\1</strong> ', |
|---|
| 167 | | '/[^a-zA-Z](edit)[^a-zA-Z]/i' => ' <strong style="color:#33CC66">\\1</strong> ', |
|---|
| 168 | | '/[^a-zA-Z](unknown)[^a-zA-Z]/i'=> ' <strong style="color:#CC00FF">\\1</strong> ', |
|---|
| 169 | | '/[^a-zA-Z](logged)[^a-zA-Z]/i' => ' <strong style="color:#336600">\\1</strong> ', |
|---|
| 170 | | '/(bad password login data)/i' => ' <strong style="color:#FF0000">\\1</strong> ' |
|---|
| 171 | | ); |
|---|
| 172 | | |
|---|
| 173 | | foreach ( $replaces as $pattern => $replacement) { |
|---|
| 174 | | $log_message = preg_replace($pattern, $replacement, $log_message); |
|---|
| 175 | | } |
|---|
| 176 | | |
|---|
| 177 | | $date_formt = $cfg['DATE_FORMAT']." H:i"; |
|---|
| 178 | | $tpl -> assign( |
|---|
| 179 | | array( |
|---|
| 180 | | 'MESSAGE' => $log_message, |
|---|
| 181 | | 'DATE' => date($date_formt, strtotime($rs->fields['dat'])), |
|---|
| 182 | | ) |
|---|
| 183 | | ); |
|---|
| 184 | | |
|---|
| 185 | | $tpl->parse('LOG_ROW', '.log_row'); |
|---|
| 186 | | |
|---|
| 187 | | $rs->MoveNext(); |
|---|
| 188 | | }//while |
|---|
| 189 | | } |
|---|
| | 258 | $rs = execute_query($sql, $query); |
|---|
| | 259 | write_log($msg); |
|---|
| | 260 | } |
|---|
| 190 | 261 | } |
|---|
| 191 | | |
|---|
| 192 | | |
|---|
| 193 | | function clear_log() { |
|---|
| 194 | | global $sql; |
|---|
| 195 | | |
|---|
| 196 | | if (isset($_POST['uaction']) && $_POST['uaction'] === 'clear_log') { |
|---|
| 197 | | |
|---|
| 198 | | $query = null; |
|---|
| 199 | | $msg = ''; |
|---|
| 200 | | |
|---|
| 201 | | switch ($_POST['uaction_clear']) { |
|---|
| 202 | | |
|---|
| 203 | | case 0: |
|---|
| 204 | | $query = <<<SQL_QUERY |
|---|
| 205 | | delete |
|---|
| 206 | | from |
|---|
| 207 | | log |
|---|
| 208 | | SQL_QUERY; |
|---|
| 209 | | $msg = tr('%s deleted the full admin log!', $_SESSION['user_logged']); |
|---|
| 210 | | break; |
|---|
| 211 | | |
|---|
| 212 | | case 2: |
|---|
| 213 | | //2 Weeks |
|---|
| 214 | | |
|---|
| 215 | | $query = <<<SQL_QUERY |
|---|
| 216 | | delete |
|---|
| 217 | | from |
|---|
| 218 | | log |
|---|
| 219 | | where |
|---|
| 220 | | DATE_SUB(CURDATE(), INTERVAL 14 DAY) |
|---|
| 221 | | >= log_time |
|---|
| 222 | | |
|---|
| 223 | | SQL_QUERY; |
|---|
| 224 | | $msg = tr('%s deleted the admin log older than two weeks!', $_SESSION['user_logged']); |
|---|
| 225 | | |
|---|
| 226 | | break; |
|---|
| 227 | | |
|---|
| 228 | | case 4: |
|---|
| 229 | | $query = <<<SQL_QUERY |
|---|
| 230 | | delete |
|---|
| 231 | | from |
|---|
| 232 | | log |
|---|
| 233 | | where |
|---|
| 234 | | DATE_SUB(CURDATE(), INTERVAL 1 MONTH) |
|---|
| 235 | | >= log_time |
|---|
| 236 | | SQL_QUERY; |
|---|
| 237 | | $msg = tr('%s deleted the admin log older than one month!', $_SESSION['user_logged']); |
|---|
| 238 | | |
|---|
| 239 | | break; |
|---|
| 240 | | |
|---|
| 241 | | case 12: |
|---|
| 242 | | $query = <<<SQL_QUERY |
|---|
| 243 | | delete |
|---|
| 244 | | from |
|---|
| 245 | | log |
|---|
| 246 | | where |
|---|
| 247 | | DATE_SUB(CURDATE(), INTERVAL 3 MONTH) |
|---|
| 248 | | >= log_time |
|---|
| 249 | | SQL_QUERY; |
|---|
| 250 | | $msg = tr('%s deleted the admin log older than three months!', $_SESSION['user_logged']); |
|---|
| 251 | | break; |
|---|
| 252 | | |
|---|
| 253 | | case 26: |
|---|
| 254 | | $query = <<<SQL_QUERY |
|---|
| 255 | | delete |
|---|
| 256 | | from |
|---|
| 257 | | log |
|---|
| 258 | | where |
|---|
| 259 | | DATE_SUB(CURDATE(), INTERVAL 6 MONTH) |
|---|
| 260 | | >= log_time |
|---|
| 261 | | SQL_QUERY; |
|---|
| 262 | | $msg = tr('%s deleted the admin log older than six months!', $_SESSION['user_logged']); |
|---|
| 263 | | break; |
|---|
| 264 | | |
|---|
| 265 | | case 52; |
|---|
| 266 | | $query = <<<SQL_QUERY |
|---|
| 267 | | delete |
|---|
| 268 | | from |
|---|
| 269 | | log |
|---|
| 270 | | where |
|---|
| 271 | | DATE_SUB(CURDATE(), INTERVAL 1 YEAR) |
|---|
| 272 | | >= log_time |
|---|
| 273 | | SQL_QUERY; |
|---|
| 274 | | $msg = tr('%s deleted the admin log older than one year!', $_SESSION['user_logged']); |
|---|
| 275 | | |
|---|
| 276 | | break; |
|---|
| 277 | | default: |
|---|
| 278 | | system_message(tr('Invalid time period!')); |
|---|
| 279 | | break; |
|---|
| 280 | | |
|---|
| 281 | | } |
|---|
| 282 | | |
|---|
| 283 | | $rs = execute_query($sql, $query); |
|---|
| 284 | | write_log($msg); |
|---|
| 285 | | |
|---|
| 286 | | } |
|---|
| 287 | | } |
|---|
| 288 | | |
|---|
| 289 | | |
|---|
| 290 | 262 | |
|---|
| 291 | 263 | /* |
|---|
| … | … | |
| 294 | 266 | * |
|---|
| 295 | 267 | */ |
|---|
| 296 | | gen_admin_mainmenu($tpl, $cfg['ADMIN_TEMPLATE_PATH'].'/main_menu_general_information.tpl'); |
|---|
| 297 | | gen_admin_menu($tpl, $cfg['ADMIN_TEMPLATE_PATH'].'/menu_general_information.tpl'); |
|---|
| | 268 | gen_admin_mainmenu($tpl, $cfg['ADMIN_TEMPLATE_PATH'] . '/main_menu_general_information.tpl'); |
|---|
| | 269 | gen_admin_menu($tpl, $cfg['ADMIN_TEMPLATE_PATH'] . '/menu_general_information.tpl'); |
|---|
| 298 | 270 | |
|---|
| 299 | 271 | clear_log(); |
|---|
| 300 | 272 | |
|---|
| 301 | | generate_page ( $tpl ); |
|---|
| 302 | | |
|---|
| 303 | | $tpl -> assign( |
|---|
| 304 | | array( |
|---|
| 305 | | 'TR_ADMIN_LOG' => tr('Admin Log'), |
|---|
| 306 | | 'TR_CLEAR_LOG' => tr('Clear log'), |
|---|
| 307 | | 'TR_DATE' => tr('Date'), |
|---|
| 308 | | 'TR_MESSAGE' => tr('Message'), |
|---|
| 309 | | 'TR_CLEAR_LOG_MESSAGE' => tr('Delete from log:'), |
|---|
| 310 | | 'TR_CLEAR_LOG_EVERYTHING' => tr('everything'), |
|---|
| 311 | | 'TR_CLEAR_LOG_LAST2' => tr('older than 2 weeks'), |
|---|
| 312 | | 'TR_CLEAR_LOG_LAST4' => tr('older than 1 month'), |
|---|
| 313 | | 'TR_CLEAR_LOG_LAST12' => tr('older than 3 months'), |
|---|
| 314 | | 'TR_CLEAR_LOG_LAST26' => tr('older than 6 months'), |
|---|
| 315 | | 'TR_CLEAR_LOG_LAST52' => tr('older than 12 months'), |
|---|
| 316 | | ) |
|---|
| 317 | | ); |
|---|
| 318 | | |
|---|
| 319 | | //gen_page_message($tpl); |
|---|
| | 273 | generate_page ($tpl); |
|---|
| | 274 | |
|---|
| | 275 | $tpl->assign( |
|---|
| | 276 | array( |
|---|
| | 277 | 'TR_ADMIN_LOG' => tr('Admin Log'), |
|---|
| | 278 | 'TR_CLEAR_LOG' => tr('Clear log'), |
|---|
| | 279 | 'TR_DATE' => tr('Date'), |
|---|
| | 280 | 'TR_MESSAGE' => tr('Message'), |
|---|
| | 281 | 'TR_CLEAR_LOG_MESSAGE' => tr('Delete from log:'), |
|---|
| | 282 | 'TR_CLEAR_LOG_EVERYTHING' => tr('everything'), |
|---|
| | 283 | 'TR_CLEAR_LOG_LAST2' => tr('older than 2 weeks'), |
|---|
| | 284 | 'TR_CLEAR_LOG_LAST4' => tr('older than 1 month'), |
|---|
| | 285 | 'TR_CLEAR_LOG_LAST12' => tr('older than 3 months'), |
|---|
| | 286 | 'TR_CLEAR_LOG_LAST26' => tr('older than 6 months'), |
|---|
| | 287 | 'TR_CLEAR_LOG_LAST52' => tr('older than 12 months'), |
|---|
| | 288 | ) |
|---|
| | 289 | ); |
|---|
| | 290 | // gen_page_message($tpl); |
|---|
| 320 | 291 | |
|---|
| 321 | 292 | $tpl->parse('PAGE', 'page'); |
|---|
| 322 | 293 | $tpl->prnt(); |
|---|
| 323 | 294 | |
|---|
| 324 | | if ($cfg['DUMP_GUI_DEBUG']) dump_gui_debug(); |
|---|
| | 295 | if ($cfg['DUMP_GUI_DEBUG']) |
|---|
| | 296 | dump_gui_debug(); |
|---|
| 325 | 297 | |
|---|
| 326 | 298 | unset_messages(); |
|---|
| | 299 | |
|---|
| 327 | 300 | ?> |
|---|
| r800 |
r1011 |
|
| 1 | 1 | <?php |
|---|
| 2 | 2 | /** |
|---|
| 3 | | * ispCP (OMEGA) - Virtual Hosting Control System | Omega Version |
|---|
| | 3 | * ispCP ω (OMEGA) a Virtual Hosting Control System |
|---|
| 4 | 4 | * |
|---|
| 5 | | * @copyright 2001-2006 by moleSoftware GmbH |
|---|
| 6 | | * @copyright 2006-2007 by ispCP | http://isp-control.net |
|---|
| 7 | | * @link http://isp-control.net |
|---|
| 8 | | * @author ispCP Team (2007) |
|---|
| | 5 | * @copyright 2001-2006 by moleSoftware GmbH |
|---|
| | 6 | * @copyright 2006-2008 by ispCP | http://isp-control.net |
|---|
| | 7 | * @version SVN: $ID$ |
|---|
| | 8 | * @link http://isp-control.net |
|---|
| | 9 | * @author ispCP Team |
|---|
| 9 | 10 | * |
|---|
| 10 | | * @license |
|---|
| 11 | | * This program is free software; you can redistribute it and/or modify it under |
|---|
| 12 | | * the terms of the MPL General Public License as published by the Free Software |
|---|
| 13 | | * Foundation; either version 1.1 of the License, or (at your option) any later |
|---|
| 14 | | * version. |
|---|
| 15 | | * You should have received a copy of the MPL Mozilla Public License along with |
|---|
| 16 | | * this program; if not, write to the Open Source Initiative (OSI) |
|---|
| 17 | | * http://opensource.org | osi@opensource.org |
|---|
| 18 | | **/ |
|---|
| | 11 | * @license |
|---|
| | 12 | * This program is free software; you can redistribute it and/or modify it under |
|---|
| | 13 | * the terms of the MPL General Public License as published by the Free Software |
|---|
| | 14 | * Foundation; either version 1.1 of the License, or (at your option) any later |
|---|
| | 15 | * version. |
|---|
| | 16 | * You should have received a copy of the MPL Mozilla Public License along with |
|---|
| | 17 | * this program; if not, write to the Open Source Initiative (OSI) |
|---|
| | 18 | * http://opensource.org | osi@opensource.org |
|---|
| | 19 | */ |
|---|
| 19 | 20 | |
|---|
| 20 | 21 | require '../include/ispcp-lib.php'; |
|---|
| … | … | |
| 23 | 24 | |
|---|
| 24 | 25 | $tpl = new pTemplate(); |
|---|
| 25 | | |
|---|
| 26 | | $tpl -> define_dynamic('page', $cfg['ADMIN_TEMPLATE_PATH'].'/rootkit_log.tpl'); |
|---|
| 27 | | |
|---|
| 28 | | $tpl -> define_dynamic('page_message', 'page'); |
|---|
| 29 | | |
|---|
| 30 | | $tpl -> define_dynamic('service_status', 'page'); |
|---|
| 31 | | |
|---|
| 32 | | $tpl -> define_dynamic('props_list', 'page'); |
|---|
| | 26 | $tpl->define_dynamic('page', $cfg['ADMIN_TEMPLATE_PATH'] . '/rootkit_log.tpl'); |
|---|
| | 27 | $tpl->define_dynamic('page_message', 'page'); |
|---|
| | 28 | $tpl->define_dynamic('service_status', 'page'); |
|---|
| | 29 | $tpl->define_dynamic('props_list', 'page'); |
|---|
| 33 | 30 | |
|---|
| 34 | 31 | $theme_color = $cfg['USER_INITIAL_THEME']; |
|---|
| 35 | 32 | |
|---|
| 36 | | $tpl -> assign( |
|---|
| 37 | | array( |
|---|
| 38 | | 'TR_ADMIN_ROOTKIT_LOG_PAGE_TITLE' => tr('ispCP Admin / System Tools / Anti-Rootkits Tools Log Checker'), |
|---|
| 39 | | 'THEME_COLOR_PATH' => "../themes/$theme_color", |
|---|
| 40 | | 'THEME_CHARSET' => tr('encoding'), |
|---|
| 41 | | 'ISP_LOGO' => get_logo($_SESSION['user_id']), |
|---|
| 42 | | 'ISPCP_LICENSE' => $cfg['ISPCP_LICENSE'] |
|---|
| 43 | | ) |
|---|
| 44 | | ); |
|---|
| | 33 | $tpl->assign( |
|---|
| | 34 | array( |
|---|
| | 35 | 'TR_ADMIN_ROOTKIT_LOG_PAGE_TITLE' => tr('ispCP Admin / System Tools / Anti-Rootkits Tools Log Checker'), |
|---|
| | 36 | 'THEME_COLOR_PATH' => "../themes/$theme_color", |
|---|
| | 37 | 'THEME_CHARSET' => tr('encoding'), |
|---|
| | 38 | 'ISP_LOGO' => get_logo($_SESSION['user_id']), |
|---|
| | 39 | 'ISPCP_LICENSE' => $cfg['ISPCP_LICENSE'] |
|---|
| | 40 | ) |
|---|
| | 41 | ); |
|---|
| 45 | 42 | |
|---|
| 46 | 43 | $blocksCount = 0; |
|---|
| … | … | |
| 51 | 48 | |
|---|
| 52 | 49 | foreach ($config_entries as $config_entry) { |
|---|
| 53 | | if (empty($config_entry) || !isset($cfg[$config_entry]) || empty($cfg[$config_entry])) { |
|---|
| 54 | | continue; |
|---|
| 55 | | } |
|---|
| | 50 | if (empty($config_entry) || !isset($cfg[$config_entry]) || empty($cfg[$config_entry])) { |
|---|
| | 51 | continue; |
|---|
| | 52 | } |
|---|
| 56 | 53 | |
|---|
| 57 | | $filename = $cfg[$config_entry]; |
|---|
| 58 | | $contents = ''; |
|---|
| | 54 | $filename = $cfg[$config_entry]; |
|---|
| | 55 | $contents = ''; |
|---|
| 59 | 56 | |
|---|
| 60 | | if (!is_readable($filename) || !filesize($filename)) { |
|---|
| | 57 | if (file_exists($filename) && is_readable($filename)) { |
|---|
| | 58 | $handle = fopen($filename, 'r'); |
|---|
| 61 | 59 | |
|---|
| 62 | | $contents = "<b><font color='#FF0000'>" . tr("%s doesn't exist or is empty", $filename) . "</font></b>" ; |
|---|
| | 60 | $log = fread($handle, filesize($filename)); |
|---|
| 63 | 61 | |
|---|
| 64 | | } else { |
|---|
| | 62 | fclose($handle); |
|---|
| 65 | 63 | |
|---|
| 66 | | $handle = fopen($filename, 'r'); |
|---|
| | 64 | $contents = nl2br(htmlentities($log)); |
|---|
| 67 | 65 | |
|---|
| 68 | | $log = fread($handle, filesize($filename)); |
|---|
| | 66 | $contents = '<div>' . $contents . '</div>'; |
|---|
| 69 | 67 | |
|---|
| 70 | | fclose($handle); |
|---|
| | 68 | $search = array(); |
|---|
| | 69 | $replace = array(); |
|---|
| | 70 | // rkhunter-like log colouring |
|---|
| | 71 | $search [] = '/[^\-]WARNING/i'; |
|---|
| | 72 | $replace[] = '<strong><font color="orange">$0</font></strong>'; |
|---|
| | 73 | $search [] = '/([^a-z])(OK)([^a-z])/i'; |
|---|
| | 74 | $replace[] = '$1<font color="green">$2</font>$3'; |
|---|
| | 75 | $search [] = '/[ \t]+clean[ \t]+/i'; |
|---|
| | 76 | $replace[] = '<font color="green">$0</font>'; |
|---|
| | 77 | $search [] = '/Not found/i'; |
|---|
| | 78 | $replace[] = '<font color="blue">$0</font>'; |
|---|
| | 79 | $search [] = '/Skipped/i'; |
|---|
| | 80 | $replace[] = '<font color="blue">$0</font>'; |
|---|
| | 81 | $search [] = '/unknown[^)]/i'; |
|---|
| | 82 | $replace[] = '<strong><font color="#bf55bf">$0</font></strong>'; |
|---|
| | 83 | $search [] = '/Unsafe/i'; |
|---|
| | 84 | $replace[] = '<strong><font color="#cfcf00">$0</font></strong>'; |
|---|
| | 85 | $search [] = '/[1-9][0-9]*[ \t]+vulnerable/i'; |
|---|
| | 86 | $replace[] = '<strong><font color="red">$0</font></strong>'; |
|---|
| | 87 | $search [] = '/0[ \t]+vulnerable/i'; |
|---|
| | 88 | $replace[] = '<font color="green">$0</font>'; |
|---|
| | 89 | $search [] = '#(\[[0-9]{2}:[[0-9]{2}:[[0-9]{2}\][ \t]+-{20,35}[ \t]+)([a-zA-Z0-9 ]+)([ \t]+-{20,35})<br />#e'; |
|---|
| | 90 | $replace[] = '"</div><a href=\"#\" onclick=\"showHideBlocks(\'rkhuntb" . $blocksCount . "\');return false;\">$1<b>$2</b>$3</a><br /><div id=\"rkhuntb" . $blocksCount++ . "\">"'; |
|---|
| | 91 | // chkrootkit-like log colouring |
|---|
| | 92 | $search [] = '/([^a-z][ \t]+)(INFECTED)/i'; |
|---|
| | 93 | $replace[] = '$1<strong><font color="red">$2</font></strong>'; |
|---|
| | 94 | $search [] = '/Nothing found/i'; |
|---|
| | 95 | $replace[] = '<font color="green">$0</font>'; |
|---|
| | 96 | $s |
|---|
|