Commit Graph

27 Commits (ea6a7cef79f5e1145d1b2d10fe3775fe5523f873)

Author SHA1 Message Date
Christian Boltz 02391146b2 AliasHandler.php: fix false positives in is_mailbox_alias and various
small fixes and cleanups

- get(): whitespace fix
- is_mailbox_alias(): avoid false positives if $address is a mailbox,
- is_mailbox_alias(): remove disabled (commented) old code
- update(): remove unused variable $true
- delete(): removed superfluous parameter in $this->get() call
- delete(): removed outdated FIXME note


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@939 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz ccda9cd995 VacationHandler.php proofreading results: small changes and some TODO notes
- added several TODO notes
- use db_insert/db_update/db_delete instead of raw queries
- get_details(): error check first (for better readable code),
  whitespace fix
- getVacationAlias: str_replace is enough


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@938 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Valkum 0ca6c9f239 Done is_mailbox_alias todo. Now it checks against the database.
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@932 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 4a2b40e100 changed db_update parameters for the most common usecase "WHERE col=value" -
column and value are separate parameters now

functions.inc.php:
- changed function db_update() parameters - column name and value for the WHERE
  condition are now two separate parameters. This means we don't need to
  escape_string(), add quotes etc. for most UPDATE queries.
  Example call: db_update('alias', 'address', $this->username, $values_array)
- the previous db_update() is now called db_update_q()

model/UserHandler.php:
- changed db_update call to the new parameters
- removed now unused variables
- renamed $username to $E_username
- call pacrypt directly when setting the $set array, no need for $new_db_password

model/AliasHandler.php
- changed db_update call to the new parameters

edit-mailbox.php
- switched to db_update_q()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@931 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 9aa96dabd0 (mostly) make CLI "alias delete" working
shells/alias.php:
- execute still called help() instead of __handle()

model/AliasHandler.php - delete():
- remove useless $address parameter from delete() (we have $this->username)
- added error messages
- fixed variable names for db_log

Reason for the "mostly":
The $this->is_mailbox_alias() in delete() always returns true and therefore
forbids deletion.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@930 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz fe2d4ba129 moved scripts/models-ext/* to model/
- moved scripts/models-ext/DomainHandler.php to model/
- deleted redirect scripts in scripts/models-ext/ (UserHandler.php, 
  AliasHandler.php)
- changed scripts/common.php to include the files from ../model/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@925 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 221c18bbc3 AliasHandler.php:
- rewrote delete(): 
  - error checks first (better readable than nested if blocks)
  - use db_delete
  - db_log() alias deletion
- removed outdated comments
- some whitespace fixes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@924 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Valkum c6771f7f04 some todos done or partially done
-added alias delete function
-remove silly password function in domain and alias

-changed some $this->err to $this->error
-error ends with stop(1) which returns 1 in *unix shells



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@920 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Valkum f98dfda9ed added some comments
missed in the previous commit


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@918 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 9c5084af04 model/UserHandler.php: fix verifying old password in change_pw()
- if you want to verify the old password, you should compare it against 
  the OLD and not the NEW password ;-)
- fix database calls

In other words: changing the password in users/password.php works again ;-)

users/password.php:
- switch from obsolete change_pass() to change_pw()



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@916 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 8e62ef1630 AliasHandler.php proofreading results: various fixes and changes
- pass $username through strtolower()
- get(): error check first for better readability (avoids long if block)
- get(): fixed a forgotten return behaviour change
- get(): renamed $new_list to $filtered_list (self-explaining code)
- update(): migrated to new return behaviour of get()
- update(): use db_update etc.
- some minor changes
- added various TODO notes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@915 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 42573d3e4e model/AliasHandler.php:
changed behaviour of get()

- get() now returns only true (success) / false (failure) instead of
  the alias list
  (result of partly merging in scripts/models-ext/AliasHandler.php)
- new method result() to get the real result (alias targets)
- added TODO on if(sizeof($addresses) == 0) - this should never happen

model/VacationHandler.php:
- updated for new AliasHandler bevaviour

xmlrpc.php:
- updated for new AliasHandler bevaviour
- switched from obsolete change_pass to change_pw method


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@912 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 1a0d584bf9 model/UserHandler.php: proofreading, lots of changes and added TODO comments
- change_pass() now returns the return value of change_pw()
- made most variables un-escaped (as expected by db_insert/db_update/
  db_delete). This means they HAVE TO BE ESCAPED when using them in a
  hand-written query. (Error messages also need escaping - the
  backslashes from escape_string wouldn't help there anyways.)
- escaped variables renamed to $E_whatever
- changed all return values to true (success) and false (failure)
  instead of shell-like 0 (success) and 1 (failure)
- removed unused global $config at various places
- removed timestamp columns from db_insert and db_update call where they
  match the default
- added db_log() for some (but not all) failures
- honor $CONF[maildir_name_hook] when creating a mailbox
- splitting a mail address is now done with list(...) = explode(...)
- switched to db_begin(), db_commit(), db_rollback()
- let smtp_mail create the mail header
- added missing db_commit in delete()
- various minor fixes, code cleanup, comments and TODO notes

To sum it up: all code in UserHandler.php that does not have a TODO
attached should be fine :-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@908 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 48af3c856e UserHandler.php: merge in changes from scripts/models-ext/UserHandler.php
- merged in all new functions and changes (by valkum + some bugfixes 
  and notes from me) - for details see r831, r888 and r891 of 
  scripts/models-ext/UserHandler.php
- re-added change_pass() function (was removed/renamed by valkum) for 
  backward compatibility. 
  IMPORTANT: change_pass will only exist temporarily and is deprecated.
  Besides that, the new implementation has different return values etc.
  so existing code might break already.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@896 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 4c912f1da8 list-virtual.php:
- hand over $search to smarty templates

templates/list-virtual_alias.tpl, templates/list-virtual_alias_domain.tpl:
- add search result highlighting

templates/list-virtual_mailbox.tpl:
- add search result highlighting
- move output of "Mailbox" / "Forward only" outside the foreach loop
  (was displayed once per mailbox alias target)

css/default.css:
- add style for ".searchresult"



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@868 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Sebastian 5275e17c20 - add ability to choose activation date for vacation message in user module
- add files to user module
TODO: clean up whole user module, use VacationHandler in admin module

git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@764 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Sebastian b1287d97e2 - big merge of Postfixadmin smarty into trunk
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@757 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Christian Boltz 365f34a43a model/*.php:
- fix unquoted boolean values in sql queries which probably caused postgresql errors


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@712 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Christian Boltz eb6e7e0709 model/*, tests/*:
- added a vim: comment for tab expansion etc.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@628 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Christian Boltz 166b93423f model/AliasHandler.php:
- really ;-) fix undefined variable $username


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@626 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Christian Boltz be00d3542e xmlrpc.php:
- remove session_start() - the session is already started in common.php

model/UserHandler.php:
- db_log() used undefined variable $USERID_USERNAME - use $username instead


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@625 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
David Goodwin b0723045b4 AliasHandler: fix undefined varaible (domain - line 157)
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@624 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
David Goodwin 667b00d13f fix errors e.g. see https://sourceforge.net/tracker/?func=detail&aid=2711888&group_id=191583&atid=937964
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@603 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
David Goodwin 139ebbb170 bug fixes
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@585 a1433add-5e2c-0410-b055-b7f2511e0802
16 years ago
David Goodwin 302914abc0 fix bugs found in initial tesitng
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@583 a1433add-5e2c-0410-b055-b7f2511e0802
16 years ago
David Goodwin 87461233d9 add xmlrpc server support - TOTALLY NOT TESTED YET!!!
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@579 a1433add-5e2c-0410-b055-b7f2511e0802
16 years ago
David Goodwin 53182c4922 refactoring of users (most app logic is now in /model)
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@575 a1433add-5e2c-0410-b055-b7f2511e0802
16 years ago