No regular expressions were active.
1 |
|
<?php
|
|
1 |
|
<?php
|
2 |
|
|
|
2 |
|
|
3 |
|
/*********
**********
**********
**********
**********
**********
**********
******
|
|
3 |
|
/*********
**********
**********
**********
**********
**********
**********
******
|
4 |
|
*
D
olphin Sma
rt Communi
ty Builder
|
|
4 |
|
*
D
olphin Sma
rt Communi
ty Builder
|
5 |
|
*
---------
--------
|
|
5 |
|
*
---------
--------
|
6 |
|
* begi
n
: M
on Mar 23
2006
|
|
6 |
|
* begi
n
: M
on Mar 23
2006
|
7 |
|
* copy
right
: (
C) 2006 Bo
onEx Group
|
|
7 |
|
* copy
right
: (
C) 2006 Bo
onEx Group
|
8 |
|
* webs
ite
: h
ttp://www.
boonex.com
/
|
|
8 |
|
* webs
ite
: h
ttp://www.
boonex.com
/
|
9 |
|
* This fil
e is part
of Dolphin
- Smart C
ommunity B
uilder
|
|
9 |
|
* This fil
e is part
of Dolphin
- Smart C
ommunity B
uilder
|
10 |
|
*
|
|
10 |
|
*
|
11 |
|
* Dolphin
is free so
ftware. Th
is work is
licensed
under a Cr
eative Com
mons Attri
bution 3.0
License.
|
|
11 |
|
* Dolphin
is free so
ftware. Th
is work is
licensed
under a Cr
eative Com
mons Attri
bution 3.0
License.
|
12 |
|
* http://c
reativecom
mons.org/l
icenses/by
/3.0/
|
|
12 |
|
* http://c
reativecom
mons.org/l
icenses/by
/3.0/
|
13 |
|
*
|
|
13 |
|
*
|
14 |
|
* Dolphin
is distrib
uted in th
e hope tha
t it will
be useful,
but WITHO
UT ANY WAR
RANTY;
|
|
14 |
|
* Dolphin
is distrib
uted in th
e hope tha
t it will
be useful,
but WITHO
UT ANY WAR
RANTY;
|
15 |
|
* without
even the i
mplied war
ranty of
MERCHANTAB
ILITY or F
ITNESS FOR
A PARTICU
LAR PURPOS
E.
|
|
15 |
|
* without
even the i
mplied war
ranty of
MERCHANTAB
ILITY or F
ITNESS FOR
A PARTICU
LAR PURPOS
E.
|
16 |
|
* See the
Creative C
ommons Att
ribution 3
.0 License
for more
details.
|
|
16 |
|
* See the
Creative C
ommons Att
ribution 3
.0 License
for more
details.
|
17 |
|
* You shou
ld have re
ceived a c
opy of the
Creative
Commons At
tribution
3.0 Licens
e along wi
th Dolphin
,
|
|
17 |
|
* You shou
ld have re
ceived a c
opy of the
Creative
Commons At
tribution
3.0 Licens
e along wi
th Dolphin
,
|
18 |
|
* see lice
nse.txt fi
le; if not
, write to
marketing
@boonex.co
m
|
|
18 |
|
* see lice
nse.txt fi
le; if not
, write to
marketing
@boonex.co
m
|
19 |
|
**********
**********
**********
**********
**********
**********
**********
*****/
|
|
19 |
|
**********
**********
**********
**********
**********
**********
**********
*****/
|
20 |
|
|
|
20 |
|
|
21 |
|
require_on
ce( '../in
c/header.i
nc.php' );
|
|
21 |
|
require_on
ce( '../in
c/header.i
nc.php' );
|
22 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'd
esign.inc.
php' );
|
|
22 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'd
esign.inc.
php' );
|
23 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'a
dmin_desig
n.inc.php'
);
|
|
23 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'a
dmin_desig
n.inc.php'
);
|
24 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'u
tils.inc.p
hp' );
|
|
24 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'u
tils.inc.p
hp' );
|
25 |
|
|
|
25 |
|
|
26 |
|
$logged['a
dmin']
=
member_aut
h(
1
);
|
|
26 |
|
$logged['a
dmin']
=
member_aut
h(
1
,
true,
true
);
|
27 |
|
$_page['he
ader'] = '
Edit CSS F
ile';
|
|
27 |
|
$_page['he
ader'] = '
Edit CSS F
ile';
|
28 |
|
|
|
28 |
|
|
29 |
|
$path = "{
$dir['root
']}templat
es/tmpl_{$
tmpl}/css/
";
|
|
29 |
|
$path = "{
$dir['root
']}templat
es/tmpl_{$
tmpl}/css/
";
|
30 |
|
$fname = p
reg_match(
"/^\w+\.cs
s$/", $_PO
ST['css_fi
le']) ? $_
POST['css_
file'] : '
';
|
|
30 |
|
$fname = p
reg_match(
"/^\w+\.cs
s$/", $_PO
ST['css_fi
le']) ? $_
POST['css_
file'] : '
';
|
31 |
|
|
|
31 |
|
|
32 |
|
$action_re
sult = "";
|
|
32 |
|
$action_re
sult = "";
|
33 |
|
$demo_text
= 'This A
ction Rest
ricted in
Demo Mode'
;
|
|
33 |
|
$demo_text
= 'This A
ction Rest
ricted in
Demo Mode'
;
|
34 |
|
|
|
34 |
|
|
35 |
|
if ( isset
($_POST['s
ave']) )
|
|
35 |
|
if ( isset
($_POST['s
ave']) )
|
36 |
|
{
|
|
36 |
|
{
|
37 |
|
if ( !
$demo_mode
)
|
|
37 |
|
if ( !
$demo_mode
)
|
38 |
|
{
|
|
38 |
|
{
|
39 |
|
$f
ile_exists
= file_ex
ists( $pat
h . $fname
);
|
|
39 |
|
$f
ile_exists
= file_ex
ists( $pat
h . $fname
);
|
40 |
|
|
|
40 |
|
|
41 |
|
if
( $file_e
xists && i
sRWAccessi
ble($path
. $fname)
)
|
|
41 |
|
if
( $file_e
xists && i
sRWAccessi
ble($path
. $fname)
)
|
42 |
|
{
|
|
42 |
|
{
|
43 |
|
$fp = fo
pen( $path
. $fname,
'w');
|
|
43 |
|
$fp = fo
pen( $path
. $fname,
'w');
|
44 |
|
$content
= process
_pass_data
( $_POST['
content']
);
|
|
44 |
|
$content
= process
_pass_data
( $_POST['
content']
);
|
45 |
|
if ( $fp
)
|
|
45 |
|
if ( $fp
)
|
46 |
|
{
|
|
46 |
|
{
|
47 |
|
fwri
te( $fp, $
content );
|
|
47 |
|
fwri
te( $fp, $
content );
|
48 |
|
fclo
se( $fp );
|
|
48 |
|
fclo
se( $fp );
|
49 |
|
$act
ion_result
= "File {
$fname} wa
s successf
ully saved
";
|
|
49 |
|
$act
ion_result
= "File {
$fname} wa
s successf
ully saved
";
|
50 |
|
}
|
|
50 |
|
}
|
51 |
|
else
|
|
51 |
|
else
|
52 |
|
{
|
|
52 |
|
{
|
53 |
|
$act
ion_result
= "Fail t
o save fil
e {$fname}
";
|
|
53 |
|
$act
ion_result
= "Fail t
o save fil
e {$fname}
";
|
54 |
|
}
|
|
54 |
|
}
|
55 |
|
}
|
|
55 |
|
}
|
56 |
|
el
se
|
|
56 |
|
el
se
|
57 |
|
{
|
|
57 |
|
{
|
58 |
|
$action_
result = "
File {$fna
me} is not
writable"
;
|
|
58 |
|
$action_
result = "
File {$fna
me} is not
writable"
;
|
59 |
|
}
|
|
59 |
|
}
|
60 |
|
}
|
|
60 |
|
}
|
61 |
|
else
|
|
61 |
|
else
|
62 |
|
{
|
|
62 |
|
{
|
63 |
|
$a
ction_resu
lt = $demo
_text;
|
|
63 |
|
$a
ction_resu
lt = $demo
_text;
|
64 |
|
}
|
|
64 |
|
}
|
65 |
|
|
|
65 |
|
|
66 |
|
}
|
|
66 |
|
}
|
67 |
|
|
|
67 |
|
|
68 |
|
TopCodeAdm
in();
|
|
68 |
|
TopCodeAdm
in();
|
69 |
|
ContentBlo
ckHead("")
;
|
|
69 |
|
ContentBlo
ckHead("")
;
|
70 |
|
|
|
70 |
|
|
71 |
|
if ( strle
n($action_
result) )
|
|
71 |
|
if ( strle
n($action_
result) )
|
72 |
|
echo "
|
|
72 |
|
echo "
|
73 |
|
<center>
|
|
73 |
|
<center>
|
74 |
|
<div c
lass=\"err
\" style=\
"margin: 5
px;\">{$ac
tion_resul
t}</div>
|
|
74 |
|
<div c
lass=\"err
\" style=\
"margin: 5
px;\">{$ac
tion_resul
t}</div>
|
75 |
|
</center>"
;
|
|
75 |
|
</center>"
;
|
76 |
|
?>
|
|
76 |
|
?>
|
77 |
|
|
|
77 |
|
|
78 |
|
<div style
="margin-l
eft: auto;
margin-ri
ght: auto;
text-alig
n: center;
">
|
|
78 |
|
<div style
="margin-l
eft: auto;
margin-ri
ght: auto;
text-alig
n: center;
">
|
79 |
|
<form
action="<?
= $_SERVER
['PHP_SELF
'] ?>" nam
e="css_fil
e" method=
"post" sty
le="margin
: 0px;">
|
|
79 |
|
<form
action="<?
= $_SERVER
['PHP_SELF
'] ?>" nam
e="css_fil
e" method=
"post" sty
le="margin
: 0px;">
|
80 |
|
Se
lect CSS f
ile you wa
nt edit:&n
bsp;<?= ge
tDirConten
t( $path,
"document.
forms['css
_file'].su
bmit();",
$fname ) ?
>
|
|
80 |
|
Se
lect CSS f
ile you wa
nt edit:&n
bsp;<?= ge
tDirConten
t( $path,
"document.
forms['css
_file'].su
bmit();",
$fname ) ?
>
|
81 |
|
<?
|
|
81 |
|
<?
|
82 |
|
|
|
82 |
|
|
83 |
|
if ( strle
n($fname)
&& $fname
!= '0' &&
file_exist
s($path.$f
name) && i
s_file($pa
th.$fname)
)
|
|
83 |
|
if ( strle
n($fname)
&& $fname
!= '0' &&
file_exist
s($path.$f
name) && i
s_file($pa
th.$fname)
)
|
84 |
|
{
|
|
84 |
|
{
|
85 |
|
$fp =
fopen( $pa
th . $fnam
e, 'r');
|
|
85 |
|
$fp =
fopen( $pa
th . $fnam
e, 'r');
|
86 |
|
$conte
nt = '';
|
|
86 |
|
$conte
nt = '';
|
87 |
|
if ( $
fp )
|
|
87 |
|
if ( $
fp )
|
88 |
|
{
|
|
88 |
|
{
|
89 |
|
wh
ile ( !feo
f($fp) )
|
|
89 |
|
wh
ile ( !feo
f($fp) )
|
90 |
|
$content
.= fgets(
$fp, 4096)
;
|
|
90 |
|
$content
.= fgets(
$fp, 4096)
;
|
91 |
|
fc
lose( $fp
);
|
|
91 |
|
fc
lose( $fp
);
|
92 |
|
}
|
|
92 |
|
}
|
93 |
|
?>
|
|
93 |
|
?>
|
94 |
|
<b
r /><br />
|
|
94 |
|
<b
r /><br />
|
95 |
|
<d
iv style="
padding-le
ft: 4px; p
adding-rig
ht: 4px; t
ext-align:
left;">
|
|
95 |
|
<d
iv style="
padding-le
ft: 4px; p
adding-rig
ht: 4px; t
ext-align:
left;">
|
96 |
|
Editing
file <b><?
= $fname ?
></b>: <?=
( !isRWAc
cessible(
$path . $f
name ) ? "
<span clas
s=\"err\"
style=\"ma
rgin-left:
5px;\">Fil
e {$fname}
is not wr
itable</sp
an>"
|
|
96 |
|
Editing
file <b><?
= $fname ?
></b>: <?=
( !isRWAc
cessible(
$path . $f
name ) ? "
<span clas
s=\"err\"
style=\"ma
rgin-left:
5px;\">Fil
e {$fname}
is not wr
itable</sp
an>"
|
97 |
|
: "<span
class=\"su
cc\" style
=\"margin-
left:5px;\
">File {$f
name} has
write perm
issions</s
pan>" ) ?>
<br />
|
|
97 |
|
: "<span
class=\"su
cc\" style
=\"margin-
left:5px;\
">File {$f
name} has
write perm
issions</s
pan>" ) ?>
<br />
|
98 |
|
<textare
a cols="81
" rows="30
" name="co
ntent" sty
le="font-f
amily: 'Co
urier New'
; font-siz
e: 11px;">
<?= htmlsp
ecialchars
($content)
?></texta
rea>
|
|
98 |
|
<textare
a cols="81
" rows="30
" name="co
ntent" sty
le="font-f
amily: 'Co
urier New'
; font-siz
e: 11px;">
<?= htmlsp
ecialchars
($content)
?></texta
rea>
|
99 |
|
</
div>
|
|
99 |
|
</
div>
|
100 |
|
<b
r />
|
|
100 |
|
<b
r />
|
101 |
|
<i
nput type=
"submit" n
ame="save"
class="no
" value="S
ave" style
="width: 6
0px" />
|
|
101 |
|
<i
nput type=
"submit" n
ame="save"
class="no
" value="S
ave" style
="width: 6
0px" />
|
102 |
|
<?
|
|
102 |
|
<?
|
103 |
|
}
|
|
103 |
|
}
|
104 |
|
?>
|
|
104 |
|
?>
|
105 |
|
</form
>
|
|
105 |
|
</form
>
|
106 |
|
</div>
|
|
106 |
|
</div>
|
107 |
|
<?
|
|
107 |
|
<?
|
108 |
|
|
|
108 |
|
|
109 |
|
ContentBlo
ckFoot();
|
|
109 |
|
ContentBlo
ckFoot();
|
110 |
|
BottomCode
();
|
|
110 |
|
BottomCode
();
|
111 |
|
|
|
111 |
|
|
112 |
|
function g
etDirConte
nt( $path,
$onchange
, $selItem
)
|
|
112 |
|
function g
etDirConte
nt( $path,
$onchange
, $selItem
)
|
113 |
|
{
|
|
113 |
|
{
|
114 |
|
$handl
e = opendi
r( $path )
;
|
|
114 |
|
$handl
e = opendi
r( $path )
;
|
115 |
|
|
|
115 |
|
|
116 |
|
$res =
"<select
name=\"css
_file\" on
change=\"{
$onchange}
\">\n";
|
|
116 |
|
$res =
"<select
name=\"css
_file\" on
change=\"{
$onchange}
\">\n";
|
117 |
|
$res .
= "<option
value=\"0
\" ". (!st
rlen($selI
tem) ? 'se
lected="se
lected"' :
'') .">--
select fi
le --</opt
ion>\n";
|
|
117 |
|
$res .
= "<option
value=\"0
\" ". (!st
rlen($selI
tem) ? 'se
lected="se
lected"' :
'') .">--
select fi
le --</opt
ion>\n";
|
118 |
|
|
|
118 |
|
|
119 |
|
while
( false !=
= ($filena
me = readd
ir($handle
)) )
|
|
119 |
|
while
( false !=
= ($filena
me = readd
ir($handle
)) )
|
120 |
|
{
|
|
120 |
|
{
|
121 |
|
if
( is_file
($path . $
filename)
&& 'css' =
= substr($
filename,
-3) )
|
|
121 |
|
if
( is_file
($path . $
filename)
&& 'css' =
= substr($
filename,
-3) )
|
122 |
|
$res .=
"<option v
alue=\"$fi
lename\" "
. ($filena
me == $sel
Item ? 'se
lected="se
lected"' :
'') . ">{
$filename}
</option>\
n";
|
|
122 |
|
$res .=
"<option v
alue=\"$fi
lename\" "
. ($filena
me == $sel
Item ? 'se
lected="se
lected"' :
'') . ">{
$filename}
</option>\
n";
|
123 |
|
}
|
|
123 |
|
}
|
124 |
|
|
|
124 |
|
|
125 |
|
$res .
= "</selec
t>\n";
|
|
125 |
|
$res .
= "</selec
t>\n";
|
126 |
|
|
|
126 |
|
|
127 |
|
closed
ir( $handl
e );
|
|
127 |
|
closed
ir( $handl
e );
|
128 |
|
|
|
128 |
|
|
129 |
|
return
$res;
|
|
129 |
|
return
$res;
|
130 |
|
}
|
|
130 |
|
}
|
131 |
|
|
|
131 |
|
|
132 |
|
?>
|
|
132 |
|
?>
|