1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-24 20:13:22 +01:00

131 Commits

Author SHA1 Message Date
Nils Adermann
6e31ce8573 Do not store email templates in database. [Bug #54505]
To explain what this is about, first a short phpBB code history lesson: ;-)

r9823 originally introduced the usage of our template class for emails. The
messenger class uses set_custom_template() to initialise the template object
which neither disables storedb nor inheritance. These two values are set in
$user->theme rather than inside a particular template instance (quite a design
failure if I may add). Thus the html page that is displayed to the user also
determines these settings for the email templates. This obviously causes
problems because both emails and other custom templates can quite simply not
be stored in the database because the db table only stores the filename, not
the path and requires a template id.

r9839 then generally disabled storedb and template inheritance for custom
templates to fix Bug #40515. This works for custom templates, but not for
emails where lots of template objects are created. In such a situation the
last call to set(_custom)_template() would now determine the values of storedb
and inheritance in _tpl_load. So any page sending emails would neither load
its template from the database nor use template inheritance. The same revision
also introduced orig_tpl_* variables in set_template() which on their own are
very much pointless, but could allow resetting the storedb and inheritance
values if they were used to reset $user->theme just before template execution
in _tpl_load.

In r10150 these orig_tpl_* variables are correctly used to access information
about the template of the page being displayed - contrary to the last template
used - from within the bbcode, fixing Bug #51285. However r10150 also introduces
a pointless $template_mode parameter for set_custom_template(). $template_mode
is really just a boolean flag (value you can be 'template' or an arbitrary other
value) that if it set circumvents the unsetting of storedb and template
inheritance. The very code that had been added to prevent issues with emails and
custom templates. Fixing the problem introduced by r8839 but at the same time
reintroducing the much greater problem from the original implementation of email
templates.

And now an explanation of what I did:

Based on this I have now changed the set_custom_template method to always
disable storedb. It can now properly use inheritance, you simply tell it the
path where the parent template can be found, by default the path is false which
will turn inheritance off. To make this work the template class now always
overwrites $user->theme storedb and inheritance variabbles with orig_tpl_* just
before rendering a template in _tpl_load. This way they are guaranteed to always
contain the value they had at the time set_template/set_custom_template were
called. This fixes [Bug #54505].

In summary, using global state is simply a horrible idea in object oriented
programming. Always Pass values, that an object depends on, as parameters - never
through magic global variables. Following this principle will safe you from a lot
of headaches.

Please test this patch as much as possible to make sure templates still work
properly for you, focus on multiple languages, missing language files, and
custom templates in systems that make use of the template class outside of
phpBB itself.


git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10460 89ea8834-ac86-4346-8a33-228a782c2dd0
2010-01-26 16:52:46 +00:00
Josh Woody
b4d6b1e980 Further fixes for r10447 and r10448. Correctly account for custom language directories (caught by naderman)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10449 89ea8834-ac86-4346-8a33-228a782c2dd0
2010-01-26 04:11:58 +00:00
Josh Woody
a314b2807f Remove needless check (revising r10447)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10448 89ea8834-ac86-4346-8a33-228a782c2dd0
2010-01-26 03:43:02 +00:00
Josh Woody
ff1aa876b5 Fall back to board default language email template if the file does not exist user's preferred language (#35595)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10447 89ea8834-ac86-4346-8a33-228a782c2dd0
2010-01-26 03:30:43 +00:00
Meik Sievertsen
782d680b54 Fix getting host for situations where the name/IP is not resolvable. Related to Bug #41025
Related revisions: r9387 and r10158

git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10178 89ea8834-ac86-4346-8a33-228a782c2dd0
2009-09-22 15:09:09 +00:00
Meik Sievertsen
223b9ed0d6 extend r9387 - check for existance of all functions we use...
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10158 89ea8834-ac86-4346-8a33-228a782c2dd0
2009-09-17 13:39:50 +00:00
Joas Schilling
697fd5a134 Fix #51285 and more issues with template inherence on set_custom_template
Conflict introduced with r9839 and r9823

Authorised by: AcydBurn

git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10150 89ea8834-ac86-4346-8a33-228a782c2dd0
2009-09-16 08:11:52 +00:00
Meik Sievertsen
19bae65f4c Fix possible wrong encodings in email template files in messenger. Related to bug #46725
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10052 89ea8834-ac86-4346-8a33-228a782c2dd0
2009-08-25 09:04:38 +00:00
Meik Sievertsen
92a1775294 we will use the non-compliant way for mail() until we further inspected PHP's source.
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10015 89ea8834-ac86-4346-8a33-228a782c2dd0
2009-08-18 13:24:45 +00:00
Meik Sievertsen
9bcc38ea0b Fix email problems on servers with PHP installations not accepting RFC-compliant subject string passed to the the mail()-function. (Bug #46725)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10014 89ea8834-ac86-4346-8a33-228a782c2dd0
2009-08-18 09:59:24 +00:00
Chris Smith
20bf778b93 Per RFC2047 section 5 do not use quoted strings for encoded recipient names
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10011 89ea8834-ac86-4346-8a33-228a782c2dd0
2009-08-18 01:43:51 +00:00
Meik Sievertsen
be963ed938 allow custom template path for email files
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9957 89ea8834-ac86-4346-8a33-228a782c2dd0
2009-08-11 16:24:18 +00:00
Meik Sievertsen
cef8c2d87e Parse email text files with the template engine.
Did not check if this influences styles template cache list/purge/etc.

git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9823 89ea8834-ac86-4346-8a33-228a782c2dd0
2009-07-22 09:07:24 +00:00
Chris Smith
05548f8f05 Correctly split UTF-8 encoded strings when using mail(). #45815
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9530 89ea8834-ac86-4346-8a33-228a782c2dd0
2009-06-03 16:29:26 +00:00
Meik Sievertsen
b8b578cd99 Messenger now also able to use a custom language path. (Bug #36545)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9450 89ea8834-ac86-4346-8a33-228a782c2dd0
2009-04-17 09:08:34 +00:00
Meik Sievertsen
0a139376ab fix revision #r9430 - all hail the math!
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9449 89ea8834-ac86-4346-8a33-228a782c2dd0
2009-04-16 15:39:29 +00:00
Meik Sievertsen
d7a8d7ad09 Correctly split long subject lines according to the used RFC. This fixes extra spaces within long subjects. (Bug #43715)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9430 89ea8834-ac86-4346-8a33-228a782c2dd0
2009-04-10 07:54:52 +00:00
Meik Sievertsen
2155bbbf8a Erm, yes, we use EOL in queue too. :/ (me is ashamed). Paul, thanks for giving me access to debug this.
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9429 89ea8834-ac86-4346-8a33-228a782c2dd0
2009-04-08 18:08:54 +00:00
Meik Sievertsen
abc458bc2a make sure eol is set (if PHP_EOL is empty? :o)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9427 89ea8834-ac86-4346-8a33-228a782c2dd0
2009-04-08 16:40:39 +00:00
Meik Sievertsen
1e36ed1f74 Mass Email works again for users with empty jabber address but notification set to 'both'. (Bug #39755)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9389 89ea8834-ac86-4346-8a33-228a782c2dd0
2009-03-17 15:50:19 +00:00
Meik Sievertsen
a80f7a5ea1 Use FQDN for SMTP EHLO/HELO command. (Bug #41025)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9387 89ea8834-ac86-4346-8a33-228a782c2dd0
2009-03-17 15:23:57 +00:00
Meik Sievertsen
61135f65b9 Use OS-specific line endings for mail headers. (related to Bug #42755)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9364 89ea8834-ac86-4346-8a33-228a782c2dd0
2009-03-11 16:23:12 +00:00
Meik Sievertsen
d9468c35da add IN_PHPBB check to generated cache files
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9363 89ea8834-ac86-4346-8a33-228a782c2dd0
2009-03-11 12:53:54 +00:00
Chris Smith
a94ed97992 Missing read permission from calls to phpbb_chmod()
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9208 89ea8834-ac86-4346-8a33-228a782c2dd0
2008-12-19 20:36:18 +00:00
Meik Sievertsen
c831a3edce Do not try to send jabber notifications if no jid entered (Bug #36775)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9078 89ea8834-ac86-4346-8a33-228a782c2dd0
2008-11-22 19:55:00 +00:00
Meik Sievertsen
876b193180 some whitespace changes and opening files in binary mode in functions_messenger
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8971 89ea8834-ac86-4346-8a33-228a782c2dd0
2008-10-06 05:50:16 +00:00
Meik Sievertsen
1f01089e2f Use phpBB 3.1.x method for storing cached data to prevent PHP bug with our usage of var_export(). (Thanks to Techie Micheal and HoL for pointing out possible problems)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8955 89ea8834-ac86-4346-8a33-228a782c2dd0
2008-09-29 15:58:42 +00:00
Meik Sievertsen
6c763cd8b6 change the way we do chmodd'ing. I know, my implementation really sucked... good we have motivated community members who point this out. ;) Thanks to faw for providing a way better function and for discussing and also abiding to our needs. :) LEW21 should maybe credited too... he gave the inspiration without knowing it.
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8780 89ea8834-ac86-4346-8a33-228a782c2dd0
2008-08-22 12:52:48 +00:00
Meik Sievertsen
068096531f the chmod change i already had within the changelog (by mistake). This should further secure writable directories and created files.
Installation need to be tested on different hosts.

git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8763 89ea8834-ac86-4346-8a33-228a782c2dd0
2008-08-16 19:06:18 +00:00
Meik Sievertsen
337f1c33c9 Do not error out if php_uname function disabled / Authenticating on SMTP Server (Bug #22235 - patch by HoL)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8449 89ea8834-ac86-4346-8a33-228a782c2dd0
2008-03-18 14:32:49 +00:00
Meik Sievertsen
e2e56acca9 some further fixes
- re-introduce grabbing random number from /dev/urandom


git-svn-id: file:///svn/phpbb/trunk@8241 89ea8834-ac86-4346-8a33-228a782c2dd0
2007-11-17 20:04:49 +00:00
Meik Sievertsen
fe57a7983b fixing tiny bugs
git-svn-id: file:///svn/phpbb/trunk@8232 89ea8834-ac86-4346-8a33-228a782c2dd0
2007-11-10 16:19:24 +00:00
Meik Sievertsen
e6c79242e6 dumdidum... sorry. ;)
git-svn-id: file:///svn/phpbb/trunk@8146 89ea8834-ac86-4346-8a33-228a782c2dd0
2007-10-05 14:30:11 +00:00
Meik Sievertsen
09f6cf11dd - correct jabber token handling
- undisclosed-recipients:; instead of undisclosed-recipient:;
- PM details button should not be there


git-svn-id: file:///svn/phpbb/trunk@8090 89ea8834-ac86-4346-8a33-228a782c2dd0
2007-09-14 14:06:23 +00:00
Meik Sievertsen
cda8083ba7 fixing some bugs
git-svn-id: file:///svn/phpbb/trunk@8075 89ea8834-ac86-4346-8a33-228a782c2dd0
2007-09-02 17:24:56 +00:00
Meik Sievertsen
c9dcf849b9 - two new packages... diff and utf
- only 60 chars for topic title if new post (please see changelog for explanation)
- change utf8_wordwrap (had some bugs david and nils spotted - was not really functional, sorry for this. :D)


git-svn-id: file:///svn/phpbb/trunk@8034 89ea8834-ac86-4346-8a33-228a782c2dd0
2007-08-16 11:28:58 +00:00
Meik Sievertsen
2bbd2fb1f9 some bugs fixed
git-svn-id: file:///svn/phpbb/trunk@8033 89ea8834-ac86-4346-8a33-228a782c2dd0
2007-08-15 17:32:48 +00:00
Meik Sievertsen
e9188d4e05 Some changes... non-invasive...
git-svn-id: file:///svn/phpbb/trunk@8025 89ea8834-ac86-4346-8a33-228a782c2dd0
2007-08-13 12:14:07 +00:00
Meik Sievertsen
75a5162945 again, a lot of bug fixes
git-svn-id: file:///svn/phpbb/trunk@7909 89ea8834-ac86-4346-8a33-228a782c2dd0
2007-07-19 20:38:38 +00:00
Meik Sievertsen
b883ff119f let's see if i can break something. :o
git-svn-id: file:///svn/phpbb/trunk@7830 89ea8834-ac86-4346-8a33-228a782c2dd0
2007-07-03 15:36:18 +00:00
Meik Sievertsen
5634fad4ae some fixes...
git-svn-id: file:///svn/phpbb/trunk@7813 89ea8834-ac86-4346-8a33-228a782c2dd0
2007-06-30 15:04:49 +00:00
Meik Sievertsen
455536773f ok, mess around with the templates + fixing some bugs + adjusting headers for those files already modified to circumvent conflicts for those having their editor set to remove trailing spaces (not recommended!)
git-svn-id: file:///svn/phpbb/trunk@7736 89ea8834-ac86-4346-8a33-228a782c2dd0
2007-06-09 11:11:20 +00:00
Meik Sievertsen
34326f7b0b oi^2
git-svn-id: file:///svn/phpbb/trunk@7689 89ea8834-ac86-4346-8a33-228a782c2dd0
2007-05-26 18:20:07 +00:00
Meik Sievertsen
1b32236b1e hopefully not too late in the game. Checked in new jabber class (the class done by the flyspray project). It would be nice if this could be tested with more servers - jabber.org seems to work fine...
- other fixes


git-svn-id: file:///svn/phpbb/trunk@7687 89ea8834-ac86-4346-8a33-228a782c2dd0
2007-05-26 16:38:33 +00:00
Meik Sievertsen
1dc89ca465 Disable DEBUG by default, enable backtrace by default
git-svn-id: file:///svn/phpbb/trunk@7631 89ea8834-ac86-4346-8a33-228a782c2dd0
2007-05-18 14:33:18 +00:00
David M
b9d77ef8d5 :(
git-svn-id: file:///svn/phpbb/trunk@7231 89ea8834-ac86-4346-8a33-228a782c2dd0
2007-03-25 16:05:22 +00:00
David M
f5ddbc4653 fopen + fread + fclose -> file_get_contents
git-svn-id: file:///svn/phpbb/trunk@7230 89ea8834-ac86-4346-8a33-228a782c2dd0
2007-03-25 15:58:48 +00:00
Meik Sievertsen
5c6653717f fixing some bugs
more mcp links for easier moderating different aspects (all, forum, topic)
i may have introduced new bugs with this commit due to me having fixed some things weeks ago and some code changed in between - please report if you see something not working as expected.


git-svn-id: file:///svn/phpbb/trunk@7007 89ea8834-ac86-4346-8a33-228a782c2dd0
2007-02-18 13:42:08 +00:00
Meik Sievertsen
5e3afe73ec those were missing
git-svn-id: file:///svn/phpbb/trunk@6977 89ea8834-ac86-4346-8a33-228a782c2dd0
2007-02-09 14:31:17 +00:00
Meik Sievertsen
ddddda47fb - fix some oddities (doubled spaces for example)
- changed the way make_forum_select() is returning the forum list - now including skipped forums but being disabled. This should make identifying the correct forum much more easier.
- Changed some permission namings based on suggestions by the community
- Tried to comply to the permission field ordering within the language files while displaying permission sets. Hopefully it's worth the additional processing time.
- Disable submit buttons after clicking for installation and conversions.


git-svn-id: file:///svn/phpbb/trunk@6930 89ea8834-ac86-4346-8a33-228a782c2dd0
2007-01-26 16:09:51 +00:00