Changeset 5195 for trunk/admin
- Timestamp:
- Mar 19, 2010, 11:25:39 PM (15 years ago)
- Location:
- trunk/admin
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/cat_list.php
r5193 r5195 34 34 check_status(ACCESS_ADMINISTRATOR); 35 35 36 if (!empty($_POST) or isset($_GET['delete'])) 37 { 38 check_pwg_token(); 39 } 40 36 41 // +-----------------------------------------------------------------------+ 37 42 // | functions | … … 65 70 // +-----------------------------------------------------------------------+ 66 71 72 check_input_parameter('parent_id', $_GET, false, PATTERN_ID); 73 67 74 $categories = array(); 68 75 … … 186 193 'CATEGORIES_NAV'=>$navigation, 187 194 'F_ACTION'=>$form_action, 195 'PWG_TOKEN' => get_pwg_token(), 188 196 )); 189 197 … … 261 269 { 262 270 $tpl_cat['U_DELETE'] = $self_url.'&delete='.$category['id']; 271 $tpl_cat['U_DELETE'].= '&pwg_token='.get_pwg_token(); 263 272 } 264 273 -
trunk/admin/element_set.php
r5021 r5195 40 40 check_status(ACCESS_ADMINISTRATOR); 41 41 42 check_input_parameter('selection', $_POST, true, PATTERN_ID); 43 42 44 // +-----------------------------------------------------------------------+ 43 45 // | caddie management | -
trunk/admin/element_set_global.php
r5188 r5195 43 43 // | deletion form submission | 44 44 // +-----------------------------------------------------------------------+ 45 46 // the $_POST['selection'] was already checked in element_set.php 47 check_input_parameter('del_tags', $_POST, true, PATTERN_ID); 48 check_input_parameter('associate', $_POST, false, PATTERN_ID); 49 check_input_parameter('dissociate', $_POST, false, PATTERN_ID); 45 50 46 51 if (isset($_POST['delete'])) -
trunk/admin/group_list.php
r5036 r5195 33 33 // +-----------------------------------------------------------------------+ 34 34 check_status(ACCESS_ADMINISTRATOR); 35 36 if (!empty($_POST) or isset($_GET['delete']) or isset($_GET['toggle_is_default'])) 37 { 38 check_pwg_token(); 39 } 35 40 36 41 // +-----------------------------------------------------------------------+ … … 156 161 'F_ADD_ACTION' => get_root_url().'admin.php?page=group_list', 157 162 'U_HELP' => get_root_url().'popuphelp.php?page=group_list', 163 'PWG_TOKEN' => get_pwg_token(), 158 164 ) 159 165 ); … … 192 198 'MEMBERS' => l10n_dec('%d member', '%d members', $counter), 193 199 'U_MEMBERS' => $members_url.$row['id'], 194 'U_DELETE' => $del_url.$row['id'] ,200 'U_DELETE' => $del_url.$row['id'].'&pwg_token='.get_pwg_token(), 195 201 'U_PERM' => $perm_url.$row['id'], 196 'U_ISDEFAULT' => $toggle_is_default_url.$row['id'] 202 'U_ISDEFAULT' => $toggle_is_default_url.$row['id'].'&pwg_token='.get_pwg_token(), 197 203 ) 198 204 ); -
trunk/admin/include/functions.php
r5188 r5195 23 23 24 24 include(PHPWG_ROOT_PATH.'admin/include/functions_metadata.php'); 25 26 /**27 * check token comming from form posted or get params to prevent csrf attacks28 * if pwg_token is empty action doesn't require token29 * else pwg_token is compare to server token30 *31 * @return void access denied if token given is not equal to server token32 */33 function check_token()34 {35 global $conf;36 37 $valid_token = hash_hmac('md5', session_id(), $conf['secret_key']);38 $given_token = null;39 40 if (!empty($_POST['pwg_token']))41 {42 $given_token = $_POST['pwg_token'];43 }44 elseif (!empty($_GET['pwg_token']))45 {46 $given_token = $_GET['pwg_token'];47 }48 if ($given_token != $valid_token)49 {50 access_denied();51 }52 }53 25 54 26 // The function delete_site deletes a site and call the function -
trunk/admin/include/uploadify/uploadify.php
r5089 r5195 9 9 include_once(PHPWG_ROOT_PATH.'admin/include/functions_upload.inc.php'); 10 10 11 //check_pwg_token();11 check_pwg_token(); 12 12 13 13 ob_start(); -
trunk/admin/photos_add_direct.php
r5089 r5195 31 31 if (isset($_GET['batch'])) 32 32 { 33 check_input_parameter('batch', $_GET ['batch'], false, '/^\d+(,\d+)*$/');33 check_input_parameter('batch', $_GET, false, '/^\d+(,\d+)*$/'); 34 34 35 35 $query = ' … … 348 348 'upload_id' => md5(rand()), 349 349 'session_id' => session_id(), 350 'pwg_token' => '1234abcd5678efgh',//get_pwg_token(),350 'pwg_token' => get_pwg_token(), 351 351 ) 352 352 ); -
trunk/admin/picture_modify.php
r5188 r5195 34 34 check_status(ACCESS_ADMINISTRATOR); 35 35 36 check_input_parameter('image_id', $_GET, false, PATTERN_ID); 37 check_input_parameter('cat_id', $_GET, false, PATTERN_ID); 38 36 39 // +-----------------------------------------------------------------------+ 37 40 // | synchronize metadata | -
trunk/admin/plugins_list.php
r3950 r5195 33 33 $order = isset($_GET['order']) ? $_GET['order'] : 'name'; 34 34 $base_url = get_root_url().'admin.php?page='.$page['page'].'&order='.$order; 35 $action_url = $base_url.'&plugin='.'%s'.'&pwg_token='.get_pwg_token(); 35 36 36 37 $plugins = new plugins(); … … 39 40 if (isset($_GET['action']) and isset($_GET['plugin']) and !is_adviser()) 40 41 { 42 check_pwg_token(); 43 41 44 $page['errors'] = $plugins->perform_action($_GET['action'], $_GET['plugin']); 42 45 … … 97 100 'VERSION' => $fs_plugin['version'], 98 101 'DESCRIPTION' => $desc, 99 'U_ACTION' => $base_url.'&plugin='.$plugin_id);102 'U_ACTION' => sprintf($action_url, $plugin_id)); 100 103 101 104 if (isset($plugins->db_plugins_by_id[$plugin_id])) … … 116 119 foreach($missing_plugin_ids as $plugin_id) 117 120 { 118 $action_url = $base_url.'&plugin='.$plugin_id;119 120 121 $template->append( 'plugins', 121 122 array( … … 123 124 'VERSION' => $plugins->db_plugins_by_id[$plugin_id]['version'], 124 125 'DESCRIPTION' => "ERROR: THIS PLUGIN IS MISSING BUT IT IS INSTALLED! UNINSTALL IT NOW !", 125 'U_ACTION' => $base_url.'&plugin='.$plugin_id,126 'U_ACTION' => sprintf($action_url, $plugin_id), 126 127 'STATE' => 'missing' 127 128 ) -
trunk/admin/plugins_new.php
r5021 r5195 39 39 if (isset($_GET['revision']) and isset($_GET['extension']) and !is_adviser()) 40 40 { 41 check_pwg_token(); 42 41 43 $install_status = $plugins->extract_plugin_files('install', $_GET['revision'], $_GET['extension']); 42 44 … … 111 113 $url_auto_install = htmlentities($base_url) 112 114 . '&revision=' . $plugin['revision_id'] 113 . '&extension=' . $plugin['extension_id']; 115 . '&extension=' . $plugin['extension_id'] 116 . '&pwg_token='.get_pwg_token() 117 ; 114 118 115 119 $template->append('plugins', array( -
trunk/admin/plugins_update.php
r5039 r5195 38 38 if (isset($_GET['plugin']) and isset($_GET['revision']) and !is_adviser()) 39 39 { 40 check_pwg_token(); 41 40 42 $plugin_id = $_GET['plugin']; 41 43 $revision = $_GET['revision']; … … 49 51 . '&revision=' . $revision 50 52 . '&plugin=' . $plugin_id 53 . '&pwg_token='.get_pwg_token() 51 54 . '&reactivate=true'); 52 55 } … … 134 137 $url_auto_update = $base_url 135 138 . '&revision=' . $plugin_info['revision_id'] 136 . '&plugin=' . $plugin_id; 139 . '&plugin=' . $plugin_id 140 . '&pwg_token='.get_pwg_token() 141 ; 137 142 138 143 $template->append('plugins_not_uptodate', array( -
trunk/admin/site_manager.php
r5036 r5195 33 33 // +-----------------------------------------------------------------------+ 34 34 check_status(ACCESS_ADMINISTRATOR); 35 36 if (!empty($_POST) or isset($_GET['action'])) 37 { 38 check_pwg_token(); 39 } 35 40 36 41 /** … … 199 204 } 200 205 201 $template->assign( array( 202 'U_HELP' => get_root_url().'popuphelp.php?page=site_manager', 203 'F_ACTION' => get_root_url().'admin.php' 204 .get_query_string_diff( array('action','site') ) 205 ) ); 206 $template->assign( 207 array( 208 'U_HELP' => get_root_url().'popuphelp.php?page=site_manager', 209 'F_ACTION' => get_root_url().'admin.php'.get_query_string_diff(array('action','site','pwg_token')), 210 'PWG_TOKEN' => get_pwg_token(), 211 ) 212 ); 206 213 207 214 // +-----------------------------------------------------------------------+ … … 243 250 $base_url.= '?page=site_manager'; 244 251 $base_url.= '&site='.$row['id']; 252 $base_url.= '&pwg_token='.get_pwg_token(); 245 253 $base_url.= '&action='; 246 254 -
trunk/admin/tags.php
r5036 r5195 29 29 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 30 30 check_status(ACCESS_ADMINISTRATOR); 31 32 if (!empty($_POST)) 33 { 34 check_pwg_token(); 35 } 31 36 32 37 // +-----------------------------------------------------------------------+ … … 190 195 $template->assign( 191 196 array( 192 'F_ACTION' => PHPWG_ROOT_PATH.'admin.php?page=tags' 197 'F_ACTION' => PHPWG_ROOT_PATH.'admin.php?page=tags', 198 'PWG_TOKEN' => get_pwg_token(), 193 199 ) 194 200 ); -
trunk/admin/themes/default/template/cat_list.tpl
r5193 r5195 27 27 28 28 <form id="addVirtual" action="{$F_ACTION}" method="post"> 29 <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}" /> 29 30 <p> 30 31 {'Add a virtual category'|@translate} : <input type="text" name="virtual_name"> … … 39 40 {if count($categories) } 40 41 <form id="categoryOrdering" action="{$F_ACTION}" method="post"> 42 <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}" /> 41 43 <p> 42 44 <input class="submit" name="submitOrder" type="submit" value="{'Save order'|@translate}" {$TAG_INPUT_ENABLED}> -
trunk/admin/themes/default/template/group_list.tpl
r5123 r5195 4 4 5 5 <form method="post" name="add_user" action="{$F_ADD_ACTION}" class="properties"> 6 <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}" /> 6 7 <fieldset> 7 8 <legend>{'Add group'|@translate}</legend> -
trunk/admin/themes/default/template/site_manager.tpl
r5178 r5195 17 17 {if isset($local_listing.CREATE)} 18 18 <form action="{$F_ACTION}" method="post"> 19 <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}" /> 19 20 <p> 20 21 {'Create this site'|@translate}: … … 64 65 65 66 <form action="{$F_ACTION}" method="post"> 67 <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}" /> 66 68 <p> 67 69 <label for="galleries_url" >{'Create a new site : (give its URL to create_listing_file.php)'|@translate}</label> -
trunk/admin/themes/default/template/tags.tpl
r5123 r5195 4 4 5 5 <form action="{$F_ACTION}" method="post"> 6 <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}" /> 6 7 7 8 {if isset($EDIT_TAGS_LIST)}
Note: See TracChangeset
for help on using the changeset viewer.