Skip to content

Commit d72d2ef

Browse files
committed
fixed broken programactions.cgi (fixes #80).
1 parent 902a4f0 commit d72d2ef

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

xmlapi/programactions.cgi

+19-14
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ if {[info exists sid] && [check_session $sid]} {
1515
set pairs [split $input &]
1616
foreach pair $pairs {
1717
if {0 != [regexp "^program_id=(.*)$" $pair dummy val]} {
18-
set programn_id $val
18+
set program_id $val
1919
continue
2020
}
21-
if {0 != [regexp "^active_id=(.*)$" $pair dummy val]} {
21+
if {0 != [regexp "^active=(.*)$" $pair dummy val]} {
2222
set active $val
2323
continue
2424
}
@@ -29,21 +29,26 @@ if {[info exists sid] && [check_session $sid]} {
2929
}
3030
}
3131

32-
array set res [rega_script "
33-
if ($program_id > 0) { object obj = dom.GetObject($program_id);
34-
if (obj && obj.IsTypeOf(OT_PROGRAM)) {
35-
if (($active == false) || ($active == true)){
36-
obj.Active($active);
37-
}
38-
if (($visible == false) || ($visible == true)){
39-
obj.Visible($visible);
40-
}
41-
Write(obj);
32+
array set res [rega_script {
33+
integer prgId = } $program_id {;
34+
string active = "} $active {";
35+
string visible = "} $visible {";
36+
if (prgId > 0) {
37+
object obj = dom.GetObject(prgId);
38+
if (obj && obj.IsTypeOf(OT_PROGRAM)) {
39+
if ((active == "false") || (active == "true")){
40+
obj.Active(active);
4241
}
43-
}"]
42+
if ((visible == "false") || (visible == "true")){
43+
obj.Visible(visible);
44+
}
45+
Write(obj);
46+
}
47+
}
48+
}]
4449

4550
if { $res(STDOUT) != "" } {
46-
puts -nonewline "<actions program_id=\"$program_id\" active=\"$active\" visible=\"$visible\"/>"
51+
puts -nonewline "<actions program_id=\"$res(prgId)\" active=\"$res(active)\" visible=\"$res(visible)\"/>"
4752
} else {
4853
puts -nonewline {<not_found/>}
4954
}

0 commit comments

Comments
 (0)