diff options
Diffstat (limited to 'zarb-ml/mageia-sysadm/2010-November/000918.html')
-rw-r--r-- | zarb-ml/mageia-sysadm/2010-November/000918.html | 156 |
1 files changed, 156 insertions, 0 deletions
diff --git a/zarb-ml/mageia-sysadm/2010-November/000918.html b/zarb-ml/mageia-sysadm/2010-November/000918.html new file mode 100644 index 000000000..e39a4511a --- /dev/null +++ b/zarb-ml/mageia-sysadm/2010-November/000918.html @@ -0,0 +1,156 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> +<HTML> + <HEAD> + <TITLE> [Mageia-sysadm] [140] Merge 138 from trunk, allow configurable login attribute + </TITLE> + <LINK REL="Index" HREF="index.html" > + <LINK REL="made" HREF="mailto:mageia-sysadm%40mageia.org?Subject=Re%3A%20%5BMageia-sysadm%5D%20%5B140%5D%20Merge%20138%20from%20trunk%2C%0A%09allow%20configurable%20login%20attribute&In-Reply-To=%3C20101125113717.8FDA33FD60%40valstar.mageia.org%3E"> + <META NAME="robots" CONTENT="index,nofollow"> + <META http-equiv="Content-Type" content="text/html; charset=us-ascii"> + <LINK REL="Previous" HREF="000917.html"> + <LINK REL="Next" HREF="000919.html"> + </HEAD> + <BODY BGCOLOR="#ffffff"> + <H1>[Mageia-sysadm] [140] Merge 138 from trunk, allow configurable login attribute</H1> + <B>root at mageia.org</B> + <A HREF="mailto:mageia-sysadm%40mageia.org?Subject=Re%3A%20%5BMageia-sysadm%5D%20%5B140%5D%20Merge%20138%20from%20trunk%2C%0A%09allow%20configurable%20login%20attribute&In-Reply-To=%3C20101125113717.8FDA33FD60%40valstar.mageia.org%3E" + TITLE="[Mageia-sysadm] [140] Merge 138 from trunk, allow configurable login attribute">root at mageia.org + </A><BR> + <I>Thu Nov 25 12:37:17 CET 2010</I> + <P><UL> + <LI>Previous message: <A HREF="000917.html">[Mageia-sysadm] [139] Dont hardcode filters, but use user's store configuration +</A></li> + <LI>Next message: <A HREF="000919.html">[Mageia-sysadm] [141] create rejected directory if needed +</A></li> + <LI> <B>Messages sorted by:</B> + <a href="date.html#918">[ date ]</a> + <a href="thread.html#918">[ thread ]</a> + <a href="subject.html#918">[ subject ]</a> + <a href="author.html#918">[ author ]</a> + </LI> + </UL> + <HR> +<!--beginarticle--> +<PRE>Revision: 140 +Author: buchan +Date: 2010-11-25 12:37:17 +0100 (Thu, 25 Nov 2010) +Log Message: +----------- +Merge 138 from trunk, allow configurable login attribute + +Modified Paths: +-------------- + identity/CatDap/branches/live/lib/CatDap/Controller/user.pm + +Modified: identity/CatDap/branches/live/lib/CatDap/Controller/user.pm +=================================================================== +--- identity/CatDap/branches/live/lib/CatDap/Controller/user.pm 2010-11-25 11:34:51 UTC (rev 139) ++++ identity/CatDap/branches/live/lib/CatDap/Controller/user.pm 2010-11-25 11:37:17 UTC (rev 140) +@@ -122,6 +122,7 @@ + my $password; + my $mesg; + my $dn; ++ my $userfilter; + + if (not defined $c->user ) { + $c->stash(template => 'index.tt'); +@@ -136,8 +137,10 @@ + + my $user = $c->user->username; + my $entry; +- $c->log->debug("Searching for user $user"); +- $mesg = $c->model('User')->search("(&(objectclass=inetOrgPerson)(uid=$user))"); ++ $userfilter = $c->user->store->user_filter; ++ $userfilter =~ s/\%s/$user/g, ++ $c->log->debug("Searching for user $user with filter $userfilter"); ++ $mesg = $c->model('User')->search($userfilter); + $entry = $mesg->entry; + my %mods; + my %params = %{$c->req->parameters}; +@@ -161,7 +164,7 @@ + } + } + +- $mesg = $c->model('User')->search("(&(objectclass=inetOrgPerson)(uid=$user))"); ++ $mesg = $c->model('User')->search($userfilter); + $c->log->debug($mesg->error) if $mesg->code; + $entry = $mesg->entry; + $c->log->debug($mesg->error) if $mesg->code; +@@ -218,12 +221,14 @@ + + sub add : Local { + my ( $self, $c) = @_; +- my ($mesg,$entry,$user,$attr,$value); ++ my ($mesg,$entry,$user,$attr,$value,$userfilter); + $attr = $c->req->param('attribute'); + $value = $c->req->param('value'); + $user = $c->user->username; +- $c->log->debug("Searching for user $user"); +- $mesg = $c->model('User')->search("(&(objectclass=inetOrgPerson)(uid=$user))"); ++ $userfilter = $c->user->store->user_filter; ++ $userfilter = s/%s/$c->user->username/g; ++ $c->log->debug("Searching for user $user with $userfilter"); ++ $mesg = $c->model('User')->search($userfilter); + $entry = $mesg->entry; + $entry->add( $attr => $value); + $c->log->info("Adding $attr = $value to user $user"); +@@ -235,10 +240,12 @@ + + sub delete : Local : Args(2) { + my ( $self, $c, $attrname,$attrvalue) = @_; +- my ($mesg,$entry,$user); ++ my ($mesg,$entry,$user,$userfilter); + $user = $c->user->username; ++ $userfilter = $c->user->store->user_filter; ++ $userfilter =~ s/%s/$c->user->username/g; + $c->log->debug("Searching for user $user"); +- $mesg = $c->model('User')->search("(&(objectclass=inetOrgPerson)(uid=$user))"); ++ $mesg = $c->model('User')->search($userfilter); + $entry = $mesg->entry; + $c->log->info("Deleting $attrname = $attrvalue from user $user"); + $entry->delete($attrname => $attrvalue); +-------------- next part -------------- +An HTML attachment was scrubbed... +URL: </pipermail/mageia-sysadm/attachments/20101125/d309ad36/attachment.html> +</PRE> + + + + + + + + + + + + + + + + + + + + + +<!--endarticle--> + <HR> + <P><UL> + <!--threads--> + <LI>Previous message: <A HREF="000917.html">[Mageia-sysadm] [139] Dont hardcode filters, but use user's store configuration +</A></li> + <LI>Next message: <A HREF="000919.html">[Mageia-sysadm] [141] create rejected directory if needed +</A></li> + <LI> <B>Messages sorted by:</B> + <a href="date.html#918">[ date ]</a> + <a href="thread.html#918">[ thread ]</a> + <a href="subject.html#918">[ subject ]</a> + <a href="author.html#918">[ author ]</a> + </LI> + </UL> + +<hr> +<a href="https://www.mageia.org/mailman/listinfo/mageia-sysadm">More information about the Mageia-sysadm +mailing list</a><br> +</body></html> |