View | Details | Raw Unified | Return to bug 23738
Collapse All | Expand All

(-)management/univention-management-console/debian/changelog (+78 lines)
 Lines 1-3    Link Here 
1
univention-management-console (3.0.111-1) unstable; urgency=low
2
3
  * Fix handling of init_umccmd for modules that hide the category list;
4
    Bug #19576
5
6
 -- Andreas Büsching <buesching@univention.de>  Mon, 29 Aug 2011 12:53:40 +0200
7
8
univention-management-console (3.0.110-1) unstable; urgency=low
9
10
  * added handling of readonly UCR variables (Bug #22755)
11
12
 -- Sönke Schwardt-Krummrich <schwardt@univention.de>  Wed, 27 Jul 2011 10:13:53 +0200
13
14
univention-management-console (3.0.109-1) unstable; urgency=low
15
16
  * added value checks for "basis" wizard (Bug #22591)
17
18
 -- Sönke Schwardt-Krummrich <schwardt@univention.de>  Fri, 22 Jul 2011 14:26:08 +0200
19
20
univention-management-console (3.0.108-1) unstable; urgency=low
21
22
  * fix processing of umc/web/timeout/presession (Bug #21982)
23
24
 -- Janek Walkenhorst <walkenhorst@univention.de>  Thu, 21 Jul 2011 10:25:49 +0200
25
26
univention-management-console (3.0.107-1) unstable; urgency=low
27
28
  * make lifetime of session, when not logged in, configureable via UCR (Bug #21982)
29
30
 -- Janek Walkenhorst <walkenhorst@univention.de>  Wed, 06 Jul 2011 10:47:33 +0200
31
32
univention-management-console (3.0.106-1) unstable; urgency=low
33
34
  * reduce lifetime of session, when not logged in, from 30s to 5s (Bug #21982)
35
36
 -- Janek Walkenhorst <walkenhorst@univention.de>  Wed, 29 Jun 2011 16:45:17 +0200
37
38
univention-management-console (3.0.105-1) unstable; urgency=low
39
40
  * added option to prevent concurrent ajax calls in umcd.RefreshFrame (Bug #22594)
41
42
 -- Sönke Schwardt-Krummrich <schwardt@univention.de>  Fri, 10 Jun 2011 17:58:23 +0200
43
44
univention-management-console (3.0.104-1) unstable; urgency=low
45
46
  * increase maximum recursive depth for UMC module processes; Bug #22594
47
48
 -- Andreas Büsching <buesching@univention.de>  Fri, 10 Jun 2011 16:00:00 +0200
49
50
univention-management-console (3.0.103-1) unstable; urgency=low
51
52
  * ensure that incoming requests for a currently starting process will
53
    not get lost; Bug #22364
54
55
 -- Andreas Büsching <buesching@univention.de>  Tue, 03 May 2011 09:45:02 +0200
56
57
univention-management-console (3.0.102-1) unstable; urgency=low
58
59
  * Fix AJAX-RefreshFrame (Bug #22268).
60
  * Fix and add source code comments.
61
62
 -- Philipp Hahn <hahn@univention.de>  Tue, 19 Apr 2011 15:36:22 +0200
63
64
univention-management-console (3.0.101-2) unstable; urgency=low
65
66
  *  Wizard, Page: buttons should not close the dialog; Bug #22275
67
68
 -- Andreas Büsching <buesching@univention.de>  Wed, 20 Apr 2011 09:45:10 +0200
69
70
univention-management-console (3.0.100-1) unstable; urgency=low
71
72
  * if there is no dialog returned and the status code of the last reponse
73
    is 201 or 301 and there is a referrer set it is shown instead of an
74
    info message; Bug #22264
75
  * bump version for UCS 2.4-3
76
77
 -- Andreas Büsching <buesching@univention.de>  Tue, 19 Apr 2011 11:20:13 +0200
78
1
univention-management-console (3.0.83-2) unstable; urgency=low
79
univention-management-console (3.0.83-2) unstable; urgency=low
2
80
3
  * fixed typo in UCR description (Bug #21586)
81
  * fixed typo in UCR description (Bug #21586)
(-)management/univention-management-console/debian/univention-management-console.univention-config-registry-variables (+6 lines)
 Lines 4-9    Link Here 
4
Type=str
4
Type=str
5
Categories=management-umc
5
Categories=management-umc
6
6
7
[umc/web/timeout/presession]
8
Description[de]=Laufzeit von Univention Management Console Sitzungen ohne Anmeldung (Anmeldung trotzdem möglich)
9
Description[en]=Timout of Univention Management Console session without login (login still possible)
10
Type=str
11
Categories=management-umc
12
7
[umc/web/debug/level]
13
[umc/web/debug/level]
8
Description[de]=Debug-Level für das Web-Frontend von UMC
14
Description[de]=Debug-Level für das Web-Frontend von UMC
9
Description[en]=Debug level of the UMC web frontend
15
Description[en]=Debug level of the UMC web frontend
(-)management/univention-management-console/modules/frontend/pages/module.py (-8 / +19 lines)
 Lines 116-134    Link Here 
116
											 umc_tools.SIZE_SMALL )
116
											 umc_tools.SIZE_SMALL )
117
		self.__startups = startup.List()
117
		self.__startups = startup.List()
118
		self.active = ActiveProcess()
118
		self.active = ActiveProcess()
119
		init_req = None
119
		for name, cmd in module[ 'commands' ].items():
120
		for name, cmd in module[ 'commands' ].items():
120
			if cmd[ 'startup' ] or name == init_cmd:
121
			if cmd[ 'startup' ]:
121
				req = umcp.Command( args = [ name ], incomplete = True )
122
				req = umcp.Command( args = [ name ], incomplete = True )
122
				# add returns the position of new startup command
123
				# add returns the position of new startup command
123
				pos = self.__startups.add( req, cmd[ 'short_description' ], cmd[ 'long_description' ],
124
				self.__startups.add( req, cmd[ 'short_description' ], cmd[ 'long_description' ],
124
										   cmd[ 'priority' ], cmd[ 'caching' ] )
125
										   cmd[ 'priority' ], cmd[ 'caching' ] )
125
				# if current command is init_cmd then select this as new active tab
126
				# if current command is init_cmd then select this as new active tab
126
				if name == init_cmd:
127
			elif name == init_cmd:
127
					self.selected = pos
128
				init_req = umcp.Command( args = [ name ], incomplete = True )
129
				if not self.categorylist_hide:
130
					self.selected = self.__startups.add( init_req, cmd[ 'short_description' ], cmd[ 'long_description' ],
131
													   cmd[ 'priority' ], cmd[ 'caching' ] )
128
132
129
		# run command of first category
133
		# run command of first category
130
		cmd = self.__startups[ self.selected ]
134
		if init_req and self.categorylist_hide:
131
		self.active.single( client.request_send( cmd.request ) )
135
			self.active.single( client.request_send( init_req ) )
136
		else:
137
			cmd = self.__startups[ self.selected ]
138
			self.active.single( client.request_send( cmd.request ) )
132
		self.categories = self.__startups.categories()
139
		self.categories = self.__startups.categories()
133
140
134
	def focused( self ):
141
	def focused( self ):
 Lines 262-270    Link Here 
262
					ud.debug( ud.ADMIN, ud.INFO, 'Module.layout: check last response message: %s' % str( last_resp.arguments ) )
269
					ud.debug( ud.ADMIN, ud.INFO, 'Module.layout: check last response message: %s' % str( last_resp.arguments ) )
263
					# if there is no dialog
270
					# if there is no dialog
264
					if len( last_resp.dialog ) == 1 and list.__getitem__( last_resp.dialog, 0 ) == None:
271
					if len( last_resp.dialog ) == 1 and list.__getitem__( last_resp.dialog, 0 ) == None:
265
						ud.debug( ud.ADMIN, ud.INFO, 'Module.layout: info layout' )
272
						ud.debug( ud.ADMIN, ud.INFO, 'Module.layout: no dialog found' )
273
						# ... check if there is a referrer and popup_infos
274
						if last_resp.status() in ( 201, 301 ) and self.__restore_referrer:
275
							self.__layout = cmd.cache
276
							self.__restore_referrer = False
266
						# ... display simple info message if report is set
277
						# ... display simple info message if report is set
267
						if last_resp.report:
278
						elif last_resp.report:
268
							self.__layout = cmd.info_message( last_resp.report )
279
							self.__layout = cmd.info_message( last_resp.report )
269
						# ... re-invoke startup command or show cache
280
						# ... re-invoke startup command or show cache
270
						else:
281
						else:
(-)management/univention-management-console/modules/frontend/univention-console-frontend.py (-1 / +4 lines)
 Lines 49-55    Link Here 
49
49
50
watchdog = time.time()
50
watchdog = time.time()
51
watchdog_timeout = 60 * 5
51
watchdog_timeout = 60 * 5
52
watchdog_timeout_short = 30
52
try:
53
	watchdog_timeout_short = abs(int(configRegistry.get('umc/web/timeout/presession', '')))
54
except ValueError:
55
	watchdog_timeout_short = 5
53
56
54
THREAD_ERRORS = []
57
THREAD_ERRORS = []
55
58
(-)management/univention-management-console/modules/univention/management/console/dialog/ajax.py (-29 / +51 lines)
 Lines 35-41    Link Here 
35
import random
35
import random
36
36
37
class RefreshFrame( base.HTML ):
37
class RefreshFrame( base.HTML ):
38
	def __init__( self, sessionid, command, opts = {}, attributes = {}, maxlen=300000, refresh_interval=3000 ):
38
	def __init__( self, sessionid, command, opts = {}, attributes = {}, maxlen=300000, refresh_interval=3000, no_concurrency=False ):
39
		"""
39
		"""
40
		Returns a frame with specified geometry and refreshes its content every 'refresh_interval' miliseconds by calling
40
		Returns a frame with specified geometry and refreshes its content every 'refresh_interval' miliseconds by calling
41
		specified 'command' and passing 'opts' as command options.
41
		specified 'command' and passing 'opts' as command options.
 Lines 46-51    Link Here 
46
			attributes: dictionary with widget attributes (colspan, width (in pixel), height (in pixel))
46
			attributes: dictionary with widget attributes (colspan, width (in pixel), height (in pixel))
47
			maxlen: maximum length of data shown in frame (don't use too large values - it will slow down your browser)
47
			maxlen: maximum length of data shown in frame (don't use too large values - it will slow down your browser)
48
			refresh_interval: interval in miliseconds
48
			refresh_interval: interval in miliseconds
49
			no_concurrency: if set to False, RefreshFrame will send out at regulary interval (refresh_interval) a new
50
							request	regardless of any outstanding requests.
51
							If set to True, a new request will be sent after refresh_interval miliseconds after the last
52
							request has been answered.
53
							Note: in this case if your request requires 1 seconds to be answered and the refresh_interval
54
								  is 3 seconds, then a new request is sent every 4 seconds! If an answer get
49
55
50
		Example for revamp:
56
		Example for revamp:
51
		result.add_row( [ umcd.RefreshFrame( self._sessionid, 'some/command', { 'foo1': 3, 'ding': 'dong' }, attributes = { 'colspan': '3', 'width': '750', 'height': '400' }, refresh_interval=1000) ] )
57
		result.add_row( [ umcd.RefreshFrame( self._sessionid, 'some/command', { 'foo1': 3, 'ding': 'dong' }, attributes = { 'colspan': '3', 'width': '750', 'height': '400' }, refresh_interval=1000) ] )
 Lines 93-135    Link Here 
93
var umc = {};
99
var umc = {};
94
umc.ajax = {};
100
umc.ajax = {};
95
umc.ajax.refreshframe = {};
101
umc.ajax.refreshframe = {};
102
umc.ajax.refreshframe.concurrency = %(concurrency)s;
96
umc.ajax.refreshframe.updateData = function(refreshurl, wndid, dataid, maxlen) {
103
umc.ajax.refreshframe.updateData = function(refreshurl, wndid, dataid, maxlen) {
97
    var xhrArgs = {
104
	var xhrArgs = {
98
            url: refreshurl,
105
			url: refreshurl,
99
            handleAs: 'json',
106
			handleAs: 'json',
100
            preventCache: true,
107
			preventCache: true,
101
            load: function(data) {
108
			load: function(data) {
102
				if (!(data['contentappend'] === undefined)) {
109
				try {
103
					var newdata = dojo.byId( dataid ).innerHTML + data['contentappend'];
110
					var contentappend = data['contentappend'];
104
					if (newdata.length > maxlen) {
111
					if (contentappend !== undefined && contentappend.length > 0) {
105
						newdata = newdata.substr(newdata.length - maxlen, maxlen);
112
						var dataobj = dojo.byId(dataid);
113
						var newdata = dataobj.innerHTML + contentappend;
114
						if (newdata.length > maxlen) {
115
							newdata = newdata.substr(newdata.length - maxlen, maxlen);
116
						}
117
						dataobj.innerHTML = newdata;
118
						var winobj = dojo.byId(wndid);
119
						winobj.scrollTop = winobj.scrollHeight;
106
					}
120
					}
107
					dojo.byId( dataid ).innerHTML = newdata;
121
				} catch(err) { ; }
108
					if (data['contentappend'].length > 0) {
122
				try {
109
						dojo.byId( wndid ).scrollTop = dojo.byId( wndid ).scrollHeight;
123
					var content = data['content'];
124
					if (content !== undefined && content.length > 0) {
125
						var dataobj = dojo.byId(dataid);
126
						dataobj.innerHTML = content;
127
						var winobj = dojo.byId(wndid);
128
						winobj.scrollTop = winobj.scrollHeight;
110
					}
129
					}
111
				}
130
				} catch(err) { ; }
112
				if (!(data['content'] === undefined)) {
113
					dojo.byId( dataid ).innerHTML = data['content'];
114
					if (data['contentappend'].length > 0) {
115
						dojo.byId( wndid ).scrollTop = dojo.byId( wndid ).scrollHeight;
116
					}
117
				}
118
				for (var curdataid in data) {
131
				for (var curdataid in data) {
119
				    if ((curdataid != 'contentappend') && (curdataid != 'content')) {
132
					if ((curdataid != 'contentappend') && (curdataid != 'content')) {
120
						dojo.byId( curdataid ).innerHTML = data[curdataid];
133
						try {
134
							var dataobj = dojo.byId(curdataid);
135
							dataobj.innerHTML = data[curdataid];
136
						} catch(err) { ; }
121
					}
137
					}
122
				}
138
				}
123
            },
139
				if ( umc.ajax.refreshframe.concurrency === false ) {
124
        }
140
					window.setTimeout( function() { umc.ajax.refreshframe.updateData(refreshurl, wndid, dataid, maxlen);}, %(interval)s);
125
    var deferred = dojo.xhrGet(xhrArgs);
141
				}
142
			}
143
		};
144
	var deferred = dojo.xhrGet(xhrArgs);
126
};
145
};
127
dojo.addOnLoad (function() {
146
dojo.addOnLoad (function() {
128
    url = 'ajax.py?session_id=%(sessionid)s&umcpcmd=%(command)s&%(options)s';
147
	var url = 'ajax.py?session_id=%(sessionid)s&umcpcmd=%(command)s&%(options)s';
129
	wndid = 'wnd%(identifier)s';
148
	var wndid = 'wnd%(identifier)s';
130
	dataid = 'data%(identifier)s';
149
	var dataid = 'data%(identifier)s';
131
	umc.ajax.refreshframe.updateData(url, wndid, dataid, %(maxlen)d);
150
	umc.ajax.refreshframe.updateData(url, wndid, dataid, %(maxlen)d);
132
    window.setInterval( function() { umc.ajax.refreshframe.updateData(url, wndid, dataid, %(maxlen)d);}, %(interval)s);
151
	if ( umc.ajax.refreshframe.concurrency ) {
152
 		window.setInterval( function() { umc.ajax.refreshframe.updateData(url, wndid, dataid, %(maxlen)d);}, %(interval)s);
153
	}
133
});
154
});
134
</script>
155
</script>
135
""" % { 'sessionid': sessionid,
156
""" % { 'sessionid': sessionid,
 Lines 138-143    Link Here 
138
		'options': url_options,
159
		'options': url_options,
139
		'interval': refresh_interval,
160
		'interval': refresh_interval,
140
		'identifier': identifier,
161
		'identifier': identifier,
162
		'concurrency': str(bool(not(no_concurrency))).lower(),
141
		}
163
		}
142
164
143
		html = '%s%s' % (txt_div, txt_javascript)
165
		html = '%s%s' % (txt_div, txt_javascript)
(-)management/univention-management-console/modules/univention/management/console/dialog/wizard.py (-9 / +28 lines)
 Lines 44-49    Link Here 
44
_ = locales.Translation( 'univention.management.console.dialog' ).translate
44
_ = locales.Translation( 'univention.management.console.dialog' ).translate
45
45
46
class Wizard( Element ):
46
class Wizard( Element ):
47
	"""Low-level graphical representation for a Wizard page."""
47
	def __init__( self, title = '' ):
48
	def __init__( self, title = '' ):
48
		Element.__init__( self )
49
		Element.__init__( self )
49
		self._title = title
50
		self._title = title
 Lines 51-62    Link Here 
51
		self._image = None
52
		self._image = None
52
53
53
	def set_image( self, image ):
54
	def set_image( self, image ):
55
		"""Set top-left image to instance of umcd.Image."""
54
		self._image = image
56
		self._image = image
55
57
56
	def add_option( self, text, option ):
58
	def add_option( self, text, option ):
59
		"""Add widget to this Wizard page."""
57
		self._content.add_row( [ option, text ] )
60
		self._content.add_row( [ option, text ] )
58
61
59
	def add_buttons( self, *args ):
62
	def add_buttons( self, *args ):
63
		"""Add buttons to this Wizard page."""
60
		if self._image:
64
		if self._image:
61
			self._content.add_row( [ Fill( 2 ) ] )
65
			self._content.add_row( [ Fill( 2 ) ] )
62
			self._content.add_row( [ '', args ] )
66
			self._content.add_row( [ '', args ] )
 Lines 65-70    Link Here 
65
			self._content.add_row( [ args ] )
69
			self._content.add_row( [ args ] )
66
70
67
	def setup( self ):
71
	def setup( self ):
72
		"""Convert Wizard to dialog element."""
68
		if self._image:
73
		if self._image:
69
			self._image[ 'width' ] = '100'
74
			self._image[ 'width' ] = '100'
70
			return Frame( [ List( content = [ [ Cell( self._image, { 'valign' : 'top' } ), self._content ] ], attributes = { 'width' : '100%' } ) ], self._title )
75
			return Frame( [ List( content = [ [ Cell( self._image, { 'valign' : 'top' } ), self._content ] ], attributes = { 'width' : '100%' } ) ], self._title )
 Lines 77-82    Link Here 
77
# dialog class above. An example can be found in the UVMM UMC module
82
# dialog class above. An example can be found in the UVMM UMC module
78
83
79
class Page( object ):
84
class Page( object ):
85
	"""High-level implementation of a wizard page."""
80
	def __init__( self, title = '', description = '' ):
86
	def __init__( self, title = '', description = '' ):
81
		self.title = title
87
		self.title = title
82
		self.description = description
88
		self.description = description
 Lines 86-91    Link Here 
86
		self.hint = None
92
		self.hint = None
87
93
88
	def setup( self, command, options, prev = True, next = True, finish = False, cancel = True ):
94
	def setup( self, command, options, prev = True, next = True, finish = False, cancel = True ):
95
		"""Convert this page into graphical representation. Returns a Wizard instance containing description, hint, options and buttons."""
89
		wizard = Wizard( self.title )
96
		wizard = Wizard( self.title )
90
		# add description
97
		# add description
91
		if self.description:
98
		if self.description:
 Lines 129-135    Link Here 
129
			if next:
136
			if next:
130
				opts = copy_module.copy( options )
137
				opts = copy_module.copy( options )
131
				opts[ 'action' ] = 'next'
138
				opts[ 'action' ] = 'next'
132
				next_btn = Button( _( 'Next' ), actions = ( Action( umcp.SimpleCommand( command, opts ), items ), ), attributes = { 'class' : 'button_right' }, default = True )
139
				next_btn = Button( _( 'Next' ), actions = ( Action( umcp.SimpleCommand( command, opts ), items ), ), attributes = { 'class' : 'button_right' }, default = True, close_dialog = False )
133
			elif finish:
140
			elif finish:
134
				opts = copy_module.copy( options )
141
				opts = copy_module.copy( options )
135
				opts[ 'action' ] = 'finish'
142
				opts[ 'action' ] = 'finish'
 Lines 153-159    Link Here 
153
				opts[ 'action' ] = 'prev'
160
				opts[ 'action' ] = 'prev'
154
				prev = umcp.SimpleCommand( command, opts )
161
				prev = umcp.SimpleCommand( command, opts )
155
				prev.verify_options = False
162
				prev.verify_options = False
156
				prev_btn = Cell( Button( _( 'Previous' ), actions = ( Action( prev, items ), ), attributes = { 'class' : 'cancel' } ), attributes = { 'type' : 'button_padding' } )
163
				prev_btn = Cell( Button( _( 'Previous' ), actions = ( Action( prev, items ), ), attributes = { 'class' : 'cancel' }, close_dialog = False ), attributes = { 'type' : 'button_padding' } )
157
			else:
164
			else:
158
				prev_btn = ''
165
				prev_btn = ''
159
166
 Lines 166-179    Link Here 
166
		return wizard.setup()
173
		return wizard.setup()
167
174
168
class WizardResult( object ):
175
class WizardResult( object ):
176
	"""Encapsulate result of a Wizard page. value=True to continue to next page, value=False & text to stay on the current page."""
169
	def __init__( self, value =True, text = '' ):
177
	def __init__( self, value =True, text = '' ):
170
		self.value = value
178
		self.value = value
171
		self.text = text
179
		self.text = text
172
180
173
	def __nonzero__( self ):
181
	def __nonzero__( self ):
182
		"""Return True, if the Wizard page in complete and the next Wizard should switch to the next page."""
174
		return self.value
183
		return self.value
175
184
176
class IWizard( list ):
185
class IWizard( list ):
186
	"""High-level implementation of a wizard containing a list of wizard pages, stacked on top of each other in card layout fashion."""
177
	def __init__( self, command = '' ):
187
	def __init__( self, command = '' ):
178
		list.__init__( self )
188
		list.__init__( self )
179
		self.current = None
189
		self.current = None
 Lines 182-194    Link Here 
182
		self._result = None
192
		self._result = None
183
193
184
	def replace_title( self, title ):
194
	def replace_title( self, title ):
195
		"""Set title of all pages."""
185
		for page in self:
196
		for page in self:
186
			page.title = title
197
			page.title = title
187
198
188
	def result( self ):
199
	def result( self ):
200
		"""Return the result storged by the last Wizard page."""
189
		return self._result
201
		return self._result
190
202
191
	def action( self, object ):
203
	def action( self, object ):
204
		"""Call the function responsible for handling the action (object.options['action']), falling back to 'next'."""
192
		if 'action' in object.options:
205
		if 'action' in object.options:
193
			action = object.options[ 'action' ]
206
			action = object.options[ 'action' ]
194
			del object.options[ 'action' ]
207
			del object.options[ 'action' ]
 Lines 201-217    Link Here 
201
		return WizardResult( False, 'Unknown wizard action: %s' % action )
214
		return WizardResult( False, 'Unknown wizard action: %s' % action )
202
215
203
	def setup( self, object, prev = None, next = None, finish = None, cancel = None ):
216
	def setup( self, object, prev = None, next = None, finish = None, cancel = None ):
217
		"""Create graphical representation for the current Wizard page."""
204
		if prev == True:
218
		if prev == True:
205
			force_prev = True
219
			force_prev = True
206
		else:
220
		else:
207
			force_prev = False
221
			force_prev = False
208
		if prev == None:
222
		if prev is None:
209
			prev = True
223
			prev = True
210
		if next == None:
224
		if next is None:
211
			next = True
225
			next = True
212
		if finish == None:
226
		if finish is None:
213
			finish = False
227
			finish = False
214
		if cancel == None:
228
		if cancel is None:
215
			cancel = True
229
			cancel = True
216
		if self.current == ( len( self ) - 1 ): # last page
230
		if self.current == ( len( self ) - 1 ): # last page
217
			next = False
231
			next = False
 Lines 219-230    Link Here 
219
				finish = True
233
				finish = True
220
		elif not self.current:
234
		elif not self.current:
221
			prev = force_prev
235
			prev = force_prev
222
		return self[ self.current ].setup( self.command, object.options, prev = prev, next = next, finish = finish, cancel = cancel )
223
236
237
		page = self[self.current]
238
		return page.setup(self.command, object.options, prev=prev, next=next, finish=finish, cancel=cancel)
239
224
	def finish( self, object ):
240
	def finish( self, object ):
241
		"""Convert the internally collected data of this Wizard into the external representation."""
225
		return WizardResult( False, 'finish is not implemented!' )
242
		return WizardResult( False, 'finish is not implemented!' )
226
243
227
	def next( self, object ):
244
	def next( self, object ):
245
		"""Transition to the next Wizard page."""
228
		if self.current == None:
246
		if self.current == None:
229
			self.current = 0
247
			self.current = 0
230
		elif self.current == ( len( self ) - 1 ):
248
		elif self.current == ( len( self ) - 1 ):
 Lines 234-241    Link Here 
234
252
235
		return WizardResult()
253
		return WizardResult()
236
254
237
238
	def prev( self, object ):
255
	def prev( self, object ):
256
		"""Transition to the previous Wizard page."""
239
		if self.current == 0:
257
		if self.current == 0:
240
			return None
258
			return None
241
		else:
259
		else:
 Lines 244-252    Link Here 
244
		return WizardResult()
262
		return WizardResult()
245
263
246
	def cancel( self, object ):
264
	def cancel( self, object ):
265
		"""Cancel the complete Wizard."""
247
		return WizardResult( False, 'cancel is not implemented!' )
266
		return WizardResult( False, 'cancel is not implemented!' )
248
267
249
	def reset( self ):
268
	def reset( self ):
269
		"""Reset Wizard back to initial values."""
250
		self.current = None
270
		self.current = None
251
		self._result = None
271
		self._result = None
252
(-)management/univention-management-console/modules/univention/management/console/handlers/baseconfig/de.po (-62 / +69 lines)
 Lines 30-156    Link Here 
30
msgstr ""
30
msgstr ""
31
"Project-Id-Version: PACKAGE VERSION\n"
31
"Project-Id-Version: PACKAGE VERSION\n"
32
"Report-Msgid-Bugs-To: \n"
32
"Report-Msgid-Bugs-To: \n"
33
"POT-Creation-Date: 2009-02-16 10:46+0100\n"
33
"POT-Creation-Date: 2011-07-27 10:10+0200\n"
34
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
34
"PO-Revision-Date: 2011-07-27 11:12+0200\n"
35
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
35
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
36
"Language-Team: LANGUAGE <LL@li.org>\n"
36
"Language-Team: LANGUAGE <LL@li.org>\n"
37
"MIME-Version: 1.0\n"
37
"MIME-Version: 1.0\n"
38
"Content-Type: text/plain; charset=UTF-8\n"
38
"Content-Type: text/plain; charset=UTF-8\n"
39
"Content-Transfer-Encoding: unicode\n"
39
"Content-Transfer-Encoding: unicode\n"
40
40
41
#: _revamp.py:81 _types.py:90
41
#: __init__.py:56
42
msgid "Univention Configuration Registry"
43
msgstr ""
44
45
#: __init__.py:57
46
msgid "Add, modify and search Univention Configuration Registry variables"
47
msgstr "Hinzufügen, Beareiten und Suchen von Configuration Registry Variablen"
48
49
#: __init__.py:62
50
msgid "Add"
51
msgstr "Hinzufügen"
52
53
#: __init__.py:63
54
msgid "Add a new configuration registry variable"
55
msgstr "Hinzufügen einer neuen Configuration Registry Variable"
56
57
#: __init__.py:74
58
msgid "Show"
59
msgstr "Anzeigen"
60
61
#: __init__.py:75
62
msgid "Display information about a configuration registry variable"
63
msgstr "Anzeigen von Informationen zu einer Configuration Registry Variable"
64
65
#: __init__.py:80
66
msgid "Remove"
67
msgstr "Entfernen"
68
69
#: __init__.py:81
70
msgid "Unset a configuration registry value"
71
msgstr "Entfernen eines Configuration Registry Wertes"
72
73
#: __init__.py:86
74
msgid "Search"
75
msgstr "Suchen"
76
77
#: __init__.py:87
78
msgid "Search for a configuration registry value"
79
msgstr "Suchen eines Configuration Registry Wertes"
80
81
#: __init__.py:157
82
#, python-format
83
msgid ""
84
"ERROR: UCR variable <i>%s</i> is read-only! Variable has not been created or "
85
"changed!"
86
msgstr "ERROR: Die UCR-Variable <i>%s</i> darf nicht verändert werden! Die Variable wurde nicht angelegt oder modifiziert."
87
88
#: _revamp.py:83 _types.py:94
42
msgid "Variable"
89
msgid "Variable"
43
msgstr "Variable"
90
msgstr "Variable"
44
91
45
#: _revamp.py:81 _types.py:90 _types.py:98
92
#: _revamp.py:83 _types.py:94 _types.py:102
46
msgid "Value"
93
msgid "Value"
47
msgstr "Wert"
94
msgstr "Wert"
48
95
49
#: _revamp.py:81 _revamp.py:188 _types.py:91 _types.py:104
96
#: _revamp.py:83 _revamp.py:196 _types.py:95 _types.py:108
50
msgid "Description"
97
msgid "Description"
51
msgstr "Beschreibung"
98
msgstr "Beschreibung"
52
99
53
#: _revamp.py:82
100
#: _revamp.py:84
54
msgid "Categories"
101
msgid "Categories"
55
msgstr "Kategorien"
102
msgstr "Kategorien"
56
103
57
#: _revamp.py:124
104
#: _revamp.py:126
58
#, python-format
105
#, python-format
59
msgid "Variable: %(key)s"
106
msgid "Variable: %(key)s"
60
msgstr "Variable: %(key)s"
107
msgstr "Variable: %(key)s"
61
108
62
#: _revamp.py:128
109
#: _revamp.py:130
63
msgid "No configuration registry variables were found."
110
msgid "No configuration registry variables were found."
64
msgstr "Es wurden keine Configuration Registry Variablen gefunden."
111
msgstr "Es wurden keine Configuration Registry Variablen gefunden."
65
112
66
#: _revamp.py:130
113
#: _revamp.py:132
67
msgid "Search result"
114
msgid "Search results"
68
msgstr "Suchergebnis"
115
msgstr "Suchergebnis"
69
116
70
#: _revamp.py:188 _types.py:105
117
#: _revamp.py:196 _types.py:109
71
msgid "Language"
118
msgid "Language"
72
msgstr "Sprache"
119
msgstr "Sprache"
73
120
74
#: _revamp.py:203
121
#: _revamp.py:211
75
msgid "Modify Configuration Registry variable"
122
msgid "Modify Configuration Registry variable"
76
msgstr "Bearbeiten einer Configuration Registry Variable"
123
msgstr "Bearbeiten einer Configuration Registry Variable"
77
124
78
#: _revamp.py:205
125
#: _revamp.py:213
79
msgid "Add Configuration Registry variable(s)"
126
msgid "Add Configuration Registry variable(s)"
80
msgstr "Hinzufügen einer Configuration Registry Variable"
127
msgstr "Hinzufügen einer Configuration Registry Variable"
81
128
82
#: __init__.py:54
129
#: _types.py:45
83
msgid "Univention Configuration Registry"
84
msgstr ""
85
86
#: __init__.py:55
87
msgid "Add, modify and search Univention Configuration Registry variables"
88
msgstr "Hinzufügen, Beareiten und Suchen von Configuration Registry Variablen"
89
90
#: __init__.py:60
91
msgid "Add"
92
msgstr "Hinzufügen"
93
94
#: __init__.py:61
95
msgid "Add a new configuration registry variable"
96
msgstr "Hinzufügen einer neuen Configuration Registry Variable"
97
98
#: __init__.py:72
99
msgid "Show"
100
msgstr "Anzeigen"
101
102
#: __init__.py:73
103
msgid "Display information about a configuration registry variable"
104
msgstr "Anzeigen von Informationen zu einer Configuration Registry Variable"
105
106
#: __init__.py:78
107
msgid "Remove"
108
msgstr "Entfernen"
109
110
#: __init__.py:79
111
msgid "Unset a configuration registry value"
112
msgstr "Entfernen eines Configuration Registry Wertes"
113
114
#: __init__.py:84
115
msgid "Search"
116
msgstr "Suchen"
117
118
#: __init__.py:85
119
msgid "Search for a configuration registry value"
120
msgstr "Suchen eines Configuration Registry Wertes"
121
122
#: _types.py:41
123
msgid "Category"
130
msgid "Category"
124
msgstr "Kategorie"
131
msgstr "Kategorie"
125
132
126
#: _types.py:62
133
#: _types.py:66
127
msgid "All (incl. not registered)"
134
msgid "All (incl. not registered)"
128
msgstr "Alle (inkl. nicht registrierter)"
135
msgstr "Alle (inkl. nicht registrierter)"
129
136
130
#: _types.py:63
137
#: _types.py:67
131
msgid "All"
138
msgid "All"
132
msgstr "Alle"
139
msgstr "Alle"
133
140
134
#: _types.py:71
141
#: _types.py:75
135
msgid "List of categories"
142
msgid "List of categories"
136
msgstr "Liste der Kategorien"
143
msgstr "Liste der Kategorien"
137
144
138
#: _types.py:78
145
#: _types.py:82
139
msgid "Types"
146
msgid "Types"
140
msgstr "Typen"
147
msgstr "Typen"
141
148
142
#: _types.py:81
149
#: _types.py:85
143
msgid "String"
150
msgid "String"
144
msgstr "Zeichenkette"
151
msgstr "Zeichenkette"
145
152
146
#: _types.py:87
153
#: _types.py:91
147
msgid "Search key"
154
msgid "Search key"
148
msgstr "Suchmaske"
155
msgstr "Suchmaske"
149
156
150
#: _types.py:96
157
#: _types.py:100
151
msgid "Key"
158
msgid "Key"
152
msgstr "Schlüssel"
159
msgstr "Schlüssel"
153
160
154
#: _types.py:106
161
#: _types.py:110
155
msgid "Multilinugal description"
162
msgid "Multilinugal description"
156
msgstr "Mehrsprachige Beschreibung"
163
msgstr "Mehrsprachige Beschreibung"
(-)management/univention-management-console/modules/univention/management/console/handlers/baseconfig/__init__.py (-11 / +31 lines)
 Lines 129-156    Link Here 
129
			info.add_variable( options[ 'key' ], var )
129
			info.add_variable( options[ 'key' ], var )
130
			info.write_customized()
130
			info.write_customized()
131
131
132
	def is_readonly( self, key ):
133
		ucrinfo_system = ConfigRegistryInfo( registered_only=False, load_customized=False )
134
		var = ucrinfo_system.get_variable( key )
135
		if var:
136
			return var.get('readonly') in ['yes','1','true']
137
		return False
138
132
	def baseconfig_set( self, object ):
139
	def baseconfig_set( self, object ):
133
		success = True
140
		success = True
141
		report = None
134
142
135
		ud.debug( ud.ADMIN, ud.INFO, 'Baseconfig.set: options: %s' % str( object.options ) )
143
		ud.debug( ud.ADMIN, ud.INFO, 'Baseconfig.set: options: %s' % str( object.options ) )
136
		if object.incomplete:
144
		if object.incomplete:
137
			object.status( 200 )
145
			object.status( 200 )
138
		elif object.options.has_key( 'key' ) and \
146
		elif object.options.has_key( 'key' ) and \
139
			   object.options.has_key( 'value' ):
147
			   object.options.has_key( 'value' ):
148
140
			value = object.options[ 'value' ]
149
			value = object.options[ 'value' ]
141
			if value == None:
150
			if value == None:
142
				value = ''
151
				value = ''
143
			arg = [ '%s=%s' % ( object.options[ 'key' ].encode(), value.encode() ) ]
152
144
			univention.config_registry.handler_set( arg )
153
			ucr = univention.config_registry.ConfigRegistry()
145
			if object.options.get( 'descriptions', '' ) or object.options.get( 'type', '' ) or \
154
			ucr.load()
146
				   object.options.get( 'categories', '' ):
155
			if self.is_readonly(object.options['key']) and not(value == ucr.get(object.options['key'],'')):
147
				self.__create_variable_info( object.options )
156
				# fail if existing UCR variable shall be created
148
			object.status( 200 )
157
				report = _('ERROR: UCR variable <i>%s</i> is read-only! Variable has not been created or changed!') % object.options['key']
158
				success = False
159
				object.status( 201 )
160
			else:
161
				# edit existing UCR variable
162
				arg = [ '%s=%s' % ( object.options[ 'key' ].encode(), value.encode() ) ]
163
				univention.config_registry.handler_set( arg )
164
				if object.options.get( 'descriptions', '' ) or object.options.get( 'type', '' ) or \
165
					   object.options.get( 'categories', '' ):
166
					self.__create_variable_info( object.options )
167
				object.status( 200 )
149
		else:
168
		else:
150
			success = False
169
			success = False
151
			object.status( 403 )
170
			object.status( 403 )
152
171
153
		self.finished( object.id(), None, success = success )
172
		self.finished( object.id(), [ None, None ], success = success, report = report )
154
173
155
	def baseconfig_unset( self, object ):
174
	def baseconfig_unset( self, object ):
156
		if object.options.has_key( 'key' ):
175
		if object.options.has_key( 'key' ):
 Lines 163-177    Link Here 
163
		"""this method returns a dictionary of configuration registry variables
182
		"""this method returns a dictionary of configuration registry variables
164
		found by searching for the (wildcard) expression defined by the UMCP
183
		found by searching for the (wildcard) expression defined by the UMCP
165
		request. Additionally a list of configuration registry categories can be defined"""
184
		request. Additionally a list of configuration registry categories can be defined"""
185
		key = object.options['key']
166
		if not object.incomplete:
186
		if not object.incomplete:
167
			baseInfo = ConfigRegistryInfo( registered_only = False )
187
			baseInfo = ConfigRegistryInfo( registered_only = False )
168
			vars = baseInfo.get_variables()
188
			vars = baseInfo.get_variables()
169
			if vars.has_key( object.options[ 'key' ] ):
189
			if vars.has_key(key):
170
				self.finished( object.id(), vars[ object.options[ 'key' ] ] )
190
				self.finished( object.id(), [ vars[key], self.is_readonly(key) ] )
171
			else:
191
			else:
172
				self.finished( object.id(), None, success = False )
192
				self.finished( object.id(), [ None, None ], success = False )
173
		else:
193
		else:
174
			self.finished( object.id(), None, success = False )
194
			self.finished( object.id(), [ None, None ], success = False )
175
195
176
	def baseconfig_search( self, object ):
196
	def baseconfig_search( self, object ):
177
		"""this method returns a dictionary of configuration registry variables
197
		"""this method returns a dictionary of configuration registry variables
(-)management/univention-management-console/modules/univention/management/console/handlers/baseconfig/_revamp.py (-2 / +6 lines)
 Lines 139-145    Link Here 
139
		form = umcd.List()
139
		form = umcd.List()
140
140
141
		ud.debug( ud.ADMIN, ud.INFO, 'Baseconfig.show: options: %s' % str( res.dialog ) )
141
		ud.debug( ud.ADMIN, ud.INFO, 'Baseconfig.show: options: %s' % str( res.dialog ) )
142
		variable = res.dialog
142
		variable, is_readonly = res.dialog
143
143
		# name
144
		# name
144
		if variable != None:
145
		if variable != None:
145
			varname = umcd.make_readonly( self[ 'baseconfig/set' ][ 'key' ],
146
			varname = umcd.make_readonly( self[ 'baseconfig/set' ][ 'key' ],
 Lines 149-155    Link Here 
149
150
150
		# value
151
		# value
151
		if variable != None:
152
		if variable != None:
152
			value = umcd.make( self[ 'baseconfig/set' ][ 'value' ], default = variable.value )
153
			if is_readonly:
154
				value = umcd.make_readonly( self[ 'baseconfig/set' ][ 'value' ], default = variable.value )
155
			else:
156
				value = umcd.make( self[ 'baseconfig/set' ][ 'value' ], default = variable.value )
153
		else:
157
		else:
154
			value = umcd.make( self[ 'baseconfig/set' ][ 'value' ] )
158
			value = umcd.make( self[ 'baseconfig/set' ][ 'value' ] )
155
		form.add_row( [ varname, value ] )
159
		form.add_row( [ varname, value ] )
(-)management/univention-management-console/modules/univention/management/console/handlers/__init__.py (-1 / +1 lines)
 Lines 265-271    Link Here 
265
265
266
266
267
	def revamped( self, id, res, rawresult = False ):
267
	def revamped( self, id, res, rawresult = False ):
268
		"""this method should in invoked by '_revamp' functions that are
268
		"""this method should be invoked by '_revamp' functions that are
269
		called after a command was successfully processed. It should be
269
		called after a command was successfully processed. It should be
270
		used to modify the result dialog to fit the specified client
270
		used to modify the result dialog to fit the specified client
271
		interface"""
271
		interface"""
(-)management/univention-management-console/modules/univention/management/console/protocol/session.py (-1 / +11 lines)
 Lines 105-110    Link Here 
105
		self.signal_new( 'result' )
105
		self.signal_new( 'result' )
106
		self.signal_new( 'finished' )
106
		self.signal_new( 'finished' )
107
		self.name = module
107
		self.name = module
108
		self.running = False
109
		self._queued_requests = []
108
110
109
	def __del__( self ):
111
	def __del__( self ):
110
		ud.debug( ud.ADMIN, ud.PROCESS, 'ModuleProcess: dying' )
112
		ud.debug( ud.ADMIN, ud.PROCESS, 'ModuleProcess: dying' )
 Lines 326-332    Link Here 
326
				notifier.timer_add( 50, cb )
328
				notifier.timer_add( 50, cb )
327
			else:
329
			else:
328
				ud.debug( ud.ADMIN, ud.INFO, 'passing new request to running module %s' % module_name )
330
				ud.debug( ud.ADMIN, ud.INFO, 'passing new request to running module %s' % module_name )
329
				self.__processes[ module_name ].request( msg )
331
				proc = self.__processes[ module_name ]
332
				if proc.running:
333
					proc.request( msg )
334
				else:
335
					proc._queued_requests.append( msg )
330
336
331
	def _mod_connect( self, mod, msg ):
337
	def _mod_connect( self, mod, msg ):
332
		ud.debug( ud.ADMIN, ud.PROCESS, 'trying to connect' )
338
		ud.debug( ud.ADMIN, ud.PROCESS, 'trying to connect' )
 Lines 343-348    Link Here 
343
				return True
349
				return True
344
		else:
350
		else:
345
			ud.debug( ud.ADMIN, ud.INFO, 'ok')
351
			ud.debug( ud.ADMIN, ud.INFO, 'ok')
352
			mod.running = True
346
353
347
			# send acls
354
			# send acls
348
			acls = self.acls.acls
355
			acls = self.acls.acls
 Lines 368-373    Link Here 
368
				mod.request( req )
375
				mod.request( req )
369
376
370
			mod.request( msg )
377
			mod.request( msg )
378
			for req in mod._queued_requests:
379
				mod.request( req )
380
			mod._queued_requests = []
371
381
372
		return False
382
		return False
373
383
(-)management/univention-management-console/modules/univention/management/console/wizards/basis/__init__.py (-4 / +4 lines)
 Lines 67-76    Link Here 
67
		short_description = _( 'Base configuration' ),
67
		short_description = _( 'Base configuration' ),
68
		long_description = _( 'Set base configuration' ),
68
		long_description = _( 'Set base configuration' ),
69
		method = 'basis_set',
69
		method = 'basis_set',
70
		values = { 'hostname' : umc.String( _( 'Hostname' ) ),
70
		values = { 'hostname' : umc.String( _( 'Hostname' ), regex = r'^[a-z]([a-z0-9-]*[a-z0-9])*$' ),
71
				   'domainname' : umc.String( _( 'Domain name' ) ),
71
				   'domainname' : umc.String( _( 'Domain name' ), regex = r'^([a-z0-9]([a-z0-9-]*[a-z0-9])*[.])*[a-z0-9]([a-z0-9-]*[a-z0-9])*$' ),
72
				   'windows_domain' : umc.String( _( 'Windows domain' ) ),
72
				   'windows_domain' : umc.String( _( 'Windows domain' ), regex = r'^([a-z]([a-z0-9-]*[a-z0-9])*[.])*[a-z]([a-z0-9-]*[a-z0-9])*$' ),
73
				   'ldap_base' : umc.String( _( 'LDAP base' ) ), },
73
				   'ldap_base' : umc.String( _( 'LDAP base' ), regex = r'^((dc|cn|c|o|l)=[^ ,=]+,)*(dc|cn|c|o|l)=[^ ,=]+$' ), },
74
	),
74
	),
75
}
75
}
76
76
(-)management/univention-management-console/usr/sbin/univention-management-console-module.py (-1 / +1 lines)
 Lines 49-55    Link Here 
49
		sys.stderr.write( '%s must be started as root\n' % os.path.basename( sys.argv[ 0 ] ) )
49
		sys.stderr.write( '%s must be started as root\n' % os.path.basename( sys.argv[ 0 ] ) )
50
		sys.exit( 1 )
50
		sys.exit( 1 )
51
51
52
	notifier.init( notifier.GENERIC )
52
	notifier.init( notifier.GENERIC, recursive_depth = 50 )
53
53
54
	parser = OptionParser( usage = "usage: %prog [options]" )
54
	parser = OptionParser( usage = "usage: %prog [options]" )
55
	parser.add_option( '-s', '--socket', type = 'string', action = 'store',
55
	parser.add_option( '-s', '--socket', type = 'string', action = 'store',

Return to bug 23738