Changeset 112

Show
Ignore:
Timestamp:
06/07/07 02:55:24 (1 year ago)
Author:
wikiplugin
Message:

Updated authentication in folio to fix some problems

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • folio/folio/config.php

    r111 r112  
    33 
    44global $CFG; 
    5 $FOLIO_CFG->version = 0.6
     5$FOLIO_CFG->version = 0.61
    66$FOLIO_CFG->ajaxprefix = 'folio_control_tree_'; 
    77 
  • folio/folio/control/commentbox_postdata.php

    r111 r112  
    5555         
    5656    // Insert new record into db. 
    57     insert_record('folio_comment',$comment); 
     57    $i = insert_record('folio_comment',$comment); 
    5858         
    5959        // Create RSS record 
     
    6464                $comment->creator_username, 
    6565                $comment->item_type . '_comment',  
    66                 $comment->item_ident,  
     66                $i,  
    6767                '',  
    6868                'Comment by ' . $comment->creator_username . ' on ' . $comment->item_title,  
  • folio/folio/control/page_edit_post.php

    r111 r112  
    3030        // Note, this is called by files in /mod/folio/html/, and not from the folder that this page is actually residing inside of. 
    3131        require_once('../../../includes.php'); 
    32  
     32    global $db, $CFG; 
     33     
    3334        // The security ident needs to be set by page_edit_security_post before this can run. 
    3435        if (!isset($security_ident) ) { 
     
    9697        $security  
    9798        ); 
     99 
     100    // Update any comments to match the same permission level. 
     101    $stmt = $db->Prepare("UPDATE {$CFG->prefix}folio_comment SET access = '{$security}' " . 
     102                         "WHERE item_ident = {$insert_id} AND item_type = 'page'" ); 
     103    $returnvalue = $db->Execute($stmt);   
     104     
     105    // Update RSS of any comments to match the same permission level. 
     106    $stmt = $db->Prepare("UPDATE {$CFG->prefix}folio_rss SET access = '{$security}' " . 
     107                         "WHERE type_ident IN ( SELECT activity_ident FROM {$CFG->prefix}folio_comment WHERE item_ident =  " . 
     108                         " {$insert_id} AND item_type = 'page') AND type = 'page_comment'" ); 
     109    $returnvalue = $db->Execute($stmt);         
    98110         
    99111?> 
  • folio/folio/html/setupdb.php

    r111 r112  
    1212 
    1313// The current version of the folio db scheme. 
    14 $folio_dbversion = 7
     14$folio_dbversion = 8
    1515 
    1616// Setup variables. 
     
    3333 
    3434// See if a user other than news is trying to run this. 
    35 //if ($USER->username <> 'news') { 
    36 //    error('You can only run this function if you logged on as "news"'); 
    37 //    die(); 
    38 //
     35if ($USER->username <> 'news') { 
     36      error('You can only run this function if you logged on as "news"'); 
     37      die(); 
     38
    3939 
    4040// Start upgrading. 
     
    6262                        case 6: 
    6363                           gotoVersion7(); 
     64                           // no break, need to continue updating.       
     65                        case 7: 
     66                           gotoVersion8(); 
    6467                           // no break, need to continue updating.       
    6568   } 
     
    98101 
    99102/**  
    100 * Update to version 7, auto-import blog entries, blog comments, & files into the global RSS table. 
    101 **/ 
    102 function gotoVersion7() { 
     103* Update to version 8, re-do the auto-import blog entries, blog comments, & files into the global RSS table. 
     104**/ 
     105function gotoVersion8() { 
    103106        global $CFG;     
    104107        $prefix = $CFG->prefix; 
     
    137140        } 
    138141    } 
     142 
     143        $version = new StdClass; 
     144        $version->version = 8; 
     145        insert_record("folio_version",$version);         
     146} 
     147 
     148/**  
     149* Update to version 7, auto-import blog entries, blog comments, & files into the global RSS table. 
     150**/ 
     151function gotoVersion7() { 
     152        global $CFG;     
     153        $prefix = $CFG->prefix; 
     154        $db = $CFG->dbname; 
     155 
    139156 
    140157        $version = new StdClass; 
  • folio/folio/lib.php

    r111 r112  
    10211021**/ 
    10221022function folio_rss_weblog_post($object_type, $event, $object) { 
    1023     global $CFG; 
    1024  
     1023    global $db, $CFG; 
     1024     
    10251025    $title = $object->title; 
    10261026    $body = $object->body; 
     
    10491049    rss_additem( $owner_id, $owner_username, $user_id, $user_name, $user_username, $type, $type_ident, $tags, $title, $body, $link, $access); 
    10501050 
     1051    // Update RSS in comments to match the same permission level. 
     1052    $stmt = $db->Prepare("UPDATE {$CFG->prefix}folio_rss SET access = '{$access}' " . 
     1053                         "WHERE type_ident IN ( SELECT ident FROM {$CFG->prefix}weblog_comments " . 
     1054                         "WHERE post_id = {$type_ident} ) AND type = 'weblog_comment'" ); 
     1055    $returnvalue = $db->Execute($stmt); 
     1056         
    10511057    // return results 
    10521058    return $object; 
     
    11731179        $rec = get_record('users','username',$reader_name); 
    11741180         
    1175         if ( $rec->password == $reader_pwd ) { 
     1181        if ( !$rec ) { 
     1182            // No matching user 
     1183            return -1; 
     1184        } elseif ( $rec->password == $reader_pwd ) { 
     1185            // Matched pwd 
    11761186            return $rec->ident; 
    11771187        } else { 
     1188            // Pwd doesn't match 
    11781189            return -1; 
    11791190        } 
  • folio/folio/readme.txt

    r111 r112  
    11---------------------------------------------------------------------------------- 
    22                                Elgg Folio Add-in 
    3                                 Updated 6/5/2007 
     3                                Updated 6/6/2007 
    44---------------------------------------------------------------------------------- 
    55 
     
    9393 
    9494Occurred: 
     95        2007.06.06 v0.61 Fixed more bugs.   
    9596        2007.06.06 v0.6 Fixed a number of bugs.  Added options via config.php for  
    9697                        different display options.