Changeset 2585


Ignore:
Timestamp:
Sep 25, 2008, 2:30:42 AM (16 years ago)
Author:
rvelices
Message:
  • some checks for admins that are advisers (no write access)
  • send the charset in http header for web services
  • tag name becomes an xml attribute instead of content for tags.getList and related tags in images.getInfo (more logical and coherent with tags.getAdminList)
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/menubar.php

    r2530 r2585  
    6565}
    6666
    67 if ( isset($_POST['reset']) )
     67if ( isset($_POST['reset']) and !is_adviser())
    6868{
    6969  $mb_conf = array();
     
    8686
    8787
    88 if ( isset($_POST['submit']) )
     88if ( isset($_POST['submit']) and !is_adviser() )
    8989{
    9090  foreach ( $mb_conf as $id => $pos )
  • trunk/admin/template/goto/menubar.tpl

    r2531 r2585  
    2525</table>
    2626<p>
    27         <input type="submit" name="submit" value="{'Submit'|@translate}" >
    28         <input type="submit" name="reset" value="{'Reset'|@translate}" >
     27        <input type="submit" name="submit" value="{'Submit'|@translate}" {$TAG_INPUT_ENABLED}/>
     28        <input type="submit" name="reset" value="{'Reset'|@translate}" {$TAG_INPUT_ENABLED}/>
    2929</p>
    3030</form>
  • trunk/include/ws_core.inc.php

    r2543 r2585  
    370370    $contentType = $this->_responseEncoder->getContentType();
    371371
    372     @header('Content-Type: '.$contentType);
     372    @header('Content-Type: '.$contentType.'; charset='.get_pwg_charset());
    373373    print_r($encodedResponse);
    374374  }
  • trunk/include/ws_functions.inc.php

    r2584 r2585  
    476476    $row['nb_images'] = isset($nb_images_of[$id]) ? $nb_images_of[$id] : 0;
    477477    array_push($cats, $row);
    478   }   
    479  
     478  }
     479
    480480  usort($cats, 'global_rank_compare');
    481481  return array(
     
    722722  $ret['rates'] = array( WS_XML_ATTRIBUTES => $rating );
    723723  $ret['categories'] = new PwgNamedArray($related_categories, 'category', array('id','url', 'page_url') );
    724   $ret['tags'] = new PwgNamedArray($related_tags, 'tag', array('id','url_name','url','page_url') );
     724  $ret['tags'] = new PwgNamedArray($related_tags, 'tag', array('id','url_name','url','name','page_url') );
    725725  if ( isset($comment_post_data) )
    726726  {
     
    976976
    977977  list($width, $height) = getimagesize($file_path);
    978  
     978
    979979  // database registration
    980980  $insert = array(
     
    10261026    $rank_on_category = array();
    10271027    $search_current_ranks = false;
    1028    
     1028
    10291029    $tokens = explode(';', $params['categories']);
    10301030    foreach ($tokens as $token)
     
    10331033
    10341034      array_push($cat_ids, $cat_id);
    1035      
     1035
    10361036      if (!isset($rank))
    10371037      {
     
    11061106      );
    11071107  }
    1108  
     1108
    11091109  invalidate_user_cache();
    11101110
     
    11901190      );
    11911191  }
    1192   return array('tags' => new PwgNamedArray($tags, 'tag', array('id','url_name','url', 'counter' )) );
     1192  return array('tags' => new PwgNamedArray($tags, 'tag', array('id','url_name','url', 'name', 'counter' )) );
    11931193}
    11941194
     
    12061206    return new PwgError(401, 'Access denied');
    12071207  }
    1208  
     1208
    12091209  $tags = get_all_tags();
    12101210  return array(
     
    13661366function ws_categories_add($params, &$service)
    13671367{
    1368   if (!is_admin())
     1368  if (!is_admin() or is_adviser())
    13691369  {
    13701370    return new PwgError(401, 'Access denied');
     
    13821382    return new PwgError(500, $creation_output['error']);
    13831383  }
    1384  
     1384
    13851385  return $creation_output;
    13861386}
Note: See TracChangeset for help on using the changeset viewer.