2018-02-16 20:42:02 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Zotlabs\Update;
|
|
|
|
|
2021-12-02 23:02:31 +00:00
|
|
|
class _1140
|
|
|
|
{
|
|
|
|
public function run()
|
|
|
|
{
|
|
|
|
$r = q("select * from clients where true");
|
|
|
|
$x = false;
|
|
|
|
if ($r) {
|
|
|
|
foreach ($r as $rr) {
|
2021-12-03 03:01:39 +00:00
|
|
|
$m = q(
|
|
|
|
"INSERT INTO xperm (xp_client, xp_channel, xp_perm) VALUES ('%s', %d, '%s') ",
|
2021-12-02 23:02:31 +00:00
|
|
|
dbesc($rr['client_id']),
|
|
|
|
intval($rr['uid']),
|
|
|
|
dbesc('all')
|
|
|
|
);
|
2021-12-03 03:01:39 +00:00
|
|
|
if (!$m) {
|
2021-12-02 23:02:31 +00:00
|
|
|
$x = true;
|
2021-12-03 03:01:39 +00:00
|
|
|
}
|
2021-12-02 23:02:31 +00:00
|
|
|
}
|
|
|
|
}
|
2021-12-03 03:01:39 +00:00
|
|
|
if ($x) {
|
2021-12-02 23:02:31 +00:00
|
|
|
return UPDATE_FAILED;
|
2021-12-03 03:01:39 +00:00
|
|
|
}
|
2021-12-02 23:02:31 +00:00
|
|
|
return UPDATE_SUCCESS;
|
|
|
|
}
|
2021-12-03 03:01:39 +00:00
|
|
|
}
|