update readme, add db_sync and custom sendername in alias

This commit is contained in:
Sebijk 2022-02-11 23:59:28 +01:00
parent 3c6e7e49f4
commit 323001d9ab
3 changed files with 17 additions and 5 deletions

View file

@ -21,9 +21,9 @@ on Windows can be achieved with a WSL setup.
In order to install a development environment, proceed as follows: In order to install a development environment, proceed as follows:
1. Clone the repository 1. Clone the repository
2. Go to `src/serverlib/` and copy `config.default.inc.php` to `config.inc.php` 2. Go to `src/serverlib/` and copy `config.default.inc.php` to `config.inc.php` and copy `version.default.inc.php` to `version.inc.php`.
3. Open the folder `src` in your web browser, e.g. `http://localhost/b1gMail/src/` 3. Open the folder `src` in your web browser, e.g. `http://localhost/b1gMail/src/`
4. Follow the setup instructs, use the normal serial number of your b1gMail license 4. Follow the setup instructs
## Staying up to date ## Staying up to date
When pulling new changes from the server, you will need to update your database When pulling new changes from the server, you will need to update your database
@ -35,7 +35,7 @@ the ACP fix any issues it found.
You want to contribute to the b1gMail code? Great! In order to do so, it's You want to contribute to the b1gMail code? Great! In order to do so, it's
probably the best idea to fork the b1gMail repository here and start creating your own commits. probably the best idea to fork the b1gMail repository here and start creating your own commits.
As soon as you feel the commit is mature and you would like to integrate it into the b1gMail code base, As soon as you feel the commit is mature and you would like to integrate it into the b1gMail code base,
create a merge request to the master repository and we will review it. create a merge request to the main repository and we will review it.
### Basic guidelines for commits ### Basic guidelines for commits
* Adhere to the b1gMail coding style * Adhere to the b1gMail coding style

View file

@ -1703,7 +1703,7 @@ class BMUser
global $db, $lang_user; global $db, $lang_user;
$aliases = array(); $aliases = array();
$res = $db->Query('SELECT id,email,type FROM {pre}aliase WHERE user=? ' $res = $db->Query('SELECT id,email,type,sendername FROM {pre}aliase WHERE user=? '
. 'ORDER BY ' . $sortColumn . ' ' . $sortOrder, . 'ORDER BY ' . $sortColumn . ' ' . $sortOrder,
$this->_id); $this->_id);
while($row = $res->FetchArray(MYSQLI_ASSOC)) while($row = $res->FetchArray(MYSQLI_ASSOC))
@ -1759,7 +1759,11 @@ class BMUser
foreach($aliases as $alias) foreach($aliases as $alias)
if(($alias['type']&ALIAS_SENDER) != 0 if(($alias['type']&ALIAS_SENDER) != 0
&& ($alias['type']&ALIAS_PENDING) == 0) && ($alias['type']&ALIAS_PENDING) == 0)
if(trim($this->_row['absendername']) != '') if(trim($alias['sendername']) != '')
$senders[] = sprintf('"%s" <%s>',
$alias['sendername'],
$alias['email']);
else if(trim($this->_row['absendername']) != '')
$senders[] = sprintf('"%s" <%s>', $senders[] = sprintf('"%s" <%s>',
$this->_row['absendername'], $this->_row['absendername'],
$alias['email']); $alias['email']);

8
tools/db_sync.php Normal file
View file

@ -0,0 +1,8 @@
<?php
error_reporting(E_ALL);
require '../src/serverlib/init.inc.php';
require '../src/serverlib/database.struct.php';
echo 'Syncing DB...';
$databaseStructure = unserialize(base64_decode($databaseStructure));
SyncDBStruct($databaseStructure);
echo 'DB synced...';