Dropping the -webroot parameter (which basically means hardcoding that
../common.php has to exist) allows to do quite some cleanup.
Also unconditionally require_once('../common.php') to ensure that
everything we expect in the global namespace (like the 'Conf' class) is
there.
This allows even more cleanup. We get rid of __bootstrap() and some
constants, and can simplify parameter handling.
- add check_db_version() to functions.inc.php
- add $min_db_version (needs to be updated at least before the release)
- call check_db_version in login.php, users/login.php and CLI - they'll
error out if the database layout is outdated
- change setup.php to use check_db_version()
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1853 a1433add-5e2c-0410-b055-b7f2511e0802
- displays the database scheme (for usage in upgrade.php)
PFAHandler:
- add "Scheme" to the list of available tasks
postfixadmin-cli.php:
- add "scheme" to help
This is the first patch of a series sponsored by
Bund der Deutschen Landjugend (german rural youth)
http://bdl.landjugend.info/
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1710 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
- 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
- pacrypt(), dovecot:* method:
- allow "." in dovecot method (to allow a suffix like ".b64")
- blacklist SCRAM-SHA-1 (needs -u)
- check against list of non-salted methods to be backward compatible
with dovecot < 2.1 again
Thanks to Szilagyi Jozsef <szjozsef AT yahoo DOT com> for providing
the list of non-salted methods etc.
functions.inc.php, scripts/postfixadmin-cli.php:
- drop unused global variables $table_admin and $table_alias_domain
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1529 a1433add-5e2c-0410-b055-b7f2511e0802
- marked camelize(), underscore() and variable() as public static
function to avoid PHP warnings with latest PHP (5.4.x)
- removed unused methods humanize(), tableize(), classify() and slug()
- removed unused function __enclose()
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1457 a1433add-5e2c-0410-b055-b7f2511e0802
- implement "update" for all *Handler classes by using CliEdit class
(yes, it's really that easy ;-)
This gives us a working *) CLI for "update" in interactive and
non-interactive mode.
*) TODO: test if everything works ;-)
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1447 a1433add-5e2c-0410-b055-b7f2511e0802
- new class for CLI add and edit
- based on AddTask, but big parts of __interactive()) are rewritten to:
- use $struct for the user interface (which means it will automatically
adopt to changes in the *Handler classes)
- check all entered data instantly. If an invalid value was entered,
ask again to give the user a chance to enter valid data.
- CliEdit already replaces all AddTask classes (interactive mode works,
commandline parameter mode not implementated yet)
- will also replace all EditTask classes in the future
scripts/shells/shell.php
- loadTasks(): for add, use new CliEdit instead of AddTask class
- in():
- print additional empty line if $prompt is not empty
- print error message when invalid option is chosen
- always return raw $in to avoid '0' vs. ''. vs NULL problems
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1437 a1433add-5e2c-0410-b055-b7f2511e0802