Blame view

sources/apps/xmpp/ajax/getRoster.php 519 Bytes
42e4f8d60   Kload   add all apps
1
2
3
4
5
6
7
8
9
10
11
12
13
  <?php
  
  $x=new OC_xmpp_login(OCP\Config::getAppValue('xmpp', 'xmppAdminUser',''),OCP\Config::getAppValue('xmpp', 'xmppDefaultDomain',''),OCP\Config::getAppValue('xmpp', 'xmppAdminPasswd',''),OCP\Config::getAppValue('xmpp', 'xmppBOSHURL',''));
  $nx=$x->doLogin(OCP\User::getUser().'@'.OCP\Config::getAppValue('xmpp', 'xmppDefaultDomain',''));
  $roster=$nx->getRoster();
  foreach($roster->iq->query->item as $item){
          $ret[]=(string)$item->attributes()->jid;
  }
  $x->logout();
  $nx->logout();
  
  echo json_encode($ret);
  ?>