- new function db_pgsql() to replace lots of
"if ($CONF[database_type] == 'pgsql')) checks
- delete unused function boolconf()
several files:
- use db_pgsql() instead of checking $CONF[database_type]
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1582 a1433add-5e2c-0410-b055-b7f2511e0802
- rename pAdminCreate_admin_username_text to email_address
- rename pAdminEdit_admin_super_admin to super_admin
AdminHandler.php - initStruct():
- adopt to the renamed $PALANG texts
- remove some TODOs
- whitespace changes
setup.php, adminlistadmin.tpl:
- adopt to the renamed $PALANG texts
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1580 a1433add-5e2c-0410-b055-b7f2511e0802
- move mailbox_postdeletion() to MailboxHandler
- move domain_postcreation() and domain_postdeletion() to
DomainHandler
- adopt those functions for usage inside the *Handler (replace
print with $this->errormsg etc.)
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1579 a1433add-5e2c-0410-b055-b7f2511e0802
- replace usage of Inflector::camelize() with ucfirst() - for our usage,
it gives the same result with easier understandable code
- remove unused PHP5 define
shells/shell.php:
- remove definition of unused variable $shellKey, which also removes
the last usage of Inflector::underscore
- remove code that was commented out since a while
scripts/inflector.php:
- delete file, no longer needed
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1577 a1433add-5e2c-0410-b055-b7f2511e0802
model/CliHelp.php:
- new class, used for "postfixadmin-cli $module help"
- replaces the PostfixAdmin* classes in scripts/shells/*.php
model/PFAHandler.php
- add public $taskNames with the list of supported CLI commands
scripts/postfixadmin-cli.php - dispatch():
- directly set the classes to load instead of using shell->loadTasks()
- when "postfixadmin-cli $module" is called, display help instead of
error message about "invalid command ''"
- make it more readable by moving error checks to the beginning
(replaces deeply nested if's with return statements)
- remove unused code parts
scripts/shells/*.php:
- remove PostfixAdmin* classes (obsoleted by CliHelp)
- remove $tasks (now in PFAHandler)
- delete alias.php and domain.php because nothing is left
- mailbox.php still contains PasswordTask
scripts/shells/shell.php:
- remove $taskNames (moved to PFAHandler)
- remove loadTasks() (integrated in postfixadmin-cli.php's dispatch())
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1575 a1433add-5e2c-0410-b055-b7f2511e0802
- add some _formatted_*() functions to get a more informative output
(currently only used in CLI)
MailboxHandler.php:
- add TODO for reading used quota from quota/quota2 table and adding
a formatted_quota() function
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1573 a1433add-5e2c-0410-b055-b7f2511e0802
- new file for CLI 'view'
- based on the ViewTask classes in scripts/shells/*.php
- introduces usage of *Handler->_formatted_$field() to get "pretty"
output for a field
(not sure if this is the final solution, but it works ;-)
scripts/shells/*.php
- remove ViewTask, obsoleted by model/CliView.php
scripts/shells/shell.php:
- use CliView instead of ViewTask
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1572 a1433add-5e2c-0410-b055-b7f2511e0802
- new file, handles deleting something with the CLI
(based on DeleteTask in scripts/shells/*.php)
scripts/shells/*.php
- remove DeleteTask, obsoleted by model/CliDelete.php
scripts/shells/shell.php:
- use CliDelete instead of DeleteTask
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1570 a1433add-5e2c-0410-b055-b7f2511e0802
for logout.
This means:
- change logout URL to login.php in menu.conf and users_main.tpl
- delete logout.php and users/logout.php
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1569 a1433add-5e2c-0410-b055-b7f2511e0802
- delete(): check if the domain is an alias domain target - if yes, do
not allow to delete it
- better error message if domain_postdeletion() fails
*.lang:
- rename pAdminDelete_domain_error to domain_postdel_failed and change
the text
- add delete_domain_aliasdomain_target
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1567 a1433add-5e2c-0410-b055-b7f2511e0802
- new, small script to change the 'active' status
- also include CSRF protection token
edit.php:
- remove handling of 'active' to make it more readable
*list*.tpl:
- change links to use editactive.php, add CSRF token
configs/menu.conf
- add url_editactive
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1566 a1433add-5e2c-0410-b055-b7f2511e0802
- initMsg(): better texts for error_already_exists and error_does_not_exist
*.lang:
- rename pAdminCreate_admin_username_text_error2 to admin_already_exists
and change the text
- add admin_does_not_exist
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1565 a1433add-5e2c-0410-b055-b7f2511e0802
- require token for CSRF protection, see
https://sourceforge.net/p/postfixadmin/bugs/269/
login.php, users/login.php:
- create token and store it in $_SESSION
templates/*:
- add token to all delete.php links
templates/list-virtual_alias_domain.tpl:
- change delete confirmation dialog to contain "from->target"
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1564 a1433add-5e2c-0410-b055-b7f2511e0802
- use *Handler for deletion
(which also means delete.php only has 17 lines of code now - 130 lines
less than before :-)
templates/list-virtual_*.tpl:
- remove now superfluous "domain" parameter in delete.php link
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1563 a1433add-5e2c-0410-b055-b7f2511e0802
- rewrite and simplify delete()
- also cleanup fetchmail, quota and quota2 tables
AliasHandler.php:
- update delete() to match the workflow in other classes
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1562 a1433add-5e2c-0410-b055-b7f2511e0802
- make error messages in _inp_*() translateable
- make date format in SQL "translateable"
*.lang:
- add the texts needed for the changes listed above
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1556 a1433add-5e2c-0410-b055-b7f2511e0802
- remove unused $CONF['usercontol'] which leaked in with an unrelated
patch in r1374
- fixed some typos in comments
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1551 a1433add-5e2c-0410-b055-b7f2511e0802
- initStruct(): remove description for current password - it doesn't
exist in $PALANG and we don't really need a description here
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1550 a1433add-5e2c-0410-b055-b7f2511e0802
- 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
- move header() calls from index.tpl to smarty.inc.php, which means
we no longer need to use SmartyBC class
- use Smarty instead of SmartyBC class
- eval_size(): use Config::Lang instead of $PALANG
templates/header.tpl:
- move header() calls to smarty.inc.php, and drop {php} usage
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1544 a1433add-5e2c-0410-b055-b7f2511e0802
- use AdminHandler to find out if the logged in user is a superadmin
- add hint about config.local.php in "unconfigured" warning
- move some lines around to match users/login.php
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1543 a1433add-5e2c-0410-b055-b7f2511e0802
- move "unmaintained" warning to templates/backupwarning.tpl (that's
the easiest way to have working HTML tags)
- remove <p> tag from pgsql error message
templates/backupwarning.tpl
- new file, contains the "unmaintained" warning for backup.php
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1542 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
- getList: change return value to be always true (even if the database
result is an empty array), and die() if the database result is not an
array.
This avoids some if blocks in various files to implement a fallback
to array() on empty results.
functions.inc.php:
- list_admins(): simplify after the *Handler->getList() change
- get_domain_properties(): change a forgotten $handler->return to
$handler->result() (follow-up for r1534)
list-domain, list-virtual.php:
- simplify after the *Handler->getList() change
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1535 a1433add-5e2c-0410-b055-b7f2511e0802