streams/Code/Update/_1249.php

42 lines
1.1 KiB
PHP
Raw Normal View History

<?php
2022-02-16 04:08:28 +00:00
namespace Code\Update;
2022-02-16 04:08:28 +00:00
use Code\Access\Permissions;
2021-12-02 23:02:31 +00:00
class _1249
{
public function run()
{
$channels = [];
$r = q("select * from abook where abook_self = 0");
if ($r) {
foreach ($r as $rv) {
if (!in_array(intval($rv['abook_channel']), $channels)) {
set_pconfig($rv['abook_channel'], 'perm_limits', 'post_mail', PERMS_SPECIFIC);
$channels[] = intval($rv['abook_channel']);
}
$x = get_abconfig($rv['abook_channel'], $rv['abook_xchan'], 'system', 'my_perms');
if ($x) {
$y = explode(',', $x);
if ($y && in_array('post_comments', $y) && !in_array('post_mail', $y)) {
$y[] = 'post_mail';
set_abconfig($rv['abook_channel'], $rv['abook_xchan'], 'system', 'my_perms', implode(',', $y));
}
}
}
}
return UPDATE_SUCCESS;
}
public function verify()
{
return true;
}
}