Author: david
Date: Tue Sep 15 15:34:49 2009
New Revision: 3321
Log:
Add logic to save username, email and groups on user/edit.
Modified:
trunk/apps/qubit/modules/user/actions/editAction.class.php
trunk/apps/qubit/modules/user/templates/editSuccess.php
Modified: trunk/apps/qubit/modules/user/actions/editAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/user/actions/editAction.class.php Tue Sep 15
15:23:44 2009 (r3320)
+++ trunk/apps/qubit/modules/user/actions/editAction.class.php Tue Sep 15
15:34:49 2009 (r3321)
@@ -118,6 +118,21 @@
protected function processForm()
{
+ $this->user->username = $this->form->getValue('username');
+ $this->user->email = $this->form->getValue('email');
+
+ if (is_array($groups = $this->form->getValue('groups')))
+ {
+ foreach ($groups as $groupId)
+ {
+ $userGroup = new QubitAclUserGroup;
+ $userGroup->userId = $this->user->id;
+ $userGroup->groupId = $groupId;
+ $userGroup->save();
+ }
+ }
+ $this->user->save();
+
return $this;
}
}
Modified: trunk/apps/qubit/modules/user/templates/editSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/user/templates/editSuccess.php Tue Sep 15
15:23:44 2009 (r3320)
+++ trunk/apps/qubit/modules/user/templates/editSuccess.php Tue Sep 15
15:34:49 2009 (r3321)
@@ -41,7 +41,10 @@
<fieldset class="collapsible collapsed" id="groupsAndPermissions">
<legend><?php echo __('groups and permissions')?></legend>
- <?php echo $form->groups->renderRow(array('class' => 'form-autocomplete')) ?>
+ <div class="form-item" style="width: 90%">
+ <?php echo $form->groups->label(__('groups'))->renderLabel() ?>
+ <?php echo $form->groups->render(array('class' => 'form-autocomplete')) ?>
+ </div>
<table class="inline">
<caption><?php echo __('Existing permissions'); ?></caption>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---