19 declare(strict_types=1);
    32         if ($this->db->tableExists(
'mail') && $this->db->tableColumnExists(
'mail', 
'm_email')) {
    33             $this->db->dropTableColumn(
'mail', 
'm_email');
    39         $result = $this->db->queryF(
'SELECT value FROM settings WHERE module = %s AND keyword = %s', [
'text', 
'text'], [
'common', 
'mail_system_sys_signature']);
    40         $row = $this->db->fetchAssoc($result);
    41         if (isset($row[
'value']) && $row[
'value'] !== 
'') {
    42             $new_value = str_replace([
'[CLIENT_NAME]', 
'[CLIENT_DESC]', 
'[CLIENT_URL]'], [
'[INSTALLATION_NAME]', 
'[INSTALLATION_DESC]', 
'[ILIAS_URL]'], $row[
'value']);
    43             if ($new_value !== $row[
'value']) {
    44                 $this->db->manipulateF(
    45                     'UPDATE settings SET value = %s WHERE module = %s AND keyword = %s',
    46                     [
'text', 
'text', 
'text'],
    47                     [$new_value, 
'common', 
'mail_system_sys_signature']
    55         $result = $this->db->query(
"SELECT tpl_id, m_message FROM mail_man_tpl WHERE m_message LIKE '%[CLIENT_NAME]%'");
    56         while ($row = $this->db->fetchAssoc($result)) {
    57             if (isset($row[
'm_message'], $row[
'tpl_id']) && $row[
'm_message'] !== 
'' && $row[
'tpl_id'] !== 
'') {
    58                 $new_value = str_replace(
'[CLIENT_NAME]', 
'[INSTALLATION_NAME]', $row[
'm_message']);
    59                 if ($new_value !== $row[
'm_message']) {
    60                     $this->db->manipulateF(
    61                         'UPDATE mail_man_tpl SET m_message = %s WHERE tpl_id = %s',
    63                         [$new_value, $row[
'tpl_id']]
    72         $result = $this->db->query(
"SELECT lang, type, body FROM mail_template WHERE body LIKE '%[CLIENT_NAME]%'");
    73         while ($row = $this->db->fetchAssoc($result)) {
    74             if (isset($row[
'lang'], $row[
'type'], $row[
'body']) && $row[
'body'] !== 
'') {
    75                 $new_value = str_replace(
'[CLIENT_NAME]', 
'[INSTALLATION_NAME]', $row[
'body']);
    76                 if ($new_value !== $row[
'body']) {
    77                     $this->db->manipulateF(
    78                         'UPDATE mail_template SET body = %s WHERE lang = %s AND type = %s',
    79                         [
'text', 
'text', 
'text'],
    80                         [$new_value, $row[
'lang'], $row[
'type']]
    89         if ($this->db->tableExists(
'mail_options') && $this->db->tableColumnExists(
'mail_options', 
'linebreak')) {
    90             $this->db->dropTableColumn(
'mail_options', 
'linebreak');
    96         if (!$this->db->tableColumnExists(
'mail_options', 
'absence_status')) {
    97             $this->db->addTableColumn(
   112         if (!$this->db->tableColumnExists(
'mail_options', 
'absent_from')) {
   113             $this->db->addTableColumn(
   128         if (!$this->db->tableColumnExists(
'mail_options', 
'absent_until')) {
   129             $this->db->addTableColumn(
   144         if (!$this->db->tableColumnExists(
'mail_options', 
'absence_ar_body')) {
   145             $this->db->addTableColumn(
   159         if (!$this->db->tableColumnExists(
'mail_options', 
'absence_ar_subject')) {
   160             $this->db->addTableColumn(
   162                 'absence_ar_subject',
   175         if (!$this->db->tableExists(
'mail_auto_responder')) {
   176             $this->db->createTable(
   177                 'mail_auto_responder',
   190                         'type' => 
'timestamp',
   195             $this->db->addPrimaryKey(
'mail_auto_responder', [
'sender_id', 
'receiver_id']);
   202             'mail_system_sys_signature',
   203             'mail_system_usr_from_name',
   207             $res = $this->db->queryF(
   208                 "SELECT value FROM settings WHERE keyword = %s AND value IS NOT NULL AND value != ''",
   212             if ($this->db->numRows(
$res) === 1) {
   213                 $value = $this->db->fetchAssoc(
$res)[
'value'] ?? 
'';
   218                 $value = preg_replace(
   224                 $this->db->manipulateF(
   225                     'UPDATE settings SET value = %s WHERE keyword = %s',
 
prepare(ilDBInterface $db)