diff options
author | Mario Vavti <mario@mariovavti.com> | 2018-07-18 20:59:45 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-07-18 20:59:45 +0200 |
commit | dfbdeafa39da8605c124f47d811ebca2330d9169 (patch) | |
tree | 1f1431f9306cc06de7fc20616cb6124f4535d1a7 /Zotlabs/Lib/Apps.php | |
parent | eb322e831297ee8fd773049c1a00c915c49dc93e (diff) | |
parent | 82a4bbd571131462bbff1cb2455af46747f3b840 (diff) | |
download | volse-hubzilla-dfbdeafa39da8605c124f47d811ebca2330d9169.tar.gz volse-hubzilla-dfbdeafa39da8605c124f47d811ebca2330d9169.tar.bz2 volse-hubzilla-dfbdeafa39da8605c124f47d811ebca2330d9169.zip |
Merge remote-tracking branch 'mike/master' into dev
Diffstat (limited to 'Zotlabs/Lib/Apps.php')
-rw-r--r-- | Zotlabs/Lib/Apps.php | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php index c2ec5c967..82f0b57b8 100644 --- a/Zotlabs/Lib/Apps.php +++ b/Zotlabs/Lib/Apps.php @@ -534,13 +534,15 @@ class Apps { intval(TERM_OBJ_APP), intval($x[0]['id']) ); - $r = q("delete from app where app_id = '%s' and app_channel = %d", - dbesc($app['guid']), - intval($uid) - ); + if ($uid) { + $r = q("delete from app where app_id = '%s' and app_channel = %d", + dbesc($app['guid']), + intval($uid) + ); - // we don't sync system apps - they may be completely different on the other system - build_sync_packet($uid,array('app' => $x)); + // we don't sync system apps - they may be completely different on the other system + build_sync_packet($uid,array('app' => $x)); + } } else { self::app_undestroy($uid,$app); @@ -605,6 +607,28 @@ class Apps { } + static public function addon_app_installed($uid,$app) { + + $r = q("select id from app where app_plugin = '%s' and app_channel = %d limit 1", + dbesc($app), + intval($uid) + ); + return(($r) ? true : false); + + } + + static public function system_app_installed($uid,$app) { + + $r = q("select id from app where app_id = '%s' and app_channel = %d limit 1", + dbesc(hash('whirlpool',$app)), + intval($uid) + ); + return(($r) ? true : false); + + } + + + static public function app_list($uid, $deleted = false, $cats = []) { if($deleted) $sql_extra = ""; |