* full support for OTHire 0.0.3
* added support for otservers that doesn't use account.name field,
instead just account number will be used
* (install) moved admin account creation to new step
* fixed encryption detection on 0.3
* fixed bug when server_config table doesn't exist
* other fixes
This commit is contained in:
slawkens1
2017-05-03 23:48:04 +02:00
parent 94b44a8d37
commit 08fce2ade4
37 changed files with 741 additions and 308 deletions

View File

@@ -31,9 +31,9 @@ class OTS_Groups_List implements IteratorAggregate, Countable
*/
public function __construct($file = '')
{
global $cache;
if(tableExist('groups')) { // read groups from database
global $db;
foreach($db->query('SELECT `id`, `name`, `access` FROM `groups`;') as $group)
{
$info = array();
@@ -52,6 +52,8 @@ class OTS_Groups_List implements IteratorAggregate, Countable
$file = $config['data_path'] . 'XML/groups.xml';
}
global $cache;
$data = array();
if($cache->enabled())
{
@@ -135,6 +137,17 @@ class OTS_Groups_List implements IteratorAggregate, Countable
throw new OutOfBoundsException();
}
public function getHighestId()
{
$group_id = 0;
foreach($this->groups as $id => $group) {
if($id > $group_id)
$group_id = $id;
}
return $group_id;
}
/**
* Returns string representation of object.
*