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
- start rewrite based on PFAHandler
- add initStruct(), initMsg(), webformConfig(), validate_new_id(),
create_allowed()
- drop old __construct() and view()
- replace $this->username with $this->id
- replace check of old password in change_pw() with $this->login
users/password.php:
- adopt to *Handler syntax
scripts/shells/mailbox.php:
- adopt to *Handler view() syntax
- add TODO - maildir column isn't displayed
xmlrpc.php:
- adopt to *Handler syntax
Note: as usual, the changes in xmlrpc.php are untested ;-)
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1360 a1433add-5e2c-0410-b055-b7f2511e0802
- use strtolower()/strtoupper() instead of low()/up() shortnames.
This makes the code slightly longer, but easier to understand because
strtolower()/strtoupper() are well-known function names
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1213 a1433add-5e2c-0410-b055-b7f2511e0802
- new config option $CONF['password_validation'] - array with regular
expressions to check if a password is valid/good enough.
The default configuration enforces:
- minimum length 5 characters/digits/whatever
- at least 2 characters
- at least 2 digits
- removed $CONF['min_password_length'] - it's now handled in /.{5}/ in
$CONF['password_validation']
functions.inc.php
- new function validate_password to check a given password against
$CONF['password_validation']
- generate_password: generated password is always 8 chars long
(instead of $CONF['min_password_length'])
edit-admin.php, users/password.php, edit-mailbox.php, setup.php:
- use validate_password instead of $CONF['min_password_length']
This implements
https://sourceforge.net/tracker/?func=detail&aid=1785513&group_id=191583&atid=937967
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1192 a1433add-5e2c-0410-b055-b7f2511e0802
(as discussed with GingerDog on IRC yesterday).
Also renamed user to mailbox in the CLI.
- renamed model/UserHandler.php to MailboxHandler.php
- renamed scripts/shells/user.php to mailbox.php
- replaced UserHandler / user with MailboxHandler / mailbox in various files
- unrelated cleanup: deleted obsolete scripts/models-ext directory
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1019 a1433add-5e2c-0410-b055-b7f2511e0802