2022-05-05 13:04:30 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Code\Update;
|
|
|
|
|
|
|
|
use Code\Lib\AbConfig;
|
|
|
|
|
|
|
|
class _1257
|
|
|
|
{
|
|
|
|
|
|
|
|
public function run()
|
|
|
|
{
|
|
|
|
$r = q("SELECT * from abook where abook_self = 0");
|
|
|
|
if ($r) {
|
|
|
|
foreach ($r as $rv) {
|
2023-01-29 18:46:13 +00:00
|
|
|
$perms = AbConfig::Get($rv['abook_channel'], $rv['abook_xchan'], 'system', 'my_perms', '' );
|
2022-05-05 13:04:30 +00:00
|
|
|
$s = explode(',', $perms);
|
|
|
|
if (in_array('view_stream', $s) && (! in_array('deliver_stream', $s))) {
|
|
|
|
$s[] = 'deliver_stream';
|
|
|
|
}
|
|
|
|
AbConfig::Set($rv['abook_channel'], $rv['abook_xchan'], 'system', 'my_perms', implode(',', $s));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return UPDATE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function verify()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|