Browse Source

fix bootstrap theme for users/ urls; make some other links use https.

pull/414/head
David Goodwin 5 years ago
parent
commit
c7850b78eb
  1. 6
      model/PFASmarty.php
  2. 8
      public/index.php
  3. 2
      public/users/edit-alias.php
  4. 1
      public/users/login.php
  5. 1
      public/users/main.php
  6. 3
      public/users/password-change.php
  7. 4
      public/users/password.php
  8. 3
      public/users/vacation.php
  9. 9
      templates/header.tpl
  10. 1
      templates/index.tpl
  11. 13
      templates/vacation.tpl

6
model/PFASmarty.php

@ -67,6 +67,7 @@ class PFASmarty {
$CONF['theme_favicon'] = $rel_path . htmlentities($CONF['theme_favicon']);
$CONF['theme_logo'] = $rel_path . htmlentities($CONF['theme_logo']);
$this->assign('rel_path', $rel_path);
$this->assign('CONF', $CONF);
}
@ -92,11 +93,10 @@ class PFASmarty {
* @param string $template
* @return void
*/
public function display($template) {
public function display($template)
{
$CONF = Config::getInstance()->getAll();
$this->assign('CONF', $CONF);
$this->assign('PALANG', $CONF['__LANG'] ?? []);
$this->assign('url_domain', '');
$this->assign('version', $CONF['version'] ?? 'unknown');

8
public/index.php

@ -42,7 +42,7 @@ if ($CONF['configured']) {
<title>Welcome to Postfix Admin</title>
</head>
<body>
<img id="login_header_logo" src="images/logo-default.png" />
<img id="login_header_logo" src="{$rel_path}images/logo-default.png" />
<h1>Welcome to Postfix Admin</h1>
<h2>What is it?</h2>
<p>Postfix Admin is a web based interface to configure and manage a Postfix based email server for many users.</p>
@ -83,9 +83,9 @@ if ($CONF['configured']) {
<h2>Postfix Admin Web sites</h2>
<p>For further help, or documentation please check out -
<ul>
<li><a href="http://github.com/postfixadmin/postfixadmin">GitHub - Postfix Admin</a> web site</li>
<li><a href="http://postfixadmin.org">Postfix Admin</a> web site<br /></li>
<li><a href="http://sourceforge.net/forum/forum.php?forum_id=676076">Knowledge Base</a></li>
<li><a href="https://github.com/postfixadmin/postfixadmin">GitHub - Postfix Admin</a> web site</li>
<li><a href="https://postfixadmin.org">Postfix Admin</a> web site<br /></li>
<li><a href="https://sourceforge.net/forum/forum.php?forum_id=676076">Knowledge Base</a></li>
</ul>
</p>
</p>

2
public/users/edit-alias.php

@ -18,10 +18,10 @@
*
*/
$rel_path = '../';
require_once('../common.php');
$smarty = PFASmarty::getInstance();
$smarty->configureTheme('../');
$smarty->assign('smarty_template', 'users_edit-alias');

1
public/users/login.php

@ -31,6 +31,7 @@ $rel_path = '../';
require_once("../common.php");
$smarty = PFASmarty::getInstance();
$smarty->configureTheme('../');
check_db_version(); # check if the database layout is up to date (and error out if not)

1
public/users/main.php

@ -28,6 +28,7 @@ authentication_require_role('user');
$USERID_USERNAME = authentication_get_username();
$smarty = PFASmarty::getInstance();
$smarty->configureTheme('../');
$vh = new VacationHandler($USERID_USERNAME);
if ($vh->check_vacation()) {

3
public/users/password-change.php

@ -25,6 +25,8 @@
* fUsername
*/
$smarty = PFASmarty::getInstance();
if (preg_match('/\/users\//', $_SERVER['REQUEST_URI'])) {
$rel_path = '../';
$context = 'users';
@ -35,7 +37,6 @@ if (preg_match('/\/users\//', $_SERVER['REQUEST_URI'])) {
require_once($rel_path . 'common.php');
$CONF = Config::getInstance()->getAll();
$smarty = PFASmarty::getInstance();
$smarty->configureTheme($rel_path);

4
public/users/password.php

@ -26,16 +26,16 @@
* fPassword2
*/
$rel_path = '../';
require_once('../common.php');
$smarty = PFASmarty::getInstance();
$smarty->configureTheme('../');
authentication_require_role('user');
$username = authentication_get_username();
$pPassword_password_text = "";
$pPassword_password_current_text = "";
$smarty = PFASmarty::getInstance();
if ($_SERVER['REQUEST_METHOD'] == "POST") {
if (safepost('token') != $_SESSION['PFA_token']) {

3
public/users/vacation.php

@ -16,9 +16,10 @@
*
*/
$rel_path = '../';
require_once('../common.php');
$smarty = PFASmarty::getInstance();
$smarty->configureTheme('../');
require_once('../vacation.php');
/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */

9
templates/header.tpl

@ -1,4 +1,3 @@
<!-- {$smarty.template} -->
<!doctype html>
<html lang="{if isset($smarty.session.lang)}{$smarty.session.lang}{/if}">
<head>
@ -14,9 +13,9 @@
<link rel="stylesheet" type="text/css" href="{$CONF.theme_custom_css}"/>
{/if}
<script src="jquery-1.12.4.min.js"></script>
<script src="css/bootstrap-3.4.1-dist/js/moment-with-locales.min.js"></script>
<script src="css/bootstrap-3.4.1-dist/js/bootstrap.min.js"></script>
<script src="css/bootstrap-3.4.1-dist/js/bootstrap-datetimepicker.min.js"></script>
<script src="{$rel_path}jquery-1.12.4.min.js"></script>
<script src="{$rel_path}css/bootstrap-3.4.1-dist/js/moment-with-locales.min.js"></script>
<script src="{$rel_path}css/bootstrap-3.4.1-dist/js/bootstrap.min.js"></script>
<script src="{$rel_path}css/bootstrap-3.4.1-dist/js/bootstrap-datetimepicker.min.js"></script>
</head>
<body class="lang-{if isset($smarty.session.lang)}{$smarty.session.lang}{/if} page-{$smarty_template} {if isset($table)}page-{$smarty_template}-{$table}{/if}">

1
templates/index.tpl

@ -1,4 +1,3 @@
<!-- {$smarty.template} -->
{strip}
{include file="header.tpl"}
{if $smarty_template !== 'login' && $smarty_template !== 'password-recover' && $smarty_template !== 'password-change'}

13
templates/vacation.tpl

@ -60,12 +60,13 @@
</div>
<div class="panel-footer">
<div class="btn-toolbar" role="toolbar">
<div class="btn-group pull-right">
<input class="btn btn-primary m-3" type="submit" name="fChange"
value="{$PALANG.pEdit_vacation_set}"/>
<input class="btn btn-primary" type="submit" name="fBack"
value="{$PALANG.pEdit_vacation_remove}"/>
<input class="btn btn-primary" type="submit" name="fCancel" value="{$PALANG.exit}"/>
<div class="pull-right">
<button class="btn btn-secondary" type="submit" name="fCancel">{$PALANG.exit}</button>
<button class="btn btn-primary" type="submit" name="fChange">{$PALANG.pEdit_vacation_set}</button>
<button class="btn btn-primary" type="submit" name="fBack">{$PALANG.pEdit_vacation_remove}</button>
</div>
</div>
</div>

Loading…
Cancel
Save