0
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2024-09-19 11:12:15 +02:00
Commit Graph

63 Commits

Author SHA1 Message Date
David Goodwin
f01274ec94
try relaxing composer dependencies to allow php8.2 dev support, reformat so composer format passes 2024-04-22 21:02:01 +01:00
David Goodwin
1988a70489 drop local copy of smarty library; use composer for installation of it; allow smarty 4.x which appears to work and also better supports php8 etc 2022-09-17 10:49:57 +01:00
Adrien Crivelli
a97771adfd
Automatic code style fixes 2022-07-15 11:29:55 +02:00
David Goodwin
e960fa96a0 put some sort of warning if a turkish locale is set - see #541 2022-07-13 21:10:35 +01:00
David Goodwin
0b9b7db917 Merge remote-tracking branch 'origin/master' into feature-improve-pacrypt 2021-09-29 18:04:49 +01:00
David Goodwin
12ed3fba3d avoid a clickjacking attack reported on huntr.dev by @ranjit-git 2021-08-04 20:38:06 +01:00
David Goodwin
2ccda5c26a move to use the composer autoloader 2021-07-07 21:41:59 +01:00
David Goodwin
2edabc3e03 phpcs insists on some brace changes 2021-04-13 21:19:16 +01:00
David Goodwin
2a58056fff be more consistent with how we load common.php, improve comments 2021-03-09 20:34:09 +00:00
David Goodwin
b2831d1241 psalm improvements 2021-02-17 21:29:18 +00:00
David Goodwin
b8fa60bb8a more type hints / psalm fixes 2020-09-28 20:33:54 +01:00
David Goodwin
484acfbf59 Remove the random_compat lib. 2020-09-27 10:47:22 +01:00
David Goodwin
8754af58cb fix undefined variables (psalm) 2020-03-12 20:45:51 +00:00
David Goodwin
036245063e drop references to magic_quotes; see: https://github.com/postfixadmin/postfixadmin/pull/325 2020-02-10 11:26:23 +00:00
David Goodwin
87824ef970 psalm fixes/workarounds; require PHP 5.6+ 2019-10-19 20:51:05 +01:00
David Goodwin
a0b4e690b2 only load random_compat if PHP_VERSION is < 7.0 2019-08-10 21:33:39 +01:00
David Goodwin
7e7f644952 skip this check if unit test 2019-01-03 19:35:33 +00:00
David Goodwin
2b31e71d5c improve error message 2019-01-01 20:39:41 +00:00
David Goodwin
4fcdba9cf4 run php-cs-fixer (code reforamt) 2018-12-28 19:31:43 +00:00
David Goodwin
5d74ff4cc7 only require language if non-empty 2018-12-27 22:01:53 +00:00
David Goodwin
1c4a6080d7 make phar loading optional depending on the extension being present or not 2018-05-25 09:44:20 +01:00
Christian Boltz
05bf2d2013
if unconfigured, recommend to edit config.local.php
... instead of config.inc.php

(idea based on comments on
7c38bdd871 )
2018-05-06 23:58:01 +02:00
David Goodwin
b97decb7c2 add a lib directory; move smarty into it; add random_compat phar (for random_bytes() on PHP < 7) 2018-04-29 20:27:33 +01:00
David Goodwin
9bef45aed5 remove logout behaviour from common.php (never used); try and fix logout in login.php - see #130 2018-02-05 20:47:07 +00:00
Adrien Crivelli
15df6c1d7b
Reformat everything with PHP-Cs-Fixer 2018-01-26 23:54:37 +09:00
David Goodwin
f0be0ebf62 remove more incpath usages 2018-01-25 21:13:36 +00:00
David Goodwin
99147d51eb move public facing stuff into public/, this allows us to stop exposing templates_c/ etc to the world 2018-01-25 20:27:09 +00:00
Christian Boltz
9df6de65af
Finally get rid of variables.inc.php
Initialize $error and $tMailbox where needed.

The other variables in variables.inc.php are already initialized
everywhere.
2017-04-10 20:54:34 +02:00
Christian Boltz
431bd3d810 rename session cookie
With the default PHPSESSID cookie name, there are some rare (and hard to
debug) cases that break logging in if a different application on the
domain also uses a PHPSESSID cookie. See
https://sourceforge.net/p/postfixadmin/bugs/314/ for details.

Using 'postfixadmin_session' as cookie name should fix this.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1846 a1433add-5e2c-0410-b055-b7f2511e0802
2016-05-22 16:57:09 +00:00
David Goodwin
9c022f7e01 merge patch from https://sourceforge.net/p/postfixadmin/bugs/347/ (thank you Eugene Grosbein) - explictly set session_cache_limiter to nocache
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1792 a1433add-5e2c-0410-b055-b7f2511e0802
2015-07-12 12:09:34 +00:00
David Goodwin
e39510726a use !empty to avoid error
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1623 a1433add-5e2c-0410-b055-b7f2511e0802
2014-01-14 16:00:42 +00:00
Christian Boltz
fbc18ff993 login.php, common.php:
- when login.php is requested, logout the current admin/user
  https://sourceforge.net/p/postfixadmin/bugs/284/



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1568 a1433add-5e2c-0410-b055-b7f2511e0802
2013-11-11 00:06:27 +00:00
Christian Boltz
6e2e132bac remove "postfixadmin.com" in comments in lots of files
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1558 a1433add-5e2c-0410-b055-b7f2511e0802
2013-11-10 15:57:32 +00:00
Christian Boltz
c6ca4f9bae common.php:
- call Config::write() earlier, because check_language() uses it
- later add $PALANG with Config::write(__LANG)

Thanks to <controlcde> for reporting the results of this bug on IRC
(even if I had to hunt it down to find the reason ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1548 a1433add-5e2c-0410-b055-b7f2511e0802
2013-10-31 20:52:45 +00:00
Christian Boltz
4d9a338eb2 After hunting an "undefined index transport" error in list-domain, I
found out that the 'Config' class is too static - it shares its static
data with the 'Lang' child class. 

This caused a conflict because we have $CONF[transport] and 
$PALANG[transport], and Config::read('transport') returned the $PALANG 
text.

To fix this, all texts are now stored as $CONF[__LANG].
I also dropped the 'Lang' class.


model/Config.php:
- mark the 'Config' class as final to ensure we don't trap into the 
  "too static" problem again.
- bool(): display and log an error message if a $CONF option does not
  contain YES or NO (that would have uncovered this bug much earlier)
- add lang() and lang_f() wrapper functions to get $PALANG texts
- remove unused $__cache and $__objects

model/Lang.php:
- deleted

common.php:
- store $PALANG as $CONF[__LANG]

lots of files:
- replace Lang::read() and Lang::read_f() calls with Config::lang()
  and Config::lang_f()




git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1536 a1433add-5e2c-0410-b055-b7f2511e0802
2013-10-13 18:11:18 +00:00
Christian Boltz
631c6e754f common.php:
- move postfixadmin_autoload() and spl_autoload_register upwards
  (it's needed earlier after using the Config class in more functions)
- call Config::write earlier (as soon as $CONF is complete)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1454 a1433add-5e2c-0410-b055-b7f2511e0802
2013-04-01 22:12:10 +00:00
David Goodwin
ecf7757981 Remove getInstance calls; not needed as we use ::write
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1239 a1433add-5e2c-0410-b055-b7f2511e0802
2011-10-24 22:25:36 +00:00
Christian Boltz
646c790371 common.php, scripts/postfixadmin-cli.php:
- init Lang and Config classes in common.php instead of postfixadmin-cli.php -
  they need to be available in the web interface also


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1215 a1433add-5e2c-0410-b055-b7f2511e0802
2011-10-17 23:37:52 +00:00
Christian Boltz
4611b111e3 common.php:
- merge with scripts/common.php
- don't start/use session in CLI mode
- don't load smarty.inc.php in CLI mode
- hardcode language to 'en' in CLI mode (was done in postfixadmin-cli.php before)

scripts/postfixadmin-cli.php - __bootstrap():
- use common.php instead of scripts/common.php
- don't load languages/language.php and languages/en.lang (already
  done via common.php)
- don't call language_hook (already done via common.php)

scripts/common.php:
- deleted
- dropped helper functions low(), up(), r() and pr() which were just
  shortnames for existing PHP functions


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1214 a1433add-5e2c-0410-b055-b7f2511e0802
2011-10-17 23:19:57 +00:00
Christian Boltz
a5f3cb9b96 config.inc.php:
- new config option $CONF['language_hook']
  Hook function to override or add translations to $PALANG.
  Example hook function included (commented out).

common.php:
- honor $CONF['language_hook']

scripts/postfixadmin-cli.php:
- honor $CONF['language_hook']
- add TODO - language shouldn't be hardcoded to english

This implements my feature request at
http://sourceforge.net/tracker/?func=detail&aid=3292408&group_id=191583&atid=937967


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1176 a1433add-5e2c-0410-b055-b7f2511e0802
2011-08-23 21:23:16 +00:00
David Goodwin
b0bd8cd1f5 see changeset:952 ... move php code out of template into here
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@953 a1433add-5e2c-0410-b055-b7f2511e0802
2011-02-07 23:31:12 +00:00
Christian Boltz
98c0252a08 common.php:
- store language in session variable
  (BTW: storing it only at login instead of calling check_language() on 
  every page would save some processor cycles ;-)

templates/header.tpl:
- add   class="lang-XY"   (where XY is the language to the body tag.
  This allows language-specific CSS code: .lang-XY table {...}

This commit implements the feature request from J.Kruis (jan-kruis)
https://sourceforge.net/tracker/?func=detail&aid=2903088&group_id=191583&atid=937967



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@872 a1433add-5e2c-0410-b055-b7f2511e0802
2010-09-30 20:43:52 +00:00
Norman Messtorff
7229502738 Small typo fixed...
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@761 a1433add-5e2c-0410-b055-b7f2511e0802
2009-11-06 19:23:07 +00:00
Sebastian
cf40467570 - accidentially deleted header.php. Needed for setup
- add some error checks.

git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@759 a1433add-5e2c-0410-b055-b7f2511e0802
2009-11-06 19:16:14 +00:00
Sebastian
b1287d97e2 - big merge of Postfixadmin smarty into trunk
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@757 a1433add-5e2c-0410-b055-b7f2511e0802
2009-11-05 14:55:39 +00:00
Christian Boltz
562ab4dc14 setup.php:
- define('POSTFIXADMIN') to avoid session_start() call in common.php
  This avoids breakage if php5-session is not installed. Fixes
  https://sourceforge.net/tracker/?func=detail&aid=2855430&group_id=191583&atid=937964

common.php
- only define('POSTFIXADMIN') if it is not yet defined (avoids a warning)



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@733 a1433add-5e2c-0410-b055-b7f2511e0802
2009-10-20 19:25:20 +00:00
Christian Boltz
acb3d4799d login.php, index.php:
- removed the $CONF['configured'] = 'I_know_the_risk_of_not_deleting_setup.php' 
  developer hack (no longer needed since setup.php requires a password)
- this also makes index.php redirecting to login.php again (the old check tested
  for file_exists(setup.php)...)

common.php:
- removed a superfluous check for $CONF[setup_password] (see mailinglist for details)

config.inc.php:
- removed a small outdated comment


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@640 a1433add-5e2c-0410-b055-b7f2511e0802
2009-04-22 11:31:53 +00:00
David Goodwin
1adebfbe03 common.php: remove redundant check
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@637 a1433add-5e2c-0410-b055-b7f2511e0802
2009-04-19 18:48:35 +00:00
David Goodwin
140864dee1 common.php: remove requirement to delete setup.php; require $CONF["setup_password"] is changed etc
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@618 a1433add-5e2c-0410-b055-b7f2511e0802
2009-04-08 20:17:24 +00:00
David Goodwin
51d418f16c fix register globals check in common.php - see https://sourceforge.net/tracker/?func=detail&aid=2721614&group_id=191583&atid=937964
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@611 a1433add-5e2c-0410-b055-b7f2511e0802
2009-04-02 20:49:32 +00:00