$a_templates = array(); while ($file = readdir($h)) { if (substr($file, -5) == '.mail' || substr($file, -5) == '.html') { $a_templates[] = $file; } } sort($a_templates); print '<table width="100%" border="0" cellspacing="0" cellpadding="3"> <tr> <td><b>Filename</b></td> <td><b>Options</b></td> <td><b>Size</b></td> <td><b>Modified</b></td> </tr>'; while (list($k, $file) = each($a_templates)) { if (!WriteAccess('../templates/' . $dir . '/' . $file)) { print ' <tr> <td' . ($k % 2 == 0 ? ' bgcolor="#eeeeee"' : '') . '>' . $file . '</td> <td' . ($k % 2 == 0 ? ' bgcolor="#eeeeee"' : '') . '>Can' . "'" . 't edit: No permission</td> <td' . ($k % 2 == 0 ? ' bgcolor="#eeeeee"' : '') . '>' . ceil(filesize('../templates/' . $dir . '/' . $file) / 1000) . ' KB</td> <td' . ($k % 2 == 0 ? ' bgcolor="#eeeeee"' : '') . '>' . date('d.m.Y, H:i', filemtime('../templates/' . $dir . '/' . $file)) . '</td> </tr>'; } else { print ' <tr> <td' . ($k % 2 == 0 ? ' bgcolor="#eeeeee"' : '') . '>' . $file . '</td> <td' . ($k % 2 == 0 ? ' bgcolor="#eeeeee"' : '') . '><a href="t-editor.php?action=EditTemplate&session=' . $session . '&name=' . $file . '&dir=' . $dir . '">Edit</a></td> <td' . ($k % 2 == 0 ? ' bgcolor="#eeeeee"' : '') . '>' . ceil(filesize('../templates/' . $dir . '/' . $file) / 1000) . ' KB</td> <td' . ($k % 2 == 0 ? ' bgcolor="#eeeeee"' : '') . '>' . date('d.m.Y, H:i', filemtime('../templates/' . $dir . '/' . $file)) . '</td> </tr>';
$_SESSION['lang'] = 'en'; } if (!install_allowed() && $_GET['step'] != 'about' && $_GET['step'] != '') { $_GET['step'] = 'deny'; } switch ($_GET['step']) { case 'configuration-download': header('Content-Type: application/octetstream'); header('Content-Disposition: filename="config.inc.php"'); header('Pragma: no-cache'); header('Expires: 0'); p_configuration(STDOUT, $_SESSION); break; case 'configuration-write': if (isset($_POST['submit'])) { if (!WriteAccess('../inc/config.inc.php')) { p_errormsg(lng('error'), lng('chmoderror'), 'JavaScript:history.back(0)'); exit; } else { $fp = @fopen('../inc/config.inc.php', 'w'); p_configuration($fp, $_SESSION); fclose($fp); echo $template->render('install-done', ['about_handler' => 'install.php?step=about']); } } else { echo $template->render('install-configuration-write', ['about_handler' => 'install.php?step=about', 'download_url' => 'install.php?step=configuration-download', 'step' => 'configuration-write']); } break; case 'administrator-create': if (!isset($_SESSION['administrator-username'])) { $_SESSION['administrator-username'] = '******';