Projects
Kolab:3.4
kolab-webadmin
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 37
View file
kolab-webadmin-3.2.tar.gz/lib/Auth/LDAP.php
Changed
@@ -780,7 +780,13 @@ public function resource_add($attrs, $typeid = null) { - $base_dn = $this->entry_base_dn('resource', $typeid); + if (!empty($attrs['ou'])) { + $base_dn = $attrs['ou']; + unset($attrs['ou']); + } + else { + $base_dn = $this->entry_base_dn('resource', $typeid); + } // TODO: The rdn is configurable as well. // Use [$type_str . "_"]resource_rdn_attr
View file
kolab-webadmin-3.2.tar.gz/lib/api/kolab_api_service_ous.php
Changed
@@ -65,6 +65,8 @@ $params = $this->parse_list_params($post); $search = $this->parse_list_search($post); + $params['page_size'] = 2000; + $units = $auth->list_organizationalunits(null, $attributes, $search, $params); $units = $this->parse_list_result($units);
View file
kolab-webadmin-3.2.tar.gz/lib/api/kolab_api_service_resource.php
Changed
@@ -146,25 +146,43 @@ } /** - * User information. + * Find resource and return its data. + * It is a combination of resource.info and resources.list with search capabilities + * If the search returns only one record we'll return resource data. * * @param array $get GET parameters * @param array $post POST parameters * - * @return array|bool User attributes, False on error + * @return array|bool Resource attributes, False on error */ - public function resource_info($getdata, $postdata) + public function resource_find($get, $post) { - if (!isset($getdata['id'])) { + $auth = Auth::get_instance(); + $attributes = array(''); + $params = array('page_size' => 2); + $search = $this->parse_list_search($post); + + // find resource(s) + $resources = $auth->list_resources(null, $attributes, $search, $params); + + if (empty($resources) || empty($resources['list']) || $resources['count'] > 1) { return false; } - $auth = Auth::get_instance(); - $result = $auth->resource_info($getdata['id']); + // get resource data + $result = $auth->resource_info(key($resources['list'])); // normalize result $result = $this->parse_result_attributes('resource', $result); + if (empty($result['ou'])) { + $dn = ldap_explode_dn($result['entrydn'], 0); + // pop the count and rdn + unset($dn['count']); + unset($dn[0]); + $result['ou'] = implode(',', $dn); + } + if ($result) { return $result; } @@ -173,31 +191,21 @@ } /** - * Find resource and return its data. - * It is a combination of resource.info and resources.list with search capabilities - * If the search returns only one record we'll return resource data. + * User information. * * @param array $get GET parameters * @param array $post POST parameters * - * @return array|bool Resource attributes, False on error + * @return array|bool User attributes, False on error */ - public function resource_find($get, $post) + public function resource_info($getdata, $postdata) { - $auth = Auth::get_instance(); - $attributes = array(''); - $params = array('page_size' => 2); - $search = $this->parse_list_search($post); - - // find resource(s) - $resources = $auth->list_resources(null, $attributes, $search, $params); - - if (empty($resources) || empty($resources['list']) || $resources['count'] > 1) { + if (!isset($getdata['id'])) { return false; } - // get resource data - $result = $auth->resource_info(key($resources['list'])); + $auth = Auth::get_instance(); + $result = $auth->resource_info($getdata['id']); // normalize result $result = $this->parse_result_attributes('resource', $result);
View file
kolab-webadmin-3.2.tar.gz/lib/ext/Net/LDAP3.php
Changed
@@ -742,9 +742,14 @@ '"*"', ); - $command = implode(' ', $command); + // remove password from debug log + $command_debug = $command; + $command_debug[11] = '*'; - $this->_debug("LDAP: Executing command: $command"); + $command = implode(' ', $command); + $command_debug = implode(' ', $command_debug); + + $this->_debug("LDAP: Executing command: $command_debug"); exec($command, $output, $return_code); @@ -1490,7 +1495,7 @@ } // ...or by fetching all records dn and count them else if (!function_exists('ldap_parse_virtuallist_control')) { - $vlv_count = $this->search($base_dn, $filter, $scope, array('dn'), $prop, true); + $vlv_count = $this->search($base_dn, $filter, $scope, array('dn'), $props, true); } $this->vlv_active = $this->_vlv_set_controls($sort, $this->list_page, $this->page_size, @@ -1837,40 +1842,40 @@ $filter = strtolower($filter); - if (!empty($vlv_indexes[$base_dn])) { - $this->_debug("Found a VLV for base_dn: " . $base_dn); - if ($vlv_indexes[$base_dn]['filter'] == $filter) { - if ($vlv_indexes[$base_dn]['scope'] == $scope) { - $this->_debug("Scope and filter matches"); - - // Not passing any sort attributes means you don't care - if (!empty($sort_attrs)) { - if (in_array($sort_attrs, $vlv_indexes[$base_dn]['sort'])) { - return $sort_attrs; + foreach ($vlv_indexes as $vlv_index) { + if (!empty($vlv_index[$base_dn])) { + $this->_debug("Found a VLV for base_dn: " . $base_dn); + if ($vlv_index[$base_dn]['filter'] == $filter) { + if ($vlv_index[$base_dn]['scope'] == $scope) { + $this->_debug("Scope and filter matches"); + + // Not passing any sort attributes means you don't care + if (!empty($sort_attrs)) { + $sort_attrs = (array) $sort_attrs; + if (count(array_intersect($sort_attrs, $vlv_index[$base_dn]['sort'])) == count($sort_attrs)) { + return $sort_attrs; + } + else { + return false; + } } else { - return false; + return $vlv_index[$base_dn]['sort'][0]; } } else { - return $vlv_indexes[$base_dn]['sort'][0]; + $this->_debug("Scope does not match. VLV: " . var_export($vlv_index[$base_dn]['scope'], true) + . " while looking for " . var_export($scope, true)); + return false; } } else { - $this->_debug("Scope does not match. VLV: " . var_export($vlv_indexes[$base_dn]['scope'], true) - . " while looking for " . var_export($scope, true)); - return false; + $this->_debug("Filter does not match"); } } - else { - $this->_debug("Filter does not match"); - return false; - } - } - else { - $this->_debug("No VLV for base dn", $base_dn); - return false; } + + return false; } /** @@ -1947,11 +1952,13 @@ $_vlv_sort[] = explode(' ', $vlv_index_attrs['vlvsort']); } - $this->_vlv_indexes_and_searches[$_vlv_base_dn] = array( - 'scope' => self::scopeint2str($_vlv_scope), - 'filter' => strtolower($_vlv_filter), - 'sort' => $_vlv_sort, - ); + $this->_vlv_indexes_and_searches[] = array( + $_vlv_base_dn => array( + 'scope' => self::scopeint2str($_vlv_scope), + 'filter' => strtolower($_vlv_filter), + 'sort' => $_vlv_sort, + ), + ); } // cache this @@ -2602,7 +2609,8 @@ 'iscritical' => true ); - $this->_debug("C: set controls sort=" . join(' ', unpack('H'.(strlen($sort_ctrl['value'])*2), $sort_ctrl['value'])) . " ($sort[0]);" + $this->_debug("C: set controls sort=" . join(' ', unpack('H'.(strlen($sort_ctrl['value'])*2), $sort_ctrl['value'])) + . " (" . implode(',', (array) $sort) . ");" . " vlv=" . join(' ', (unpack('H'.(strlen($vlv_ctrl['value'])*2), $vlv_ctrl['value']))) . " ($offset/$page_size)"); if (!ldap_set_option($this->conn, LDAP_OPT_SERVER_CONTROLS, array($sort_ctrl, $vlv_ctrl))) {
View file
kolab-webadmin-3.2.tar.gz/lib/kolab_client_task.php
Changed
@@ -1353,6 +1353,8 @@ $field['options'][$opt_idx] = kolab_html::escape($this->translate($option)); } } + + $field['escaped'] = true; } if (!empty($field['description'])) {
View file
kolab-webadmin-3.2.tar.gz/lib/locale/en_US.php
Changed
@@ -56,12 +56,16 @@ $LANG['aci.selected'] = 'all selected'; $LANG['aci.other'] = 'all except selected'; -$LANG['acl.read'] = 'read'; -$LANG['acl.write'] = 'write'; -$LANG['acl.post'] = 'post'; -$LANG['acl.append'] = 'append'; $LANG['acl.all'] = 'all'; +$LANG['acl.append'] = 'append'; $LANG['acl.custom'] = 'custom...'; +$LANG['acl.full'] = 'Full (without access control)'; +$LANG['acl.post'] = 'post'; +$LANG['acl.read'] = 'read'; +$LANG['acl.read-only'] = 'Read-Only'; +$LANG['acl.read-write'] = 'Read/Write'; +$LANG['acl.semi-full'] = 'Write new items'; +$LANG['acl.write'] = 'write'; $LANG['acl.l'] = 'Lookup'; $LANG['acl.r'] = 'Read messages'; $LANG['acl.s'] = 'Keep Seen state';
View file
kolab-webadmin-3.2.tar.gz/public_html/js/kolab_admin.js
Changed
@@ -1862,9 +1862,10 @@ .on('change', function() { rights_div[$(this).val() == 'custom' ? 'show' : 'hide'](); }), - epoch_input = $('<input id="acl-epoch" type="text" size="13" />'), +// Not yet implemented +// epoch_input = $('<input id="acl-epoch" type="text" size="13" />'), subjects = 'user,anyone,anonymous'.split(','), - options = 'all,read,write,post,append,custom'.split(','), + options = 'all,read-only,read-write,semi-full,full,custom'.split(','), rights = 'l,r,s,w,i,p,k,x,t,n,e,a'.split(','); $.each(subjects, function() { @@ -1886,22 +1887,24 @@ $('td.value', rows[0]).append(subject_select).append(subject_input); $('td.label', rows[1]).text(this.t('acl.rights')); $('td.value', rows[1]).append(select).append(rights_div.append(spans)); - $('td.label', rows[2]).text(this.t('acl.expire')); - $('td.value', rows[2]).append(epoch_input); +// Not yet implemented +// $('td.label', rows[2]).text(this.t('acl.expire')); +// $('td.value', rows[2]).append(epoch_input); dialog.hide().appendTo('body'); this.trigger_event('form-load', 'acl-form'); // reset form elements - subject_select.val(acl.subject.match(/^(anyone|anonymous)$/i) ? acl.subject : 'user').change(); - subject_input.val(subject_select.val() == 'user' ? acl.subject : ''); - epoch_input.val(this.unix_to_date(acl.epoch, true)); + subject_select.val(acl.subject && acl.subject.match(/^(anyone|anonymous)$/i) ? acl.subject : 'user').change(); + subject_input.val(acl.subject && subject_select.val() == 'user' ? acl.subject : ''); +// Not yet implemented +/* epoch_input.val(this.unix_to_date(acl.epoch, true)); epoch_input.datetimepicker({ lang: 'en', format: 'Y-m-d H:i' }); - +*/ var v = $.inArray(acl.rights, options) != -1 ? acl.rights : 'custom'; select.val(v).change(); $.each(rights, function() { @@ -1927,7 +1930,8 @@ user_input = $('#acl-subject-user'), user = $.trim(user_input.val()), rights = $('#acl-type').val(), - epoch = $.trim($('#acl-epoch').val()), +// Not yet implemented +// epoch = $.trim($('#acl-epoch').val()), acl_list = $('#acl' + this.acl_dialog_name); // sanity checks @@ -1962,7 +1966,8 @@ } } - if (epoch) { +// Not yet implemented +/* if (epoch) { if (epoch.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2})$/)) epoch = Date.UTC(RegExp.$1, RegExp.$2 - 1, RegExp.$3, RegExp.$4, RegExp.$5) / 1000; else if (epoch.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/)) @@ -1972,8 +1977,10 @@ return false; } } +*/ - acl = {subject: subject, rights: rights, epoch: epoch}; +// acl = {subject: subject, rights: rights, epoch: epoch}; + acl = {subject: subject, rights: rights}; // this.log(acl); // this.log(this.build_acl([acl])); @@ -3145,8 +3152,11 @@ // Syntax subject, rights[, epoch] var entry = self.explode_quoted_str(str, ','); - if (entry.length == 2 || entry.length == 3) - acl.push({subject: entry[0], rights: entry[1], epoch: entry[2] || 0}); + if (entry.length == 2 || entry.length == 3) { +// Not yet implemented +// acl.push({subject: entry[0], rights: entry[1], epoch: entry[2] || 0}); + acl.push({subject: entry[0], rights: entry[1] || 0}); + } }); return acl; @@ -3169,8 +3179,9 @@ tokens.push(subject); tokens.push(entry.rights); - if (entry.epoch) - tokens.push(entry.epoch); +// Not yet implemented +// if (entry.epoch) +// tokens.push(entry.epoch); result.push(tokens.join(', ')); });
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.