Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > d536e3b2143fe88c174c968d683c0f4f > files > 13

conga-0.12.2-24.el5_6.1.src.rpm

diff -ur conga-0.12.2.orig/luci/homebase/form-macros conga-0.12.2/luci/homebase/form-macros
--- conga-0.12.2.orig/luci/homebase/form-macros	2009-12-22 03:57:50.000000000 -0500
+++ conga-0.12.2/luci/homebase/form-macros	2009-12-22 03:58:06.000000000 -0500
@@ -210,6 +210,17 @@
 			</tal:block>
 		</select>
 
+		<table class="homebase">
+			<tr class="homebase">
+				<td>
+					Set user password
+				</td>
+				<td>
+					<input type="password" name="newpasswd" checked="0" />
+				</td>
+			</tr>
+		</table>
+
 		<h3 class="homebase" tal:condition="python:systems[0] and len(systems[0]) > 0">
 			Clusters
 		</h3>
diff -ur conga-0.12.2.orig/luci/site/luci/Extensions/homebase_adapters.py conga-0.12.2/luci/site/luci/Extensions/homebase_adapters.py
--- conga-0.12.2.orig/luci/site/luci/Extensions/homebase_adapters.py	2009-12-22 03:57:50.000000000 -0500
+++ conga-0.12.2/luci/site/luci/Extensions/homebase_adapters.py	2009-12-22 03:58:06.000000000 -0500
@@ -769,6 +769,18 @@
 	if len(errors) > 0:
 		return (False, { 'errors': errors })
 
+	new_passwd = request.form.get('newpasswd')
+	if new_passwd:
+		new_passwd = new_passwd.strip()
+	if new_passwd:
+		try:
+			user.userSetPassword(user_id, new_passwd)
+			messages.append('Set password for user "%s"' % username)
+		except Exception, e:
+			errors.append('An error occurred while setting the password for user "%s"' % username)
+	if len(errors) > 0:
+		return (False, { 'errors': errors })
+
 	clusters = self.restrictedTraverse('%s/systems/cluster/objectItems' % PLONE_ROOT)('Folder')
 	if not request.form.has_key('__CLUSTER'):
 		for i in clusters: