PostfixAdmin - web based virtual user administration interface for Postfix mail servers https://postfixadmin.github.io/postfixadmin/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

252 lines
8.8 KiB

The work of two nights causes a long changelog. Here we go: fetchmail.php: - IMPORTANT: fixed typo in database column name. If you have created the fetchmail database already, you have to rename the "pool_time" column to "poll_time" - fixed adding of new entries - don't display status fields (last poll date and result) in edit mode - validate and quote the GET and POST variables - show POSTed data again if invalid values were entered (data to display in the edit form is passed to fetchmail.tpl in $formvars) - check results of database operations and display error/success messages - check owner of target mailbox on all operations - changed password handling: empty means no change (instead of sending "******" around) - reworked and moved around large code portions - added some TODO notes fetchmail.tpl: - use data from $formvars in edit mode instead of parsing the full array - moved "new entry" below the table - replaced delete button with delete links - Note: the boolean fields need testing with PgSQL. Especially test if they are displayed as active correctly in list and edit mode! *.lang: - added several fetchmail-related strings, more to follow - added $PALANG['please_keep_this_as_last_entry'] which always has to be the last entry in the language files. This solves the problem that language-check.sh mixes up the string order when adding strings at the end of the language files. - added vim:ft=php git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@163 a1433add-5e2c-0410-b055-b7f2511e0802
19 years ago
The work of two nights causes a long changelog. Here we go: fetchmail.php: - IMPORTANT: fixed typo in database column name. If you have created the fetchmail database already, you have to rename the "pool_time" column to "poll_time" - fixed adding of new entries - don't display status fields (last poll date and result) in edit mode - validate and quote the GET and POST variables - show POSTed data again if invalid values were entered (data to display in the edit form is passed to fetchmail.tpl in $formvars) - check results of database operations and display error/success messages - check owner of target mailbox on all operations - changed password handling: empty means no change (instead of sending "******" around) - reworked and moved around large code portions - added some TODO notes fetchmail.tpl: - use data from $formvars in edit mode instead of parsing the full array - moved "new entry" below the table - replaced delete button with delete links - Note: the boolean fields need testing with PgSQL. Especially test if they are displayed as active correctly in list and edit mode! *.lang: - added several fetchmail-related strings, more to follow - added $PALANG['please_keep_this_as_last_entry'] which always has to be the last entry in the language files. This solves the problem that language-check.sh mixes up the string order when adding strings at the end of the language files. - added vim:ft=php git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@163 a1433add-5e2c-0410-b055-b7f2511e0802
19 years ago
The work of two nights causes a long changelog. Here we go: fetchmail.php: - IMPORTANT: fixed typo in database column name. If you have created the fetchmail database already, you have to rename the "pool_time" column to "poll_time" - fixed adding of new entries - don't display status fields (last poll date and result) in edit mode - validate and quote the GET and POST variables - show POSTed data again if invalid values were entered (data to display in the edit form is passed to fetchmail.tpl in $formvars) - check results of database operations and display error/success messages - check owner of target mailbox on all operations - changed password handling: empty means no change (instead of sending "******" around) - reworked and moved around large code portions - added some TODO notes fetchmail.tpl: - use data from $formvars in edit mode instead of parsing the full array - moved "new entry" below the table - replaced delete button with delete links - Note: the boolean fields need testing with PgSQL. Especially test if they are displayed as active correctly in list and edit mode! *.lang: - added several fetchmail-related strings, more to follow - added $PALANG['please_keep_this_as_last_entry'] which always has to be the last entry in the language files. This solves the problem that language-check.sh mixes up the string order when adding strings at the end of the language files. - added vim:ft=php git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@163 a1433add-5e2c-0410-b055-b7f2511e0802
19 years ago
The work of two nights causes a long changelog. Here we go: fetchmail.php: - IMPORTANT: fixed typo in database column name. If you have created the fetchmail database already, you have to rename the "pool_time" column to "poll_time" - fixed adding of new entries - don't display status fields (last poll date and result) in edit mode - validate and quote the GET and POST variables - show POSTed data again if invalid values were entered (data to display in the edit form is passed to fetchmail.tpl in $formvars) - check results of database operations and display error/success messages - check owner of target mailbox on all operations - changed password handling: empty means no change (instead of sending "******" around) - reworked and moved around large code portions - added some TODO notes fetchmail.tpl: - use data from $formvars in edit mode instead of parsing the full array - moved "new entry" below the table - replaced delete button with delete links - Note: the boolean fields need testing with PgSQL. Especially test if they are displayed as active correctly in list and edit mode! *.lang: - added several fetchmail-related strings, more to follow - added $PALANG['please_keep_this_as_last_entry'] which always has to be the last entry in the language files. This solves the problem that language-check.sh mixes up the string order when adding strings at the end of the language files. - added vim:ft=php git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@163 a1433add-5e2c-0410-b055-b7f2511e0802
19 years ago
The work of two nights causes a long changelog. Here we go: fetchmail.php: - IMPORTANT: fixed typo in database column name. If you have created the fetchmail database already, you have to rename the "pool_time" column to "poll_time" - fixed adding of new entries - don't display status fields (last poll date and result) in edit mode - validate and quote the GET and POST variables - show POSTed data again if invalid values were entered (data to display in the edit form is passed to fetchmail.tpl in $formvars) - check results of database operations and display error/success messages - check owner of target mailbox on all operations - changed password handling: empty means no change (instead of sending "******" around) - reworked and moved around large code portions - added some TODO notes fetchmail.tpl: - use data from $formvars in edit mode instead of parsing the full array - moved "new entry" below the table - replaced delete button with delete links - Note: the boolean fields need testing with PgSQL. Especially test if they are displayed as active correctly in list and edit mode! *.lang: - added several fetchmail-related strings, more to follow - added $PALANG['please_keep_this_as_last_entry'] which always has to be the last entry in the language files. This solves the problem that language-check.sh mixes up the string order when adding strings at the end of the language files. - added vim:ft=php git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@163 a1433add-5e2c-0410-b055-b7f2511e0802
19 years ago
The work of two nights causes a long changelog. Here we go: fetchmail.php: - IMPORTANT: fixed typo in database column name. If you have created the fetchmail database already, you have to rename the "pool_time" column to "poll_time" - fixed adding of new entries - don't display status fields (last poll date and result) in edit mode - validate and quote the GET and POST variables - show POSTed data again if invalid values were entered (data to display in the edit form is passed to fetchmail.tpl in $formvars) - check results of database operations and display error/success messages - check owner of target mailbox on all operations - changed password handling: empty means no change (instead of sending "******" around) - reworked and moved around large code portions - added some TODO notes fetchmail.tpl: - use data from $formvars in edit mode instead of parsing the full array - moved "new entry" below the table - replaced delete button with delete links - Note: the boolean fields need testing with PgSQL. Especially test if they are displayed as active correctly in list and edit mode! *.lang: - added several fetchmail-related strings, more to follow - added $PALANG['please_keep_this_as_last_entry'] which always has to be the last entry in the language files. This solves the problem that language-check.sh mixes up the string order when adding strings at the end of the language files. - added vim:ft=php git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@163 a1433add-5e2c-0410-b055-b7f2511e0802
19 years ago
The work of two nights causes a long changelog. Here we go: fetchmail.php: - IMPORTANT: fixed typo in database column name. If you have created the fetchmail database already, you have to rename the "pool_time" column to "poll_time" - fixed adding of new entries - don't display status fields (last poll date and result) in edit mode - validate and quote the GET and POST variables - show POSTed data again if invalid values were entered (data to display in the edit form is passed to fetchmail.tpl in $formvars) - check results of database operations and display error/success messages - check owner of target mailbox on all operations - changed password handling: empty means no change (instead of sending "******" around) - reworked and moved around large code portions - added some TODO notes fetchmail.tpl: - use data from $formvars in edit mode instead of parsing the full array - moved "new entry" below the table - replaced delete button with delete links - Note: the boolean fields need testing with PgSQL. Especially test if they are displayed as active correctly in list and edit mode! *.lang: - added several fetchmail-related strings, more to follow - added $PALANG['please_keep_this_as_last_entry'] which always has to be the last entry in the language files. This solves the problem that language-check.sh mixes up the string order when adding strings at the end of the language files. - added vim:ft=php git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@163 a1433add-5e2c-0410-b055-b7f2511e0802
19 years ago
The work of two nights causes a long changelog. Here we go: fetchmail.php: - IMPORTANT: fixed typo in database column name. If you have created the fetchmail database already, you have to rename the "pool_time" column to "poll_time" - fixed adding of new entries - don't display status fields (last poll date and result) in edit mode - validate and quote the GET and POST variables - show POSTed data again if invalid values were entered (data to display in the edit form is passed to fetchmail.tpl in $formvars) - check results of database operations and display error/success messages - check owner of target mailbox on all operations - changed password handling: empty means no change (instead of sending "******" around) - reworked and moved around large code portions - added some TODO notes fetchmail.tpl: - use data from $formvars in edit mode instead of parsing the full array - moved "new entry" below the table - replaced delete button with delete links - Note: the boolean fields need testing with PgSQL. Especially test if they are displayed as active correctly in list and edit mode! *.lang: - added several fetchmail-related strings, more to follow - added $PALANG['please_keep_this_as_last_entry'] which always has to be the last entry in the language files. This solves the problem that language-check.sh mixes up the string order when adding strings at the end of the language files. - added vim:ft=php git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@163 a1433add-5e2c-0410-b055-b7f2511e0802
19 years ago
The work of two nights causes a long changelog. Here we go: fetchmail.php: - IMPORTANT: fixed typo in database column name. If you have created the fetchmail database already, you have to rename the "pool_time" column to "poll_time" - fixed adding of new entries - don't display status fields (last poll date and result) in edit mode - validate and quote the GET and POST variables - show POSTed data again if invalid values were entered (data to display in the edit form is passed to fetchmail.tpl in $formvars) - check results of database operations and display error/success messages - check owner of target mailbox on all operations - changed password handling: empty means no change (instead of sending "******" around) - reworked and moved around large code portions - added some TODO notes fetchmail.tpl: - use data from $formvars in edit mode instead of parsing the full array - moved "new entry" below the table - replaced delete button with delete links - Note: the boolean fields need testing with PgSQL. Especially test if they are displayed as active correctly in list and edit mode! *.lang: - added several fetchmail-related strings, more to follow - added $PALANG['please_keep_this_as_last_entry'] which always has to be the last entry in the language files. This solves the problem that language-check.sh mixes up the string order when adding strings at the end of the language files. - added vim:ft=php git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@163 a1433add-5e2c-0410-b055-b7f2511e0802
19 years ago
The work of two nights causes a long changelog. Here we go: fetchmail.php: - IMPORTANT: fixed typo in database column name. If you have created the fetchmail database already, you have to rename the "pool_time" column to "poll_time" - fixed adding of new entries - don't display status fields (last poll date and result) in edit mode - validate and quote the GET and POST variables - show POSTed data again if invalid values were entered (data to display in the edit form is passed to fetchmail.tpl in $formvars) - check results of database operations and display error/success messages - check owner of target mailbox on all operations - changed password handling: empty means no change (instead of sending "******" around) - reworked and moved around large code portions - added some TODO notes fetchmail.tpl: - use data from $formvars in edit mode instead of parsing the full array - moved "new entry" below the table - replaced delete button with delete links - Note: the boolean fields need testing with PgSQL. Especially test if they are displayed as active correctly in list and edit mode! *.lang: - added several fetchmail-related strings, more to follow - added $PALANG['please_keep_this_as_last_entry'] which always has to be the last entry in the language files. This solves the problem that language-check.sh mixes up the string order when adding strings at the end of the language files. - added vim:ft=php git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@163 a1433add-5e2c-0410-b055-b7f2511e0802
19 years ago
The work of two nights causes a long changelog. Here we go: fetchmail.php: - IMPORTANT: fixed typo in database column name. If you have created the fetchmail database already, you have to rename the "pool_time" column to "poll_time" - fixed adding of new entries - don't display status fields (last poll date and result) in edit mode - validate and quote the GET and POST variables - show POSTed data again if invalid values were entered (data to display in the edit form is passed to fetchmail.tpl in $formvars) - check results of database operations and display error/success messages - check owner of target mailbox on all operations - changed password handling: empty means no change (instead of sending "******" around) - reworked and moved around large code portions - added some TODO notes fetchmail.tpl: - use data from $formvars in edit mode instead of parsing the full array - moved "new entry" below the table - replaced delete button with delete links - Note: the boolean fields need testing with PgSQL. Especially test if they are displayed as active correctly in list and edit mode! *.lang: - added several fetchmail-related strings, more to follow - added $PALANG['please_keep_this_as_last_entry'] which always has to be the last entry in the language files. This solves the problem that language-check.sh mixes up the string order when adding strings at the end of the language files. - added vim:ft=php git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@163 a1433add-5e2c-0410-b055-b7f2511e0802
19 years ago
The work of two nights causes a long changelog. Here we go: fetchmail.php: - IMPORTANT: fixed typo in database column name. If you have created the fetchmail database already, you have to rename the "pool_time" column to "poll_time" - fixed adding of new entries - don't display status fields (last poll date and result) in edit mode - validate and quote the GET and POST variables - show POSTed data again if invalid values were entered (data to display in the edit form is passed to fetchmail.tpl in $formvars) - check results of database operations and display error/success messages - check owner of target mailbox on all operations - changed password handling: empty means no change (instead of sending "******" around) - reworked and moved around large code portions - added some TODO notes fetchmail.tpl: - use data from $formvars in edit mode instead of parsing the full array - moved "new entry" below the table - replaced delete button with delete links - Note: the boolean fields need testing with PgSQL. Especially test if they are displayed as active correctly in list and edit mode! *.lang: - added several fetchmail-related strings, more to follow - added $PALANG['please_keep_this_as_last_entry'] which always has to be the last entry in the language files. This solves the problem that language-check.sh mixes up the string order when adding strings at the end of the language files. - added vim:ft=php git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@163 a1433add-5e2c-0410-b055-b7f2511e0802
19 years ago
The work of two nights causes a long changelog. Here we go: fetchmail.php: - IMPORTANT: fixed typo in database column name. If you have created the fetchmail database already, you have to rename the "pool_time" column to "poll_time" - fixed adding of new entries - don't display status fields (last poll date and result) in edit mode - validate and quote the GET and POST variables - show POSTed data again if invalid values were entered (data to display in the edit form is passed to fetchmail.tpl in $formvars) - check results of database operations and display error/success messages - check owner of target mailbox on all operations - changed password handling: empty means no change (instead of sending "******" around) - reworked and moved around large code portions - added some TODO notes fetchmail.tpl: - use data from $formvars in edit mode instead of parsing the full array - moved "new entry" below the table - replaced delete button with delete links - Note: the boolean fields need testing with PgSQL. Especially test if they are displayed as active correctly in list and edit mode! *.lang: - added several fetchmail-related strings, more to follow - added $PALANG['please_keep_this_as_last_entry'] which always has to be the last entry in the language files. This solves the problem that language-check.sh mixes up the string order when adding strings at the end of the language files. - added vim:ft=php git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@163 a1433add-5e2c-0410-b055-b7f2511e0802
19 years ago
The work of two nights causes a long changelog. Here we go: fetchmail.php: - IMPORTANT: fixed typo in database column name. If you have created the fetchmail database already, you have to rename the "pool_time" column to "poll_time" - fixed adding of new entries - don't display status fields (last poll date and result) in edit mode - validate and quote the GET and POST variables - show POSTed data again if invalid values were entered (data to display in the edit form is passed to fetchmail.tpl in $formvars) - check results of database operations and display error/success messages - check owner of target mailbox on all operations - changed password handling: empty means no change (instead of sending "******" around) - reworked and moved around large code portions - added some TODO notes fetchmail.tpl: - use data from $formvars in edit mode instead of parsing the full array - moved "new entry" below the table - replaced delete button with delete links - Note: the boolean fields need testing with PgSQL. Especially test if they are displayed as active correctly in list and edit mode! *.lang: - added several fetchmail-related strings, more to follow - added $PALANG['please_keep_this_as_last_entry'] which always has to be the last entry in the language files. This solves the problem that language-check.sh mixes up the string order when adding strings at the end of the language files. - added vim:ft=php git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@163 a1433add-5e2c-0410-b055-b7f2511e0802
19 years ago
The work of two nights causes a long changelog. Here we go: fetchmail.php: - IMPORTANT: fixed typo in database column name. If you have created the fetchmail database already, you have to rename the "pool_time" column to "poll_time" - fixed adding of new entries - don't display status fields (last poll date and result) in edit mode - validate and quote the GET and POST variables - show POSTed data again if invalid values were entered (data to display in the edit form is passed to fetchmail.tpl in $formvars) - check results of database operations and display error/success messages - check owner of target mailbox on all operations - changed password handling: empty means no change (instead of sending "******" around) - reworked and moved around large code portions - added some TODO notes fetchmail.tpl: - use data from $formvars in edit mode instead of parsing the full array - moved "new entry" below the table - replaced delete button with delete links - Note: the boolean fields need testing with PgSQL. Especially test if they are displayed as active correctly in list and edit mode! *.lang: - added several fetchmail-related strings, more to follow - added $PALANG['please_keep_this_as_last_entry'] which always has to be the last entry in the language files. This solves the problem that language-check.sh mixes up the string order when adding strings at the end of the language files. - added vim:ft=php git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@163 a1433add-5e2c-0410-b055-b7f2511e0802
19 years ago
The work of two nights causes a long changelog. Here we go: fetchmail.php: - IMPORTANT: fixed typo in database column name. If you have created the fetchmail database already, you have to rename the "pool_time" column to "poll_time" - fixed adding of new entries - don't display status fields (last poll date and result) in edit mode - validate and quote the GET and POST variables - show POSTed data again if invalid values were entered (data to display in the edit form is passed to fetchmail.tpl in $formvars) - check results of database operations and display error/success messages - check owner of target mailbox on all operations - changed password handling: empty means no change (instead of sending "******" around) - reworked and moved around large code portions - added some TODO notes fetchmail.tpl: - use data from $formvars in edit mode instead of parsing the full array - moved "new entry" below the table - replaced delete button with delete links - Note: the boolean fields need testing with PgSQL. Especially test if they are displayed as active correctly in list and edit mode! *.lang: - added several fetchmail-related strings, more to follow - added $PALANG['please_keep_this_as_last_entry'] which always has to be the last entry in the language files. This solves the problem that language-check.sh mixes up the string order when adding strings at the end of the language files. - added vim:ft=php git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@163 a1433add-5e2c-0410-b055-b7f2511e0802
19 years ago
The work of two nights causes a long changelog. Here we go: fetchmail.php: - IMPORTANT: fixed typo in database column name. If you have created the fetchmail database already, you have to rename the "pool_time" column to "poll_time" - fixed adding of new entries - don't display status fields (last poll date and result) in edit mode - validate and quote the GET and POST variables - show POSTed data again if invalid values were entered (data to display in the edit form is passed to fetchmail.tpl in $formvars) - check results of database operations and display error/success messages - check owner of target mailbox on all operations - changed password handling: empty means no change (instead of sending "******" around) - reworked and moved around large code portions - added some TODO notes fetchmail.tpl: - use data from $formvars in edit mode instead of parsing the full array - moved "new entry" below the table - replaced delete button with delete links - Note: the boolean fields need testing with PgSQL. Especially test if they are displayed as active correctly in list and edit mode! *.lang: - added several fetchmail-related strings, more to follow - added $PALANG['please_keep_this_as_last_entry'] which always has to be the last entry in the language files. This solves the problem that language-check.sh mixes up the string order when adding strings at the end of the language files. - added vim:ft=php git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@163 a1433add-5e2c-0410-b055-b7f2511e0802
19 years ago
The work of two nights causes a long changelog. Here we go: fetchmail.php: - IMPORTANT: fixed typo in database column name. If you have created the fetchmail database already, you have to rename the "pool_time" column to "poll_time" - fixed adding of new entries - don't display status fields (last poll date and result) in edit mode - validate and quote the GET and POST variables - show POSTed data again if invalid values were entered (data to display in the edit form is passed to fetchmail.tpl in $formvars) - check results of database operations and display error/success messages - check owner of target mailbox on all operations - changed password handling: empty means no change (instead of sending "******" around) - reworked and moved around large code portions - added some TODO notes fetchmail.tpl: - use data from $formvars in edit mode instead of parsing the full array - moved "new entry" below the table - replaced delete button with delete links - Note: the boolean fields need testing with PgSQL. Especially test if they are displayed as active correctly in list and edit mode! *.lang: - added several fetchmail-related strings, more to follow - added $PALANG['please_keep_this_as_last_entry'] which always has to be the last entry in the language files. This solves the problem that language-check.sh mixes up the string order when adding strings at the end of the language files. - added vim:ft=php git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@163 a1433add-5e2c-0410-b055-b7f2511e0802
19 years ago
The work of two nights causes a long changelog. Here we go: fetchmail.php: - IMPORTANT: fixed typo in database column name. If you have created the fetchmail database already, you have to rename the "pool_time" column to "poll_time" - fixed adding of new entries - don't display status fields (last poll date and result) in edit mode - validate and quote the GET and POST variables - show POSTed data again if invalid values were entered (data to display in the edit form is passed to fetchmail.tpl in $formvars) - check results of database operations and display error/success messages - check owner of target mailbox on all operations - changed password handling: empty means no change (instead of sending "******" around) - reworked and moved around large code portions - added some TODO notes fetchmail.tpl: - use data from $formvars in edit mode instead of parsing the full array - moved "new entry" below the table - replaced delete button with delete links - Note: the boolean fields need testing with PgSQL. Especially test if they are displayed as active correctly in list and edit mode! *.lang: - added several fetchmail-related strings, more to follow - added $PALANG['please_keep_this_as_last_entry'] which always has to be the last entry in the language files. This solves the problem that language-check.sh mixes up the string order when adding strings at the end of the language files. - added vim:ft=php git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@163 a1433add-5e2c-0410-b055-b7f2511e0802
19 years ago
The work of two nights causes a long changelog. Here we go: fetchmail.php: - IMPORTANT: fixed typo in database column name. If you have created the fetchmail database already, you have to rename the "pool_time" column to "poll_time" - fixed adding of new entries - don't display status fields (last poll date and result) in edit mode - validate and quote the GET and POST variables - show POSTed data again if invalid values were entered (data to display in the edit form is passed to fetchmail.tpl in $formvars) - check results of database operations and display error/success messages - check owner of target mailbox on all operations - changed password handling: empty means no change (instead of sending "******" around) - reworked and moved around large code portions - added some TODO notes fetchmail.tpl: - use data from $formvars in edit mode instead of parsing the full array - moved "new entry" below the table - replaced delete button with delete links - Note: the boolean fields need testing with PgSQL. Especially test if they are displayed as active correctly in list and edit mode! *.lang: - added several fetchmail-related strings, more to follow - added $PALANG['please_keep_this_as_last_entry'] which always has to be the last entry in the language files. This solves the problem that language-check.sh mixes up the string order when adding strings at the end of the language files. - added vim:ft=php git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@163 a1433add-5e2c-0410-b055-b7f2511e0802
19 years ago
The work of two nights causes a long changelog. Here we go: fetchmail.php: - IMPORTANT: fixed typo in database column name. If you have created the fetchmail database already, you have to rename the "pool_time" column to "poll_time" - fixed adding of new entries - don't display status fields (last poll date and result) in edit mode - validate and quote the GET and POST variables - show POSTed data again if invalid values were entered (data to display in the edit form is passed to fetchmail.tpl in $formvars) - check results of database operations and display error/success messages - check owner of target mailbox on all operations - changed password handling: empty means no change (instead of sending "******" around) - reworked and moved around large code portions - added some TODO notes fetchmail.tpl: - use data from $formvars in edit mode instead of parsing the full array - moved "new entry" below the table - replaced delete button with delete links - Note: the boolean fields need testing with PgSQL. Especially test if they are displayed as active correctly in list and edit mode! *.lang: - added several fetchmail-related strings, more to follow - added $PALANG['please_keep_this_as_last_entry'] which always has to be the last entry in the language files. This solves the problem that language-check.sh mixes up the string order when adding strings at the end of the language files. - added vim:ft=php git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@163 a1433add-5e2c-0410-b055-b7f2511e0802
19 years ago
  1. <?php
  2. /**
  3. * Postfix Admin
  4. *
  5. * LICENSE
  6. * This source file is subject to the GPL license that is bundled with
  7. * this package in the file LICENSE.TXT.
  8. *
  9. * Further details on the project are available at :
  10. * http://www.postfixadmin.com or http://postfixadmin.sf.net
  11. *
  12. * @version $Id$
  13. * @license GNU GPL v2 or later.
  14. *
  15. * File: fetchmail.php
  16. * Responsible for setting up fetchmail
  17. *
  18. * @version $Id$
  19. * @license GNU GPL v2 or later.
  20. *
  21. * Template Variables:
  22. *
  23. * Form POST \ GET Variables:
  24. *
  25. * GET:
  26. * - edit
  27. * - delete
  28. * - new
  29. *
  30. * POST:
  31. * - save
  32. * - cancel
  33. * - all editable form values, see $fm_struct
  34. */
  35. require_once('common.php');
  36. authentication_require_role('admin');
  37. $extra_options = 0;
  38. if ($CONF['fetchmail_extra_options'] == 'YES') $extra_options = 1;
  39. # import control GET/POST variables. Form values are imported below.
  40. $new = (int) safeget ("new") == 1 ? 1:0;
  41. $edit = (int) safeget ("edit");
  42. $delete = (int) safeget ("delete");
  43. $save = safepost("save") != "" ? 1:0;
  44. $cancel = safepost("cancel") != "" ? 1:0;
  45. $display_status = 1;
  46. if ($new || $edit) $display_status = 0;
  47. $fm_struct=array( // list($editible,$view,$type)
  48. # field name allow editing? display field? type
  49. "id" => array(0, 0, 'id' ),
  50. "mailbox" => array(1, 1, 'enum' ),
  51. "src_server" => array(1, 1, 'text' ),
  52. "src_auth" => array(1, 1, 'enum' ),
  53. "src_user" => array(1, 1, 'text' ),
  54. "src_password" => array(1, 0, 'password' ),
  55. "src_folder" => array(1, 1, 'text' ),
  56. "poll_time" => array(1, 1, 'num' ),
  57. "fetchall" => array(1, 1, 'bool' ),
  58. "keep" => array(1, 1, 'bool' ),
  59. "protocol" => array(1, 1, 'enum' ),
  60. "usessl" => array(1, 1, 'bool' ),
  61. "extra_options" => array($extra_options, $extra_options, 'longtext' ),
  62. "mda" => array($extra_options, $extra_options, 'longtext' ),
  63. "date" => array(0, $display_status, 'text' ),
  64. "returned_text" => array(0, $display_status, 'longtext' ),
  65. );
  66. # labels and descriptions are taken from $PALANG['pFetchmail_field_xxx'] and $PALANG['pFetchmail_desc_xxx']
  67. # TODO: After pressing save or cancel in edit form, date and returned text are not displayed in list view.
  68. # TODO: Reason: $display_status is set before $new and $edit are reset to 0.
  69. # TODO: Fix: split the "display field?" column into "display in list" and "display in edit mode".
  70. $SESSID_USERNAME = authentication_get_username();
  71. if (!$SESSID_USERNAME )
  72. exit;
  73. $fm_defaults=array(
  74. "id" =>0,
  75. "mailbox" => array($SESSID_USERNAME),
  76. "poll_time" => 10,
  77. "src_auth" =>
  78. array('password','kerberos_v5','kerberos','kerberos_v4','gssapi','cram-md5','otp','ntlm','msn','ssh','any'),
  79. "protocol" =>
  80. array('POP3','IMAP','POP2','ETRN','AUTO'),
  81. );
  82. $table_fetchmail = table_by_key('fetchmail');
  83. $table_mailbox = table_by_key('mailbox');
  84. if (authentication_has_role('global-admin')) {
  85. $list_domains = list_domains ();
  86. } else {
  87. $list_domains = list_domains_for_admin(authentication_get_username());
  88. }
  89. $user_domains=implode(", ",array_values($list_domains)); # for displaying
  90. $user_domains_sql=implode("','",escape_string(array_values($list_domains))); # for SQL
  91. $sql="SELECT username FROM $table_mailbox WHERE domain in ('".$user_domains_sql."')"; # TODO: replace with domain selection dropdown
  92. $res = db_query ($sql);
  93. if ($res['rows'] > 0){
  94. $fm_defaults["mailbox"]=array();
  95. while ($name = db_array ($res['result'])){
  96. $fm_defaults["mailbox"][] = $name["username"];
  97. }
  98. }
  99. else{
  100. $fm_defaults["mailbox"]=array();
  101. $fm_defaults["mailbox"][]=$SESSID_USERNAME; # TODO: Does this really make sense? Or should we display a message "please create a mailbox first!"?
  102. }
  103. $row_id = 0;
  104. if ($delete) {
  105. $row_id = $delete;
  106. } elseif ($edit) {
  107. $row_id = $edit;
  108. }
  109. $user_mailboxes_sql= "'" . implode("','",escape_string(array_values($fm_defaults["mailbox"]))) . "'"; # mailboxes as SQL
  110. if ($row_id) {
  111. $result = db_query ("SELECT ".implode(",",escape_string(array_keys($fm_struct)))." FROM $table_fetchmail WHERE id=$row_id AND mailbox IN ($user_mailboxes_sql)");
  112. # TODO: the "AND mailbox IN ..." part should obsolete the check_owner call. Remove it after checking again.
  113. if ($result['rows'] > 0) {
  114. $edit_row = db_array ($result['result']);
  115. $account = $edit_row['src_user'] . " @ " . $edit_row['src_server'];
  116. }
  117. $edit_row_domain = explode('@', $edit_row['mailbox']);
  118. if ($result['rows'] <= 0 || !check_owner($SESSID_USERNAME, $edit_row_domain[1])) { # owner check for $edit and $delete
  119. flash_error(sprintf($PALANG['pFetchmail_error_invalid_id'], $row_id));
  120. $edit = 0; $delete = 0;
  121. }
  122. }
  123. if ($cancel) { # cancel $new or $edit
  124. $edit=0;
  125. $new=0;
  126. } elseif ($delete) { # delete an entry
  127. $result = db_query ("delete from $table_fetchmail WHERE id=".$delete);
  128. if ($result['rows'] != 1)
  129. {
  130. flash_error($PALANG['pDelete_delete_error']) . '</span>';
  131. } else {
  132. flash_info(sprintf($PALANG['pDelete_delete_success'],$account));
  133. }
  134. $delete=0;
  135. } elseif ( ($edit || $new) && $save) { # $edit or $new AND save button pressed
  136. $formvars=array();
  137. foreach($fm_struct as $key=>$row){
  138. list($editible,$view,$type)=$row;
  139. if ($editible != 0){
  140. $func="_inp_".$type;
  141. $val=safepost($key);
  142. if ($type!="password" || strlen($val) > 0) { # skip on empty (aka unchanged) password
  143. $formvars[$key]= escape_string( function_exists($func) ?$func($val) :$val);
  144. }
  145. }
  146. }
  147. $formvars['id'] = $edit; # results in 0 on $new
  148. if($CONF['database_type'] == 'pgsql' && $new) {
  149. // skip - shouldn't need to specify this as it will default to the next available value anyway.
  150. unset($formvars['id']);
  151. }
  152. if (!in_array($formvars['mailbox'], $fm_defaults['mailbox'])) {
  153. flash_error($PALANG['pFetchmail_invalid_mailbox']);
  154. $save = 0;
  155. }
  156. if ($formvars['src_server'] == '') {
  157. flash_error($PALANG['pFetchmail_server_missing']);
  158. # TODO: validate domain name
  159. $save = 0;
  160. }
  161. if (empty($formvars['src_user']) ) {
  162. flash_error($PALANG['pFetchmail_user_missing']);
  163. $save = 0;
  164. }
  165. if ($new && empty($formvars['src_password']) ) {
  166. flash_error($PALANG['pFetchmail_password_missing']);
  167. $save = 0;
  168. }
  169. if ($save) {
  170. if ($new) {
  171. $sql="INSERT INTO $table_fetchmail (".implode(",",escape_string(array_keys($formvars))).") VALUES ('".implode("','",escape_string($formvars))."')";
  172. } else { # $edit
  173. foreach(array_keys($formvars) as $key) {
  174. $formvars[$key] = escape_string($key) . "='" . escape_string($formvars[$key]) . "'";
  175. }
  176. $sql="UPDATE $table_fetchmail SET ".implode(",",$formvars).",returned_text='', date=NOW() WHERE id=".$edit;
  177. }
  178. $result = db_query ($sql);
  179. if ($result['rows'] != 1)
  180. {
  181. flash_error($PALANG['pFetchmail_database_save_error']);
  182. } else {
  183. flash_info($PALANG['pFetchmail_database_save_success']);
  184. $edit = 0; $new = 0; # display list after saving
  185. }
  186. } else {
  187. $formvars['src_password'] = ''; # never display password
  188. }
  189. } elseif ($edit) { # edit entry form
  190. $formvars = $edit_row;
  191. $formvars['src_password'] = '';
  192. } elseif ($new) { # create entry form
  193. foreach (array_keys($fm_struct) as $value) {
  194. if (isset($fm_defaults[$value])) {
  195. $formvars[$value] = $fm_defaults[$value];
  196. } else {
  197. $formvars[$value] = '';
  198. }
  199. }
  200. }
  201. $tFmail = array();
  202. if ($edit + $new == 0) { # display list
  203. # TODO: ORDER BY would even be better if it would order by the _domain_ of the target mailbox first
  204. $res = db_query ("SELECT ".implode(",",escape_string(array_keys($fm_struct)))." FROM $table_fetchmail WHERE mailbox IN ($user_mailboxes_sql) ORDER BY mailbox,src_server,src_user");
  205. if ($res['rows'] > 0) {
  206. while ($row = db_array ($res['result'])) {
  207. $tFmail[] = $row;
  208. }
  209. }
  210. }
  211. function _inp_num($val){
  212. return (int)($val);
  213. }
  214. function _inp_bool($val){
  215. return $val ? db_get_boolean(true): db_get_boolean(false);
  216. }
  217. function _inp_password($val){
  218. return base64_encode($val);
  219. }
  220. include ("./templates/header.php");
  221. include ("./templates/menu.php");
  222. include ("./templates/fetchmail.php");
  223. include ("./templates/footer.php");
  224. /* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
  225. ?>