forked from toteph42/identity_switch
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathidentity_switch.php
More file actions
720 lines (612 loc) · 19.9 KB
/
identity_switch.php
File metadata and controls
720 lines (612 loc) · 19.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
<?php
declare(strict_types=1);
/*
* Identity switch RoundCube Bundle
*
* @copyright (c) 2024 - 2025 Florian Daeumling, Germany. All right reserved
* @license https://github.com/toteph42/identity_switch/blob/master/LICENSE
*/
/**
*
* Data structure
*
* config configuration data
* logging loggin level to 'logs/identity_switch.log'
* check allow new mail checking
* interval specify interval for checking of new mails
* delay delay between each new mail check
* retries specify no. of retries for reading data from mail server
* wait max. number of seconds to wait for response from identity_switch_newmails.php
* language language used
* cache all session variables used by identity switch
* data unseen exchange data file
* fp file pointer
* iid active identity
* lock lock all activities
* [n] cached identity data
* label label
* flags flags
* imap_user IMAP user
* imap_pwd IMAP password
* imap_host IMAP host
* imap_delim golder delimiter
* imap_port IMAP port
* smtp_user SMTP user
* smtp_pwd SMTP password
* smtp_host SMTP host
* smtp_port SMTP port
* notify_timeout notification timeout
* newmail_check new mail check interval
* folders special folder name array
* unseen # of unseen messages
* checked_last last time checked
* notify notify user flag
*
*/
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Filesystem\Path;
require_once \INSTALL_PATH.'plugins/identity_switch/identity_switch_prefs.php';
require_once \INSTALL_PATH.'plugins/identity_switch/identity_switch_newmails.php';
class identity_switch extends identity_switch_prefs
{
/**
* Initialize Plugin
*
* {@inheritDoc}
* @see rcube_plugin::init()
*/
function init(): void
{
$rc = rcmail::get_instance();
// identity switch hooks and actions
$this->add_hook('startup', [ $this, 'on_startup' ]);
$this->add_hook('render_page', [ $this, 'on_render_page' ]);
$this->add_hook('smtp_connect', [ $this, 'on_smtp_connect' ]);
$this->add_hook('template_object_composeheaders', [ $this, 'on_object_composeheaders' ]);
$this->register_action('identity_switch_do', [ $this, 'identity_switch_do_switch' ]);
// preference hooks and actions
parent::init();
// notification hooks and action
if ($rc->output instanceof rcmail_output_html) {
$rc->output->add_script('identity_switch_init();', 'head_top');
$rc->output->include_script('../../plugins/identity_switch/assets/identity_switch.js');
}
// new mail hooks and action
$this->add_hook('new_messages', [ $this, 'catch_newmails' ]);
$this->add_hook('refresh', [ $this, 'check_newmails' ]);
$this->add_hook('ready', [ $this, 'check_newmails' ]);
// LDAP hooks
if ($rc->config->get('ldapAliasSync', null))
$this->add_hook('storage_connect', [ $this, 'override_ldap_password' ]);
$this->include_stylesheet('assets/identity_switch.css');
// check for symlink in public_html for RoundCube >= 1.6
$link = 'plugins/identity_switch';
$fs = new Filesystem();
if (!$fs->exists($link)) {
if (!$fs->exists(\INSTALL_PATH.'public_html/'.$link)) {
$path = \INSTALL_PATH.'plugins/identity_switch';
// check for Windows OS
if ('\\' === \DIRECTORY_SEPARATOR)
$fs->symlink($path, $link);
else
$fs->symlink(Path::makeRelative($path, Path::getDirectory($link)), $link);
self::write_log(__FILE__, __LINE__, 'Creating symlink "'.$link.'" to "'.$path.'"', true);
}
}
}
/**
* Startup script
*
* @param array $args
* @return array
*/
function on_startup(array $args): array
{
$rc = rcmail::get_instance();
// not default user?
if (isset($_SESSION['username']) && strcasecmp($rc->user->data['username'], $_SESSION['username']) !== 0)
{
// we are impersonating
$rc->config->set('imap_cache', null);
$rc->config->set('messages_cache', false);
if ($args['task'] == 'mail')
{
$this->add_texts('localization/');
$rc->config->set('create_default_folders', false);
}
}
return $args;
}
/**
* Dispatch action
*
* @param array $args
* @return array
*/
function on_render_page(array $args): array
{
$rc = rcmail::get_instance();
switch ($rc->task)
{
case 'mail':
$this->add_texts('localization');
if (self::get('iid') > 0)
{
if ($args['template'] == 'mail')
{
while (self::get('lock'))
usleep(100);
self::create_menu();
}
break;
}
$iid = $rc->user->get_identity();
$iid = $iid['identity_id'];
// create defaults for default user
self::get($iid);
// set default user number
self::set('iid', $iid);
// collect data for default identity
$i = $rc->user->get_identity();
self::set($iid, 'label', $i['name']);
self::set($iid, 'flags', self::ENABLED);
// swap IMAP data
self::set($iid, 'imap_user', $_SESSION['username']);
self::set($iid, 'imap_pwd', $_SESSION['password']);
self::set($iid, 'imap_host', $_SESSION['storage_host']);
self::set($iid, 'imap_port', $_SESSION['storage_port']);
if ($_SESSION['storage_ssl'] == 'ssl')
self::set($iid, 'flags', self::get($iid, 'flags') | self::IMAP_SSL);
if ($_SESSION['storage_ssl'] == 'tls')
self::set($iid, 'flags', self::get($iid, 'flags') | self::IMAP_TLS);
self::set($iid, 'imap_delim', $_SESSION['imap_delimiter']);
// swap SMTP data
self::set($iid, 'smtp_user', $_SESSION['username']);
self::set($iid, 'smtp_pwd', $_SESSION['password']);
$hosts = $rc->config->get('smtp_host');
if (!is_array ($hosts))
$hosts = [ $_SESSION['storage_host'] => $hosts ];
$host = null;
foreach ($hosts as $imap => $smtp)
{
if (!strcmp($imap, $_SESSION['storage_host']))
{
$host = $smtp;
break;
}
}
if (!$host)
{
self::write_log(__FILE__, __LINE__, 'Cannot discover associated SMTP host to IMAP server "'.
$_SESSION['storage_host'].'" - substituting with "localhost"');
$host = 'localhost';
}
// parse host name for special characters
$host = rcube_utils::parse_host($host);
if (substr($host, 3, 1) == ':')
{
if (strtolower(substr($host, 0, 3)) == 'ssl')
{
self::set($iid, 'flags', self::get($iid, 'flags') | self::SMTP_SSL);
$host = substr($host, 6);
self::set($iid, 'smtp_port', 465);
}
elseif (strtolower(substr($host, 0, 3)) == 'tls')
{
self::set($iid, 'flags', self::get($iid, 'flags') | self::SMTP_TLS);
$host = substr($host, 6);
self::set($iid, 'smtp_port', 587);
}
// Unknown protocoll
if (($p = strpos($host, ':')) !== false)
{
self::set($iid, 'smtp_port', substr($host, $p + 1));
$host = substr($host, 0, $p);
}
}
self::set($iid, 'smtp_host', $host);
$prefs = $rc->user->get_prefs();
// swap nofication data
$p = 'newmail_notifier_';
if (isset($prefs['check_all_folders']) && $prefs['check_all_folders'])
self::set($iid, 'flags', self::get($iid, 'flags') | self::CHECK_ALLFOLDER);
foreach ([ 'basic' => self::NOTIFY_BASIC,
'desktop' => self::NOTIFY_DESKTOP,
'sound' => self::NOTIFY_SOUND] as $k => $v)
{
if (isset($prefs[$p.$k]) && $prefs[$p.$k] == 1)
self::set($iid, 'flags', self::get($iid, 'flags') | $v);
}
if (isset($prefs[$p.'_desktop_timeout']))
self::set($iid, 'notify_timeout', $prefs[$p.'_desktop_timeout']);
// swap new mail check interval
self::set($iid, 'newmail_check', (int)(isset($prefs['refresh_interval']) ? $prefs['refresh_interval'] :
$rc->config->get('refresh_interval')));
// swap special folder names
$box = [];
foreach (rcube_storage::$folder_types as $mbox)
$box[$mbox] = isset($prefs[$mbox.'_mbox']) ? $prefs[$mbox.'_mbox'] : '';
self::set($iid, 'folders', $box);
if (isset($prefs['show_real_foldernames']) && $prefs['show_real_foldernames'] == 'true')
self::set($iid, 'flags', self::get($iid, 'flags') | self::SHOW_REAL_FOLDER);
self::set($iid, 'flags', self::get($iid, 'flags') | (isset($prefs['lock_special_folders']) &&
$prefs['lock_special_folders'] == true ? self::LOCK_SPECIAL_FOLDER : 0));
// swap data of alternate accounts
$sql = 'SELECT isw.* '.
'FROM '.$rc->db->table_name(self::TABLE).' isw '.
'INNER JOIN '.$rc->db->table_name('identities').' ii ON isw.iid=ii.identity_id '.
'WHERE isw.user_id = ?';
$q = $rc->db->query($sql, $rc->user->data['user_id']);
while ($r = $rc->db->fetch_assoc($q))
{
// is it default identity?
if ($iid == $r['iid'])
self::set($iid, 'label', $r['label']);
else {
// load default settings
self::get($r['iid']);
// swap saved data
foreach ($r as $k => $v)
{
// skip some fields
if ($k == 'id' || $k == 'user_id' || $k == 'iid')
continue;
if ($k == 'folders')
$v = is_null($v) ? [] : json_decode($v);
self::set($r['iid'], $k, $v);
}
}
}
if ($args['template'] == 'mail')
self::create_menu();
break;
case 'settings':
$this->include_script('assets/identity_switch-form.js');
break;
}
return $args;
}
/**
* Create selection menu
*/
protected function create_menu(): void
{
// build identity table
$acc = [];
foreach (self::get() as $iid => $rec)
{
// identity switch enabled?
if (is_numeric($iid) && is_array($rec) && ($rec['flags'] & self::ENABLED))
$acc[rcube::Q($rec['label'])] = [ 'iid' => $iid, 'unseen' => $rec['unseen'] ];
}
// sort identities
ksort($acc);
// find position of iid
$iid = self::get('iid');
$off = 0;
foreach ($acc as $a)
{
// identity found?
if ($a['iid'] == $iid)
break;
$off++;
}
// get dropdown line size
$size = $this->get('config', 'dropdown_size');
// render UI if user has extra accounts
if (count($acc) > 1)
{
$div = '<div id="identity_switch_menu" '.
'class="form-control" '.
'onclick="identity_switch_toggle_menu('.$off * $size.')">'.
rcube::Q(self::get($iid, 'label')).
'<div id="identity_switch_dropdown" style="line-height:'.$size.'px"><ul>';
foreach ($acc as $name => $rec)
$div .= '<li onclick="identity_switch_run('.$rec['iid'].');"><a href="#">'.$name.
'<span id="identity_switch_opt_'.$rec['iid'].'" class="unseen" '.
'style="top:'.($size >= 24 ? ((34 - $size)/2).'px' :
'0px;line-height:initial;font-size:x-small').'">'.
($rec['iid'] == $iid ? "" : ($rec['unseen'] > 0 ? $rec['unseen'] : '')).'</span></a></li>';
self::set($iid, 'unseen', 0);
rcmail::get_instance()->output->add_footer($div.'</ul></div></div>');
}
}
/**
* Perform identity switch
*/
function identity_switch_do_switch(): void
{
$rc = rcmail::get_instance();
$rc->session->remove('folders');
$rc->session->remove('unseen_count');
// update current unseen counter
self::set('lock', 1);
$iid = self::get('iid');
$folders = [ 'INBOX' ];
$storage = $rc->get_storage();
if (self::get($iid, 'flags') & identity_switch_prefs::CHECK_ALLFOLDER)
$folders += $storage->list_folders_subscribed('', '*'. null, null, true);
$unseen = 0;
foreach ($folders as $mbox)
$unseen += $storage->count($mbox, 'UNSEEN', true, false);
self::set($iid, 'unseen', $unseen);
self::set($iid, 'checked_last', time());
// get new account
$rec = self::get($iid = rcube_utils::get_input_value('identity_switch_iid', rcube_utils::INPUT_POST));
// swap data
self::swap($iid, $rec);
self::set('lock', 0);
$this->write_log(__FILE__, __LINE__, 'Switching to identity "'.$rec['imap_user'].'"');
$rc->output->redirect(
[
'_task' => 'mail',
'_mbox' => 'INBOX',
]
);
}
/**
* Send mail
*
* @param array $args
* @return array
*/
function on_smtp_connect(array $args): array
{
$rc = rcmail::get_instance();
$rec = self::get(self::get('iid'));
$args['smtp_user'] = $rec['smtp_user'];
$args['smtp_pass'] = $rec['smtp_pwd'] && ($rec['flags'] & (self::SMTP_SSL|self::SMTP_TLS)) ?
$rc->decrypt($rec['smtp_pwd']) : '';
$args['smtp_host'] = $rec['smtp_host'].':'.$rec['smtp_port'];
if ($rec['flags'] & (self::SMTP_SSL|self::SMTP_TLS))
$args['smtp_host'] = ($rec['flags'] & self::SMTP_SSL ? 'ssl' : 'tls').'://'.$args['smtp_host'];
return $args;
}
/**
* Change userid in composer window to select proper identity
*
* @param array $args
*/
function on_object_composeheaders(array $args): void
{
if ($args['id'] == '_from')
{
$rc = rcmail::get_instance();
if (strcasecmp($_SESSION['username'], $rc->user->data['username']) !== 0)
$rc->output->add_script('identity_switch_fixIdent('.self::get('iid').');', 'docready');
}
}
/**
* Override LDAP password
*
* @param array $args
* @return array
*/
function override_ldap_password(array $args): array
{
$rc = rcmail::get_instance();
// do not do anything for default identity
if (strcasecmp($args['user'], $rc->user->data['username']) === 0)
return $args;
$sql = 'SELECT imap_pwd FROM '.$rc->db->table_name(self::TABLE).' WHERE imap_user = ?';
$q = $rc->db->query($sql, $args['user']);
$r = $rc->db->fetch_assoc($q);
if(is_array($r))
{
if($r['imap_pwd'])
{
$this->write_log(__FILE__, __LINE__, 'Override IMAP password for user "' .$args['user'].'"');
// replace 'password' with the password you want to use
$args['pass'] = $rc->decrypt($r['imap_pwd']);
}
}
return $args;
}
/**
* Catch new mail notification for default user
*/
function catch_newmails(array $args): array
{
// unexpected input?
if (empty($args['diff']['new']))
return $args;
$iid = self::get('iid');
$n = 0;
foreach (explode(':', $args['diff']['new']) as $id)
if (strlen($id) > 1)
$n++;
self::set($iid, 'unseen', (int)(self::get($iid, 'unseen')) + $n);
self::set($iid, 'checked_last', time());
self::set($iid, 'notify', true);
self::do_notify();
return $args;
}
/**
* Check for number of new mails
*/
function check_newmails($args) {
// get configuration
if(!is_array($cfg = self::get('config')))
return $args;
// new mail check disabled?
if (!self::get('config', 'check'))
{
self::write_log(__FILE__, __LINE__, 'New mail check disabled - stop checking', true);
return $args;
}
// only allow call under special conditions
if (!isset($args['action']) || ($args['action'] != 'refresh' && $args['action'] != 'getunread'))
return $args;
self::write_log(__FILE__, __LINE__, 'Starting new mail check with arguments "'.serialize($args).'"."', true);
self::write_log(__FILE__, __LINE__, 'Configuration loaded "'.serialize($cfg).'".', true);
// make a copy of our cached data
$cache = self::get();
// check if we're outside waiting window
$chk = 0;
foreach ($cache as $iid => $rec)
{
if (!is_integer($iid))
continue;
if ((int)$rec['flags'] & identity_switch_prefs::ENABLED &&
(int)$rec['checked_last'] + (int)$rec['newmail_check'] < time())
$chk++;
else
unset($cache[$iid]);
}
if (!$chk)
{
if (!$chk)
self::write_log(__FILE__, __LINE__, 'No accounts to check - stop checking', true);
return $args;
}
self::write_log(__FILE__, __LINE__, 'Check allowed for '.$chk.' account(s)', true);
if ($chk && !file_exists($cfg['cache']))
{
// Any connection available?
if (!is_resource($cfg['fp']))
{
// #71 check whether host supports SSL
// host with port?[
if (strpos($_SERVER['HTTP_HOST'], ':'))
$c = explode(':', $_SERVER['HTTP_HOST']);
else
$c = [ $_SERVER['HTTP_HOST'], $_SERVER['SERVER_PORT'] ];
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on')
$host = 'ssl://';
$host .= $c[0].':'.$c[1];
self::set('config', 'fp', $cfg['fp'] = new identity_switch_rpc());
if (is_string($cfg['fp']->open($host)))
{
$this->write_log(__FILE__, __LINE__, 'Cannot open connection for "'.$host.'" - stop checking');
return $args;
}
self::write_log(__FILE__, __LINE__, 'Host "'.$host.'" connected', true);
}
// save data for background sharing
file_put_contents($cfg['cache'], serialize($cache));
self::write_log(__FILE__, __LINE__, 'Cache file "'.$cfg['cache'].'" created');
// prepare request (no fopen() usage because "allow_url_fopen=FALSE" may be set in PHP.INI)
$req = '/plugins/identity_switch/identity_switch_newmails.php?iid=0&cache='.urlencode($cfg['cache']);
if (!$cfg['fp']->write($req))
{
if (is_resource($cfg['fp']))
fclose($cfg['fp']);
self::set('config', 'fp', $cfg['fp'] = 0);
$this->write_log(__FILE__, __LINE__, 'Cannot write to "'.$host.'" Request: "'.$req.'" - stop checking');
return $args;
}
self::write_log(__FILE__, __LINE__, 'Request started "'.$req.'"', true);
} else
self::write_log(__FILE__, __LINE__, 'We assume connection is still alive and cache file "'.$cfg['cache'].'" is available', true);
// check for data file
$n = 0;
while (!file_exists($cfg['data']))
{
if ($n++ > self::get('config', 'wait'))
{
self::write_log(__FILE__, __LINE__, 'No data file found - stop checking after '.self::get('config', 'wait').
' seconds waiting for "'.$cfg['data'].'"', true);
return $args;
}
sleep (1);
}
// load data file
self::write_log(__FILE__, __LINE__, 'Loading and deleting data file', true);
$wrk = file_get_contents($cfg['data']);
@unlink($cfg['data']);
$ok = true;
// process data lines
if (is_string($wrk))
{
foreach (explode('###', $wrk) as $line)
{
if (!$line)
continue;
$r = explode('##', $line);
// #35 bad formatted returned string
if (!is_array($r))
continue;
// Check for error message
if (!$r[1] && isset($r[2]))
{
$this->write_log(__FILE__, __LINE__, 'NewMail error: '.$r[2]);
$ok = false;
continue;
}
// #062 Notice: Only variables should be assigned by reference
self::get($r[1]);
$rec = $_SESSION[self::TABLE][$r[1]];
if ($r[2] != $rec['unseen'] && $r[0] > $rec['checked_last'])
{
if ($r[2] > $rec['unseen'])
{
// Allow to notify
if (!($rec['flags'] & self::UNSEEN))
self::set($r[1], 'notify', true);
else
self::set($r[1], 'flags', $rec['flags'] & ~self::UNSEEN);
}
self::set($r[1], 'unseen', $r[2]);
}
if ($r[0] > $rec['checked_last'])
self::set($r[1], 'checked_last', $r[0]);
}
if ($ok)
{
self::write_log(__FILE__, __LINE__, 'Starting notification.', true);
self::do_notify();
}
}
return $args;
}
/**
* Do notification
*/
function do_notify(): void
{
$rc = rcmail::get_instance();
$this->add_texts('localization');
// control array
$ctl = [];
$ctl[0] = [
'autoplay' => rawurlencode($this->gettext('notify.err.autoplay')),
'notification' => rawurlencode($this->gettext('notify.err.notification')),
'title' => rawurlencode($this->gettext('notify.title')),
];
$cnt = 1;
$sound = false;
$basic = false;
foreach (self::get() as $iid => $rec)
{
// skip unwanted entries
if (!is_numeric($iid))
continue;
// set unseen to provide to browser
$ctl[$cnt]['iid'] = $iid;
$ctl[$cnt]['unseen'] = $rec['unseen'];
// should we notify?
if ($rec['notify'])
{
self::set($iid, 'notify', false);
if ($rec['flags'] & self::NOTIFY_BASIC && !$basic)
{
$basic = true;
$ctl[$cnt]['basic'] = 1;
}
if ($rec['flags'] & self::NOTIFY_DESKTOP)
$ctl[$cnt]['desktop'] = [
'text' => rawurlencode(sprintf($this->gettext('notify.msg'), $rec['unseen'],
$rec['label'])),
'timeout' => $rec['notify_timeout'],
];
if ($rec['flags'] & self::NOTIFY_SOUND && !$sound)
{
$sound = true;
$ctl[$cnt]['sound'] = 1;
}
}
$cnt++;
}
$rc->output->command('plugin.identity_switch_notify', $ctl);
}
}