|
From: Jon O. <jon...@us...> - 2006-06-17 20:47:23
|
Update of /cvsroot/mxbb/mx_gallery2 In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv5129/modules/mx_gallery2 Modified Files: gallery2.php gallery2_toplist.php Log Message: security Index: gallery2.php =================================================================== RCS file: /cvsroot/mxbb/mx_gallery2/gallery2.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** gallery2.php 5 Apr 2006 22:34:09 -0000 1.5 --- gallery2.php 17 Jun 2006 20:47:18 -0000 1.6 *************** *** 8,15 **** * */ ! ! if( !defined('IN_PORTAL') ) { ! die("Hacking attempt !!!"); } --- 8,15 ---- * */ ! ! if( !defined('IN_PORTAL') || !is_object($mx_block)) { ! die("Hacking attempt"); } *************** *** 45,49 **** // Include the gallery embed class // ! require_once($relativeG2Path . '/embed.php'); // --- 45,49 ---- // Include the gallery embed class // ! require_once($relativeG2Path . '/embed.php'); // *************** *** 67,89 **** echo($map_debug); } ! // // Init the GalleryEmbed class, passing current user_id // ! if($userdata['user_id'] != ANONYMOUS) { ! $ret = GalleryEmbed::init(array( 'embedUri' => $embedUri, 'embedPath' => $embedPath, 'relativeG2Path' => $relativeG2Path, 'loginRedirect' => $loginRedirect, 'activeUserId' => $userdata['user_id'])); ! if ($ret->isError()) { echo $ret->getAsHtml(); ! exit; ! } } ! else { ! $ret = GalleryEmbed::init(array( 'embedUri' => $embedUri, 'embedPath' => $embedPath, 'relativeG2Path' => $relativeG2Path, 'loginRedirect' => $loginRedirect, 'activeUserId' => 0)); ! if ($ret->isError()) { echo $ret->getAsHtml(); ! exit; ! } } --- 67,89 ---- echo($map_debug); } ! // // Init the GalleryEmbed class, passing current user_id // ! if($userdata['user_id'] != ANONYMOUS) { ! $ret = GalleryEmbed::init(array( 'embedUri' => $embedUri, 'embedPath' => $embedPath, 'relativeG2Path' => $relativeG2Path, 'loginRedirect' => $loginRedirect, 'activeUserId' => $userdata['user_id'])); ! if ($ret->isError()) { echo $ret->getAsHtml(); ! exit; ! } } ! else { ! $ret = GalleryEmbed::init(array( 'embedUri' => $embedUri, 'embedPath' => $embedPath, 'relativeG2Path' => $relativeG2Path, 'loginRedirect' => $loginRedirect, 'activeUserId' => 0)); ! if ($ret->isError()) { echo $ret->getAsHtml(); ! exit; ! } } *************** *** 92,107 **** // GalleryCapabilities::set('showSidebarBlocks', true); ! $g2data = GalleryEmbed::handleRequest(); ! if ($g2data['isDone']) { ! exit; // Gallery 2 has already sent output (redirect or binary data) ! } ! // Use $g2data['headHtml'] and $g2data['bodyHtml'] ! // to display Gallery 2 content inside embedding application ! // if you don't want to use $g2data['headHtml'] directly, you can get the css, ! // javascript and page title separately by calling... ! if (isset($g2data['headHtml'])) { ! list($title, $css, $javascript) = GalleryEmbed::parseHead($g2data['headHtml']); } --- 92,107 ---- // GalleryCapabilities::set('showSidebarBlocks', true); ! $g2data = GalleryEmbed::handleRequest(); ! if ($g2data['isDone']) { ! exit; // Gallery 2 has already sent output (redirect or binary data) ! } ! // Use $g2data['headHtml'] and $g2data['bodyHtml'] ! // to display Gallery 2 content inside embedding application ! // if you don't want to use $g2data['headHtml'] directly, you can get the css, ! // javascript and page title separately by calling... ! if (isset($g2data['headHtml'])) { ! list($title, $css, $javascript) = GalleryEmbed::parseHead($g2data['headHtml']); } Index: gallery2_toplist.php =================================================================== RCS file: /cvsroot/mxbb/mx_gallery2/gallery2_toplist.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** gallery2_toplist.php 5 Apr 2006 22:34:09 -0000 1.5 --- gallery2_toplist.php 17 Jun 2006 20:47:18 -0000 1.6 *************** *** 8,38 **** * */ ! /* ! Externt Bildblock ! Använd ett PHP-block liknande det som visas nedan för att inkludera ett blidblock på en PHP sida utanför Gallery. ! <?php @readfile('http://www.samskolan.se/modules/gallery2/main.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_show=title'); ?> ! g2_blocks Pipe(|) separate list chosen from: randomImage, recentImage, viewedImage, randomAlbum, recentAlbum, viewedAlbum, dailyImage, weeklyImage, monthlyImage, dailyAlbum, weeklyAlbum, monthlyAlbum, specificItem; default is randomImage ! g2_show * Pipe(|) separated list chosen from: title, date, views, owner, heading, fullSize; the value can also be: none ! g2_itemId Limit the item selection to the subtree of the gallery under the album with the given id; or the id of the item to display when used with specificItem block type ! g2_maxSize Scale images to this maximum size. If maxSize exceeds the thumbnail dimensions, you must also specify g2_show=fullSize ! g2_linkTarget Add a link target (for example, to open links in a new browser window) ! g2_itemFrame * Ram att använda runt bilder ! g2_albumFrame * Ram att använda runt album ! If a parameter marked with * is omitted then the site default defined above is used. ! Image frames require CSS to be displayed correctly. Include the following in the <head> section to support image frames. ! <link rel="stylesheet" href="http://www.samskolan.se/modules/gallery2/main.php?g2_controller=imageblock.ExternalCSS&g2_frames=wood"/> ! Specify the frame id (or pipe separated list of ids) in the frames parameter. Omit the parameter to support the image frames configured above. Frame ids are the directory names in the modules/imageframe/frames directory. */ ! if( !defined('IN_PORTAL') ) { ! die("Hacking attempt !!!"); } --- 8,38 ---- * */ ! /* ! Externt Bildblock ! Använd ett PHP-block liknande det som visas nedan för att inkludera ett blidblock på en PHP sida utanför Gallery. ! <?php @readfile('http://www.samskolan.se/modules/gallery2/main.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_show=title'); ?> ! g2_blocks Pipe(|) separate list chosen from: randomImage, recentImage, viewedImage, randomAlbum, recentAlbum, viewedAlbum, dailyImage, weeklyImage, monthlyImage, dailyAlbum, weeklyAlbum, monthlyAlbum, specificItem; default is randomImage ! g2_show * Pipe(|) separated list chosen from: title, date, views, owner, heading, fullSize; the value can also be: none ! g2_itemId Limit the item selection to the subtree of the gallery under the album with the given id; or the id of the item to display when used with specificItem block type ! g2_maxSize Scale images to this maximum size. If maxSize exceeds the thumbnail dimensions, you must also specify g2_show=fullSize ! g2_linkTarget Add a link target (for example, to open links in a new browser window) ! g2_itemFrame * Ram att använda runt bilder ! g2_albumFrame * Ram att använda runt album ! If a parameter marked with * is omitted then the site default defined above is used. ! Image frames require CSS to be displayed correctly. Include the following in the <head> section to support image frames. ! <link rel="stylesheet" href="http://www.samskolan.se/modules/gallery2/main.php?g2_controller=imageblock.ExternalCSS&g2_frames=wood"/> ! Specify the frame id (or pipe separated list of ids) in the frames parameter. Omit the parameter to support the image frames configured above. Frame ids are the directory names in the modules/imageframe/frames directory. */ ! if( !defined('IN_PORTAL') || !is_object($mx_block)) { ! die("Hacking attempt"); } *************** *** 101,105 **** { $$getImageBlockargs['itemFrame'] = $g2_itemFrame; ! $g2_frames = 'g2_frames=' . $g2_itemFrame; } else if ( !empty($g2_albumFrame) ) --- 101,105 ---- { $$getImageBlockargs['itemFrame'] = $g2_itemFrame; ! $g2_frames = 'g2_frames=' . $g2_itemFrame; } else if ( !empty($g2_albumFrame) ) *************** *** 108,112 **** $g2_frames = 'g2_frames=' . $g2_albumFrame; } ! else { $g2_frames = ''; --- 108,112 ---- $g2_frames = 'g2_frames=' . $g2_albumFrame; } ! else { $g2_frames = ''; *************** *** 133,137 **** // Include the gallery embed class // ! require_once($relativeG2Path . '/embed.php'); // --- 133,137 ---- // Include the gallery embed class // ! require_once($relativeG2Path . '/embed.php'); // *************** *** 155,177 **** echo($map_debug); } ! // // Init the GalleryEmbed class, passing current user_id // ! if($userdata['user_id'] != ANONYMOUS) { ! $ret = GalleryEmbed::init(array( 'embedUri' => $embedUri, 'embedPath' => $embedPath, 'relativeG2Path' => $relativeG2Path, 'loginRedirect' => $loginRedirect, 'activeUserId' => $userdata['user_id'])); ! if ($ret->isError()) { echo $ret->getAsHtml(); ! exit; ! } } ! else { ! $ret = GalleryEmbed::init(array( 'embedUri' => $embedUri, 'embedPath' => $embedPath, 'relativeG2Path' => $relativeG2Path, 'loginRedirect' => $loginRedirect, 'activeUserId' => 2)); ! if ($ret->isError()) { echo $ret->getAsHtml(); ! exit; ! } } --- 155,177 ---- echo($map_debug); } ! // // Init the GalleryEmbed class, passing current user_id // ! if($userdata['user_id'] != ANONYMOUS) { ! $ret = GalleryEmbed::init(array( 'embedUri' => $embedUri, 'embedPath' => $embedPath, 'relativeG2Path' => $relativeG2Path, 'loginRedirect' => $loginRedirect, 'activeUserId' => $userdata['user_id'])); ! if ($ret->isError()) { echo $ret->getAsHtml(); ! exit; ! } } ! else { ! $ret = GalleryEmbed::init(array( 'embedUri' => $embedUri, 'embedPath' => $embedPath, 'relativeG2Path' => $relativeG2Path, 'loginRedirect' => $loginRedirect, 'activeUserId' => 2)); ! if ($ret->isError()) { echo $ret->getAsHtml(); ! exit; ! } } *************** *** 186,194 **** header('Content-Type: text/html; charset=' . $lang['ENCODING']); } ! // // Hook up with ImageAlbum // ! $g2data = GalleryEmbed::getImageBlock($getImageBlockargs); $bodyHtml = GalleryUtilities::utf8ToUnicodeEntities($g2data[1]); // --- 186,194 ---- header('Content-Type: text/html; charset=' . $lang['ENCODING']); } ! // // Hook up with ImageAlbum // ! $g2data = GalleryEmbed::getImageBlock($getImageBlockargs); $bodyHtml = GalleryUtilities::utf8ToUnicodeEntities($g2data[1]); // |