Commit Graph

1045 Commits (161c9b1ed2c218ea4f2ad641ff0d9db23e4fc2bc)
 

Author SHA1 Message Date
Christian Boltz cebf126eff AliasHandler.php:
- escape $address in is_mailbox_alias()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@956 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz e8beac17d0 index.tpl:
- footer.tpl was accidently lost in r951, added again


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@955 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 53ecb4cb50 ru.lang:
- translation update by Pavel Usischev (pusischev @SF)
  https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3178905&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@954 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
David Goodwin b0bd8cd1f5 see changeset:952 ... move php code out of template into here
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@953 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
David Goodwin a7942d7059 move this to common.php; i dislike inline php in templates
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@952 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
David Goodwin d798138d1d i prefer english... ;-)
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@951 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
David Goodwin 43a150941b check if a variable is populated...
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@950 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
David Goodwin 7424cb0c1a remove strict standards issue with redefinition of smarty::assign() with different parameters than parent class; ideally I should not put the __get/__set/__call methods in here as living without them would reduce our dependency on smarty, but meh (PFASmarty should stil appear and BEHAVE like a Smarty object, it just technically is not one - it is just using one
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@949 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
David Goodwin cf22f1dfd4 reindent; give tMessage a default value (undefined var etc)
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@948 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
David Goodwin 834f533371 fix some undefined variables
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@947 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 515fa83809 upgrade.php: add vacation.activefrom/activeuntil even for updates from 2.3.x
- MySQL only allows one column with DEFAULT CURRENT_TIMESTAMP per table
  -> introduce {DATE} with DEFAULT 2000-01-01 as workaround
  -> GingerDog, please check if the PostgreSQL variant of {DATE} is valid
- disable upgrade_727_mysql because
  - function number is too small for upgrades from 2.3.x
  - MySQL only
  - it creates some tables PostfixAdmin doesn't use
- new function upgrade_946 to add activefrom/activeuntil fields to the
  vacation table (previously done in upgrade_727_mysql)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@946 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz fc26618140 upgrade.php: add "modified" column to vacation table, various fixes and new helper functions
- fix _pgsql_field_exists and _mysql_field_exists to work with 
  non-default table names
- new function _db_field_exists as database-independent wrapper for 
  _*_field_exists
- new function _db_add_field to add a field to a table
- new function printdebug for debug output (grey text)
- define {DATECURRENT} for timestamp fields (avoids lots of duplication)
  -> @GingerDog: please check if the PostgreSQL statement is correct!
- upgrade_945: add a 'modified' column to the vacation table
- various small changes (whitespace, comments, TODO notes etc.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@945 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Sebastian d3e68fdc8a two small bugfixes:
- syntax error
- fix commentation marks

git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@944 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz fb6ee0ea9a sk.lang:
- big translation update by Ondrej Zary (rnbw @sf) - thanks!
  https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3162501&group_id=191583

*.lang:
- added pViewlog_action_create_domain, pViewlog_action_delete_domain and
  pViewlog_action_edit_domain (was only in en.lang)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@942 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 412fe0fa48 UPGRADE.txt:
- renumbering headlines


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@941 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz ea6a7cef79 footer.tpl: remove escaping of $CONF[footer_link]
url-escaping $CONF[footer_link] makes the link look like
"http%3A%2F%2Fexample.com". Browsers interpret this as file name 
relative to the current domain and directory, not as full 
http://example.com URL. Removed escaping.

Thanks to jan-kruis @SF for pointing this out.
https://sourceforge.net/tracker/?func=detail&aid=3153035&group_id=191583&atid=937964


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@940 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
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
Christian Boltz fc4b51d938 various documentation updates:
INSTALL.TXT:
- added a note to read the official PostfixAdmin documentation first,
  and that "external" HOWTOs on the web are often outdated or incomplete.
  That might sound selfish, but would already have saved several users
  some time.
- updated some links
- added link to the wiki
- added hint about config.local.php
- added note about write access for templates_c directory for www-data

UPGRADE.txt
- added note about setup.php?debug=1
- added note about postfix config update (alias domains)
- added note about templates_c permissions


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@937 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 80412e4d60 list-virtual_alias.tpl: fix editing of aliases with $CONF[special_alias_control] == NO
- with special_alias_control = NO, no alias was editable.
  Fixed - only default_aliases should be locked (looks like == instead 
  of === needs to be used in smarty for bool comparison)
- merged conditions, simplified code


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@936 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 0afa2957e6 config.inc.php:
- better documentation for $CONF[alias_control], $CONF[alias_control_admin]
  and $CONF[special_alias_control] because the existing comments were 
  confusing (as pointed out by libertytrek in #postfixadmin)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@934 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Valkum f73c7cbad2 added some things to model class
added user_model.php for user handling
added user_controller.php for controlling user missgin view for output.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@933 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
Valkum 20e14ad664 Fixed CRYPT
added CRAM-MD5


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@929 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Valkum 3c7d04e92a Own Crypt Library. Independence of dovecotpw/doveadm pw
added some structure and tried to impelement CRYPT.

Dovecots Version is here (crypt_generate() ) http://hg.dovecot.org/dovecot-1.2/file/84373d238073/src/auth/password-scheme.c

Can someone help me with creating the lib?



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@928 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz f3450acd0a shells/alias.php:
- fixed wrong variable name for user input


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@927 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 0f4f202371 create-mailbox.php:
- let smtp_mail() construct the mail headers


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@926 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
Christian Boltz b9e562f426 INSTALL.TXT:
- fix example /etc/passwd line (had too many fields)
- moved no_address_mappings to the smtpd on port 25
- removed no_unknown_recipient_checks on port 10025


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@923 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Valkum 3004a6cafc added some snippets for new model layout. with new database framework
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@921 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 320a9331f1 added unix return code in user add. please check it!
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@919 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
Valkum 02868eb680 Added some TODOs and MARKs
Some lines in the shells are duplicate



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@917 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 f6cb87eb6e users/edit-alias.php:
- another fix for fForward_and_store on validation errors


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@914 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz da3ef2e1c0 shells/alias.php:
- changed AliasHandler->get call - it does not need the address as parameter
- adopted to true/false return values
- some minor changes and TODO notes

models-ext/AliasHandler.php
- deleted, replaced with a redirect to ../model/AliasHandler.php


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@913 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 5381f96426 users/edit-alias.php: prepared for updated AliasHandler, small fixes
- prepared for updated AliasHandler from scripts/
- user could cause an empty alias with a trick (or form manipulation).
  Checking forward_and_store for != YES instead of == NO fixes this.
- don't replace spaces in the middle of an (BTW: invalid) alias target
- preserve user input on validation error
- allowed displaying of multiple error messages
- removed unused $_POST[fVacation] variable
- some whitespace fixes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@911 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 93d80797ea functions.inc.php: last commit missed some changes to db_log():
- sorted $action_list to make it more readable
- cleanup


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@910 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz f963cc33f1 scripts/shells/user.php:
- adopted return value checks to true/false instead of shell-like 0/1
- fixed some messages in interactive mode
- various minor fixes
- added some TODO notes, but didn't do a full proofreading

scripts/models-ext/UserHandler.php:
- deleted, replaced with a redirect to /model/UserHandler.php

scripts/common.php, scripts/shells/shell.php:
- replaced obsolete "... =& new ..." with "... = new ..."


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@909 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 900615a5ec functions.inc.php: various improvements while working on UserHandler.php
- smtp_mail(): added another (currently optional) parameter.
  It can now be called with subject and body, no need to build the mail
  header in every script that needs to send a mail.
- db_delete() did not use table_by_key. Fixed, backport queued for 
  2.3 branch
- db_insert() now has array(created,modified) as default for timestamp 
  columns so that most calls can be done without that parameter
- db_update() now has array(modified) as default for timestamp column
  so that most calls can be done without that parameter
- new functions db_begin / db_commit / db_rollback - BEGIN / COMMIT / 
  ROLLBACK wrapped in a check for $CONF['database_type'] == "pgsql".
  One more step to get rid of database-specific code in all files.
- db_log(): 
  - migrated to db_insert. This should also fix some missing quoting.
  - sorted $action_list to make it more readable
  - backport queued for 2.3 branch for both changes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@907 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 36bdb2fbd0 postfixadmin-cli:
- don't clear the screen at startup


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@906 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz bf17e00daf templates_c:
- updated svn:ignore - the new smarty version seems to use different filenames


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@905 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 623d992091 functions.inc.php:
- check_domain(): don't trim() the domain - whitespace is an error.
  This catches "foo@ domain.com" that wasn't catched before.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@902 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago