Ignore:
Timestamp:
Feb 22, 2007, 6:31:08 AM (17 years ago)
Author:
rvelices
Message:
  • change the way confguest_access is handled so that web services work correctly (and also nbm.php and feed.php)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions_user.inc.php

    r1817 r1850  
    393393function calculate_permissions($user_id, $user_status)
    394394{
    395   global $user;
    396 
    397395  $private_array = array();
    398396  $authorized_array = array();
     
    438436
    439437  // if user is not an admin, locked categories are forbidden
    440   if (!is_admin($user_status))
     438  if ( $user_status!='administrator' and $user_status!='webmaster' )
    441439  {
    442440    $query = '
     
    982980 * @return bool
    983981*/
    984 function get_access_type_status($user_status = '')
     982function get_access_type_status($user_status='')
    985983{
    986984  global $user;
    987985
    988   if (($user_status == '') and isset($user['status']))
     986  if ($user_status == '' and isset($user['status']) )
    989987  {
    990988    $user_status = $user['status'];
     
    10251023 * @return bool
    10261024*/
    1027 function is_autorize_status($access_type, $user_status = '')
    1028 {
    1029   return (get_access_type_status($user_status) >= $access_type);
     1025function is_autorize_status($access_type)
     1026{
     1027  global $user, $conf;
     1028  if (
     1029      !isset($user) or
     1030      ($user['id']==$conf['guest_id'] and $conf['guest_access']==false)
     1031    )
     1032  {
     1033    return ACCESS_NONE>=$access_type;
     1034  }
     1035
     1036  return (get_access_type_status() >= $access_type);
    10301037}
    10311038
     
    10361043 * @return none
    10371044*/
    1038 function check_status($access_type, $user_status = '')
    1039 {
    1040   if (!is_autorize_status($access_type, $user_status))
     1045function check_status( $access_type )
     1046{
     1047  if (!is_autorize_status($access_type) )
    10411048  {
    10421049    access_denied();
     
    10481055 * @return bool
    10491056*/
    1050 function is_admin($user_status = '')
    1051 {
    1052   return is_autorize_status(ACCESS_ADMINISTRATOR, $user_status);
     1057function is_admin()
     1058{
     1059  return is_autorize_status(ACCESS_ADMINISTRATOR);
    10531060}
    10541061
Note: See TracChangeset for help on using the changeset viewer.