SMTP config not deleted when another email method is selected
After initial install of ver 7.0.1 administrator credentials are saved in config.php as smtpname and smtppassword. And it seems that they are also stored somewhere else because if I delete credentials from config.php manually, after changing send mail to PHP and back to SMTP the same credentials appear in config file.
this has already been discussed on irc by @carlaschroder @bantu
@bantu can you please have a look and submit a pull request to fix this? THX
Hey Guys, any update on this one?
Can have a look tomorrow
excellent, thank you.
Hmm the only way I can reproduce this is by:
- Open the settings page
- Deleting the configs
- Changing the config without reloading the page
- Changing back the config still without reloading
In this case the HTML page still contains the data, although it's not displayed. But if the page is reloaded after 2. , it works as expected.
What we could do, is manually unset (set to empty string) all the smtp fields, if php or sendmail is selected. However, if one selects that accidently then, the user needs to find the SMTP data again in order to set it up. So not sure whether thats the way to go.
@MTRichards want to make a decision on this? ^
My opinion, an apply button would be preferable to an accidental delete by an admin. @jancborchardt thoughts?
If we have the interface in admin settings for this, why do they need to be edited directly from config.php?
It seems this issue is a conflict of config.php and web interface. Can we make them sync up better?
In this case the HTML page still contains the data, although it's not displayed.
@nickvergessen If PHP or Sendmail is selected the fields should be hidden, that is »deactivated«. When you switch directly back to SMTP they should be brought back with the values you had before.
@nickvergessen If PHP or Sendmail is selected the fields should be hidden, that is »deactivated«. When you switch directly back to SMTP they should be brought back with the values you had before.
They are hidden and HTML still has the old values.
If we have the interface in admin settings for this, why do they need to be edited directly from config.php?
They are not needed, but it's possible.
It seems this issue is a conflict of config.php and web interface. Can we make them sync up better?
I don't think this is easily possible. But seems like you agree with my idea, of just not doing anything about the issue. If the file is edited, one must either reload the page or expect misbehaviour like this.
Now I am confused. If the user switches from SMTP to PHP (or the other way around), the SMTP settings remain in the config file - right?
Would not a "save" or "apply" button solve this issue where we need to keep a physical file in sync with the web front end?
Right now it is broken, it seems, in some cases and, well, still broken? Probably shouldn't close it just yet.
Even with an apply button you would have inconsistencies since the values, when changed in the config.php, won’t be updated in the input fields. Only after refresh – which is the same as with the current solution.
Hmmm. Perhaps it´s only me but changing the same value in the webinterface and in the config file at the same exact same time is a corner case. I don´t think this is a critical issue.
@karlitschek It doesn't sound like it has to be the exact same time. It more sounds like you can checkout the config into HTML, wait two hours, then make changes to the config.php via filesystem, then wait another two hours, then send the HTML which will undo/screwup/whatever the config. This probably requires your session to stay valid, but this is possible over a long period by just browsing files every now and then I suppose.
@jnfrmarks something to consider in your ample testing time. :smile:
An improvement could be the following: a) Expose a method lastModificationTime() via the config object (using filemtime() in the background) and b) Only update the config file, if it was not changed. Otherwise inform the user or otherwise handle the conflict (e.g. just tell them to reload).
@bantu Sure. I know. But this doesn´t sound like something a sane admin would do. :-)
I totally agree with @karlitschek here.
Then make it two admins. :P
So what's the status here? Do we want to try and fight runtime problems, or do we want to have admins overwrite each others settings and stuff.
So the only 'issue' here is that you can overwrite settings if you have the web interface open and the config file edited at the same time??
Sorry this is not a serious issue but the way most web applications work
@karlitschek seems that is so.