Changeset 1447

Show
Ignore:
Timestamp:
12/12/07 16:37:25 (8 months ago)
Author:
rho
Message:

fixed multiple issues

  • walledgarden access on some pages
  • empty comment on commentwall
  • added community profile permission check
  • corrected paths on templates edit
  • blog widget display issue

Signed-off: Rolando Espinoza La fuente <rho@prosoftpeople.com>

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • devel/cron.php

    r1439 r1447  
    44// later this will go through /mod  
    55// and things like auth plugins 
    6 // but we don't have those yet, so.... 
     6// but we don't have those yet, so... 
     7 
     8define('context','external'); 
    79 
    810$starttime = microtime(); 
  • devel/index.php

    r1378 r1447  
    33    global $CFG; 
    44 
     5    define('context', 'external'); 
    56    require_once(dirname(__FILE__)."/includes.php"); 
    67 
  • devel/lib/templates.php

    r1444 r1447  
    7070                                   'html' => templates_draw(array( 'context' => 'submenuitem', 
    7171                                                                   'name' => __gettext("Change theme"), 
    72                                                                    'location' => url . '_templates/'))); 
     72                                                                   'location' => url . 'mod/template/'))); 
    7373    } 
    7474 
     
    727727            $name .=" /> "; 
    728728            $column1 = "<b>" . $template['name'] . "</b>"; 
    729             $column2 = "<a href=\"".url."_templates/preview.php?template_preview=".$template['shortname']."\" target=\"preview\">" . __gettext("Preview") . "</a>"; 
     729            $column2 = "<a href=\"".url."mod/template/preview.php?template_preview=".$template['shortname']."\" target=\"preview\">" . __gettext("Preview") . "</a>"; 
    730730            $panel .=templates_draw(array( 
    731731                                                        'context' => 'adminTable', 
     
    759759                    $name .=" /> "; 
    760760                    $column1 = "<b>" . $template->name . "</b>"; 
    761                     $column2 = "<a href=\"".url."_templates/preview.php?template_preview=".$template->shortname."\" target=\"preview\">" . __gettext("Preview") . "</a>"; 
    762  
    763                     $column2 .= " | <a href=\"".url."_templates/edit.php?id=".$template->ident."\" >". __gettext("Edit") ."</a>"; 
    764                     $column2 .= " | <a href=\"".url."_templates/?action=deletetemplate&amp;delete_template_id=".$template->ident."\"  onclick=\"return confirm('" . __gettext("Are you sure you want to permanently remove this template?") . "')\">" . __gettext("Delete") . "</a>"; 
     761                    $column2 = "<a href=\"".url."mod/template/preview.php?template_preview=".$template->shortname."\" target=\"preview\">" . __gettext("Preview") . "</a>"; 
     762 
     763                    $column2 .= " | <a href=\"".url."mod/template/edit.php?id=".$template->ident."\" >". __gettext("Edit") ."</a>"; 
     764                    $column2 .= " | <a href=\"".url."mod/template/?action=deletetemplate&amp;delete_template_id=".$template->ident."\"  onclick=\"return confirm('" . __gettext("Are you sure you want to permanently remove this template?") . "')\">" . __gettext("Delete") . "</a>"; 
    765765                    $panel .=templates_draw(array( 
    766766                                                        'context' => 'adminTable', 
     
    12261226                // TODO: check again if is readable? 
    12271227                if (is_readable($tpl)) { 
    1228                     $template[$context] .= @file_get_contents($tpl); 
     1228                    $content = @file_get_contents($tpl); 
     1229                    $template[$context] = $template[$context] . @file_get_contents($tpl); 
    12291230                    //print_object('Loaded: ' . $tpl); 
    12301231                } else { 
  • devel/mod/blog/lib.php

    r1434 r1447  
    347347                $anyComments = __gettext("comment(s)"); 
    348348           
    349                 $body .= '<h3><a href="' . $CFG->wwwroot . user_name($post->weblog) . '/weblog/' . $post->ident . '.html">' . $post->title . '</a></h3>'; 
     349                $body .= '<h3><a href="' . $CFG->wwwroot . user_info('username', $post->weblog) . '/weblog/' . $post->ident . '.html">' . $post->title . '</a></h3>'; 
    350350                $body .= $postedby . ' ' . $username . ' (' . $date . ')<br><br>'; 
    351351                $body .= $post->body . '<br>'; 
     
    357357                } 
    358358                $numcomments = $_SESSION['comment_cache'][$post->ident]->data; 
    359                 $comments = "<a href=\"".url.$username."/{$post->ident}.html\">$numcomments $anyComments</a>"; 
     359                $comments = "<a href=\"".url.$username."/weblog/{$post->ident}.html\">$numcomments $anyComments</a>"; 
    360360         
    361                 $body .= $comments . '</div>'; 
    362     } 
    363   } 
    364  
    365   return array ( 
    366     'title' => __gettext("Weblog" 
    367   ), 'content' => $body); 
     361                $body .= $comments; 
     362    } 
     363  } 
     364  $body .= '</div>'; 
     365 
     366  return array ('title' => __gettext('Blog').' :: '.htmlspecialchars(user_name($blog_id), ENT_COMPAT, 'utf-8'), 'content' => $body); 
    368367 
    369368} 
  • devel/mod/commentwall/do_action.php

    r1218 r1447  
    2828                         
    2929                // Store the rating 
    30                $success = commentwall_addcomment($wallowner, $comment_owner, $text); 
     30        $success = (empty($text)) ? false : commentwall_addcomment($wallowner, $comment_owner, $text); 
    3131 
    3232                // Message 
  • devel/mod/community/lib.php

    r1430 r1447  
    306306            // members have access to upload files or create directories 
    307307            if (run('community:membership:check', array($_SESSION['userid'], $object_owner))) { 
    308                 return true; 
     308                $result = true; 
    309309            } 
    310310            break; 
     
    312312            // community owner can edit all files 
    313313            if (record_exists('users', 'ident', $object_owner, 'owner', $_SESSION['userid'])) { 
    314                 return true; 
     314                $result = true; 
    315315            } 
    316316            break; 
    317  
     317        case 'profile': 
     318            // owner can edit profile 
     319            if (record_exists('users', 'ident', $object_owner, 'owner', $_SESSION['userid'])) { 
     320                $result = true; 
     321            } 
     322            break; 
    318323    } 
    319324 
  • devel/mod/elggadmin/lib/elggadmin.inc.php

    r1421 r1447  
    204204    $page = new StdClass; 
    205205    $page->title = __gettext('Front page'); 
    206     $page->body .= elggadmin_tpltextarea('frontpage_loggedout', __gettext('Front page (when logged out)')); 
     206    $page->body = elggadmin_tpltextarea('frontpage_loggedout', __gettext('Front page (when logged out)')); 
    207207    $page->body .= elggadmin_tpltextarea('frontpage_loggedin', __gettext('Front page (when logged in)')); 
    208208    $page->body .= pages_html_input('hidden', array('name'=>'action','value'=>'elggadmin:frontpage')); 
  • devel/mod/pages/index.php

    r1376 r1447  
    88 */ 
    99 
    10 define('context', 'pages'); 
    1110 
    1211include(dirname(dirname(dirname(__FILE__))) . '/includes.php'); 
    1312require(dirname(__FILE__) . '/lib/pages.inc.php'); 
     13 
     14if (page_owner() > 0) { 
     15    define('context', 'pages'); 
     16} else { 
     17    define('context', 'external'); 
     18} 
    1419 
    1520// pages init 
  • devel/mod/pages/lib.php

    r1421 r1447  
    451451    } 
    452452 
    453     if (!empty($content)) { 
     453    if (isset($content)) { 
    454454        $result = "<{$tag}{$extra}>{$content}</{$tag}>\n"; 
    455455    } else { 
  • devel/mod/template/lib.php

    r1301 r1447  
    1212        if ($page_owner == $_SESSION['userid'] && $page_owner != -1) { 
    1313            $PAGE->menu_sub[] = array( 'name' => 'template:change', 
    14                                        'html' => a_href( "{$CFG->wwwroot}_templates/", 
     14                                       'html' => a_href( "{$CFG->wwwroot}mod/template/", 
    1515                                                          __gettext("Change theme")));   
    1616        } 
  • devel/mod/template/lib/templates_preview.php

    r1301 r1447  
    1313        $body = <<< END 
    1414         
    15     <img src="/_templates/leaves.jpg" width="300" height="225" alt="A test image" align="right" /> 
     15    <img src="/mod/template/images/leaves.jpg" width="300" height="225" alt="A test image" align="right" /> 
    1616    <h1>$heading1</h1> 
    1717    <p>Paragraph text</p>