Skin rules in trunk (#578)
This commit is contained in:
parent
ae7ac2de48
commit
13446072d0
|
@ -2,7 +2,7 @@ package Lemonldap::NG::Common::Conf::Serializer;
|
|||
|
||||
use Data::Dumper;
|
||||
|
||||
our $VERSION = '1.1.0';
|
||||
our $VERSION = '1.2.3';
|
||||
|
||||
BEGIN {
|
||||
*Lemonldap::NG::Common::Conf::normalize = \&normalize;
|
||||
|
@ -116,6 +116,7 @@ sub unserialize {
|
|||
|macros
|
||||
|notificationStorageOptions
|
||||
|persistentStorageOptions
|
||||
|portalSkinRules
|
||||
|post
|
||||
|reloadUrls
|
||||
|remoteGlobalStorageOptions
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
var text4protect='<lang en="Protect" fr="Protéger" />';
|
||||
var text4newCategory='<lang en="Category identifier" fr="Identifiant de la catégorie" />';
|
||||
var text4newApplication='<lang en="Application identifier" fr="Identifiant de l\'application" />';
|
||||
var text4newCondition='<lang en="New Condition" fr="nouvelle Condition" />';
|
||||
var text4newCondition='<lang en="New Condition" fr="Nouvelle Condition" />';
|
||||
//]]></script>
|
||||
<script src="<TMPL_VAR NAME="DIR">/js/manager.js" type="text/JavaScript"></script>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
|
||||
|
|
|
@ -291,11 +291,16 @@ sub struct {
|
|||
|
||||
portalCustomization => {
|
||||
_nodes => [
|
||||
qw(portalSkin portalAutocomplete portalCheckLogins portalUserAttr portalOpenLinkInNewWindow portalAntiFrame passwordManagement)
|
||||
qw(portalSkin cn:portalSkinRules portalAutocomplete portalCheckLogins portalUserAttr portalOpenLinkInNewWindow portalAntiFrame passwordManagement)
|
||||
],
|
||||
_help => 'portalcustom',
|
||||
|
||||
portalSkin => 'text:/portalSkin:portalcustom:skinSelect',
|
||||
portalSkinRules => {
|
||||
_nodes => ['hash:/portalSkinRules:portalcustom:btext'],
|
||||
_js => 'hashRoot',
|
||||
_help => 'portalcustom',
|
||||
},
|
||||
portalAutocomplete => 'bool:/portalAutocomplete',
|
||||
portalCheckLogins => 'bool:/portalCheckLogins',
|
||||
portalUserAttr => 'text:/portalUserAttr',
|
||||
|
@ -715,9 +720,9 @@ sub struct {
|
|||
|
||||
# LOGS PARAMETERS
|
||||
logParams => {
|
||||
_nodes => [qw(syslog trustedProxies whatToTrace)],
|
||||
_help => 'logs',
|
||||
syslog => 'text:/syslog',
|
||||
_nodes => [qw(syslog trustedProxies whatToTrace)],
|
||||
_help => 'logs',
|
||||
syslog => 'text:/syslog',
|
||||
trustedProxies => 'text:/trustedProxies',
|
||||
whatToTrace => 'text:/whatToTrace',
|
||||
},
|
||||
|
@ -1553,6 +1558,12 @@ m{^(?:ldapi://[^/]*/?|\w[\w\-\.]*(?::\d{1,5})?|ldap(?:s|\+tls)?://\w[\w\-\.]*(?:
|
|||
test => qr/\w+$/,
|
||||
msgFail => 'Bad skin name',
|
||||
},
|
||||
portalSkinRules => {
|
||||
keyTest => $perlExpr,
|
||||
keyMsgFail => 'Bad skin rule',
|
||||
test => qr/\w+$/,
|
||||
msgFail => 'Bad skin name',
|
||||
},
|
||||
portalUserAttr => {
|
||||
test => qr/\w+$/,
|
||||
msgFail => 'Unvalid session field',
|
||||
|
@ -1604,7 +1615,7 @@ m{^(?:ldapi://[^/]*/?|\w[\w\-\.]*(?::\d{1,5})?|ldap(?:s|\+tls)?://\w[\w\-\.]*(?:
|
|||
msgFail => 'Bad number',
|
||||
},
|
||||
trustedProxies => $testNotDefined,
|
||||
userControl => {
|
||||
userControl => {
|
||||
test => $pcre,
|
||||
msgFail => 'Bad regular expression',
|
||||
},
|
||||
|
|
|
@ -274,7 +274,8 @@ sub en {
|
|||
portalParams => 'Portal',
|
||||
portalRedirection => 'Portal redirections',
|
||||
portalRequireOldPassword => 'Require old password',
|
||||
portalSkin => 'Skin',
|
||||
portalSkin => 'Default Skin',
|
||||
portalSkinRules => 'Skin display rules',
|
||||
portalUserAttr => 'User attribute',
|
||||
post => 'Form replay',
|
||||
proxyParams => 'Proxy parameters',
|
||||
|
@ -728,7 +729,8 @@ sub fr {
|
|||
portalParams => 'Portail',
|
||||
portalRedirection => 'Redirections du portail',
|
||||
portalRequireOldPassword => 'Ancien mot de passe requis',
|
||||
portalSkin => 'Thème visuel',
|
||||
portalSkin => 'Thème visuel par défaut',
|
||||
portalSkinRules => "Règles d'affichage du thème visuel",
|
||||
portalUserAttr => "Attribut de l'utilisateur",
|
||||
post => 'Rejeu de formulaires',
|
||||
proxyParams => 'Paramètres Proxy',
|
||||
|
|
|
@ -308,6 +308,20 @@ sub display {
|
|||
|
||||
}
|
||||
|
||||
# Fill sessionInfo to eval rule if empty (unauthenticated user)
|
||||
$self->{sessionInfo}->{_url} ||= $self->{urldc};
|
||||
$self->{sessionInfo}->{ipAddr} ||= $self->ipAddr;
|
||||
|
||||
# Load specific skin from skinRules
|
||||
if ( $self->{portalSkinRules} ) {
|
||||
foreach my $skinRule ( sort keys $self->{portalSkinRules} ) {
|
||||
if ( $self->safe->reval($skinRule) ) {
|
||||
$skin = $self->{portalSkinRules}->{$skinRule};
|
||||
$self->lmLog( "Skin $skin selected from skin rule", 'debug' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
## Common template params
|
||||
my $portalPath = $self->{portal};
|
||||
$portalPath =~ s#^https?://[^/]+/?#/#;
|
||||
|
|
Loading…
Reference in New Issue
Block a user