private static function generateFromRow($row_) { if (!array_keys_exists_not_empty(array('id', 'fqdn', 'timestamp', 'external_name', 'cpu', 'ram', 'data'), $row_)) { return null; } $report = new ServerReportItem($row_['timestamp'], $row_['id'], $row_['fqdn'], $row_['external_name'], $row_['cpu'], $row_['ram'], $row_['data']); return $report; }
public function __construct($array_env) { $this->org_request_arg = $array_env; $this->search_item = ''; $this->search_fields = array('login'); if (array_keys_exists_not_empty(array('search_item'), $array_env) && isset($array_env['search_fields'])) { $this->search_item = $array_env['search_item']; $this->search_fields = $array_env['search_fields']; $this->empty_filter = false; } }
public function __construct($array_env) { $this->search_item = ''; $this->search_fields = array('login'); if (array_keys_exists_not_empty(array('search_item'), $array_env) && isset($array_env['search_fields'])) { $this->search_item = $array_env['search_item']; $this->search_fields = $array_env['search_fields']; } $prefs = Preferences::getInstance(); $this->search_limit = $prefs->get('general', 'max_items_per_page'); }
private static function generateFromRow($row_) { if (!array_keys_exists_not_empty(array('id', 'user', 'server', 'start_stamp'), $row_)) { return null; } $stop_stamp = null; $stop_why = null; $data = null; if (array_key_exists('stop_stamp', $row_) and $row_['stop_stamp'] !== '') { $stop_stamp = $row_['stop_stamp']; } if (array_key_exists('stop_why', $row_) and $row_['stop_why'] !== '') { $stop_why = $row_['stop_why']; } if (array_key_exists('data', $row_) || strlen($row_['data']) > 0) { $data = $row_['data']; } $report = new SessionReportItem($row_['id'], $row_['user'], $row_['server'], $row_['start_stamp'], $stop_stamp, $stop_why, $data); return $report; }
public static function prefsIsValid($prefs_, &$log = array()) { $prefs2 = $prefs_->get('UserGroupDB', 'ldap'); if (is_null(LDAP::join_filters(array($prefs2['filter']), '|'))) { $log['LDAP usersgroup filter'] = false; return false; } $log['LDAP usersgroup filter'] = true; if (!array_keys_exists_not_empty(array('name'), $prefs2['match'])) { $log['LDAP usersgroup match'] = false; return false; } $log['LDAP usersgroup match'] = true; $group_match_user_enabled_count = 0; if (in_array('user_field', $prefs2['group_match_user'])) { if (strlen($prefs2['user_field']) == 0) { $log['LDAP group_match_user user_member'] = false; return false; } $group_match_user_enabled_count++; } if (in_array('group_field', $prefs2['group_match_user'])) { if (strlen($prefs2['group_field']) == 0) { $log['LDAP group_match_user group_membership'] = false; return false; } $group_match_user_enabled_count++; } if ($group_match_user_enabled_count == 0) { $log['LDAP group_match_user'] = false; return false; } return true; }
protected function get_user_ldap_config() { $configLDAP = $this->makeLDAPconfig(); if (array_keys_exists_not_empty(array('ou'), $configLDAP)) { $configLDAP['suffix'] = $configLDAP['ou'] . ',' . $configLDAP['suffix']; } return $configLDAP; }