Commit Graph

43 Commits (99f871d45d9bac1776113590a4fead83235197af)

Author SHA1 Message Date
Christian Boltz 60297e483c *.lang:
- 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
11 years ago
Christian Boltz 6e2e132bac remove "postfixadmin.com" in comments in lots of files
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1558 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 8df6e37dcf setup.php:
- fix displaying the success message for creating a new admin


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1553 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz e96544e815 model/PFAHandler.php, setup.php:
- use Config::lang_f() for $this->msg['successmessage']

*.lang:
- add %s to all texts used for 'successmessage'


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1540 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 4d9a338eb2 After hunting an "undefined index transport" error in list-domain, I
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
11 years ago
Christian Boltz 08c9b4e49f *.lang:
- renamed some $PALANG texts:
  - pOverview_button => go
  - pOverview_mailbox_name => name
  - pSendmail_admin => from
  - pAdminEdit_admin_username => admin
  - pEdit_alias_goto => to 
- deleted obsolete or duplicate $PALANG texts:
  - pOverview_alias_goto
  - pCreate_alias_goto
  - pEdit_alias_button
  - pEdit_mailbox_name
  - pEdit_mailbox_button
  - pViewlog_username
  - pViewlog_button
  - pAdminList_admin_username
  - pAdminList_virtual_button
  - pAdminList_virtual_alias_address
  - pAdminList_virtual_alias_goto
  - pAdminList_virtual_mailbox_name
  - pAdminEdit_domain_button
  - pAdminEdit_admin_button
  - pBroadcast_from
  - pBroadcast_send

model/*, setup.php, templates/*, users/edit-alias.php:
- update to use the renamed $PALANG texts


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1513 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 76f66ac8db *.lang:
- rename some $PALANG variables once more because smarty breaks when
  using "-"
  - add-alias => add_alias
  - add-alias-domain => add_alias_domain
  - add-mailbox => add_mailbox
  - email-address-already-exists => email_address_already_exists
  - change-password => change_password
  - password-again => password_again

model/*, setup.php, templates/*
- update to use the changed $PALANG variables


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1511 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 9c0004a431 *.lang:
- rename various $PALANG texts:
  - pMenu_create_alias => add-alias
  - pMenu_create_alias_domain => add-alias-domain
  - pMenu_create_mailbox => add-mailbox
  - pOverview_get_mailboxes => mailboxes
  - pPassword_button => change-password
  - pAdminList_domain_description => description
  - pAdminList_domain_aliases => aliases
  - pAdminEdit_domain_transport => transport
  - pAdminEdit_admin_password2 => password-again
- remove duplicate or unused $PALANG texts:
  - pOverview_alias_alias_count
  - pOverview_alias_mailbox_count
  - pOverview_get_aliases
  - pCreate_alias_domain_button
  - pCreate_alias_welcome
  - pCreate_alias_button
  - pCreate_mailbox_password2
  - pCreate_mailbox_quota_text_error
  - pCreate_mailbox_button
  - pAdminMenu_viewlog
  - pAdminMenu_create_alias
  - pAdminMenu_create_mailbox
  - pAdminList_domain_mailboxes
  - pAdminList_domain_transport
  - pAdminList_virtual_welcome
  - pAdminList_virtual_alias_alias_count
  - pAdminList_virtual_alias_mailbox_count
  - pAdminList_virtual_mailbox_username
  - pAdminList_virtual_mailbox_quota
  - pAdminEdit_domain_description
  - pAdminEdit_domain_aliases
  - pAdminEdit_domain_mailboxes
  - pAdminEdit_domain_mailboxes_text
  - pUsersMenu_password

model/*, seetup.php, templates/*
- use changed $PALANG texts


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1510 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 80591f97bc *.lang:
- add $PALANG['password'] to replace duplicate texts
  -$PALANG['pLogin_password']
  -$PALANG['pCreate_mailbox_password']
  -$PALANG['pAdminEdit_admin_password']
- set $PALANG['pFetchmail_field_src_password']= $PALANG['password']; 
  (needed until fetchmail is migrated into FetchmailHandler)

model/*, setup.php, templates/*:
- use $PALANG['password'] everywhere	  


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1504 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz c5b8814130 setup.php:
- add TODO note to check for PHP >= 5.2.3 because smarty uses 
  htmlentities with 4 parameters (4th param added in PHP 5.2.3)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1499 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 880e6f50ae setup.php:
- explicitely specify (empty) values for description and transport when 
  creating the "ALL" domain to fix problems with strict SQL mode in MariaDB
  https://sourceforge.net/p/postfixadmin/bugs/288/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1497 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 51434a05a6 setup.php
- replace some strings marked as obsolete


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1463 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz ee33647232 setup.php
- add rewritten function create_admin() (now using AdminHandler, 
  which means 25 instead of 80 lines)
- various follow-up changes to match the rewritten function create_admin()

functions.inc.php:
- delete function create_admin() - setup.php was the last file calling it
- honor POSTFIXADMIN_SETUP in authentification_get_username() to avoid
  a redirect to login.php after creating an admin with setup.php and to
  get "SETUP.PHP" for db_log()

model/AdminHandler.php:
- add TODO: implement generate_password


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1301 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 69b3df10e4 config.inc.php
- 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
13 years ago
Christian Boltz 9f2a0db106 create_admin() cleanup
functions.inc.php:
- create_admin(): use db_insert instead of INSERT queries
  (this includes automatic escaping of all values)

create-admin.php:
- use safepost instead of isset($_POST[...])
- don't escape_string post values - it's done inside create_admin now
- remove superfluous emptying of empty $tDomains for GET
- allow htmlentities-escaping for pAdminCreate_admin_username_text
- some whitespace / linebreak changes

setup.php:
- load config.inc.php only once (loading it twice will break if custom
  hook functions exist in config.*.php - "can't redefine function ...")
- use safepost instead of isset($_POST[...])
- don't escape_string post values - it's done inside create_admin now
- escape $tUsername with htmlentities() instead of escape_string



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1190 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 5fdb814ca4 setup.php:
- renamed $tMessage to $setupMessage

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1078 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz d0327cbbc7 setup.php:
- make check for $CONF['configured'] more strict (=== instead of ==)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@976 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 e701d6e756 - improved error message of setup.php
- Use $incpath in setup.php to make sure nobody is doing evil things

git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@763 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Sebastian cf40467570 - accidentially deleted header.php. Needed for setup
- add some error checks.

git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@759 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Christian Boltz 562ab4dc14 setup.php:
- define('POSTFIXADMIN') to avoid session_start() call in common.php
  This avoids breakage if php5-session is not installed. Fixes
  https://sourceforge.net/tracker/?func=detail&aid=2855430&group_id=191583&atid=937964

common.php
- only define('POSTFIXADMIN') if it is not yet defined (avoids a warning)



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@733 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Christian Boltz 5ec73b7044 setup.php:
- added form to create setup password hash. It will be displayed if
  a) no setup password is defined yet
  b) the "lost password" link was clicked
- moved checks for empty and too short passwort into check_setup_password()
- added an optional $lostpw_mode parameter to check_setup_password() which
  causes slightly different behaviour (enforces generation of new hash, even
  if the password would match)
- changed check_password_setup() return value to array($error, $message)
- moved displaying $tMessage above the form - it is more useful there.
- removed "see config.inc.php" notice from password field in "create superadmin" 
  form - this hint doesn't help much with the hashed password ;-)
- TODO: The if statements to decide which form to display is quite difficult
  (and will become unreadable in case we need another form ;-)
  We should think about a better way to select the form to display...
  (maybe flash_error / flash_info + redirect?)

upgrade.php:
- added missing <p> tag


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@648 a1433add-5e2c-0410-b055-b7f2511e0802
16 years ago
David Goodwin c4c88ccabb setup.php: remove duplication of error message ...
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@633 a1433add-5e2c-0410-b055-b7f2511e0802
16 years ago
Christian Boltz 05e832ca8c setup.php:
- setup_password is now checked against a hashed value instead of plain text
- setup.php will display the hash value of the entered password if it 
  doesn't match - copy&paste ready to include in config.inc.php. 
  No need to compute the password hash yourself ;-)
- see generate_setup_password_salt(), encrypt_setup_password() and
  check_setup_password() for details how the password hashing works.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@629 a1433add-5e2c-0410-b055-b7f2511e0802
16 years ago
Christian Boltz ac26b96152 setup.php:
- remove "define('POSTFIXADMIN', 1)" and inclusion of en.lang - this is 
  already done by common.php (used since r616).
  This fixes a "already defined" warning.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@623 a1433add-5e2c-0410-b055-b7f2511e0802
16 years ago
David Goodwin e4498461ba setup.php: reindent; require setup_password before it will add an admin user
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@616 a1433add-5e2c-0410-b055-b7f2511e0802
16 years ago
David Goodwin f22ac38db3 require php5
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@576 a1433add-5e2c-0410-b055-b7f2511e0802
16 years ago
Christian Boltz 11c39af699 - added/fixed vim: lines to nearly all *.php files (exception: templates/*)
(ts=3 or ts=4 depending on the file content)
- several whitespace fixes
- (no code changes)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@566 a1433add-5e2c-0410-b055-b7f2511e0802
16 years ago
David Goodwin 43cfa0136f try to be more helpful
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@523 a1433add-5e2c-0410-b055-b7f2511e0802
16 years ago
David Goodwin 2e2ae0c36b setup.php: fix table_by_key issue for domain table
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@489 a1433add-5e2c-0410-b055-b7f2511e0802
16 years ago
Christian Boltz d81a199597 setup.php:
- check if imap_open is available. If not, print a warning.
  This was indirectly ;-) requested in
  https://sourceforge.net/forum/forum.php?thread_id=2071718&forum_id=676076


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@379 a1433add-5e2c-0410-b055-b7f2511e0802
17 years ago
Christian Boltz c9e613c1e5 setup.php:
- remove warning that apache version can't be detected when running on
  another webserver software
  https://sourceforge.net/tracker/index.php?func=detail&aid=1865122&group_id=191583&atid=937964


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@370 a1433add-5e2c-0410-b055-b7f2511e0802
17 years ago
David Goodwin 45ee01a551 setup.php - call upgrade.php to undertake DB upgrade/table creation as necessary (revert previous change to $CONF[configured] too)
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@328 a1433add-5e2c-0410-b055-b7f2511e0802
17 years ago
Christian Boltz ba0c3780b4 setup.php:
- added hardcoded $CONF['theme_logo'] and $CONF['theme_css'] to fix the 
  layout


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@320 a1433add-5e2c-0410-b055-b7f2511e0802
17 years ago
Christian Boltz 88c3246764 setup.php:
- added check for $CONF['configured']


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@289 a1433add-5e2c-0410-b055-b7f2511e0802
17 years ago
Christian Boltz d821e03b93 setup.php:
- added check for multibyte string extension (mb_encode_mimeheader)
- added note that Apache version check failure can be ignored if another
  webserver is used


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@268 a1433add-5e2c-0410-b055-b7f2511e0802
17 years ago
Christian Boltz 9ef961a770 setup.php:
- added missing define('POSTFIXADMIN', 1);
  https://sourceforge.net/forum/message.php?msg_id=4660403


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@258 a1433add-5e2c-0410-b055-b7f2511e0802
17 years ago
David Goodwin 39953d029d rename templates to .php instead of .tpl
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@250 a1433add-5e2c-0410-b055-b7f2511e0802
17 years ago
David Goodwin ef7b6f0925 setup.php: try and make sure the "ALL" domain exists to start with when creating the super admin user; fix html so li elements are closed
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@180 a1433add-5e2c-0410-b055-b7f2511e0802
17 years ago
Christian Boltz 2d65b8b858 - setup.php now has a "create superadmin" form
- completely reworked HTML code in setup.php
- moved admin creation code from create_admin.php to functions.php,
  function create_admin
- several related changes in functions.inc.php:
  - use table_by_key() directly instead of the cached variables (which
    are empty if config.inc.php was not read before functions.php)
  - add an additional (optional) parameter $setup to db_connect, changed
    many die(msg) calls to $error_message .= msg.
    If $setup is given, the return value is array($link, $error_text)
    instead of $link
  - db_connect now checks for invalid $CONF['database_type']


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@135 a1433add-5e2c-0410-b055-b7f2511e0802
17 years ago
David Goodwin dc51d62e15 update license headers
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@107 a1433add-5e2c-0410-b055-b7f2511e0802
17 years ago
David Goodwin 68511080ff setup.php: setting magic quotes off should be the ideal setting
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@66 a1433add-5e2c-0410-b055-b7f2511e0802
17 years ago
Mischa Peters 85dc57beee Initial Import in SourceForge
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1 a1433add-5e2c-0410-b055-b7f2511e0802
18 years ago