Commit df828353 authored by Xavier Guimard's avatar Xavier Guimard

- make tidy

- OpenID log levels
- DIFFPREFIX in Makefile (for vservers,...)


git-svn-id: svn://svn.forge.objectweb.org/svnroot/lemonldap/trunk@1652 1dbb9719-a921-0410-b57f-c3a383c2c641
parent a2391a59
......@@ -98,6 +98,8 @@ SRCMANAGERDIR=lemonldap-ng-manager
EXAMPLELANG=en # For static Manager example only
ERASECONFIG=1 # Set to 0 if you do not want to replace your configuration
DIFFPREFIX=
# Liberty Alliance support
WITHLA=0 # Set to 1 if you want to install Liberty Alliance portal (deprecated by SAML2 support)
LASPPORTALDIR=$(DOCUMENTROOT)/liberty-alliance-sp-portal
......@@ -560,30 +562,30 @@ diff: debian-diff
debian-diff:
@# Portal
@$(DIFF) lemonldap-ng-portal/lib/Lemonldap/NG/Portal /usr/share/perl5/Lemonldap/NG/Portal ||true
@$(DIFF) lemonldap-ng-portal/example/scripts/purgeCentralCache /usr/share/lemonldap-ng/bin/purgeCentralCache ||true
@$(DIFF) lemonldap-ng-portal/example/scripts/buildPortalWSDL /usr/share/lemonldap-ng/bin/buildPortalWSDL ||true
@$(DIFF) lemonldap-ng-portal/lib/Lemonldap/NG/Portal $(DIFFPREFIX)/usr/share/perl5/Lemonldap/NG/Portal ||true
@$(DIFF) lemonldap-ng-portal/example/scripts/purgeCentralCache $(DIFFPREFIX)/usr/share/lemonldap-ng/bin/purgeCentralCache ||true
@$(DIFF) lemonldap-ng-portal/example/scripts/buildPortalWSDL $(DIFFPREFIX)/usr/share/lemonldap-ng/bin/buildPortalWSDL ||true
@for i in $(PORTALSKINS); do \
$(DIFF) -x 'jquery*' lemonldap-ng-portal/example/skins/$$i /usr/share/lemonldap-ng/portal-skins/$$i; \
$(DIFF) -x 'jquery*' lemonldap-ng-portal/example/skins/$$i $(DIFFPREFIX)/usr/share/lemonldap-ng/portal-skins/$$i; \
done ||true
@$(DIFF) lemonldap-ng-portal/example/index_skin.pl /var/lib/lemonldap-ng/portal/index.pl ||true
@$(DIFF) lemonldap-ng-portal/example/mail.pl /var/lib/lemonldap-ng/portal/mail.pl ||true
@$(DIFF) lemonldap-ng-portal/example/metadata.pl /var/lib/lemonldap-ng/portal/metadata.pl ||true
@$(DIFF) lemonldap-ng-portal/example/cdc.pl /var/lib/lemonldap-ng/portal/cdc.pl ||true
@$(DIFF) lemonldap-ng-portal/example/index_skin.pl $(DIFFPREFIX)/var/lib/lemonldap-ng/portal/index.pl ||true
@$(DIFF) lemonldap-ng-portal/example/mail.pl $(DIFFPREFIX)/var/lib/lemonldap-ng/portal/mail.pl ||true
@$(DIFF) lemonldap-ng-portal/example/metadata.pl $(DIFFPREFIX)/var/lib/lemonldap-ng/portal/metadata.pl ||true
@$(DIFF) lemonldap-ng-portal/example/cdc.pl $(DIFFPREFIX)/var/lib/lemonldap-ng/portal/cdc.pl ||true
@# Handler
@$(DIFF) lemonldap-ng-handler/lib/Lemonldap/NG/Handler /usr/share/perl5/Lemonldap/NG/Handler ||true
@$(DIFF) lemonldap-ng-handler/lib/Lemonldap/NG/Handler $(DIFFPREFIX)/usr/share/perl5/Lemonldap/NG/Handler ||true
@# Common
@$(DIFF) lemonldap-ng-common/lib/Lemonldap/NG/Common /usr/share/perl5/Lemonldap/NG/Common ||true
@$(DIFF) lemonldap-ng-common/lib/Lemonldap/NG/Common.pm /usr/share/perl5/Lemonldap/NG/Common.pm ||true
@$(DIFF) lemonldap-ng-common/scripts/lmMigrateConfFiles2ini /usr/share/lemonldap-ng/bin/lmMigrateConfFiles2ini ||true
@$(DIFF) lemonldap-ng-common/scripts/convertConfig /usr/share/lemonldap-ng/bin/convertConfig ||true
@$(DIFF) lemonldap-ng-common/lib/Lemonldap/NG/Common $(DIFFPREFIX)/usr/share/perl5/Lemonldap/NG/Common ||true
@$(DIFF) lemonldap-ng-common/lib/Lemonldap/NG/Common.pm $(DIFFPREFIX)/usr/share/perl5/Lemonldap/NG/Common.pm ||true
@$(DIFF) lemonldap-ng-common/scripts/lmMigrateConfFiles2ini $(DIFFPREFIX)/usr/share/lemonldap-ng/bin/lmMigrateConfFiles2ini ||true
@$(DIFF) lemonldap-ng-common/scripts/convertConfig $(DIFFPREFIX)/usr/share/lemonldap-ng/bin/convertConfig ||true
@# Manager
@$(DIFF) lemonldap-ng-manager/lib/Lemonldap/NG/Manager /usr/share/perl5/Lemonldap/NG/Manager ||true
@$(DIFF) lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm /usr/share/perl5/Lemonldap/NG/Manager.pm ||true
@$(DIFF) lemonldap-ng-manager/example/index.pl /var/lib/lemonldap-ng/manager/index.pl ||true
@$(DIFF) lemonldap-ng-manager/example/sessions.pl /var/lib/lemonldap-ng/manager/sessions.pl ||true
@$(DIFF) lemonldap-ng-manager/lib/Lemonldap/NG/Manager $(DIFFPREFIX)/usr/share/perl5/Lemonldap/NG/Manager ||true
@$(DIFF) lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm $(DIFFPREFIX)/usr/share/perl5/Lemonldap/NG/Manager.pm ||true
@$(DIFF) lemonldap-ng-manager/example/index.pl $(DIFFPREFIX)/var/lib/lemonldap-ng/manager/index.pl ||true
@$(DIFF) lemonldap-ng-manager/example/sessions.pl $(DIFFPREFIX)/var/lib/lemonldap-ng/manager/sessions.pl ||true
@for i in $(MANAGERSKINS); do \
$(DIFF) -x 'jquery*' lemonldap-ng-manager/example/skins/$$i /usr/share/lemonldap-ng/manager-skins/$$i; \
$(DIFF) -x 'jquery*' lemonldap-ng-manager/example/skins/$$i $(DIFFPREFIX)/usr/share/lemonldap-ng/manager-skins/$$i; \
done ||true
default-diff:
......
......@@ -74,7 +74,7 @@ sub confUpload {
my $appflag = 0;
# For POST URL keys
my $postflag = 0;
my $postflag = 0;
my $postdataflag = 0;
# Unescape value
......@@ -131,10 +131,10 @@ sub confUpload {
$postdataflag = 1;
}
else {
$self->lmLog( "Entering POST URL $name", 'debug' );
$self->lmLog( "Entering POST URL $name", 'debug' );
$postflag = 1;
$postname = $name;
}
$postname = $name;
}
}
# Manage new keys
......@@ -716,11 +716,11 @@ sub setKeyToH {
}
}
else {
$self->lmLog(
"setKeyToH: set $value in key $k2 inside key $key",
'debug' );
$tmp->{$key}->{$k2} = $value;
}
$self->lmLog(
"setKeyToH: set $value in key $k2 inside key $key",
'debug' );
$tmp->{$key}->{$k2} = $value;
}
}
else {
$self->lmLog( "setKeyToH: set $value in key $key", 'debug' );
......
......@@ -59,13 +59,13 @@ sub extractFormInfo {
# Remote error
unless ( $csr->is_server_response() ) {
$self->{msg} = 'No OpenID valid message found' . $csr->err();
$self->lmLog( $self->{msg}, 'debug' );
$self->lmLog( $self->{msg}, 'info' );
return PE_BADCREDENTIALS;
}
# If confirmation is needed
if ( my $setup_url = $csr->user_setup_url ) {
$self->lmLog( 'OpenID confirmation needed', 'debug' );
$self->lmLog( 'OpenID confirmation needed', 'info' );
print $self->redirect($setup_url);
$self->quit();
}
......@@ -73,7 +73,7 @@ sub extractFormInfo {
# Check if user has refused to share his authentication
elsif ( $csr->user_cancel() ) {
$self->{msg} = "OpenID request cancelled by user";
$self->lmLog( $self->{msg}, 'debug' );
$self->lmLog( $self->{msg}, 'info' );
return PE_FIRSTACCESS;
}
......@@ -89,7 +89,7 @@ sub extractFormInfo {
# Other errors
else {
$self->{msg} = 'OpenID error: ' . $csr->err;
$self->lmLog( $self->{msg}, 'debug' );
$self->lmLog( $self->{msg}, 'warn' );
return PE_ERROR;
}
}
......@@ -101,7 +101,7 @@ sub extractFormInfo {
# Check if url is valid
unless ($claimed_identity) {
$self->{msg} = "OpenID error : " . $self->{csr}->err();
$self->lmLog( $self->{msg}, 'debug' );
$self->lmLog( $self->{msg}, 'warn' );
return PE_BADCREDENTIALS;
}
......
......@@ -6,14 +6,13 @@
package Lemonldap::NG::Portal::OpenID::Server;
use strict;
use fields qw(_extensions setup_url);
use base qw(Net::OpenID::Server);
use fields qw(_extensions);
use Net::OpenID::Server;
use Lemonldap::NG::Common::Regexp;
use constant DEBUG => 0;
use base qw(Net::OpenID::Server);
our $VERSION = '0.1';
my $OPENID2_NS = qq!http://specs.openid.net/auth/2.0!;
......@@ -91,7 +90,7 @@ sub _mode_checkid {
$extArgs{$tmp}->{$val} = scalar $self->args->($arg);
}
foreach my $ns ( keys %{ $self->{_extensions} } ) {
print STDERR "Launching OpenIP $ns hook\n" if(DEBUG);
print STDERR "Launching OpenIP $ns hook\n" if (DEBUG);
my $h;
( $is_ext_trusted{$ns}, $h ) = $self->{_extensions}->{$ns}->(
$u, $trust_root, $is_identity, $is_trusted,
......@@ -99,7 +98,7 @@ sub _mode_checkid {
);
if ($h) {
while ( my ( $k, $v ) = each %$h ) {
print STDERR "$ns returned data: $k => $v\n" if(DEBUG);
print STDERR "$ns returned data: $k => $v\n" if (DEBUG);
$extVars{"$ns.$k"} = $v;
}
}
......
......@@ -67,6 +67,7 @@ sub setSessionInfo {
'warn'
);
$self->{mustRedirect} = 0;
return PE_MISSINGREQATTR;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment