Esempio n. 1
0
 /**
  * covering code
  * @return void
  */
 public function testCovering()
 {
     $rez = DM\UsersGroups::getAvailableGroups();
     $this->assertTrue(!empty($rez), 'Empty groups');
     $rez = DM\UsersGroups::getAvailableUsers();
     $this->assertTrue(!empty($rez), 'Empty users');
     $rez = DM\UsersGroups::getMemberGroupIds(1);
     $this->assertTrue(empty($rez), 'Empty member groups');
     $rez = DM\UsersGroups::getGroupUserIds(2);
     $this->assertTrue(empty($rez), '!Empty group users for everyone');
     $rez = DM\UsersGroups::getDisplayData();
     $this->assertTrue(!empty($rez), 'Display data');
 }
Esempio n. 2
0
 /**
  * Get the list of active users with basic data
  * @return array
  */
 public static function getActiveUsers()
 {
     $rez = array('success' => true, 'data' => array());
     // $photosPath = Config::get('photos_path');
     $users = DM\UsersGroups::getAvailableUsers();
     foreach ($users as $r) {
         $r['user'] = $r['name'];
         $r['name'] = User::getDisplayName($r);
         $r['photo'] = User::getPhotoParam($r);
         $rez['data'][] = $r;
     }
     return $rez;
 }