Commit 78506944 authored by Yadd's avatar Yadd
Browse files

Boolean type

"New virtual host" is ready
parent c759234a
...@@ -219,6 +219,11 @@ input ...@@ -219,6 +219,11 @@ input
background: url(expandable-last.gif) 0 -2px no-repeat; background: url(expandable-last.gif) 0 -2px no-repeat;
} }
.simpleTree .folder-hidden,.folder-hidden-last
{
display:none;
}
.simpleTree .doc .simpleTree .doc
{ {
margin-left:-16px; margin-left:-16px;
......
...@@ -88,6 +88,11 @@ function btext(id) { ...@@ -88,6 +88,11 @@ function btext(id) {
display('btext','Clef'); display('btext','Clef');
$('#newkb,#delkb').css('display',''); $('#newkb,#delkb').css('display','');
} }
function bool(id) {
currentId=id;
if(lmdata(id)==1){$('#On').attr('checked',true)}else{$('#Off').attr('checked',true)}
display('bool',lmtext(id));
}
function int(id) { function int(id) {
currentId=id; currentId=id;
$('#int').attr('value',lmdata(id)); $('#int').attr('value',lmdata(id));
......
...@@ -50,7 +50,7 @@ var scriptname='<TMPL_VAR NAME="SCRIPT_NAME">';var imagepath='<TMPL_VAR NAME="DI ...@@ -50,7 +50,7 @@ var scriptname='<TMPL_VAR NAME="SCRIPT_NAME">';var imagepath='<TMPL_VAR NAME="DI
<lang en="Apply" fr="Appliquer" /> <lang en="Apply" fr="Appliquer" />
</button> </button>
<button id="bnewvh" onclick="newVh('test25.example.com');return false;" class="ui-state-default ui-corner-all"> <button id="bnewvh" style="display:none;" onclick="newVh('test25.example.com');return false;" class="ui-state-default ui-corner-all">
<lang en="New virtual host" fr="Nouvel hôte virtuel" /> <lang en="New virtual host" fr="Nouvel hôte virtuel" />
</button> </button>
...@@ -109,6 +109,11 @@ var scriptname='<TMPL_VAR NAME="SCRIPT_NAME">';var imagepath='<TMPL_VAR NAME="DI ...@@ -109,6 +109,11 @@ var scriptname='<TMPL_VAR NAME="SCRIPT_NAME">';var imagepath='<TMPL_VAR NAME="DI
<input type="text" id="int" onchange="setlmdata(currentId,this.value)"/> <input type="text" id="int" onchange="setlmdata(currentId,this.value)"/>
</div> </div>
<div id="content_bool" class="hidden">
<input id="On" type="radio" name="boolean" value="1" onclick="setlmdata(currentId,1)"/> <lang en="On" fr="Activé"/>
<input id="Off" type="radio" name="boolean" value="0" onclick="setlmdata(currentId,0)"/> <lang en="Off" fr="Désactivé"/>
</div>
<div id="content_btext" class="hidden"> <div id="content_btext" class="hidden">
<input type="text" id="btextKey" onchange="setlmtext(currentId,this.value)"/> <input type="text" id="btextValue" onchange="setlmdata(currentId,this.value)"/> <input type="text" id="btextKey" onchange="setlmtext(currentId,this.value)"/> <input type="text" id="btextValue" onchange="setlmdata(currentId,this.value)"/>
</div> </div>
......
...@@ -112,9 +112,13 @@ $.fn.simpleTree = function(opt){ ...@@ -112,9 +112,13 @@ $.fn.simpleTree = function(opt){
{ {
url=$.trim(url.replace(/.*\{url:(.*)\}/i ,'$1')); url=$.trim(url.replace(/.*\{url:(.*)\}/i ,'$1'));
var js=''; var js='';
var call='';
if(url.indexOf(',js:')){ if(url.indexOf(',js:')){
js=$.trim(url.replace(/.*,js:(.*)/i ,'$1')); call=url.match(/.*,call:(.*)/i);
url=$.trim(url.replace(/,js:.*/i ,'')); if(call==null){call='';}else{call=call[1].replace(/,call.*$/,'');}
js=url.match(/.*,js:(.*)/i);
if(js==null){js='';}else{js=js[1].replace(/,call.*$/,'');}
url=$.trim(url.replace(/,(?:js|call):.*/i ,''));
} }
$.ajax({ $.ajax({
type: "GET", type: "GET",
...@@ -135,7 +139,8 @@ $.fn.simpleTree = function(opt){ ...@@ -135,7 +139,8 @@ $.fn.simpleTree = function(opt){
{ {
callback(node); callback(node);
} }
if(js.length)$('>span',node.parent()).click(function(){eval(js+'()')}); if(js.length){if(!js.match(/\(/))js+='()';$('>span',node.parent()).click(function(){eval(js)});}
if(call.length){if(!call.match(/\(/))call+='()';eval(call);}
}, },
error: function(xhr, ajaxOptions, thrownError){ error: function(xhr, ajaxOptions, thrownError){
TREE.closeNearby(node); TREE.closeNearby(node);
...@@ -212,7 +217,9 @@ $.fn.simpleTree = function(opt){ ...@@ -212,7 +217,9 @@ $.fn.simpleTree = function(opt){
var childNode = $('>ul',this); var childNode = $('>ul',this);
if(childNode.size()>0){ if(childNode.size()>0){
var setClassName = 'folder-'; var setClassName = 'folder-';
if(className && className.indexOf('open')>=0){ if(className && className.indexOf('hidden')>=0){
setClassName=setClassName+'hidden';
}else if(className && className.indexOf('open')>=0){
setClassName=setClassName+'open'; setClassName=setClassName+'open';
open=true; open=true;
}else{ }else{
......
...@@ -47,7 +47,10 @@ sub node { ...@@ -47,7 +47,10 @@ sub node {
"$target", "$target",
"node=$node/$target", "node=$node/$target",
$tmp->{$target}->{_help} || $help, $tmp->{$target}->{_help} || $help,
$tmp->{$target}->{_js} $tmp->{$target}->{_js},
'',
0,
$tmp->{$target}->{_call}
); );
next; next;
} }
...@@ -64,9 +67,10 @@ sub node { ...@@ -64,9 +67,10 @@ sub node {
"$node/$target", $target, '', "$node/$target", $target, '',
$tmp->{$target}->{_js}, $tmp->{$target}->{_js},
$tmp->{$target}->{_help} || $help $tmp->{$target}->{_help} || $help
) . "<ul>"; )
$res .= $self->node("$node/$target"); . "<ul>"
$res .= "</ul></li>"; . $self->node("$node/$target")
. "</ul></li>";
} }
# subnode points to a configuration node # subnode points to a configuration node
...@@ -332,7 +336,7 @@ sub confObj { ...@@ -332,7 +336,7 @@ sub confObj {
# @param $noT Optional flag to block translation # @param $noT Optional flag to block translation
# @return HTML string # @return HTML string
sub ajaxNode { sub ajaxNode {
my ( $self, $id, $text, $param, $help, $js, $data, $noT ) = @_; my ( $self, $id, $text, $param, $help, $js, $data, $noT, $call ) = @_;
$param .= "&amp;cfgNum=$self->{cfgNum}"; $param .= "&amp;cfgNum=$self->{cfgNum}";
return return
$self->li($id) $self->li($id)
...@@ -341,6 +345,7 @@ sub ajaxNode { ...@@ -341,6 +345,7 @@ sub ajaxNode {
. $self->li("sub_$id") . $self->li("sub_$id")
. ".{url:$ENV{SCRIPT_NAME}?$param" . ".{url:$ENV{SCRIPT_NAME}?$param"
. ( $js ? ",js:$js" : '' ) . ( $js ? ",js:$js" : '' )
. ( $call ? ",call:$call" : '' )
. "}</li></ul></li>\n"; . "}</li></ul></li>\n";
} }
......
...@@ -25,8 +25,11 @@ sub import { ...@@ -25,8 +25,11 @@ sub import {
} }
} }
$l ||= "en"; $l ||= "en";
foreach $h (qw(authParams cookieName domain groups ldap macros storage timeout vars foreach $h (
whatToTrace virtualHosts)) { qw(authParams cookieName domain groups ldap macros storage timeout vars
whatToTrace virtualHosts)
)
{
*{"${caller_package}::help_$h"} = \&{"help_${h}_$l"}; *{"${caller_package}::help_$h"} = \&{"help_${h}_$l"};
} }
} }
......
...@@ -36,14 +36,15 @@ sub new { ...@@ -36,14 +36,15 @@ sub new {
# Try to get configuration values from local configuration # Try to get configuration values from local configuration
my $config = Lemonldap::NG::Common::Conf->new( $self->{configStorage} ); my $config = Lemonldap::NG::Common::Conf->new( $self->{configStorage} );
unless ( $config ) { unless ($config) {
$self->abort( "Unable to start", $self->abort( "Unable to start",
"Configuration not loaded\n" . $Lemonldap::NG::Common::Conf::msg ); "Configuration not loaded\n" . $Lemonldap::NG::Common::Conf::msg );
} }
my $localconf = $config->getLocalConf( MANAGERSECTION ); my $localconf = $config->getLocalConf(MANAGERSECTION);
if ( $localconf ) { if ($localconf) {
$self->{$_} = $args->{$_} || $localconf->{$_} foreach ( keys %$localconf ); $self->{$_} = $args->{$_} || $localconf->{$_}
foreach ( keys %$localconf );
} }
# Check some paramaters # Check some paramaters
......
...@@ -113,7 +113,7 @@ sub confUpload { ...@@ -113,7 +113,7 @@ sub confUpload {
foreach ( @{ $result->getChildrenByTagName('ignore') } ) { foreach ( @{ $result->getChildrenByTagName('ignore') } ) {
my $node = $_->getAttribute('value'); my $node = $_->getAttribute('value');
$node =~ s/^.*node=(.*?)(?:&.*)?\}$/$1/; $node =~ s/^.*node=(.*?)(?:&.*)?\}$/$1/;
foreach my $k ( $self->findAllConfKeys( $self->corresp( $node ) ) ) { foreach my $k ( $self->findAllConfKeys( $self->corresp($node) ) ) {
my $v = $self->keyToH( $k, $self->conf ); my $v = $self->keyToH( $k, $self->conf );
$v = $self->keyToH( $k, $self->defaultConf ) unless ( defined $v ); $v = $self->keyToH( $k, $self->defaultConf ) unless ( defined $v );
if ( defined $v ) { if ( defined $v ) {
...@@ -238,6 +238,7 @@ sub findAllConfKeys { ...@@ -238,6 +238,7 @@ sub findAllConfKeys {
# @param $k2 Optional subkey # @param $k2 Optional subkey
sub setKeyToH { sub setKeyToH {
my $value = pop; my $value = pop;
return unless ( ref($value) or length($value) );
my ( $self, $h, $key, $k2 ) = @_; my ( $self, $h, $key, $k2 ) = @_;
my $tmp = $h; my $tmp = $h;
$key =~ s/^\///; $key =~ s/^\///;
......
...@@ -98,13 +98,13 @@ sub struct { ...@@ -98,13 +98,13 @@ sub struct {
managerDn => 'text:/managerDn', managerDn => 'text:/managerDn',
managerPassword => 'text:/managerPassword', managerPassword => 'text:/managerPassword',
}, },
SSLRequired => 'int:/SSLRequired', SSLRequired => 'bool:/SSLRequired',
}, },
# LOGS PARAMETERS # LOGS PARAMETERS
logParams => { logParams => {
_nodes => [qw(useXForwardedForIP whatToTrace)], _nodes => [qw(useXForwardedForIP whatToTrace)],
useXForwardedForIP => 'int:/useXForwardedForIP', useXForwardedForIP => 'bool:/useXForwardedForIP',
whatToTrace => 'text:/whatToTrace:whatToTrace:text', whatToTrace => 'text:/whatToTrace:whatToTrace:text',
}, },
...@@ -144,10 +144,10 @@ sub struct { ...@@ -144,10 +144,10 @@ sub struct {
_js => 'hashRoot' _js => 'hashRoot'
}, },
}, },
singleSession => 'int:/singleSession', singleSession => 'bool:/singleSession',
singleIP => 'int:/singleIP', singleIP => 'bool:/singleIP',
singleUserByIP => 'int:/singleUserByIP', singleUserByIP => 'bool:/singleUserByIP',
storePassword => 'int:/storePassword', storePassword => 'bool:/storePassword',
timeout => 'text:/timeout:timeout:text', timeout => 'text:/timeout:timeout:text',
}, },
...@@ -156,15 +156,15 @@ sub struct { ...@@ -156,15 +156,15 @@ sub struct {
_nodes => [ _nodes => [
qw(Soap exportedAttr trustedDomains https notifications passwordManagement userControl) qw(Soap exportedAttr trustedDomains https notifications passwordManagement userControl)
], ],
Soap => 'int:/Soap', Soap => 'bool:/Soap',
https => 'int:/https', https => 'bool:/https',
exportedAttr => 'text:/exportedAttr', exportedAttr => 'text:/exportedAttr',
notifications => { notifications => {
_nodes => [ _nodes => [
qw(notification notificationStorage notificationStorageOptions) qw(notification notificationStorage notificationStorageOptions)
], ],
_help => 'notifications', _help => 'notifications',
notification => 'int:/notification', notification => 'bool:/notification',
notificationStorage => 'text:/notificationStorage', notificationStorage => 'text:/notificationStorage',
notificationStorageOptions => { notificationStorageOptions => {
_nodes => ['hash:/notificationStorageOptions'], _nodes => ['hash:/notificationStorageOptions'],
...@@ -203,6 +203,7 @@ sub struct { ...@@ -203,6 +203,7 @@ sub struct {
_nodes => ['nhash:/locationRules:virtualHosts:none'], _nodes => ['nhash:/locationRules:virtualHosts:none'],
_upload => ['/exportedHeaders'], _upload => ['/exportedHeaders'],
_help => 'default', _help => 'default',
_call => '$(\'#bnewvh\').show();',
}, },
}; };
} }
......
...@@ -72,11 +72,13 @@ sub en { ...@@ -72,11 +72,13 @@ sub en {
ldapServer => 'LDAP Server', ldapServer => 'LDAP Server',
logParams => 'Logs parameters', logParams => 'Logs parameters',
macros => 'Macros', macros => 'Macros',
mailBody => 'Message content', mailBody => 'Mail content',
mailFrom => 'Mail sender', mailFrom => 'Mail sender',
mailSubject => 'Mail subject',
managerDn => 'LDAP Account', managerDn => 'LDAP Account',
managerPassword => 'LDAP Password', managerPassword => 'LDAP Password',
notification => 'Active notifications', notification => 'Active notifications',
notifications => 'Notifications',
notificationStorage => 'Notifications storage type', notificationStorage => 'Notifications storage type',
notificationStorageOptions => 'Storage module parameters', notificationStorageOptions => 'Storage module parameters',
passwordDB => 'Passaword database type', passwordDB => 'Passaword database type',
...@@ -101,6 +103,7 @@ sub en { ...@@ -101,6 +103,7 @@ sub en {
uploadDenied => 'Upload denied', uploadDenied => 'Upload denied',
userDB => 'Users database type', userDB => 'Users database type',
userControl => 'Username control', userControl => 'Username control',
useXForwardedForIP => "Use X-Forwarded-For header address",
virtualHosts => 'Virtual Hosts', virtualHosts => 'Virtual Hosts',
whatToTrace => "Attribute to use in Apache's logs", whatToTrace => "Attribute to use in Apache's logs",
}; };
...@@ -135,15 +138,18 @@ sub fr { ...@@ -135,15 +138,18 @@ sub fr {
macros => 'Macros', macros => 'Macros',
mailBody => 'Contenu du message', mailBody => 'Contenu du message',
mailFrom => 'Expéditeur du message', mailFrom => 'Expéditeur du message',
mailSubject => 'Sujet du message',
managerDn => 'Compte de connexion LDAP', managerDn => 'Compte de connexion LDAP',
managerPassword => 'Mot de passe LDAP', managerPassword => 'Mot de passe LDAP',
notification => 'Active les notifications', notification => 'Active les notifications',
notifications => 'Notifications',
notificationStorage => 'Type de stockage des notifications', notificationStorage => 'Type de stockage des notifications',
notificationStorageOptions => 'Paramètres du module de stockage', notificationStorageOptions => 'Paramètres du module de stockage',
passwordDB => 'Type de base de données des mots-de-passe', passwordDB => 'Type de base de données des mots-de-passe',
passwordManagement => 'Gestion des mots-de-passe', passwordManagement => 'Gestion des mots-de-passe',
portal => 'Portail', portal => 'Portail',
randomPasswordRegexp => 'Expression regulière pour la génération des mots-de-passe', randomPasswordRegexp =>
'Expression regulière pour la génération des mots-de-passe',
rules => 'Règles', rules => 'Règles',
securedCookie => 'Cookie sécurisé (SSL)', securedCookie => 'Cookie sécurisé (SSL)',
sessionParams => 'Paramètres des Sessions Parameters', sessionParams => 'Paramètres des Sessions Parameters',
...@@ -153,7 +159,8 @@ sub fr { ...@@ -153,7 +159,8 @@ sub fr {
singleUserByIP => 'Une seule adresse IP par utilisateur', singleUserByIP => 'Une seule adresse IP par utilisateur',
SMTPServer => 'Serveur SMTP', SMTPServer => 'Serveur SMTP',
Soap => 'Active les fonctions SOAP du portail', Soap => 'Active les fonctions SOAP du portail',
storePassword => "Stocke le mot-de-passe de l'utilisateur dans les données de session", storePassword =>
"Stocke le mot-de-passe de l'utilisateur dans les données de session",
syntaxError => 'Erreur de syntaxe', syntaxError => 'Erreur de syntaxe',
syslog => 'Facilité syslog', syslog => 'Facilité syslog',
timeout => 'Durée de vie des sessions', timeout => 'Durée de vie des sessions',
...@@ -162,6 +169,8 @@ sub fr { ...@@ -162,6 +169,8 @@ sub fr {
uploadDenied => 'Téléchargement refusé', uploadDenied => 'Téléchargement refusé',
userDB => "Type de base de données d'utilisateurs", userDB => "Type de base de données d'utilisateurs",
userControl => "Contrôle du nom d'utilisateur", userControl => "Contrôle du nom d'utilisateur",
useXForwardedForIP =>
"Utiliser l'adresse IP de l'en-tête X-Forwarded-For",
virtualHosts => 'Hôtes virtuels', virtualHosts => 'Hôtes virtuels',
whatToTrace => "Donnée à inscrire dans les journaux d'Apache", whatToTrace => "Donnée à inscrire dans les journaux d'Apache",
}; };
......
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