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
|
<?php
/**
* Visibility.php - VisibilityAPI
*
* The visibilityAPI provides all accessmethods to create visibilitysettings
* that apear in the users setting menu. The verify method makes it possible to
* check if the user wants another user to see something on his homepage
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* @author Florian Bieringer <florian.bieringer@uni-passau.de>
* @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2
* @category Stud.IP
*/
class Visibility
{
private static $verified;
/**
* Basic visibilitycheck to find out if a given user (or the current logged
* on user) is allowed to view the object that is defined by a visibilityid
*
* @param int|string $visibilityid The visibility to check can be defined by
* the direct id (int) or the predefined identifier (string)
*
* @param int $userid The user for whom we check the visibility. If no user
* is given, the system will take the current logged on user
*
* @return boolean true if user is allowed to view content according to the
* current visibilitysetting otherwise false;
*/
public static function verify($visibilityid, $ownerid, $userid = null)
{
// check if visiting user is given
self::getUser($userid);
// root sees everything
if ($GLOBALS['perm'] && $GLOBALS['perm']->have_perm('root') || $ownerid === $userid) {
return true;
}
if (isset(self::$verified[$visibilityid][$ownerid][$userid])) {
return self::$verified[$visibilityid][$ownerid][$userid];
}
// load the possible visibilities
$vs = VisibilitySettings::getInstance();
// produce where clause
$where = self::prepareWhere($visibilityid, $ownerid);
// load the owner and the state of the visibility
$sql = "SELECT `user_id`, state FROM `user_visibility_settings` $where";
$db = DBManager::get();
$stmt = $db->prepare($sql);
$stmt->execute();
// if we got a record we verify if the calling user is allowed to see what he wants to see
if ($result = $stmt->fetch(PDO::FETCH_ASSOC)) {
return self::$verified[$visibilityid][$ownerid][$userid] = $vs->verify($userid, $ownerid, $result['state']);
}
// if db query fails something went wrong anyway so we use the default setting
return self::$verified[$visibilityid][$ownerid][$userid] = $vs->verify($userid, $ownerid, constant(Config::get()->HOMEPAGE_VISIBILITY_DEFAULT));
}
/**
* Adds a privacysetting for a user. The user can change the setting in his
* privacytab. To check back if a user is allowed to see any content use the
* verify method
*
* @param string $name The setting's name, that will be displayed in the
* user's settingtab (Important: Don't mix the name up with the identifier)
*
* @param string $identifier the identifier is used to simplify the usage
* of the visibilityAPI. An identifier maps a string to a visibilityid
* (under the usage of a userid) therefore all identifier set for one user
* MUST be unique.
*
* @param int|string $parent Determines the parent of the visibility to add.
* Use the direct visibilityid of the parent visibility or the identifier.
* If the visibility should be created on the top level the value has to be
* 0. Plugins creating a privacysetting will automaticly be added to the
* parent "plugins". Important: If u add a visibility without as a parent
* and as a category it wont be displayed until it has children that are
* displayed.
*
* @param int $category Sets the type of the visibilitysetting. Currently
* there are only 2 types available:
* 0 - The setting is only a header without any options
* 1 (Default) - Normal setting
*
* @param string $user Userid of the user that should be added the visibility.
* Default: The current logged on user
*
* @param int $default int representation of the visibility that should be
* set. Use with caution since the API provides the easy change of the
* visibility int representation
*
* @param int $pluginid Connects the created visibility with a plugin.
* Important: If addPrivacySetting is called in a file of a plugin there is
* no need to set the pluginid manually, because the API will normally find
* it
*
* @return int the created visibilityid
*/
public static function addPrivacySetting($name, $identifier = "", $parent = 0, $category = 1, $user = null, $default = null, $pluginid = null)
{
$db = DBManager::get();
// find out our default state
if ($default == null) {
$default = self::get_default_homepage_visibility($user);
}
// parse User and Identifier to format we want to have in the database
self::getUser($user);
$parent = self::parseIdentifier($parent, $user);
// dont create duplicates
if (self::exists($identifier, $user)) {
return false;
}
// insert the new id and return the id
$sql = "INSERT INTO user_visibility_settings (`user_id`, `parent_id`, `category`, `name`, `state`, `identifier`, `plugin`)
VALUES (?, ?, ?, ?, ?, ?, ?)";
$stmt = $db->prepare($sql);
$stmt->execute([$user, $parent, $category, $name, $default, $identifier, $pluginid]);
NotificationCenter::postNotification('UserVisibilitySettingDidCreate', $user, $identifier);
return $db->lastInsertId();
}
/**
* Adds a privacysetting for all users. If a parent is given, the function
* will only add a privacySetting for those users that have an existing
* parent
*
* @param string $name The setting's name, that will be displayed in the
* user's settingtab (Important: Don't mix the name up with the identifier)
*
* @param string $identifier the identifier is used to simplify the usage
* of the visibilityAPI. An identifier maps a string to a visibilityid
* (under the usage of a userid) therefore all identifier set for one user
* MUST be unique.
*
* @param int|string $parent Determines the parent of the visibility to add.
* Use the direct visibilityid of the parent visibility or the identifier.
* If the visibility should be created on the top level the value has to be
* 0. Plugins creating a privacysetting will automaticly be added to the
* parent "plugins". Important: If u add a visibility without a parent and
* without beeing a toplevelpoint itself it will NEVER be displayed.
*
* @param int $category Sets the type of the visibilitysetting. Currently
* there are only 2 types available:
* 0 - The setting is only a header without any options
* 1 (Default) - Normal setting
*
* @param string $user Userid of the user that should be added the visibility.
* Default: The current logged on user
*
* @param int $default int representation of the visibility that should be
* set. Use with caution since the API provides the easy change of the
* visibility int representation
*
* @param int $pluginid Connects the created visibility with a plugin.
* Important: If addPrivacySetting is called in a file of a plugin there is
* no need to set the pluginid manually, because the API will normally find
* it
*
* @return int the created visibilityid
*/
public static function addPrivacySettingForAll($name, $identifier = "", $parent_identifier = 0, $category = 1, $default = null, $pluginid = null)
{
$db = DBManager::get();
// load the users default out of the database if needed
if ($default == null) {
$default = "default_homepage_visibility as state ";
$default_join = "JOIN `user_visibility` USING (`user_id`)";
} else {
$default = "'$default' as state";
}
// sure we could do this less complicated with php but with a single
// query it's a lot faster
$sql = "REPLACE into `user_visibility_settings`
(`user_id`, `parent_id`, `identifier`, `category`, `name`, `state`, `plugin`)
(SELECT user_id, visibilityid as parent_id,
? as identifier,
? as category,
? as name,
$default,
? as plugin
FROM `user_visibility_settings`
$default_join
WHERE `identifier`= ? );";
$stmt = $db->prepare($sql);
$stmt->execute([$identifier, $category, $name, $pluginid, $parent_identifier]);
NotificationCenter::postNotification('UserVisibilitySettingDidCreate', 'all', $identifier);
}
/**
* Creates all nessesary categories for standard usage
*
* @param int $user Userid to define what user should create the categories
* default: current logged on user;
*/
public static function createDefaultCategories($user = null)
{
self::getUser($user);
Visibility::addPrivacySetting(_("Allgemeine Daten"), "commondata", 0, 0, $user);
Visibility::addPrivacySetting(_("Private Daten"), "privatedata", 0, 0, $user);
Visibility::addPrivacySetting(_("Studien-/Einrichtungsdaten"), "studdata", 0, 0, $user);
Visibility::addPrivacySetting(_("Zusätzliche Datenfelder"), "additionaldata", 0, 0, $user);
Visibility::addPrivacySetting(_("Eigene Kategorien"), "owncategory", 0, 0, $user);
// Visibility::addPrivacySetting(_("Plugins"), "plugins", 0, 0, $user);
// self::createHomepagePluginEntries($user);
}
/**
* Returns the description for a specific state set on a visibilityID
*
* @param int $visibilityid the visibility id
*
* @return string Description of the state or false if visibilityid was not found
*/
public static function getStateDescription($visibilityid, $owner = null)
{
$visibilityid = self::parseIdentifier($visibilityid, $owner);
$vs = VisibilitySettings::getInstance();
$sql = "SELECT state FROM user_visibility_settings WHERE visibilityid = ?";
$db = DBManager::get();
$stmt = $db->prepare($sql);
$stmt->execute([$visibilityid]);
if ($result = $stmt->fetch(PDO::FETCH_ASSOC)) {
return $vs->getDescription($result['state']);
}
return false;
}
/**
* Updates a privacySetting. Important: The whole privacySetting gets
* deleted and recreated. Therefore a new visibilityID is created.
* If you use the privacyID you will have to update it as well.
*
* @param string $name The setting's name, that will be displayed in the
* user's settingtab (Important: Don't mix the name up with the identifier)
*
* @param string $identifier the identifier is used to simplify the usage
* of the visibilityAPI. An identifier maps a string to a visibilityid
* (under the usage of a userid) therefore all identifier set for one user
* MUST be unique.
*
* @param int|string $parent Determines the parent of the visibility to add.
* Use the direct visibilityid of the parent visibility or the identifier.
* If the visibility should be created on the top level the value has to be
* 0. Plugins creating a privacysetting will automaticly be added to the
* parent "plugins". Important: If u add a visibility without a parent and
* without beeing a toplevelpoint itself it will NEVER be displayed.
*
* @param int $category Sets the type of the visibilitysetting. Currently
* there are only 2 types available:
* 0 - The setting is only a header without any options
* 1 (Default) - Normal setting
*
* @param string $user Userid of the user that should be added the visibility.
* Default: The current logged on user
*
* @param int $default int representation of the visibility that should be
* set. Use with caution since the API provides the easy change of the
* visibility int representation
*
* @param int $pluginid Connects the created visibility with a plugin.
* Important: If addPrivacySetting is called in a file of a plugin there is
* no need to set the pluginid manually, because the API will normally find
* it
*
* @return int the created visibilityid
*/
public static function updatePrivacySetting($name, $id = "", $parent = null, $category = 1, $user = null, $default = null, $pluginid = null)
{
$default = Visibility::removePrivacySetting($id);
return Visibility::addPrivacySetting($name, $id, $parent, $category, $user, $default, $pluginid);
}
/**
* Updates a privacySetting. Important: The whole privacySetting gets
* deleted and recreated if the teststring is not empty. Therefore a new
* visibilityID is created. If you use the privacyID you will have to update
* it as well.
*
* @param string $test A teststring to determine if the privacySetting is
* only deleted or if it is deleted and recreated. Use this with a request-
* string for example.
*
* @param string $name The setting's name, that will be displayed in the
* user's settingtab (Important: Don't mix the name up with the identifier)
*
* @param string $identifier the identifier is used to simplify the usage
* of the visibilityAPI. An identifier maps a string to a visibilityid
* (under the usage of a userid) therefore all identifier set for one user
* MUST be unique.
*
* @param int|string $parent Determines the parent of the visibility to add.
* Use the direct visibilityid of the parent visibility or the identifier.
* If the visibility should be created on the top level the value has to be
* 0. Plugins creating a privacysetting will automaticly be added to the
* parent "plugins". Important: If u add a visibility without a parent and
* without beeing a toplevelpoint itself it will NEVER be displayed.
*
* @param int $category Sets the type of the visibilitysetting. Currently
* there are only 2 types available:
* 0 - The setting is only a header without any options
* 1 (Default) - Normal setting
*
* @param string $user Userid of the user that should be added the visibility.
* Default: The current logged on user
*
* @param int $default int representation of the visibility that should be
* set. Use with caution since the API provides the easy change of the
* visibility int representation
*
* @param int $pluginid Connects the created visibility with a plugin.
* Important: If addPrivacySetting is called in a file of a plugin there is
* no need to set the pluginid manually, because the API will normally find
* it
*
* @return int the created visibilityid
*/
public static function updatePrivacySettingWithTest($test, $name, $id, $parent = null, $category = 1, $user = null, $default = null, $pluginid = null)
{
$default = Visibility::removePrivacySetting($id, $user);
if ($test != "") {
return Visibility::addPrivacySetting($name, $id, $parent, $category, $user, $default, $pluginid);
}
return false;
}
/**
* Returns the visibilityID by an identifier and a user
*
* @param string $ident The identifier for the visibilityid
*
* @param string $user The userid. Default: Current logged on user
*
* @return int The visibilityID
*/
public static function getPrivacyIdByIdentifier($ident, $user = null)
{
self::getUser($user);
$sql = "SELECT `visibilityid` FROM user_visibility_settings WHERE `user_id` = ? AND `identifier` = ?";
$db = DBManager::get();
$stmt = $db->prepare($sql);
$stmt->execute([$user, $ident]);
$result = $stmt->fetch(PDO::FETCH_ASSOC);
if ($result) {
return $result['visibilityid'];
}
return false;
}
/**
* Removes a privacysetting via ID or Identifier and user
*
* @param int|string $id ID or Identifier
*
* @param string $user Userid. Default: Current logged on user
*
* @return int state The state the deleted visibility had
*/
public static function removePrivacySetting($id, $user = null)
{
$db = DBManager::get();
$where = self::prepareWhere($id, $user);
// select last state
$sql = "SELECT state FROM user_visibility_settings $where";
$stmt = $db->prepare($sql);
$stmt->execute();
$lastState = $stmt->fetch(PDO::FETCH_ASSOC);
$lastState = $lastState['state'];
// now delete the value
$sql = "DELETE FROM user_visibility_settings $where";
$db->prepare($sql)->execute();
NotificationCenter::postNotification('UserVisibilitySettingDidDelete', $user, $id);
return $lastState;
}
/**
* Deletes ALL privacySettings for a Identifier (for ALL users!)
*
* @param string $ident The Identifier to be removed
*/
public static function removeAllPrivacySettingForIdentifier($ident)
{
$db = DBManager::get();
$sql = "DELETE FROM user_visibility_settings WHERE `identifier`= " . $db->quote($ident);
NotificationCenter::postNotification('UserVisibilitySettingDidDelete', 'all', $ident);
$db->exec($sql);
}
/**
* Removes all PrivacySetting of the given pluginid
*
* @param int $id the pluginid
*/
public static function removePlugin($id)
{
$db = DBManager::get();
$sql = "DELETE FROM user_visibility_settings WHERE `plugin`= " . $db->quote($id);
}
/**
* Renames a PrivacySetting
*
* @param int|string $id VisibilityID or Identifier to be renamed
*
* @param string $new_name the new name
*
* @param string $user Userid. Default: Current logged on user
*/
public static function renamePrivacySetting($id, $new_name, $user = null)
{
$setting = User_Visibility_Settings::find($id, $user);
if ($setting) {
$setting->name = $new_name;
$setting->store();
}
}
/**
* Removes all PrivacySettings from a user
*
* @param string $user_id the given userid
*/
public static function removeUserPrivacySettings($user_id)
{
$db = DBManager::get();
$sql = "DELETE FROM user_visibility_settings WHERE `user_id`= " . $db->quote($user_id);
$db->exec($sql);
}
/**
* Builds up the htmlArgs for display in Settings
*
* @param string $userid the userid
*
* @return array tree of htmlArgs
*/
public static function getSettingsArgs($userid)
{
$userPrivacy = new UserPrivacy($userid);
return $userPrivacy->getHTMLArgs();
}
/**
* Takes the updaterequestdata and stores it into the database
*
* @param array $data Data produced by the settingspage
*
* @param string $userid the userid. Default: current logged on user
*/
public static function updateUserFromRequest($data, $userid = null)
{
self::getUser($userid);
try {
$userPrivacy = new UserPrivacy($userid);
$userPrivacy->updateAllFromRequest($data);
} catch (Exception $e) {
return false;
}
return true;
}
/**
* Helpfunction to produce a where clause for sql statements by the type
* given
*
* @param int|string $id ID or identifier.
*
* @param type $userid Userid. Default: Current logged on user
*
* @return string Where clause to use in a sql statement
*/
private static function prepareWhere($id, $userid = null)
{
$db = DBManager::get();
if (is_int($id)) {
return "WHERE `visibilityid`= " . $db->quote($id);
} else {
self::getUser($userid);
return "WHERE `user_id` = " . $db->quote($userid) . " AND `identifier` = " . $db->quote($id);
}
}
/**
* Helpfunction to set default user
*
* @param type $user Userid input.
*/
private static function getUser(&$user)
{
if ($user == null) {
$user = $GLOBALS['user']->user_id;
}
}
/**
* Helpfunction to calculate how many columns the settingstable needs
*
* @return int Number of columns
*/
public static function getColCount()
{
return VisibilitySettings::getInstance()->count();
}
/**
* Helpfunction to get all names for the settingstable
*
* @return array all visibility names
*/
public static function getVisibilities()
{
return VisibilitySettings::getInstance()->getAllNames();
}
/**
* Helpfunction to get the data for the settingstable
*
* @return array tree of settingelements
*/
public static function getHTMLArgs($userid = null)
{
$ps = new UserPrivacy($userid);
return $ps->getHTMLArgs();
}
/**
* Helpfunction to determine the visibilityID
*
* @param int|string $id ID or identifier.
*
* @param string $user The user. Default: Current logged on user
*
* @return id The visibilityID
*/
private static function parseIdentifier($id, $user)
{
if (is_int($id)) {
return $id;
} else {
return self::getPrivacyIdByIdentifier($id, $user);
}
}
/**
* Sets all visibilites of a user to a specific state. This function should
* ONLY be called from the settingspage or some administration page NOT from
* a plugin
*
* @param type $state The int representation of the state everything should
* be set to
*
* @param type $user The user. Default: current logged on user;
*/
public static function setAllSettingsForUser($state, $user = null)
{
try {
self::getUser($user);
$sql = "UPDATE user_visibility_settings SET `state` = ? WHERE `user_id`= ?";
$db = DBManager::get();
$st = $db->prepare($sql);
$st->execute([$state, $user]);
return true;
} catch (Exception $ex) {
return false;
}
}
/**
* Retrieves the standard visibility level for a homepage element if the user
* hasn't specified anything explicitly. This default can be set via the global
* configuration (variable "HOMEPAGE_VISIBILITY_DEFAULT").
*
* @return int Default visibility level.
*/
public static function get_default_homepage_visibility($user_id = null)
{
self::getUser($user_id);
$query = "SELECT default_homepage_visibility FROM user_visibility WHERE user_id = ?";
$statement = DBManager::get()->prepare($query);
$statement->execute([$user_id]);
/*
* If we have no default visibility set by the user itself we load the
* global config set in configuration. Unfortunatelly we have to map
* this throughout the constants. Oneday this should be eliminated
* by a migration.
*/
if (!$visibility = $statement->fetchColumn()) {
$def = Config::get()->HOMEPAGE_VISIBILITY_DEFAULT;
$consts = get_defined_constants();
$visibility = $consts[$def];
}
return $visibility;
}
/**
* Creates a visibilitySetting for every homepagePlugin
*
* @param type $user the user for whom the settings should be created
*/
private function createHomepagePluginEntries($user)
{
self::getUser($user);
$homepageplugins = PluginEngine::getPlugins('HomepagePlugin');
foreach ($homepageplugins as $plugin) {
self::addPrivacySetting($plugin->getPluginName(), ("plugin".$plugin->getPluginId()), 'plugins', 1, $user, null, $plugin->getPluginId());
}
}
/**
* Checks if a specific visibilityID or an identifier & userid combination
* exists
*
* @param type $id id or identifier
*
* @param type $user user id
*
* @return type true if the id exists. false if not
*/
public static function exists($id, $user = null)
{
$where = self::prepareWhere($id, $user);
$sql = "SELECT user_id FROM user_visibility_settings $where";
$db = DBManager::get();
$stmt = $db->prepare($sql);
$stmt->execute();
return $stmt->rowCount();
}
/**
* Returns whether the user should be allowed to configure the extended
* settings.
*
* @param User|null $user User object (defaults to current user)
*
* @return bool
*/
public static function allowExtendedSettings(\User $user = null): bool
{
$user = $user ?? User::findCurrent();
if (!$user) {
return false;
}
// Check if all fields for the extended settings are not hideable. If
// so, we mustn't show the extended settings.
if (
!self::isFieldHideableForUser('online', $user)
&& !self::isFieldHideableForUser('search', $user)
&& !self::isFieldHideableForUser('email', $user)
) {
return false;
}
// User chose to be visible and may configure the extended settings.
if (in_array($user->visible, ['yes', 'global'])) {
return true;
}
// User did not specify a visibility but the global config defines
// visibility, so the user may configure the extended settings.
if ($user->visible === 'unknown' && Config::get()->USER_VISIBILITY_UNKNOWN) {
return true;
}
// Teachers are always visible by configuration? So they may see the
// extended settings
if ($user->perms === 'dozent' && Config::get()->DOZENT_ALWAYS_VISIBLE) {
return true;
}
// In all other cases, don't show the extended settings.
return false;
}
/**
* Returns whether the given field is hideable by configuration for the
* given user permission.
*
* @param string $field Field that should be hidden
* @param User|null $user User object (defaults to current user)
*
* @return bool
*/
public static function isFieldHideableForUser(string $field, User $user = null): bool
{
$user = $user ?? User::findCurrent();
return empty($GLOBALS['NOT_HIDEABLE_FIELDS'][$user->perms][$field]);
}
}
|