Changeset 1004 for trunk


Ignore:
Timestamp:
Jan 15, 2006, 2:45:42 PM (19 years ago)
Author:
nikrou
Message:

Improve security of sessions:

  • use only cookies to store session id on client side
  • use default php session system with database handler to store sessions on server side
Location:
trunk
Files:
43 edited

Legend:

Unmodified
Added
Removed
  • trunk/about.php

    r897 r1004  
    4646$template->assign_vars(
    4747  array(
    48     'U_HOME' => add_session_id(PHPWG_ROOT_PATH.'category.php')
     48    'U_HOME' => PHPWG_ROOT_PATH.'category.php'
    4949    )
    5050  );
  • trunk/admin.php

    r948 r1004  
    6666$template->assign_vars(
    6767  array(
    68     'U_HISTORY'=>add_session_id($link_start.'stats' ),
    69     'U_FAQ'=>add_session_id($link_start.'help' ),
    70     'U_SITES'=>add_session_id($link_start.'remote_site'),
    71     'U_MAINTENANCE'=>add_session_id($link_start.'maintenance'),
    72     'U_CONFIG_GENERAL'=>add_session_id($conf_link.'general' ),
    73     'U_CONFIG_COMMENTS'=>add_session_id($conf_link.'comments' ),
    74     'U_CONFIG_DISPLAY'=>add_session_id($conf_link.'default' ),
    75     'U_CATEGORIES'=>add_session_id($link_start.'cat_list' ),
    76     'U_MOVE'=>add_session_id($link_start.'cat_move' ),
    77     'U_CAT_UPLOAD'=>add_session_id($opt_link.'upload'),
    78     'U_CAT_COMMENTS'=>add_session_id($opt_link.'comments'),
    79     'U_CAT_VISIBLE'=>add_session_id($opt_link.'visible'),
    80     'U_CAT_STATUS'=>add_session_id($opt_link.'status'),
    81     'U_CAT_OPTIONS'=>add_session_id($link_start.'cat_options'),
    82     'U_CAT_UPDATE'=>add_session_id($link_start.'update'),
    83     'U_WAITING'=>add_session_id($link_start.'waiting' ),
    84     'U_COMMENTS'=>add_session_id($link_start.'comments' ),
    85     'U_CADDIE'=>add_session_id($link_start.'element_set&cat=caddie'),
    86     'U_THUMBNAILS'=>add_session_id($link_start.'thumbnail' ),
    87     'U_USERS'=>add_session_id($link_start.'user_list' ),
    88     'U_GROUPS'=>add_session_id($link_start.'group_list' ),
    89     'U_RETURN'=>add_session_id(PHPWG_ROOT_PATH.'category.php'),
    90     'U_ADMIN'=>add_session_id( PHPWG_ROOT_PATH.'admin.php' ),
     68    'U_HISTORY'=> $link_start.'stats',
     69    'U_FAQ'=> $link_start.'help',
     70    'U_SITES'=> $link_start.'remote_site',
     71    'U_MAINTENANCE'=> $link_start.'maintenance',
     72    'U_CONFIG_GENERAL'=> $conf_link.'general',
     73    'U_CONFIG_COMMENTS'=> $conf_link.'comments',
     74    'U_CONFIG_DISPLAY'=> $conf_link.'default',
     75    'U_CATEGORIES'=> $link_start.'cat_list',
     76    'U_MOVE'=> $link_start.'cat_move',
     77    'U_CAT_UPLOAD'=> $opt_link.'upload',
     78    'U_CAT_COMMENTS'=> $opt_link.'comments',
     79    'U_CAT_VISIBLE'=> $opt_link.'visible',
     80    'U_CAT_STATUS'=> $opt_link.'status',
     81    'U_CAT_OPTIONS'=> $link_start.'cat_options',
     82    'U_CAT_UPDATE'=> $link_start.'update',
     83    'U_WAITING'=> $link_start.'waiting',
     84    'U_COMMENTS'=> $link_start.'comments',
     85    'U_CADDIE'=> $link_start.'element_set&cat=caddie',
     86    'U_THUMBNAILS'=> $link_start.'thumbnail',
     87    'U_USERS'=> $link_start.'user_list',
     88    'U_GROUPS'=> $link_start.'group_list',
     89    'U_RETURN'=> PHPWG_ROOT_PATH.'category.php'
     90    'U_ADMIN'=> PHPWG_ROOT_PATH.'admin.php',
    9191    'L_ADMIN' => $lang['admin'],
    9292    'L_ADMIN_HINT' => $lang['hint_admin']
     
    9999    'representative',
    100100    array(
    101       'URL' => add_session_id($opt_link.'representative')
     101      'URL' => $opt_link.'representative'
    102102      )
    103103    );
  • trunk/admin/cat_list.php

    r960 r1004  
    6666
    6767$base_url = PHPWG_ROOT_PATH.'admin.php?page=cat_list';
    68 $navigation = '<a class="" href="'.add_session_id($base_url).'">';
     68$navigation = '<a class="" href="'.$base_url.'">';
    6969$navigation.= $lang['home'];
    7070$navigation.= '</a>';
     
    239239  'CATEGORIES_NAV'=>$navigation,
    240240  'NEXT_RANK'=>$next_rank,
    241   'F_ACTION'=>add_session_id($form_action),
     241  'F_ACTION'=>$form_action,
    242242 
    243243  'L_ADD_VIRTUAL'=>$lang['cat_add'],
     
    319319      'RANK'=>$category['rank']*10,
    320320
    321       'U_JUMPTO'=>
    322       add_session_id(PHPWG_ROOT_PATH.'category.php?cat='.$category['id']),
    323      
    324       'U_CHILDREN'=>
    325       add_session_id($cat_list_url.'&amp;parent_id='.$category['id']),
    326      
    327       'U_EDIT'=>
    328       add_session_id($base_url.'cat_modify&amp;cat_id='.$category['id'])
     321      'U_JUMPTO'=>PHPWG_ROOT_PATH.'category.php?cat='.$category['id'],
     322      'U_CHILDREN'=>$cat_list_url.'&amp;parent_id='.$category['id'],     
     323      'U_EDIT'=>$base_url.'cat_modify&amp;cat_id='.$category['id']
    329324      )
    330325    );
     
    335330      'category.delete',
    336331      array(
    337         'URL'=>add_session_id($self_url.'&amp;delete='.$category['id'])
     332        'URL'=>$self_url.'&amp;delete='.$category['id']
    338333        )
    339334      );
     
    345340      'category.elements',
    346341      array(
    347         'URL'=>add_session_id($base_url.'element_set&amp;cat='.$category['id'])
     342        'URL'=>$base_url.'element_set&amp;cat='.$category['id']
    348343        )
    349344      );
     
    355350      'category.permissions',
    356351      array(
    357         'URL'=>add_session_id($base_url.'cat_perm&amp;cat='.$category['id'])
     352        'URL'=>$base_url.'cat_perm&amp;cat='.$category['id']
    358353        )
    359354      );
  • trunk/admin/cat_modify.php

    r881 r1004  
    172172  'L_SET_RANDOM_REPRESENTANT'=>$lang['cat_representant'],
    173173
    174   'U_JUMPTO'=>
    175     add_session_id(PHPWG_ROOT_PATH.'category.php?cat='.$category['id']),
    176   'U_CHILDREN'=>
    177     add_session_id($cat_list_url.'&amp;parent_id='.$category['id']),
     174  'U_JUMPTO'=>PHPWG_ROOT_PATH.'category.php?cat='.$category['id'],
     175  'U_CHILDREN'=>$cat_list_url.'&amp;parent_id='.$category['id'],
    178176  'U_HELP' => PHPWG_ROOT_PATH.'/popuphelp.php?page=cat_modify',
    179177   
    180   'F_ACTION'=>add_session_id($form_action)
     178  'F_ACTION'=>$form_action
    181179  ));
    182180
     
    187185    'permissions',
    188186    array(
    189       'URL'=>add_session_id($base_url.'cat_perm&amp;cat='.$category['id'])
     187      'URL'=>$base_url.'cat_perm&amp;cat='.$category['id']
    190188        )
    191189    );
     
    198196    'elements',
    199197    array(
    200       'URL'=>add_session_id($base_url.'element_set&amp;cat='.$category['id'])
     198      'URL'=>$base_url.'element_set&amp;cat='.$category['id']
    201199      )
    202200    );
     
    268266    'delete',
    269267    array(
    270       'URL'=>add_session_id($self_url.'&amp;delete='.$category['id'])
     268      'URL'=>$self_url.'&amp;delete='.$category['id']
    271269      )
    272270    );
  • trunk/admin/cat_move.php

    r881 r1004  
    6969$template->assign_vars(
    7070  array(
    71     'F_ACTION' => add_session_id(PHPWG_ROOT_PATH.'admin.php?page=cat_move'),
     71    'F_ACTION' => PHPWG_ROOT_PATH.'admin.php?page=cat_move',
    7272    )
    7373  );
  • trunk/admin/cat_options.php

    r862 r1004  
    154154    'U_HELP' => PHPWG_ROOT_PATH.'/popuphelp.php?page=cat_options',
    155155   
    156     'F_ACTION'=>add_session_id($base_url.$page['section'])
     156    'F_ACTION'=>$base_url.$page['section']
    157157   )
    158158 );
  • trunk/admin/cat_perm.php

    r873 r1004  
    208208        ),
    209209    'U_HELP' => PHPWG_ROOT_PATH.'/popuphelp.php?page=cat_perm',
    210     'F_ACTION' =>
    211       add_session_id(
    212         PHPWG_ROOT_PATH.'admin.php?page=cat_perm&amp;cat='.$page['cat']
    213         )
     210    'F_ACTION' => PHPWG_ROOT_PATH.'admin.php?page=cat_perm&amp;cat='.$page['cat']
    214211    )
    215212  );
  • trunk/admin/comments.php

    r839 r1004  
    118118$template->assign_vars(
    119119  array(
    120     'F_ACTION' => add_session_id(PHPWG_ROOT_PATH.'admin.php?page=comments')
     120    'F_ACTION' => PHPWG_ROOT_PATH.'admin.php?page=comments'
    121121    )
    122122  );
     
    142142    array(
    143143      'U_PICTURE' =>
    144         add_session_id(
    145144          PHPWG_ROOT_PATH.'admin.php?page=picture_modify'.
    146           '&amp;image_id='.$row['image_id']
    147           ),
     145          '&amp;image_id='.$row['image_id'],
    148146      'ID' => $row['id'],
    149147      'TN_SRC' => get_thumbnail_src($row['path'], @$row['tn_ext']),
  • trunk/admin/configuration.php

    r960 r1004  
    150150    'U_HELP' => PHPWG_ROOT_PATH.'/popuphelp.php?page=configuration',
    151151   
    152     'F_ACTION'=>add_session_id($action)
     152    'F_ACTION'=>$action
    153153    ));
    154154
  • trunk/admin/element_set_unit.php

    r875 r1004  
    223223            $row['name'] : get_name_from_file($row['file']),
    224224        'U_EDIT' =>
    225           add_session_id(
    226225            PHPWG_ROOT_PATH.'admin.php?page=picture_modify'.
    227             '&amp;image_id='.$row['id']
    228             ),
     226            '&amp;image_id='.$row['id'],
    229227        'ID' => $row['id'],
    230228        'FILENAME' => $row['path'],
  • trunk/admin/group_list.php

    r815 r1004  
    125125$template->assign_vars(
    126126  array(
    127     'F_ADD_ACTION' =>
    128       add_session_id(PHPWG_ROOT_PATH.'admin.php?page=group_list')
     127    'F_ADD_ACTION' => PHPWG_ROOT_PATH.'admin.php?page=group_list'
    129128    )
    130129  );
  • trunk/admin/group_perm.php

    r817 r1004  
    141141   
    142142    'F_ACTION' =>
    143       add_session_id(
    144143        PHPWG_ROOT_PATH.
    145144        'admin.php?page=group_perm&amp;group_id='.
    146145        $page['group']
    147         )
    148146    )
    149147  );
  • trunk/admin/intro.php

    r861 r1004  
    176176    'DB_GROUPS' => sprintf(l10n('%d groups'), $nb_groups),
    177177    'DB_COMMENTS' => sprintf(l10n('%d comments'), $nb_comments),
    178     'U_CHECK_UPGRADE' =>
    179       add_session_id(PHPWG_ROOT_PATH.'admin.php?action=check_upgrade'),
    180     'U_PHPINFO' =>
    181       add_session_id(PHPWG_ROOT_PATH.'admin.php?action=phpinfo')
     178    'U_CHECK_UPGRADE' => PHPWG_ROOT_PATH.'admin.php?action=check_upgrade',
     179    'U_PHPINFO' => PHPWG_ROOT_PATH.'admin.php?action=phpinfo'
    182180    )
    183181  );
     
    216214    'waiting',
    217215    array(
    218       'URL' => add_session_id(PHPWG_ROOT_PATH.'admin.php?page=waiting'),
     216      'URL' => PHPWG_ROOT_PATH.'admin.php?page=waiting',
    219217      'INFO' => sprintf(l10n('%d waiting for validation'), $nb_waiting)
    220218      )
     
    235233    'unvalidated',
    236234    array(
    237       'URL' => add_session_id(PHPWG_ROOT_PATH.'admin.php?page=comments'),
     235      'URL' => PHPWG_ROOT_PATH.'admin.php?page=comments',
    238236      'INFO' => sprintf(l10n('%d waiting for validation'), $nb_comments)
    239237      )
  • trunk/admin/maintenance.php

    r858 r1004  
    9999$template->assign_vars(
    100100  array(
    101     'U_MAINT_CATEGORIES' => add_session_id($start_url.'categories'),
    102     'U_MAINT_IMAGES' => add_session_id($start_url.'images'),
    103     'U_MAINT_HISTORY' => add_session_id($start_url.'history'),
    104     'U_MAINT_SESSIONS' => add_session_id($start_url.'sessions'),
    105     'U_MAINT_FEEDS' => add_session_id($start_url.'feeds'),
     101    'U_MAINT_CATEGORIES' => $start_url.'categories',
     102    'U_MAINT_IMAGES' => $start_url.'images',
     103    'U_MAINT_HISTORY' => $start_url.'history',
     104    'U_MAINT_SESSIONS' => $start_url.'sessions',
     105    'U_MAINT_FEEDS' => $start_url.'feeds',
    106106    'U_HELP' => PHPWG_ROOT_PATH.'/popuphelp.php?page=maintenance',
    107107    )
  • trunk/admin/picture_modify.php

    r825 r1004  
    196196  array(
    197197    'U_SYNC' =>
    198       add_session_id(
    199198        PHPWG_ROOT_PATH.'admin.php?page=picture_modify'.
    200199        '&amp;image_id='.$_GET['image_id'].
    201200        (isset($_GET['cat_id']) ? '&amp;cat_id='.$_GET['cat_id'] : '').
    202         '&amp;sync_metadata=1'
    203         ),
     201        '&amp;sync_metadata=1',
    204202   
    205203    'PATH'=>$row['path'],
     
    231229 
    232230    'F_ACTION' =>
    233       add_session_id(
    234231        PHPWG_ROOT_PATH.'admin.php'
    235232        .get_query_string_diff(array('sync_metadata'))
    236         )
    237233    )
    238234  );
  • trunk/admin/remote_site.php

    r927 r1004  
    516516    'U_HELP' => PHPWG_ROOT_PATH.'/popuphelp.php?page=remote_site',
    517517   
    518     'F_ACTION'=>add_session_id(PHPWG_ROOT_PATH.'admin.php?page=remote_site')
     518    'F_ACTION'=>PHPWG_ROOT_PATH.'admin.php?page=remote_site'
    519519   )
    520520 );
     
    687687      array(
    688688        'URL' => $url,
    689         'U_UPDATE' => add_session_id($base_url.'local_update')
     689        'U_UPDATE' => $base_url.'local_update'
    690690        )
    691691      );
     
    732732    array(
    733733      'NAME' => $row['galleries_url'],
    734       'U_GENERATE' => add_session_id($base_url.'generate'),
    735       'U_UPDATE' => add_session_id($base_url.'update'),
    736       'U_CLEAN' => add_session_id($base_url.'clean'),
    737       'U_DELETE' => add_session_id($base_url.'delete')
     734      'U_GENERATE' => $base_url.'generate',
     735      'U_UPDATE' => $base_url.'update',
     736      'U_CLEAN' => $base_url.'clean',
     737      'U_DELETE' => $base_url.'delete'
    738738     )
    739739   );
  • trunk/admin/stats.php

    r918 r1004  
    6363  $title_page=$lang['stats_day_title'].' du '.$date_of_day;
    6464  $url_back = PHPWG_ROOT_PATH."admin.php?page=stats";
    65   $url_back = add_session_id($url_back);
     65  $url_back = $url_back;
    6666  $title_details='<a href='.$url_back.'>'.$lang['stats_day_title'].'</a>';
    6767  $title_day = $date_of_day;
     
    7272  $title_page=$lang['stats_month_title'].' : '.$date_of_day;
    7373  $url_back = PHPWG_ROOT_PATH."admin.php?page=stats";
    74   $url_back = add_session_id($url_back);
     74  $url_back = $url_back;
    7575  $title_details='<a href='.$url_back.'>'.$lang['stats_day_title'].'</a>';
    7676  $title_day=$lang['today'];
     
    106106  'L_STAT_PICTURE'=>$lang['stats_picture'],
    107107 
    108   'IMG_REPORT'=>add_session_id($url_img)
     108  'IMG_REPORT'=>$url_img
    109109  ));
    110110
     
    142142      ;
    143143
    144     $value = '<a href="'.add_session_id($url).'">';
     144    $value = '<a href="'.$url.'">';
    145145    $value.= $row['d'].' ('.$week_day.')';
    146146    $value.= "</a>";
     
    161161      ;
    162162   
    163     $value = '<a href="'.add_session_id($url).'">';
     163    $value = '<a href="'.$url.'">';
    164164    $value.= $lang['month'][$row['m']].' '.$row['y'];
    165165    $value.= "</a>";
  • trunk/admin/thumbnail.php

    r862 r1004  
    359359    'params',
    360360    array(
    361       'F_ACTION'=>add_session_id($form_url),
     361      'F_ACTION'=>$form_url,
    362362      $gdlabel=>'checked="checked"',
    363363      $nlabel=>'checked="checked"',
  • trunk/admin/user_list.php

    r998 r1004  
    425425$template->set_filenames(array('user_list'=>'admin/user_list.tpl'));
    426426
    427 $base_url = add_session_id(PHPWG_ROOT_PATH.'admin.php?page=user_list');
     427$base_url = PHPWG_ROOT_PATH.'admin.php?page=user_list';
    428428
    429429if (isset($_GET['start']) and is_numeric($_GET['start']))
     
    791791      'ID' => $local_user['id'],
    792792      'CHECKED' => $checked,
    793       'U_MOD' => add_session_id($profile_url.$local_user['id']),
    794       'U_PERM' => add_session_id($perm_url.$local_user['id']),
     793      'U_MOD' => $profile_url.$local_user['id'],
     794      'U_PERM' => $perm_url.$local_user['id'],
    795795      'USERNAME' => $local_user['username'],
    796796      'STATUS' => $lang['user_status_'.$local_user['status']],
  • trunk/admin/user_perm.php

    r818 r1004  
    134134   
    135135    'F_ACTION' =>
    136       add_session_id(
    137136        PHPWG_ROOT_PATH.
    138137        'admin.php?page=user_perm'.
    139138        '&amp;user_id='.$page['user']
    140         )
    141139    )
    142140  );
  • trunk/admin/waiting.php

    r849 r1004  
    149149  'L_DELETE'=>$lang['delete'],
    150150 
    151   'F_ACTION'=>add_session_id(str_replace( '&', '&amp;', $_SERVER['REQUEST_URI'] ))
     151  'F_ACTION'=>str_replace( '&', '&amp;', $_SERVER['REQUEST_URI'])
    152152  ));
    153153 
  • trunk/category.php

    r1000 r1004  
    3232if ( isset( $_GET['act'] )
    3333     and $_GET['act'] == 'logout'
    34      and isset( $_COOKIE['id'] ) )
     34     and isset( $_COOKIE[session_name()] ) )
    3535{
    3636  // cookie deletion if exists
    37   setcookie( 'id', '', 0, cookie_path() );
     37  $_SESSION = array();
     38  session_unset();
     39  session_destroy();
     40  setcookie(session_name(),'',0,'/');
    3841  $url = 'category.php';
    3942  redirect( $url );
     
    164167  'L_REMEMBER_ME' => $lang['remember_me'],
    165168 
    166   'F_IDENTIFY' => add_session_id( PHPWG_ROOT_PATH.'identification.php' ),
     169  'F_IDENTIFY' => PHPWG_ROOT_PATH.'identification.php',
    167170  'T_RECENT' => $icon_recent,
    168171
    169   'U_HOME' => add_session_id( PHPWG_ROOT_PATH.'category.php' ),
    170   'U_REGISTER' => add_session_id( PHPWG_ROOT_PATH.'register.php' ),
    171   'U_LOST_PASSWORD' => add_session_id(PHPWG_ROOT_PATH.'password.php'),
     172  'U_HOME' => PHPWG_ROOT_PATH.'category.php',
     173  'U_REGISTER' => PHPWG_ROOT_PATH.'register.php',
     174  'U_LOST_PASSWORD' => PHPWG_ROOT_PATH.'password.php',
    172175  'U_LOGOUT' => PHPWG_ROOT_PATH.'category.php?act=logout',
    173   'U_ADMIN'=>add_session_id( PHPWG_ROOT_PATH.'admin.php' ),
    174   'U_PROFILE'=>add_session_id(PHPWG_ROOT_PATH.'profile.php')
     176  'U_ADMIN'=> PHPWG_ROOT_PATH.'admin.php',
     177  'U_PROFILE'=> PHPWG_ROOT_PATH.'profile.php'
    175178  )
    176179);
     
    199202    'special_cat',
    200203    array(
    201       'URL' => add_session_id(PHPWG_ROOT_PATH.'category.php?cat=fav'),
     204      'URL' => PHPWG_ROOT_PATH.'category.php?cat=fav',
    202205      'TITLE' => $lang['favorite_cat_hint'],
    203206      'NAME' => $lang['favorite_cat']
     
    208211  'special_cat',
    209212  array(
    210     'URL' => add_session_id(PHPWG_ROOT_PATH.'category.php?cat=most_visited'),
     213    'URL' => PHPWG_ROOT_PATH.'category.php?cat=most_visited',
    211214    'TITLE' => $lang['most_visited_cat_hint'],
    212215    'NAME' => $lang['most_visited_cat']
     
    218221    'special_cat',
    219222    array(
    220       'URL' => add_session_id(PHPWG_ROOT_PATH.'category.php?cat=best_rated'),
     223      'URL' => PHPWG_ROOT_PATH.'category.php?cat=best_rated',
    221224      'TITLE' => $lang['best_rated_cat_hint'],
    222225      'NAME' => $lang['best_rated_cat']
     
    228231  'special_cat',
    229232  array(
    230     'URL' => add_session_id(PHPWG_ROOT_PATH.'random.php'),
     233    'URL' => PHPWG_ROOT_PATH.'random.php',
    231234    'TITLE' => $lang['random_cat_hint'],
    232235    'NAME' => $lang['random_cat']
     
    236239  'special_cat',
    237240  array(
    238     'URL' => add_session_id(PHPWG_ROOT_PATH.'category.php?cat=recent_pics'),
     241    'URL' => PHPWG_ROOT_PATH.'category.php?cat=recent_pics',
    239242    'TITLE' => $lang['recent_pics_cat_hint'],
    240243    'NAME' => $lang['recent_pics_cat']
     
    244247  'special_cat',
    245248  array(
    246     'URL' => add_session_id(PHPWG_ROOT_PATH.'category.php?cat=recent_cats'),
     249    'URL' => PHPWG_ROOT_PATH.'category.php?cat=recent_cats',
    247250    'TITLE' => $lang['recent_cats_cat_hint'],
    248251    'NAME' => $lang['recent_cats_cat']
     
    252255  'special_cat',
    253256  array(
    254     'URL' => add_session_id(PHPWG_ROOT_PATH.'category.php?cat=calendar'),
     257    'URL' => PHPWG_ROOT_PATH.'category.php?cat=calendar',
    255258    'TITLE' => $lang['calendar_hint'],
    256259    'NAME' => $lang['calendar']
     
    291294'TITLE'=>$lang['hint_search'],
    292295'NAME'=>$lang['search'],
    293 'U_SUMMARY'=>add_session_id( 'search.php' ),
     296'U_SUMMARY'=> 'search.php',
    294297));
    295298
     
    298301'TITLE'=>$lang['hint_comments'],
    299302'NAME'=>$lang['comments'],
    300 'U_SUMMARY'=>add_session_id( 'comments.php' ),
     303'U_SUMMARY'=> 'comments.php',
    301304));
    302305
     
    305308'TITLE'=>$lang['about_page_title'],
    306309'NAME'=>$lang['About'],
    307 'U_SUMMARY'=>add_session_id( 'about.php?'.str_replace( '&', '&amp;', $_SERVER['QUERY_STRING'] ) )
     310'U_SUMMARY'=> 'about.php?'.str_replace( '&', '&amp;', $_SERVER['QUERY_STRING'] )
    308311));
    309312
     
    314317    'TITLE'=>l10n('notification'),
    315318    'NAME'=>l10n('Notification'),
    316     'U_SUMMARY'=>add_session_id(PHPWG_ROOT_PATH.'notification.php')
     319    'U_SUMMARY'=> PHPWG_ROOT_PATH.'notification.php'
    317320));
    318321
     
    325328    array(
    326329      'URL' =>
    327         add_session_id(
    328330          PHPWG_ROOT_PATH.'admin.php?page=cat_modify'
    329331          .'&amp;cat_id='.$page['cat']
    330           )
    331332      )
    332333    );
     
    353354      array(
    354355        'URL' =>
    355           add_session_id(
    356356            PHPWG_ROOT_PATH.'category.php'
    357357            .get_query_string_diff(array('caddie')).'&amp;caddie=1')
    358         )
    359358      );
    360359  }
     
    384383    $template->assign_block_vars(
    385384      'upload',
    386       array('U_UPLOAD'=>add_session_id( $url ))
     385      array('U_UPLOAD'=> $url )
    387386      );
    388387  }
  • trunk/comments.php

    r889 r1004  
    180180    'F_AUTHOR'=>@$_GET['author'],
    181181   
    182     'U_HOME' => add_session_id(PHPWG_ROOT_PATH.'category.php')
     182    'U_HOME' => PHPWG_ROOT_PATH.'category.php'
    183183    )
    184184  );
     
    415415        'TITLE_IMG'=>$name,
    416416        'I_THUMB'=>$thumbnail_src,
    417         'U_THUMB'=>add_session_id($url)
     417        'U_THUMB'=>$url
    418418        ));
    419419   
     
    427427      'comment',
    428428      array(
    429         'U_PICTURE' => add_session_id($url),
     429        'U_PICTURE' => $url,
    430430        'TN_SRC' => $thumbnail_src,
    431431        'AUTHOR' => $author,
  • trunk/identification.php

    r866 r1004  
    5252      $session_length = $conf['remember_me_length'];
    5353    }
    54     $session_id = session_create($row['id'], $session_length);
    55     redirect('category.php?id='.$session_id);
     54    session_start();
     55    $_SESSION['id'] = $row['id'];
     56    redirect('category.php');
    5657  }
    5758  else
     
    8182    'L_REMEMBER_ME'=>$lang['remember_me'],
    8283
    83     'U_REGISTER' => add_session_id(PHPWG_ROOT_PATH.'register.php'),
    84     'U_LOST_PASSWORD' => add_session_id(PHPWG_ROOT_PATH.'password.php'),
    85     'U_HOME' => add_session_id(PHPWG_ROOT_PATH.'category.php'),
     84    'U_REGISTER' => PHPWG_ROOT_PATH.'register.php',
     85    'U_LOST_PASSWORD' => PHPWG_ROOT_PATH.'password.php',
     86    'U_HOME' => PHPWG_ROOT_PATH.'category.php',
    8687   
    87     'F_LOGIN_ACTION' => add_session_id(PHPWG_ROOT_PATH.'identification.php')
     88    'F_LOGIN_ACTION' => PHPWG_ROOT_PATH.'identification.php'
    8889    ));
    8990
  • trunk/include/category_calendar.inc.php

    r896 r1004  
    6868    $url = PHPWG_ROOT_PATH.'category.php?cat=calendar';
    6969    $url.= '&amp;year='.$calendar_year;
    70     $url = add_session_id($url);
    7170    $years_nav_bar.= ' <a href="'.$url.'">'.$calendar_year.'</a>';
    7271  }
     
    125124      $url.= $page['calendar_year'].'.'.sprintf('%02s', $calendar_month);
    126125      $months_nav_bar.= ' ';
    127       $months_nav_bar.= '<a href="'.add_session_id($url).'">';
     126      $months_nav_bar.= '<a href="'.$url.'">';
    128127      $months_nav_bar.= $lang['month'][(int)$calendar_month];
    129128      $months_nav_bar.= '</a>';
     
    249248        'IMAGE_TITLE'=>$thumbnail_title,
    250249         
    251         'U_IMG_LINK'=>add_session_id($url_link)
     250        'U_IMG_LINK'=>$url_link
    252251       )
    253252     );
     
    309308        'IMAGE_TITLE'=>$thumbnail_title,
    310309         
    311         'U_IMG_LINK'=>add_session_id($url_link)
     310        'U_IMG_LINK'=>$url_link
    312311       )
    313312     );
     
    363362        'IMAGE_TITLE'=>$thumbnail_title,
    364363         
    365         'U_IMG_LINK'=>add_session_id($url_link)
     364        'U_IMG_LINK'=>$url_link
    366365         )
    367366       );
     
    437436        'IMAGE_TITLE'=>$thumbnail_title,
    438437         
    439         'U_IMG_LINK'=>add_session_id($url_link)
     438        'U_IMG_LINK'=>$url_link
    440439         )
    441440       );
  • trunk/include/category_default.inc.php

    r803 r1004  
    9090      'IMAGE_TS'           => get_icon($row['date_available']),
    9191     
    92       'U_IMG_LINK'         => add_session_id($url_link)
     92      'U_IMG_LINK'         => $url_link
    9393      )
    9494    );
  • trunk/include/category_recent_cats.inc.php

    r760 r1004  
    7979      'IMAGE_TITLE'             => $lang['hint_category'],
    8080       
    81       'U_IMG_LINK'              => add_session_id($url_link)
     81      'U_IMG_LINK'              => $url_link
    8282      )
    8383    );
  • trunk/include/category_subcats.inc.php

    r809 r1004  
    153153        'IMAGE_TS' => get_icon(@$item['date_last']),
    154154        'U_IMG_LINK' =>
    155           add_session_id(PHPWG_ROOT_PATH.'category.php?cat='.$item['category'])
     155          PHPWG_ROOT_PATH.'category.php?cat='.$item['category']
    156156        )
    157157      );
  • trunk/include/config_default.inc.php

    r953 r1004  
    265265// +-----------------------------------------------------------------------+
    266266
     267// specifies to use cookie to store the session id on client side
     268$conf['session_use_cookies'] = 1;
     269
     270// specifies to only use cookie to store the session id on client side
     271$conf['session_use_only_cookies'] = 1;
     272
     273// do not use transparent session id support
     274$conf['session_use_trans_sid'] = 0;
     275
     276// specifies the name of the session which is used as cookie name
     277$conf['session_name'] = 'pwg_id';
     278
     279// comment the line below to use file handler for sessions.
     280$conf['session_save_handler'] = 'db';
     281
    267282// authorize_remembering : permits user to stay logged for a long time. It
    268283// creates a cookie on client side.
     
    275290// session_length : time of validity for normal session, in seconds.
    276291$conf['session_length'] = 3600;
    277 
    278 // session_id_size : a session identifier is compound of alphanumeric
    279 // characters and is case sensitive. Each character is among 62
    280 // possibilities. The number of possible sessions is
    281 // 62^$conf['session_id_size'].
    282 //
    283 // 62^5  =             916,132,832
    284 // 62^10 = 839,299,365,868,340,224
    285 //
    286 $conf['session_id_size'] = 10;
    287292
    288293// +-----------------------------------------------------------------------+
  • trunk/include/functions_category.inc.php

    r867 r1004  
    4848  {
    4949    echo '<div style="text-align:center;">'.$lang['access_forbiden'].'<br />';
    50     echo '<a href="'.add_session_id( './category.php' ).'">';
     50    echo '<a href="./category.php">';
    5151    echo $lang['thumbnails'].'</a></div>';
    5252    exit();
  • trunk/include/functions_html.inc.php

    r976 r1004  
    8282    {
    8383      $navbar.= '<a href="';
    84       $navbar.= add_session_id($url.'&amp;start=0');
     84      $navbar.= $url.'&amp;start=0';
    8585      $navbar.= '" class="'.$link_class.'">'.$lang['first_page'];
    8686      $navbar.= '</a>';
     
    9696      $previous = $start - $nb_element_page;
    9797      $navbar.= '<a href="';
    98       $navbar.= add_session_id( $url.'&amp;start='.$previous );
     98      $navbar.= $url.'&amp;start='.$previous;
    9999      $navbar.= '" class="'.$link_class.'">'.$lang['previous_page'];
    100100      $navbar.= '</a>';
     
    109109    {
    110110      $navbar.= '&nbsp;<a href="';
    111       $navbar.= add_session_id($url.'&amp;start=0');
     111      $navbar.= $url.'&amp;start=0';
    112112      $navbar.= '" class="'.$link_class.'">1</a>';
    113113      if ($cur_page > $pages_around + 2)
     
    130130        $temp_start = ($i - 1) * $nb_element_page;
    131131        $navbar.= '&nbsp;<a href="';
    132         $navbar.= add_session_id($url.'&amp;start='.$temp_start);
     132        $navbar.= $url.'&amp;start='.$temp_start;
    133133        $navbar.= '" class="'.$link_class.'">'.$i.'</a>';
    134134      }
     
    148148      }
    149149      $navbar.= ' <a href="';
    150       $navbar.= add_session_id($url.'&amp;start='.$temp_start);
     150      $navbar.= $url.'&amp;start='.$temp_start;
    151151      $navbar.= '" class="'.$link_class.'">'.$maximum.'</a>';
    152152    }
     
    159159      $next = $start + $nb_element_page;
    160160      $navbar.= '<a href="';
    161       $navbar.= add_session_id( $url.'&amp;start='.$next );
     161      $navbar.= $url.'&amp;start='.$next;
    162162      $navbar.= '" class="'.$link_class.'">'.$lang['next_page'].'</a>';
    163163    }
     
    173173      $temp_start = ($maximum - 1) * $nb_element_page;
    174174      $navbar.= '<a href="';
    175       $navbar.= add_session_id($url.'&amp;start='.$temp_start);
     175      $navbar.= $url.'&amp;start='.$temp_start;
    176176      $navbar.= '" class="'.$link_class.'">'.$lang['last_page'];
    177177      $navbar.= '</a>';
     
    242242    {
    243243      $output.= '<a class=""';
    244       $output.= ' href="'.add_session_id(PHPWG_ROOT_PATH.$url.$id).'">';
     244      $output.= ' href="'.PHPWG_ROOT_PATH.$url.$id.'">';
    245245      $output.= $name.'</a>';
    246246    }
     
    311311      $output.= '
    312312<a class=""
    313    href="'.add_session_id(PHPWG_ROOT_PATH.$url.$category_id).'">'.$name.'</a>';
     313   href="'.PHPWG_ROOT_PATH.$url.$category_id.'">'.$name.'</a>';
    314314    }
    315315  }
     
    370370    $menu.= '>';
    371371 
    372     $url = add_session_id(PHPWG_ROOT_PATH.'category.php?cat='.$category['id']);
     372    $url = PHPWG_ROOT_PATH.'category.php?cat='.$category['id'];
    373373    $menu.= "\n".'<a href="'.$url.'">'.$category['name'].'</a>';
    374374
  • trunk/include/functions_session.inc.php

    r808 r1004  
    2626// +-----------------------------------------------------------------------+
    2727
    28 // The function generate_key creates a string with pseudo random characters.
    29 // the size of the string depends on the $conf['session_id_size'].
    30 // Characters used are a-z A-Z and numerical values. Examples :
    31 //                    "Er4Tgh6", "Rrp08P", "54gj"
    32 // input  : none (using global variable)
    33 // output : $key
    34 function generate_key($size)
     28if (isset($conf['session_save_handler']) and ($conf['session_save_handler'] == 'db')) {
     29  session_set_save_handler('pwg_session_open',
     30                           'pwg_session_close',
     31                           'pwg_session_read',
     32                           'pwg_session_write',
     33                           'pwg_session_destroy',
     34                           'pwg_session_gc'
     35                           );
     36}
     37
     38ini_set('session.use_cookies', $conf['session_use_cookies']);
     39ini_set('session.use_only_cookies', $conf['session_use_only_cookies']);
     40ini_set('session.use_trans_sid', $conf['session_use_trans_sid']);
     41ini_set('session.name', $conf['session_name']);
     42
     43function pwg_session_open($path, $name)
     44{
     45  return true;
     46}
     47
     48function pwg_session_close()
     49{
     50  pwg_session_gc();
     51  return true;
     52}
     53
     54function pwg_session_read($session_id)
     55{
     56  $query = "SELECT data FROM " . SESSIONS_TABLE;
     57  $query .= " WHERE id = '$session_id'";
     58  $result = pwg_query($query);
     59  if ($result) {
     60    $row = mysql_fetch_assoc($result);
     61    return $row['data'];
     62  } else {
     63    return '';
     64  }
     65}
     66
     67function pwg_session_write($session_id, $data)
     68{
     69  $query = "SELECT id FROM " . SESSIONS_TABLE;
     70  $query .= " WHERE id = '$session_id'";
     71  $result = pwg_query($query);
     72  if (mysql_num_rows($result)) {
     73    $query = "UPDATE " . SESSIONS_TABLE . " SET expiration = now()";
     74    $query .= " WHERE id = '$session_id'";   
     75    pwg_query($query);
     76  } else {
     77    $query = "INSERT INTO " . SESSIONS_TABLE . " (id,data,expiration)";
     78    $query .= " VALUES('$session_id','$data',now())";
     79    pwg_query($query);   
     80  }
     81  return true;
     82}
     83
     84function pwg_session_destroy($session_id)
     85{
     86  $query = "DELETE FROM " . SESSIONS_TABLE;
     87  $query .= " WHERE id = '$session_id'";
     88  pwg_query($query);
     89  return true;
     90}
     91
     92function pwg_session_gc()
    3593{
    3694  global $conf;
    3795
    38   $md5 = md5(substr(microtime(), 2, 6));
    39   $init = '';
    40   for ( $i = 0; $i < strlen( $md5 ); $i++ )
    41   {
    42     if ( is_numeric( $md5[$i] ) ) $init.= $md5[$i];
    43   }
    44   $init = substr( $init, 0, 8 );
    45   mt_srand( $init );
    46   $key = '';
    47   for ( $i = 0; $i < $size; $i++ )
    48   {
    49     $c = mt_rand( 0, 2 );
    50     if ( $c == 0 )      $key .= chr( mt_rand( 65, 90 ) );
    51     else if ( $c == 1 ) $key .= chr( mt_rand( 97, 122 ) );
    52     else                $key .= mt_rand( 0, 9 );
    53   }
    54   return $key;
    55 }
    56 
    57 /**
    58  * create a new session and returns the session identifier
    59  *
    60  * - find a non-already-used session key
    61  * - create a session in database
    62  * - return session identifier
    63  *
    64  * @param int userid
    65  * @param int session_lentgh : in seconds
    66  * @return string
    67  */
    68 function session_create($userid, $session_length)
    69 {
    70   global $conf;
    71 
    72   // 1. searching an unused session key
    73   $id_found = false;
    74   while (!$id_found)
    75   {
    76     $generated_id = generate_key($conf['session_id_size']);
    77     $query = '
    78 SELECT id
    79   FROM '.SESSIONS_TABLE.'
    80   WHERE id = \''.$generated_id.'\'
    81 ;';
    82     $result = pwg_query($query);
    83     if (mysql_num_rows($result) == 0)
    84     {
    85       $id_found = true;
    86     }
    87   }
    88   // 3. inserting session in database
    89   $query = '
    90 INSERT INTO '.SESSIONS_TABLE.'
    91   (id,user_id,expiration)
    92   VALUES
    93   (\''.$generated_id.'\','.$userid.',
    94    ADDDATE(NOW(), INTERVAL '.$session_length.' SECOND))
    95 ;';
     96  $query = "DELETE FROM " . SESSIONS_TABLE;
     97  $query .= " WHERE UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(expiration) > " . $conf['session_length'];
    9698  pwg_query($query);
    97 
    98   $expiration = $session_length + time();
    99   setcookie('id', $generated_id, $expiration, cookie_path());
    100                
    101   return $generated_id;
    102 }
    103 
    104 // add_session_id adds the id of the session to the string given in
    105 // parameter as $url. If the session id is the first parameter to the url,
    106 // it is preceded by a '?', else it is preceded by a '&amp;'. If the
    107 // parameter $redirect is set to true, '&' is used instead of '&'.
    108 function add_session_id( $url, $redirect = false )
    109 {
    110   global $page, $user, $conf;
    111 
    112   if ($user['is_the_guest']
    113       or $user['has_cookie']
    114       or $conf['apache_authentication'])
    115   {
    116     return $url;
    117   }
    118 
    119   if (preg_match('/\.php\?/', $url))
    120   {
    121     $separator = $redirect ? '&' : '&amp;';
    122   }
    123   else
    124   {
    125     $separator = '?';
    126   }
    127 
    128   return $url.$separator.'id='.$page['session_id'];
    129 }
    130 
    131 // cookie_path returns the path to use for the PhpWebGallery cookie.
    132 // If PhpWebGallery is installed on :
    133 // http://domain.org/meeting/gallery/category.php
    134 // cookie_path will return : "/meeting/gallery"
    135 function cookie_path()
    136 {
    137   return substr($_SERVER['PHP_SELF'],0,strrpos( $_SERVER['PHP_SELF'],'/'));
     99  return true;
    138100}
    139101?>
  • trunk/include/page_header.php

    r850 r1004  
    6262    array(
    6363      'REFRESH_TIME' => $refresh,
    64       'U_REFRESH' => add_session_id( $url_link )
     64      'U_REFRESH' => $url_link
    6565      ));
    6666  $template->assign_block_vars('refresh', array());
  • trunk/include/user.inc.php

    r817 r1004  
    2727
    2828// retrieving connected user informations
    29 if (isset($_COOKIE['id']))
     29if (isset($_COOKIE[session_name()]))
    3030{
    31   $session_id = $_COOKIE['id'];
    32   $user['has_cookie'] = true;
    33 }
    34 else if (isset($_GET['id']))
     31 session_start();
     32 if (isset($_SESSION['id']))
     33 {
     34   $user['id'] = $_SESSION['id'];   
     35 }
     36 else
     37 {
     38   // session timeout
     39   $user['id'] = $conf['guest_id'];
     40   $user['is_the_guest'] = true;
     41 }
     42}
     43else
    3544{
    36   $session_id = $_GET['id'];
    37   $user['has_cookie'] = false;
    38 }
    39 else
    40 {
    41   $user['has_cookie'] = false;
    42 }
    43 
    44 if (isset($session_id)
    45     and ereg("^[0-9a-zA-Z]{".$conf['session_id_size']."}$", $session_id))
    46 {
    47   $page['session_id'] = $session_id;
    48   $query = '
    49 SELECT user_id,expiration,NOW() AS now
    50   FROM '.SESSIONS_TABLE.'
    51   WHERE id = \''.$page['session_id'].'\'
    52 ;';
    53   $result = pwg_query($query);
    54   if (mysql_num_rows($result) > 0)
    55   {
    56     $row = mysql_fetch_array($result);
    57     if (strnatcmp($row['expiration'], $row['now']) < 0)
    58     {
    59       // deletion of the session from the database, because it is
    60       // out-of-date
    61       $delete_query = '
    62 DELETE FROM '.SESSIONS_TABLE.'
    63   WHERE id = \''.$page['session_id'].'\'
    64 ;';
    65       pwg_query($delete_query);
    66     }
    67     else
    68     {
    69       $user['id'] = $row['user_id'];
    70       $user['is_the_guest'] = false;
    71     }
    72   }
    73 }
    74 if (!isset($user['id']))
    75 {
    76   $user['id'] = $conf['guest_id'];
    77   $user['is_the_guest'] = true;
     45 $user['id'] = $conf['guest_id'];
     46 $user['is_the_guest'] = true;
    7847}
    7948
  • trunk/install/phpwebgallery_structure.sql

    r965 r1004  
    184184CREATE TABLE `phpwebgallery_sessions` (
    185185  `id` varchar(255) binary NOT NULL default '',
    186   `user_id` smallint(5) NOT NULL default '0',
     186  `data` text NOT NULL,
    187187  `expiration` datetime NOT NULL default '0000-00-00 00:00:00',
    188188  PRIMARY KEY  (`id`)
  • trunk/notification.php

    r850 r1004  
    5959  array(
    6060    'FEED_URL' => PHPWG_ROOT_PATH.'feed.php?feed='.$page['feed'],
    61     'U_HOME' => add_session_id(PHPWG_ROOT_PATH.'category.php')
     61    'U_HOME' => PHPWG_ROOT_PATH.'category.php'
    6262    )
    6363  );
  • trunk/password.php

    r901 r1004  
    177177$template->assign_vars(
    178178  array(
    179     'U_HOME' => add_session_id(PHPWG_ROOT_PATH.'category.php')
     179    'U_HOME' => PHPWG_ROOT_PATH.'category.php'
    180180    )
    181181  );
  • trunk/picture.php

    r995 r1004  
    7777{
    7878  echo '<div style="text-align:center;">'.$lang['access_forbiden'].'<br />';
    79   echo '<a href="'.add_session_id( PHPWG_ROOT_PATH.'category.php' ).'">';
     79  echo '<a href="'.PHPWG_ROOT_PATH.'category.php'.'">';
    8080  echo $lang['thumbnails'].'</a></div>';
    8181  exit();
     
    324324      // there is no favorite picture anymore we redirect the user to the
    325325      // category page
    326       $url = add_session_id($url_up);
    327       redirect($url);
     326      redirect($url_up);
    328327    }
    329328    else if (!$has_prev)
    330329    {
    331330      $url = str_replace( '&amp;', '&', $picture['next']['url'] );
    332       $url = add_session_id( $url, true);
     331      redirect( $url );
    333332    }
    334333    else
    335334    {
    336335      $url = str_replace('&amp;', '&', $picture['prev']['url'] );
    337       $url = add_session_id( $url, true);
     336      redirect( $url );
    338337    }
    339338    redirect( $url );
     
    523522  'L_UP_ALT' => $lang['home'],
    524523 
    525   'U_HOME' => add_session_id(PHPWG_ROOT_PATH.'category.php'),
    526   'U_UP' => add_session_id($url_up),
    527   'U_METADATA' => add_session_id($url_metadata),
    528   'U_ADMIN' => add_session_id($url_admin),
    529   'U_SLIDESHOW'=> add_session_id($url_slide),
    530   'U_ADD_COMMENT' => add_session_id(str_replace( '&', '&amp;', $_SERVER['REQUEST_URI'] ))
     524  'U_HOME' => (PHPWG_ROOT_PATH.'category.php'),
     525  'U_UP' => $url_up,
     526  'U_METADATA' => $url_metadata,
     527  'U_ADMIN' => $url_admin,
     528  'U_SLIDESHOW'=> $url_slide,
     529  'U_ADD_COMMENT' => str_replace( '&', '&amp;', $_SERVER['REQUEST_URI'] )
    531530  )
    532531);
     
    585584    array(
    586585      'URL' =>
    587       add_session_id(
    588586        PHPWG_ROOT_PATH.'picture.php'
    589587        .get_query_string_diff(array('caddie')).'&amp;caddie=1')
    590       )
    591588    );
    592589}
     
    646643      'TITLE_IMG' => $picture['prev']['name'],
    647644      'IMG' => $picture['prev']['thumbnail'],
    648       'U_IMG' => add_session_id($picture['prev']['url'])
     645      'U_IMG' => $picture['prev']['url']
    649646      ));
    650647}
     
    657654      'TITLE_IMG' => $picture['next']['name'],
    658655      'IMG' => $picture['next']['thumbnail'],
    659       'U_IMG' => add_session_id($picture['next']['url'])
     656      'U_IMG' => $picture['next']['url']
    660657      ));
    661658}
     
    680677  $infos['INFO_AUTHOR'] =
    681678    '<a href="'.
    682     add_session_id(
    683679      PHPWG_ROOT_PATH.'category.php?cat=search'.
    684680      '&amp;search=author:'.$picture['current']['author']
    685       ).
    686     '">'.$picture['current']['author'].'</a>';
     681      .'">'.$picture['current']['author'].'</a>';
    687682}
    688683else
     
    696691  $infos['INFO_CREATION_DATE'] =
    697692    '<a href="'.
    698     add_session_id(
    699693      PHPWG_ROOT_PATH.'category.php?cat=search'.
    700694      '&amp;search=date_creation:'.$picture['current']['date_creation']
    701       ).
    702     '">'.format_date($picture['current']['date_creation']).'</a>';
     695      .'">'.format_date($picture['current']['date_creation']).'</a>';
    703696}
    704697else
     
    710703$infos['INFO_AVAILABILITY_DATE'] =
    711704  '<a href="'.
    712   add_session_id(
    713705    PHPWG_ROOT_PATH.'category.php?cat=search'.
    714706    '&amp;search=date_available:'.
    715707    substr($picture['current']['date_available'], 0, 10)
    716     ).
    717     '">'.
     708    .'">'.
    718709  format_date($picture['current']['date_available'], 'mysql_datetime').
    719710  '</a>';
     
    764755      '/([^,]+)/',
    765756      '<a href="'.
    766       add_session_id(
    767757        PHPWG_ROOT_PATH.'category.php?cat=search&amp;search=keywords:$1'
    768         ).
    769       '">$1</a>',
     758        .'">$1</a>',
    770759      $picture['current']['keywords']
    771760      );
     
    891880       
    892881  $template->assign_block_vars('stop_slideshow', array(
    893   'U_SLIDESHOW'=>add_session_id( $picture['current']['url'] )
     882  'U_SLIDESHOW'=>$picture['current']['url']
    894883  ));
    895884}
     
    10441033      $template->assign_block_vars(
    10451034        'comments.comment.delete',
    1046         array('U_COMMENT_DELETE'=>add_session_id( $url.'&amp;del='.$row['id'])
     1035        array('U_COMMENT_DELETE'=> $url.'&amp;del='.$row['id']
    10471036          ));
    10481037    }
  • trunk/profile.php

    r960 r1004  
    137137    // redirection
    138138    $url = PHPWG_ROOT_PATH.'category.php?'.$_SERVER['QUERY_STRING'];
    139     redirect(add_session_id($url));
     139    redirect($url);
    140140  }
    141141}
     
    199199    'L_RETURN_HINT' =>  $lang['home_hint'],
    200200
    201     'U_RETURN' => add_session_id(PHPWG_ROOT_PATH.'category.php'),
    202    
    203     'F_ACTION'=>add_session_id($url_action),
     201    'U_RETURN' => PHPWG_ROOT_PATH.'category.php',
     202   
     203    'F_ACTION'=>$url_action,
    204204    ));
    205205
  • trunk/random.php

    r675 r1004  
    6060// +-----------------------------------------------------------------------+
    6161$url = PHPWG_ROOT_PATH.'category.php?cat=list&amp;list='.implode(',', $ids);
    62 redirect(add_session_id($url));
     62redirect($url);
    6363?>
  • trunk/register.php

    r902 r1004  
    7676  'L_EMAIL' => $lang['mail_address'],
    7777
    78   'U_HOME' => add_session_id(PHPWG_ROOT_PATH.'category.php'),
     78  'U_HOME' => PHPWG_ROOT_PATH.'category.php',
    7979 
    80   'F_ACTION' => add_session_id('register.php'),
     80  'F_ACTION' => 'register.php',
    8181  'F_LOGIN' => $login,
    8282  'F_EMAIL' => $email
  • trunk/search.php

    r867 r1004  
    130130{
    131131  $url = 'category.php?cat=search&search='.$search_string;
    132   $url = add_session_id($url, true);
    133132  redirect($url);
    134133}
     
    181180  'TODAY_MONTH' => date('m', time()),
    182181  'TODAY_YEAR' => date('Y', time()),
    183   'S_SEARCH_ACTION' => add_session_id( 'search.php' ),
     182  'S_SEARCH_ACTION' => 'search.php',
    184183  'U_HELP' => PHPWG_ROOT_PATH.'/popuphelp.php?page=search',
    185   'U_HOME' => add_session_id( 'category.php' )
     184  'U_HOME' => 'category.php'
    186185  )
    187186);
  • trunk/upload.php

    r849 r1004  
    126126  {
    127127    echo '<div style="text-align:center;">'.$lang['upload_forbidden'].'<br />';
    128     echo '<a href="'.add_session_id( './category.php' ).'">';
     128    echo '<a href="./category.php">';
    129129    echo $lang['thumbnails'].'</a></div>';
    130130    exit();
     
    300300  'L_MANDATORY' =>  $lang['mandatory'],
    301301       
    302   'F_ACTION' => add_session_id( $u_form ),
    303 
    304   'U_RETURN' => add_session_id(PHPWG_ROOT_PATH.'category.php?'.$_SERVER['QUERY_STRING'])
     302  'F_ACTION' => $u_form,
     303
     304  'U_RETURN' => PHPWG_ROOT_PATH.'category.php?'.$_SERVER['QUERY_STRING']
    305305  ));
    306306 
Note: See TracChangeset for help on using the changeset viewer.