[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[6195] trunk
- Subject: SF.net SVN: ledger-smb:[6195] trunk
- From: ..hidden..
- Date: Tue, 29 Oct 2013 03:17:23 +0000
Revision: 6195
http://sourceforge.net/p/ledger-smb/code/6195
Author: einhverfr
Date: 2013-10-29 03:17:22 +0000 (Tue, 29 Oct 2013)
Log Message:
-----------
User permissions now stick when edited
Modified Paths:
--------------
trunk/LedgerSMB/Entity/User.pm
trunk/LedgerSMB/Scripts/employee.pm
trunk/UI/Contact/divs/user.html
Modified: trunk/LedgerSMB/Entity/User.pm
===================================================================
--- trunk/LedgerSMB/Entity/User.pm 2013-10-28 10:43:40 UTC (rev 6194)
+++ trunk/LedgerSMB/Entity/User.pm 2013-10-29 03:17:22 UTC (rev 6195)
@@ -130,6 +130,7 @@
sub save_roles{
my ($self, $role_list) = @_;
+ $role_list = $self->role_list unless $role_list;
for my $rol_name (@$role_list) {
$self->call_procedure(procname => 'admin__add_user_to_role',
args => [$self->{username}, $rol_name]);
Modified: trunk/LedgerSMB/Scripts/employee.pm
===================================================================
--- trunk/LedgerSMB/Scripts/employee.pm 2013-10-28 10:43:40 UTC (rev 6194)
+++ trunk/LedgerSMB/Scripts/employee.pm 2013-10-29 03:17:22 UTC (rev 6195)
@@ -86,7 +86,7 @@
my ($request, $employee) = @_;
my $user;
my @entity_files;
- if ($employee->{entity_id}){
+ if (eval { $employee->can('entity_id')} ){
$user = LedgerSMB::Entity::User->get($employee->{entity_id});
@entity_files = LedgerSMB::File->list(
{ref_key => $employee->{entity_id}, file_class => '4'}
@@ -125,6 +125,7 @@
# DIVS contents
my $entity_id = $employee->{entity_id};
+ $entity_id ||= $request->{entity_id};
my $entity_class = 3;
@@ -483,10 +484,12 @@
my ($request) = @_;
if ($request->close_form){
my $user = LedgerSMB::Entity::User->get($request->{entity_id});
- my $roles;
+ my $roles = [];
+ $request->{_role_prefix} = "lsmb_$request->{company}__"
+ unless defined $request->{_role_prefix};
for my $key(keys %$request){
- if ($key =~ $request->{_role_prefix} and $request->{key}){
- push @$roles, $request->{key};
+ if ($key =~ /$request->{_role_prefix}/ and $request->{$key}){
+ push @$roles, $key;
}
}
$user->role_list($roles);
Modified: trunk/UI/Contact/divs/user.html
===================================================================
--- trunk/UI/Contact/divs/user.html 2013-10-28 10:43:40 UTC (rev 6194)
+++ trunk/UI/Contact/divs/user.html 2013-10-29 03:17:22 UTC (rev 6195)
@@ -105,7 +105,14 @@
type="hidden"
name="user_id"
value= user.id
- } ?>
+ };
+ PROCESS input element_data = {
+ type = 'hidden'
+ name = 'form_id'
+ value = form_id
+ };
+ ?>
+ <input type="hidden" name="entity_id" value="<?lsmb entity_id ?>"/>
<table>
<!-- Groups section -->
<tr>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits