Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Xavier Bachelot
lemonldap-ng
Commits
19ae0803
Commit
19ae0803
authored
Dec 30, 2009
by
Yadd
Browse files
Conf datas (not finished)
parent
1c1ea8fe
Changes
4
Hide whitespace changes
Inline
Side-by-side
modules/lemonldap-ng-manager/example/skins/default/manager.js
View file @
19ae0803
...
...
@@ -113,6 +113,9 @@ function vhost(id){
display
(
'
none
'
,
lmtext
(
id
));
$
(
'
#bdelvh
'
).
show
();
}
function
cfgDatas
(
id
){
display
(
'
cfgDatas
'
);
}
function
delvh
(
id
){
if
(
confirm
(
"
Are you sure ?
"
)){
alert
(
id
);
$
(
'
#
'
+
id
).
remove
();}
}
...
...
@@ -222,6 +225,8 @@ function uploadConf(f){
tmp
=
tmp
.
replace
(
/
\d
+/
,
data
.
result
.
cfgNum
);
setlmtext
(
'
li_cm9vdA2
'
,
tmp
);
setlmdata
(
'
li_cm9vdA2
'
,
data
.
result
.
cfgNum
);
$
(
'
#cfgNum
'
).
text
(
data
.
result
.
cfgNum
);
setCfgAttributes
(
data
.
result
.
attributes
);
}
if
(
typeof
(
data
.
warnings
)
!=
'
undefined
'
){
for
(
m
in
data
.
warnings
){
...
...
@@ -236,6 +241,23 @@ function uploadConf(f){
}
});
}
var
cfgAttrDone
;
function
getCfgAttributes
()
{
$
.
ajax
({
type
:
"
POST
"
,
url
:
scriptname
,
data
:{
cfgNum
:
lmdata
(
'
li_cm9vdA2
'
),
attr
:
1
},
dataType
:
'
json
'
,
success
:
function
(
data
){
setCfgAttributes
(
data
);
},
error
:
function
(
xhr
,
ajaxOptions
,
thrownError
){
setCfgAttributes
({
cfgAuthor
:
'
unknown
'
,
cfgAuthorIP
:
'
unknown
'
,
cfgDate
:
'
unknown
'
});
}
});
}
function
setCfgAttributes
(
data
){
}
/* Warning, it's not a real base64 */
function
myB64
(
s
)
{
var
keyStr
=
"
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/
"
;
...
...
modules/lemonldap-ng-manager/example/skins/default/manager.tpl
View file @
19ae0803
...
...
@@ -98,6 +98,16 @@ var scriptname='<TMPL_VAR NAME="SCRIPT_NAME">';var imagepath='<TMPL_VAR NAME="DI
<lang
en=
"No value"
fr=
"Pas de valeur"
/>
</div>
<!-- Configuration datas -->
<div
id=
"cfgDatas"
class=
"hidden"
>
<ul>
<li><lang
en=
"Configuration number"
fr=
"Numéro de configuration"
/>
:
<span
id=
"cfgNum"
><TMPL_VAR
NAME=
"CFGNUM"
></span></li>
<li><lang
en=
"Author"
fr=
"Auteur"
>
:
<span
id=
"cfgAuthor"
></span></li>
<li><lang
en=
"IP Address"
fr=
"Adresse IP"
>
:
<span
id=
"cfgAuthorIP"
></span></li>
<li><lang
en=
"Date"
fr=
"Date"
>
:
<span
id=
"cfgDate"
></span></li>
</ul>
</div>
<!-- Contextual text -->
<div
id=
"content_text"
class=
"hidden"
>
<input
type=
"text"
id=
"text"
onchange=
"setlmdata(currentId,this.value)"
/>
...
...
modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm
View file @
19ae0803
...
...
@@ -57,6 +57,20 @@ sub new {
print
$self
->
node
(
$p
);
$self
->
quit
();
}
if
(
$self
->
param
('
cfgAttr
')
)
{
my
@buf
;
foreach
(
qw(cfgAuthor cfgAuthorIP cfgDate)
){
my
$tmp
=
$self
->
conf
()
->
{
$_
}
||
'
anonymous
';
$tmp
=~
s/'/\\'/g
;
push
@buf
,
"
$_
:'
$tmp
'
";
}
$_
=
'
{
'
.
join
('
,
',
@buf
)
.
'
}
';
print
$self
->
header
(
-
type
=>
'
application/json
',
-
Content_Length
=>
length
(
$_
)
)
.
$_
;
}
return
$self
;
}
...
...
@@ -70,7 +84,7 @@ sub menu {
'
<ul class="simpleTree">
'
.
$self
->
li
(
'
root
',
'
root
'
)
.
$self
->
span
(
'
root
',
"
Configuration
$self
->{cfgNum}
",
$self
->
{
cfgNum
},
'
none
'
)
$self
->
{
cfgNum
},
'
cfgDatas
'
)
.
'
<ul>
'
.
$self
->
node
()
.
'
</ul></li></ul>
';
...
...
modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_Struct.pm
View file @
19ae0803
...
...
@@ -69,7 +69,7 @@ sub struct {
||
$self
->
defaultConf
()
->
{
userDB
};
$auth
=
lc
(
$auth
);
$udb
=
lc
(
$udb
);
my
%res
=
qw(authentication 1 userDB
1 syslog
1)
;
my
%res
=
qw(authentication 1 userDB 1)
;
foreach
my
$mod
(
(
$auth
,
(
$auth
ne
$udb
?
$udb
:
()
)
)
)
{
my
$tmp
=
{
...
...
@@ -86,7 +86,6 @@ sub struct {
_help
=>
'
authParams
',
authentication
=>
'
text:/authentication:authParams:authParams
',
userDB
=>
'
text:/userDB:authParams:authParams
',
syslog
=>
'
text:/syslog
',
ldapParams
=>
{
_nodes
=>
[
qw(ldapServer ldapPort ldapBase managerDn managerPassword)
...
...
@@ -103,7 +102,8 @@ sub struct {
# LOGS PARAMETERS
logParams
=>
{
_nodes
=>
[
qw(useXForwardedForIP whatToTrace)
],
_nodes
=>
[
qw(syslog useXForwardedForIP whatToTrace)
],
syslog
=>
'
text:/syslog
',
useXForwardedForIP
=>
'
bool:/useXForwardedForIP
',
whatToTrace
=>
'
text:/whatToTrace:whatToTrace:text
',
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment