- 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
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
- 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
- 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
- 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
- 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
- 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
- common.php is indirectly included in setup.php (via upgrade.php),
avoid endless redirect loop from setup.php to setup.php
(just found some minutes ago, had blocker quality...)
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@343 a1433add-5e2c-0410-b055-b7f2511e0802
- check if setup.php exists before blindly redirecting to it.
Display error message if the user has already deleted it.
(old behaviour caused some user confusion)
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@288 a1433add-5e2c-0410-b055-b7f2511e0802
functions.inc.php:
- function check_language
- new optional parameter $use_post (needed by login.php)
- check for language cookie
- check for $_POST['lang']
- removed substr() call because it made pt-br translation unuseable
- new function language_selector
- returns a HTML dropdown language selector
- new function safecookie
- similar to safeget, but for cookies
templates/login.php, templates/users_login.php:
- display language selector dropdown
login.php, users/login.php:
- check for selected language
- set cookie if user selected non-default language
languages/language.php: (NEW FILE)
- list of supported languages
- language names taken from phpMyAdmin login form
common.php:
- include languages/language.php
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@280 a1433add-5e2c-0410-b055-b7f2511e0802
- define('POSTFIXADMIN', 1)
templates/*.php
- check if POSTFIXADMIN is defined to prevent direct access to the
template files
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@256 a1433add-5e2c-0410-b055-b7f2511e0802