[Linpha-cvs] SF.net SVN: linpha: [4649] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <fan...@us...> - 2006-11-13 21:58:28
|
Revision: 4649 http://svn.sourceforge.net/linpha/?rev=4649&view=rev Author: fangehrn Date: 2006-11-13 13:58:18 -0800 (Mon, 13 Nov 2006) Log Message: ----------- 2006-11-13 flo * changed behaviour of the session data on logout dont destroy the session, only delete the user sensitive informations like username, userid, user_groups and user_displayname * fixed view_basket view * fixed bug in exif index Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/lib/classes/linpha.image.class.php trunk/linpha2/lib/classes/linpha.imgview.class.php trunk/linpha2/lib/classes/linpha.metadata.class.php trunk/linpha2/lib/classes/linpha.sql.class.php trunk/linpha2/lib/modules/module.ajax.php trunk/linpha2/lib/modules/module.basket.php trunk/linpha2/templates/default/basket.html.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-11-13 21:57:49 UTC (rev 4648) +++ trunk/linpha2/ChangeLog 2006-11-13 21:58:18 UTC (rev 4649) @@ -1,3 +1,10 @@ +2006-11-13 flo + * changed behaviour of the session data + on logout dont destroy the session, only delete the user sensitive informations + like username, userid, user_groups and user_displayname + * fixed view_basket view + * fixed bug in exif index + 2006-11-13 bzrudi * fixed broken search * made image ratating by menu work (there is a know problem with the aspect Modified: trunk/linpha2/lib/classes/linpha.image.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.image.class.php 2006-11-13 21:57:49 UTC (rev 4648) +++ trunk/linpha2/lib/classes/linpha.image.class.php 2006-11-13 21:58:18 UTC (rev 4649) @@ -492,14 +492,13 @@ * @param int $linID * */ - - function rotateImageByMenuCall($direction, $linId) + function rotateImageByMenuCall($direction, $linId) { /** * Insert ration value in linpha_photos */ $rotate = $GLOBALS['linpha']->db->Execute("UPDATE ".LIN_PREFIX."photos " . - "SET rotate='".$direction."' " . + "SET rotate='".LinSql::linAddslashes($direction)."' " . "WHERE id='".$linId."'"); /** @@ -507,12 +506,12 @@ */ $imagedata = $GLOBALS['linpha']->db->GetRow("SELECT width AS width, height AS height " . "FROM ".LIN_PREFIX."photos " . - "WHERE id='".$linId."' "); + "WHERE id='".LinSql::linAddslashes($linId)."' "); $swap = $GLOBALS['linpha']->db->Execute("UPDATE ".LIN_PREFIX."photos SET " . - "width = '".$imagedata['height']."', " . - "height = '".$imagedata['width']."' " . - "WHERE id='".$linId."'"); + "width = '".LinSql::linAddslashes($imagedata['height'])."', " . + "height = '".LinSql::linAddslashes($imagedata['width'])."' " . + "WHERE id='".LinSql::linAddslashes($linId)."'"); /** * force recreate with new values Modified: trunk/linpha2/lib/classes/linpha.imgview.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-11-13 21:57:49 UTC (rev 4648) +++ trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-11-13 21:58:18 UTC (rev 4649) @@ -166,6 +166,14 @@ $this->adminCommands(); } + if(isset($_GET['linMsg'])) + { + switch($_GET['linMsg']) + { + case 'basket_added': linSysLog(i18n("Images Added To Basket.")); break; + } + } + /** * set ref urls * used in basket and ajax reloadmenu @@ -436,9 +444,9 @@ { $GLOBALS['linpha']->template->output['menu_More']['edit']['name'] = i18n("Edit"); $GLOBALS['linpha']->template->output['menu_More']['edit']['value'][0]['name'] = i18n("Rotate Left"); - $GLOBALS['linpha']->template->output['menu_More']['edit']['value'][0]['value'] = LINPHA_LINK.'&linCat=alb&linId='.$GLOBALS['linpha']->template->idCurrent.'&admin_cmd=rotate_left'; + $GLOBALS['linpha']->template->output['menu_More']['edit']['value'][0]['value'] = $GLOBALS['linpha']->template->URL_full.'&admin_cmd=rotate_left'; $GLOBALS['linpha']->template->output['menu_More']['edit']['value'][1]['name'] = i18n("Rotate Right"); - $GLOBALS['linpha']->template->output['menu_More']['edit']['value'][1]['value'] = LINPHA_LINK.'&linCat=alb&linId='.$GLOBALS['linpha']->template->idCurrent.'&admin_cmd=rotate_right';; + $GLOBALS['linpha']->template->output['menu_More']['edit']['value'][1]['value'] = $GLOBALS['linpha']->template->URL_full.'&admin_cmd=rotate_right'; } if($GLOBALS['linpha']->sql->photoIsAllowed( $this->id_parent, 'write')) Modified: trunk/linpha2/lib/classes/linpha.metadata.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.metadata.class.php 2006-11-13 21:57:49 UTC (rev 4648) +++ trunk/linpha2/lib/classes/linpha.metadata.class.php 2006-11-13 21:58:18 UTC (rev 4649) @@ -377,7 +377,7 @@ /** * there are currently only entries at level deep 2 and 5 in the array */ - $array_pieces = explode('/',$value['pathvalue']); + $array_pieces = explode('/',LinMetaData::$Tags['exif'][$key]['pathvalue']); switch(count($array_pieces)) { case 2: @@ -399,7 +399,7 @@ } break; default: - echo "Error no valid path for key: ".$key." value: ".$value['pathvalue']."<br />"; + echo "Error no valid path for key: ".$key." value: ".LinMetaData::$Tags['exif'][$key]['pathvalue']."<br />"; break; } } Modified: trunk/linpha2/lib/classes/linpha.sql.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.sql.class.php 2006-11-13 21:57:49 UTC (rev 4648) +++ trunk/linpha2/lib/classes/linpha.sql.class.php 2006-11-13 21:58:18 UTC (rev 4649) @@ -282,8 +282,16 @@ { linLog(LOG_TYPE_USER,LOG_NOTICE,'logout','User '.$_SESSION['user_name'].': logged out'); - $_SESSION = array(); // delete all session data - session_destroy(); // destroy session + /** + * do not destroy the session because we save a lot of other informations in the session + * like: ref_url, use_ajax, ... + * $_SESSION = array(); // delete all session data + * session_destroy(); // destroy session + */ + unset($_SESSION['user_name']); + unset($_SESSION['user_id']); + unset($_SESSION['user_groups']); + unset($_SESSION['user_display_name']); if(isset($_COOKIE['linpha_userid'])) { setcookie('linpha_userid'); // delete cookie linpha_userid Modified: trunk/linpha2/lib/modules/module.ajax.php =================================================================== --- trunk/linpha2/lib/modules/module.ajax.php 2006-11-13 21:57:49 UTC (rev 4648) +++ trunk/linpha2/lib/modules/module.ajax.php 2006-11-13 21:58:18 UTC (rev 4649) @@ -65,12 +65,10 @@ { if( isset($_SESSION['ref_url_base']) ) { - include_once(LINPHA_DIR . '/lib/classes/linpha.imgview.class.php'); $linpha->imgview = new linImgview(); - $linpha->imgview->setCurrentView($_SESSION['ref_modulename']); - + $linpha->template->URL_base = $_SESSION['ref_url_base']; $linpha->template->URL_full = $linpha->template->URL_base.'&linId='.$linpha->template->idCurrent; $_SESSION['ref_url_full'] = $linpha->template->URL_full; @@ -79,7 +77,6 @@ } else // return a default menu { - } $linpha->template->printMenus('home,search,login,more,icons,settings,admin',$comingfrom_ajax=true); Modified: trunk/linpha2/lib/modules/module.basket.php =================================================================== --- trunk/linpha2/lib/modules/module.basket.php 2006-11-13 21:57:49 UTC (rev 4648) +++ trunk/linpha2/lib/modules/module.basket.php 2006-11-13 21:58:18 UTC (rev 4649) @@ -25,10 +25,6 @@ if(!defined('LINPHA_DIR')) { exit(1); } -@ini_set("memory_limit", "100M"); // try to increase memory_limit -@ini_set('max_execution_time','1000'); // try remove php script time limit of 30 sec -@set_time_limit(0); // try remove php script time limit of 30 sec - /** * parse POST data and GET commands */ @@ -48,6 +44,10 @@ */ if( isset( $_REQUEST['cmd'] ) ) { + @ini_set("memory_limit", "100M"); // try to increase memory_limit + @ini_set('max_execution_time','1000'); // try remove php script time limit of 30 sec + @set_time_limit(0); // try remove php script time limit of 30 sec + switch($_REQUEST['cmd']) { case 'checkout': @@ -125,7 +125,7 @@ } } - Header("Location: ".linConvertAmp($_SESSION['basket_ref_url'])); + Header("Location: ".linConvertAmp($_SESSION['ref_url_full'])."&linMsg=basket_added"); exit(); case 'remove_all': @@ -180,7 +180,7 @@ /** * create select form */ - $GLOBALS['linpha']->template->output['select_checkout'] = '<option value=""></option>'."\n"; + $GLOBALS['linpha']->template->output['select_checkout'] = ''; if( $GLOBALS['linpha']->sql->checkPermission('basket_download') ) { $GLOBALS['linpha']->template->output['select_checkout'] .= '<option value="download"'. Modified: trunk/linpha2/templates/default/basket.html.php =================================================================== --- trunk/linpha2/templates/default/basket.html.php 2006-11-13 21:57:49 UTC (rev 4648) +++ trunk/linpha2/templates/default/basket.html.php 2006-11-13 21:58:18 UTC (rev 4649) @@ -8,18 +8,19 @@ <?php } ?> <br /><br /> + <h1 class="linStyle"><?php echo i18n("Basket"); ?></h1> - <br /> - <form name="basket_checkout" action="<?php echo $linTpl->URL_full; ?>" method="POST"> - <h2 class="linStyle">1. <?php echo i18n("Select Checkout"); ?></h2> + <?php if($linTpl->output['select_checkout']!='') { ?> + <form name="basket_checkout" action="<?php echo $linTpl->URL_full; ?>" method="POST"> + <h2 class="linStyle">1. <?php echo i18n("Select Checkout"); ?></h2> + <select name="checkout_as" class="linForms" onchange="document.basket_checkout.submit()"> + <option value=""></option> + <?php echo $linTpl->output['select_checkout']; ?> + </select> + </form> + <br /> + <?php } ?> - <select name="checkout_as" class="linForms" onchange="document.basket_checkout.submit()"> - <?php echo $linTpl->output['select_checkout']; ?> - </select> - - </form> - <br /> - <?php if(isset($_REQUEST['checkout_as'])) { @@ -190,10 +191,14 @@ foreach($linTpl->output['basket_folder_contents'][$value] AS $sub_value) { ?> - <div style='float: left;'> - <label for='<?php echo $i; ?>'><img style='cursor: pointer;' src='<?php echo LINPHA_CLIENT.'/get_thumb.php?linId='.$sub_value; ?>' class='img_thumbnail' /></label> + <div style="float: left;"> + <label for="<?php echo $i; ?>"><img style="cursor: pointer;" src="<?php + echo LINPHA_CLIENT.'/get_thumb.php?linId='.$sub_value; ?>" width="<?php + echo $GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_display']; ?>" height="<?php + echo $GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_display']; + ?>" class="img_thumbnail" /></label> <br /> - <input type='checkbox' id='<?php echo $i; ?>' name='img_id[]' value='<?php echo $sub_value; ?>'> + <input type="checkbox" id="<?php echo $i; ?>" name="img_id[]" value="<?php echo $sub_value; ?>"> </div> <?php $i++; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |