[geeklog-cvs] geeklog-1.3/public_html index.php,1.42,1.43
dhaun at geeklog.net
dhaun at geeklog.net
Tue Mar 11 12:00:58 EST 2003
Update of /usr/cvs/geeklog/geeklog-1.3/public_html
In directory internal.geeklog.net:/tmp/cvs-serv3643/public_html
Modified Files:
index.php
Log Message:
Fixed problems with static pages permissions.
Index: index.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/index.php,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -d -r1.42 -r1.43
*** index.php 9 Mar 2003 11:47:22 -0000 1.42
--- index.php 11 Mar 2003 17:00:56 -0000 1.43
***************
*** 81,85 ****
if (DB_getItem ($_TABLES['plugins'], 'pi_enabled', "pi_name = 'staticpages'") == 1) {
! $spsql = "SELECT sp_content,sp_label,sp_format,sp_php FROM {$_TABLES['staticpage']} WHERE sp_title = 'frontpage' AND " . SP_getPerms ();
$result = DB_query ($spsql);
--- 81,89 ----
if (DB_getItem ($_TABLES['plugins'], 'pi_enabled', "pi_name = 'staticpages'") == 1) {
! $perms = SP_getPerms ();
! if (!empty ($perms)) {
! $perms = ' AND ' . $perms;
! }
! $spsql = "SELECT sp_content,sp_label,sp_format,sp_php FROM {$_TABLES['staticpage']} WHERE sp_title = 'frontpage'" . $perms;
$result = DB_query ($spsql);
***************
*** 209,217 ****
$sql .= "(owner_id = {$_USER['uid']} AND perm_owner >= 2) OR ";
$sql .= "(group_id IN ($groupList) AND perm_group >= 2) OR ";
! $sql .= "(perm_members >= 2) OR ";
}
- $sql .= "(perm_anon >= 2))";
if (!empty($U['aids'])) {
$AIDS = explode(' ',$U['aids']);
for ($z = 0; $z < sizeof($AIDS); $z++) {
--- 213,223 ----
$sql .= "(owner_id = {$_USER['uid']} AND perm_owner >= 2) OR ";
$sql .= "(group_id IN ($groupList) AND perm_group >= 2) OR ";
! $sql .= "(perm_members >= 2))";
! } else {
! $sql .= "perm_anon >= 2)";
}
if (!empty($U['aids'])) {
+ $sql .= ' ';
$AIDS = explode(' ',$U['aids']);
for ($z = 0; $z < sizeof($AIDS); $z++) {
***************
*** 221,224 ****
--- 227,231 ----
if (!empty($U['tids'])) {
+ $sql .= ' ';
$TIDS = explode(' ',$U['tids']);
for ($z = 0; $z < sizeof($TIDS); $z++) {
***************
*** 228,232 ****
if ($newstories) {
! $sql .= "AND (date >= (NOW() - INTERVAL {$_CONF['newstoriesinterval']} SECOND))";
}
--- 235,239 ----
if ($newstories) {
! $sql .= "AND (date >= (NOW() - INTERVAL {$_CONF['newstoriesinterval']} SECOND)) ";
}
***************
*** 249,255 ****
$countsql .= "(owner_id = {$_USER['uid']} AND perm_owner >= 2) OR ";
$countsql .= "(group_id IN ($groupList) AND perm_group >= 2) OR ";
! $countsql .= "(perm_members >= 2) OR ";
}
- $countsql .= "(perm_anon >= 2))";
if ($newstories) {
--- 256,263 ----
$countsql .= "(owner_id = {$_USER['uid']} AND perm_owner >= 2) OR ";
$countsql .= "(group_id IN ($groupList) AND perm_group >= 2) OR ";
! $countsql .= "(perm_members >= 2))";
! } else {
! $countsql .= "perm_anon >= 2)";
}
if ($newstories) {
***************
*** 264,278 ****
for ($x = 1; $x <= $nrows; $x++) {
$A = DB_fetchArray($result);
! if (SEC_hasAccess($A['owner_id'],$A['group_id'],$A['perm_owner'],$A['perm_group'],$A['perm_members'],$A['perm_anon']) > 0) {
! if ($A['featured'] == 1) {
! $feature = 'true';
! } elseif (($x == 1) && ($_CONF['showfirstasfeatured'] == 1)) {
! $feature = 'true';
! $A['featured'] = 1;
! }
! $display .= COM_article($A,'y');
}
}
!
// Print Google-like paging navigation
if (empty($topic)) {
--- 272,284 ----
for ($x = 1; $x <= $nrows; $x++) {
$A = DB_fetchArray($result);
! if ($A['featured'] == 1) {
! $feature = 'true';
! } elseif (($x == 1) && ($_CONF['showfirstasfeatured'] == 1)) {
! $feature = 'true';
! $A['featured'] = 1;
}
+ $display .= COM_article($A,'y');
}
!
// Print Google-like paging navigation
if (empty($topic)) {
More information about the geeklog-cvs
mailing list