Changeset 8126


Ignore:
Timestamp:
Dec 14, 2010, 2:47:24 PM (10 years ago)
Author:
patdenice
Message:

feature 2060: Remove adviser mode.
First commit: only php files.

Location:
trunk
Files:
28 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/cat_list.php

    r6993 r8126  
    104104// +-----------------------------------------------------------------------+
    105105// request to delete a virtual category / not for an adviser
    106 if (isset($_GET['delete']) and is_numeric($_GET['delete']) and !is_adviser())
     106if (isset($_GET['delete']) and is_numeric($_GET['delete']))
    107107{
    108108  delete_categories(array($_GET['delete']));
  • trunk/admin/comments.php

    r6363 r8126  
    3838// +-----------------------------------------------------------------------+
    3939
    40 if (!empty($_POST) and !is_adviser())
     40if (!empty($_POST))
    4141{
    4242  if (empty($_POST['comments']))
  • trunk/admin/configuration.php

    r6411 r8126  
    107107
    108108//------------------------------ verification and registration of modifications
    109 if (isset($_POST['submit']) and !is_adviser())
     109if (isset($_POST['submit']))
    110110{
    111111  $int_pattern = '/^\d+$/';
     
    324324
    325325    $errors = array();
    326     if ( !is_adviser() )
    327     {
    328       if (save_profile_from_post($edit_user, $errors))
    329       {
    330         // Reload user
    331         $edit_user = build_user($conf['guest_id'], false);
    332         array_push($page['infos'], l10n('Information data registered in database'));
    333       }
     326    if (save_profile_from_post($edit_user, $errors))
     327    {
     328      // Reload user
     329      $edit_user = build_user($conf['guest_id'], false);
     330      array_push($page['infos'], l10n('Information data registered in database'));
    334331    }
    335332    $page['errors'] = array_merge($page['errors'], $errors);
  • trunk/admin/extend_for_templates.php

    r6550 r8126  
    118118// +-----------------------------------------------------------------------+
    119119
    120 if (isset($_POST['submit']) and !is_adviser())
     120if (isset($_POST['submit']))
    121121{
    122122  $replacements = array();
  • trunk/admin/group_list.php

    r6363 r8126  
    4343// +-----------------------------------------------------------------------+
    4444
    45 if (isset($_GET['delete']) and is_numeric($_GET['delete']) and !is_adviser())
     45if (isset($_GET['delete']) and is_numeric($_GET['delete']))
    4646{
    4747  // destruction of the access linked to the group
     
    8686// +-----------------------------------------------------------------------+
    8787
    88 if (isset($_POST['submit_add']) and !is_adviser())
     88if (isset($_POST['submit_add']))
    8989{
    9090  if (empty($_POST['groupname']))
     
    128128// +-----------------------------------------------------------------------+
    129129
    130 if (isset($_GET['toggle_is_default']) and is_numeric($_GET['toggle_is_default']) and !is_adviser())
     130if (isset($_GET['toggle_is_default']) and is_numeric($_GET['toggle_is_default']))
    131131{
    132132  $query = '
  • trunk/admin/include/check_integrity.class.php

    r5287 r8126  
    7878
    7979    // Treatments
    80     if (!is_adviser())
    81     {
    82       if (isset($_POST['c13y_submit_correction']) and isset($_POST['c13y_selection']))
    83       {
    84         $corrected_count = 0;
    85         $not_corrected_count = 0;
     80    if (isset($_POST['c13y_submit_correction']) and isset($_POST['c13y_selection']))
     81    {
     82      $corrected_count = 0;
     83      $not_corrected_count = 0;
     84
     85      foreach ($this->retrieve_list as $i => $c13y)
     86      {
     87        if (!empty($c13y['correction_fct']) and
     88            $c13y['is_callable'] and
     89            in_array($c13y['id'], $_POST['c13y_selection']))
     90        {
     91          if (is_array($c13y['correction_fct_args']))
     92          {
     93            $args = $c13y['correction_fct_args'];
     94          }
     95          else
     96          if (!is_null($c13y['correction_fct_args']))
     97          {
     98            $args = array($c13y['correction_fct_args']);
     99          }
     100          else
     101          {
     102            $args = array();
     103          }
     104          $this->retrieve_list[$i]['corrected'] = call_user_func_array($c13y['correction_fct'], $args);
     105
     106          if ($this->retrieve_list[$i]['corrected'])
     107          {
     108            $corrected_count += 1;
     109          }
     110          else
     111          {
     112            $not_corrected_count += 1;
     113          }
     114        }
     115      }
     116
     117      if ($corrected_count > 0)
     118      {
     119        $page['infos'][] =
     120          l10n_dec('%d anomaly has been corrected.', '%d anomalies have been detected corrected.',
     121            $corrected_count);
     122      }
     123      if ($not_corrected_count > 0)
     124      {
     125        $page['errors'][] =
     126          l10n_dec('%d anomaly has not been corrected.', '%d anomalies have not been corrected.',
     127            $not_corrected_count);
     128      }
     129    }
     130    else
     131    {
     132      if (isset($_POST['c13y_submit_ignore']) and isset($_POST['c13y_selection']))
     133      {
     134        $ignored_count = 0;
    86135
    87136        foreach ($this->retrieve_list as $i => $c13y)
    88137        {
    89           if (!empty($c13y['correction_fct']) and
    90               $c13y['is_callable'] and
    91               in_array($c13y['id'], $_POST['c13y_selection']))
    92           {
    93             if (is_array($c13y['correction_fct_args']))
    94             {
    95               $args = $c13y['correction_fct_args'];
    96             }
    97             else
    98             if (!is_null($c13y['correction_fct_args']))
    99             {
    100               $args = array($c13y['correction_fct_args']);
    101             }
    102             else
    103             {
    104               $args = array();
    105             }
    106             $this->retrieve_list[$i]['corrected'] = call_user_func_array($c13y['correction_fct'], $args);
    107 
    108             if ($this->retrieve_list[$i]['corrected'])
    109             {
    110               $corrected_count += 1;
    111             }
    112             else
    113             {
    114               $not_corrected_count += 1;
    115             }
    116           }
    117         }
    118 
    119         if ($corrected_count > 0)
     138          if (in_array($c13y['id'], $_POST['c13y_selection']))
     139          {
     140            $this->build_ignore_list[] = $c13y['id'];
     141            $this->retrieve_list[$i]['ignored'] = true;
     142            $ignored_count += 1;
     143          }
     144        }
     145
     146        if ($ignored_count > 0)
    120147        {
    121148          $page['infos'][] =
    122             l10n_dec('%d anomaly has been corrected.', '%d anomalies have been detected corrected.',
    123               $corrected_count);
    124         }
    125         if ($not_corrected_count > 0)
    126         {
    127           $page['errors'][] =
    128             l10n_dec('%d anomaly has not been corrected.', '%d anomalies have not been corrected.',
    129               $not_corrected_count);
    130         }
    131       }
    132       else
    133       {
    134         if (isset($_POST['c13y_submit_ignore']) and isset($_POST['c13y_selection']))
    135         {
    136           $ignored_count = 0;
    137 
    138           foreach ($this->retrieve_list as $i => $c13y)
    139           {
    140             if (in_array($c13y['id'], $_POST['c13y_selection']))
    141             {
    142               $this->build_ignore_list[] = $c13y['id'];
    143               $this->retrieve_list[$i]['ignored'] = true;
    144               $ignored_count += 1;
    145             }
    146           }
    147 
    148           if ($ignored_count > 0)
    149           {
    150             $page['infos'][] =
    151               l10n_dec('%d anomaly has been ignored.', '%d anomalies have been ignored.',
    152                 $ignored_count);
    153           }
     149            l10n_dec('%d anomaly has been ignored.', '%d anomalies have been ignored.',
     150              $ignored_count);
    154151        }
    155152      }
  • trunk/admin/languages_installed.php

    r6550 r8126  
    3838
    3939//--------------------------------------------------perform requested actions
    40 if (isset($_GET['action']) and isset($_GET['language']) and !is_adviser())
     40if (isset($_GET['action']) and isset($_GET['language']))
    4141{
    4242  $page['errors'] = $languages->perform_action($_GET['action'], $_GET['language']);
  • trunk/admin/languages_new.php

    r6363 r8126  
    5757// +-----------------------------------------------------------------------+
    5858
    59 if (isset($_GET['revision']) and !is_adviser())
     59if (isset($_GET['revision']))
    6060{
    6161  if (!is_webmaster())
  • trunk/admin/maintenance.php

    r6993 r8126  
    3838// +-----------------------------------------------------------------------+
    3939
    40 $action = (isset($_GET['action']) and !is_adviser()) ? $_GET['action'] : '';
     40$action = isset($_GET['action']) ? $_GET['action'] : '';
    4141
    4242switch ($action)
  • trunk/admin/menubar.php

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

    r6411 r8126  
    507507  case 'param' :
    508508  {
    509     if (isset($_POST['param_submit']) and !is_adviser())
     509    if (isset($_POST['param_submit']))
    510510    {
    511511      $updated_param_count = 0;
     
    540540  case 'subscribe' :
    541541  {
    542     if (!is_adviser())
    543     {
    544       if (isset($_POST['falsify']) and isset($_POST['cat_true']))
    545       {
    546         $check_key_treated = unsubscribe_notification_by_mail(true, $_POST['cat_true']);
    547         do_timeout_treatment('cat_true', $check_key_treated);
    548       }
    549       else
    550       if (isset($_POST['trueify']) and isset($_POST['cat_false']))
    551       {
    552         $check_key_treated = subscribe_notification_by_mail(true, $_POST['cat_false']);
    553         do_timeout_treatment('cat_false', $check_key_treated);
    554       }
     542    if (isset($_POST['falsify']) and isset($_POST['cat_true']))
     543    {
     544      $check_key_treated = unsubscribe_notification_by_mail(true, $_POST['cat_true']);
     545      do_timeout_treatment('cat_true', $check_key_treated);
     546    }
     547    else
     548    if (isset($_POST['trueify']) and isset($_POST['cat_false']))
     549    {
     550      $check_key_treated = subscribe_notification_by_mail(true, $_POST['cat_false']);
     551      do_timeout_treatment('cat_false', $check_key_treated);
    555552    }
    556553    break;
     
    559556  case 'send' :
    560557  {
    561     if (isset($_POST['send_submit']) and isset($_POST['send_selection']) and isset($_POST['send_customize_mail_content']) and !is_adviser())
     558    if (isset($_POST['send_submit']) and isset($_POST['send_selection']) and isset($_POST['send_customize_mail_content']))
    562559    {
    563560      $check_key_treated = do_action_send_mail_notification('send', $_POST['send_selection'], stripslashes($_POST['send_customize_mail_content']));
  • trunk/admin/permalinks.php

    r6550 r8126  
    8484
    8585$selected_cat = array();
    86 if ( isset($_POST['set_permalink']) and $_POST['cat_id']>0 and !is_adviser() )
     86if ( isset($_POST['set_permalink']) and $_POST['cat_id']>0 )
    8787{
    8888  $permalink = $_POST['permalink'];
     
    9393  $selected_cat = array( $_POST['cat_id'] );
    9494}
    95 elseif ( isset($_GET['delete_permanent']) and !is_adviser() )
     95elseif ( isset($_GET['delete_permanent']) )
    9696{
    9797  $query = '
  • trunk/admin/picture_modify.php

    r6714 r8126  
    4141// +-----------------------------------------------------------------------+
    4242
    43 if (isset($_GET['sync_metadata']) and !is_adviser())
     43if (isset($_GET['sync_metadata']))
    4444{
    4545  $query = '
     
    7171}
    7272
    73 if (isset($_POST['submit']) and count($page['errors']) == 0 and !is_adviser())
     73if (isset($_POST['submit']) and count($page['errors']) == 0)
    7474{
    7575  $data = array();
     
    125125    and isset($_POST['cat_dissociated'])
    126126    and count($_POST['cat_dissociated']) > 0
    127     and !is_adviser()
    128127  )
    129128{
     
    137136    and isset($_POST['cat_associated'])
    138137    and count($_POST['cat_associated']) > 0
    139     and !is_adviser()
    140138  )
    141139{
     
    153151    and isset($_POST['cat_dismissed'])
    154152    and count($_POST['cat_dismissed']) > 0
    155     and !is_adviser()
    156153  )
    157154{
     
    171168    and isset($_POST['cat_elected'])
    172169    and count($_POST['cat_elected']) > 0
    173     and !is_adviser()
    174170  )
    175171{
  • trunk/admin/plugins_list.php

    r6363 r8126  
    3737
    3838//--------------------------------------------------perform requested actions
    39 if (isset($_GET['action']) and isset($_GET['plugin']) and !is_adviser())
     39if (isset($_GET['action']) and isset($_GET['plugin']))
    4040{
    4141  check_pwg_token();
  • trunk/admin/plugins_update.php

    r6363 r8126  
    3636
    3737//-----------------------------------------------------------automatic upgrade
    38 if (isset($_GET['plugin']) and isset($_GET['revision']) and !is_adviser())
     38if (isset($_GET['plugin']) and isset($_GET['revision']))
    3939{
    4040  if (!is_webmaster())
  • trunk/admin/profile.php

    r6897 r8126  
    3434
    3535$errors = array();
    36 if ( !is_adviser() )
    37 {
    38   save_profile_from_post($edit_user, $errors);
    39 }
     36save_profile_from_post($edit_user, $errors);
    4037
    4138load_profile_in_template(
  • trunk/admin/rating.php

    r6607 r8126  
    7171}
    7272
    73 if (isset($_GET['del']) and !is_adviser())
     73if (isset($_GET['del']))
    7474{
    7575  $del_params = urldecode( $_GET['del'] );
  • trunk/admin/site_manager.php

    r8083 r8126  
    8484// |                        new site creation form                         |
    8585// +-----------------------------------------------------------------------+
    86 if (isset($_POST['submit']) and !empty($_POST['galleries_url'])
    87     and !is_adviser() )
     86if (isset($_POST['submit']) and !empty($_POST['galleries_url']))
    8887{
    8988  $is_remote = url_is_remote( $_POST['galleries_url'] );
     
    168167  $page['site'] = $_GET['site'];
    169168}
    170 if (isset($_GET['action']) and isset($page['site']) and !is_adviser())
     169if (isset($_GET['action']) and isset($page['site']))
    171170{
    172171  $query = '
  • trunk/admin/site_update.php

    r7024 r8126  
    109109
    110110  // shall we simulate only
    111   if ((isset($_POST['simulate']) and $_POST['simulate'] == 1) or is_adviser())
     111  if (isset($_POST['simulate']) and $_POST['simulate'] == 1)
    112112  {
    113113    $simulate = true;
  • trunk/admin/tags.php

    r6363 r8126  
    3939// +-----------------------------------------------------------------------+
    4040
    41 if (isset($_POST['submit']) and !is_adviser())
     41if (isset($_POST['submit']))
    4242{
    4343  $query = '
     
    105105// +-----------------------------------------------------------------------+
    106106
    107 if (isset($_POST['delete']) and isset($_POST['tags']) and !is_adviser())
     107if (isset($_POST['delete']) and isset($_POST['tags']))
    108108{
    109109  $query = '
     
    142142// +-----------------------------------------------------------------------+
    143143
    144 if (isset($_POST['add']) and !empty($_POST['add_tag']) and !is_adviser())
     144if (isset($_POST['add']) and !empty($_POST['add_tag']))
    145145{
    146146  $tag_name = $_POST['add_tag'];
  • trunk/admin/themes_installed.php

    r6363 r8126  
    3737// +-----------------------------------------------------------------------+
    3838
    39 if (isset($_GET['action']) and isset($_GET['theme']) and !is_adviser())
     39if (isset($_GET['action']) and isset($_GET['theme']))
    4040{
    4141  $page['errors'] = $themes->perform_action($_GET['action'], $_GET['theme']);
  • trunk/include/common.inc.php

    r7501 r8126  
    208208}
    209209
    210 if (is_adviser())
    211 {
    212   $header_msgs[] = l10n('Adviser mode enabled');
    213 }
    214 
    215210if (count($header_msgs) > 0)
    216211{
  • trunk/include/functions_user.inc.php

    r6660 r8126  
    13201320
    13211321/*
    1322  * Return if current user is an adviser
    1323  * @return bool
     1322 * Adviser status is depreciated from piwigo 2.2
     1323 * @return false
    13241324*/
    13251325function is_adviser()
    13261326{
    1327   global $user;
    1328 
    1329   return ($user['adviser'] == 'true');
     1327  return false;
    13301328}
    13311329
     
    13851383  else
    13861384  {
    1387     if (defined('IN_ADMIN') and is_adviser())
    1388     {
    1389       return 'adviser.mode@'.$_SERVER['SERVER_NAME'];
    1390     }
    1391     else
    1392     {
    1393       return $email_address;
    1394     }
     1385    return $email_address;
    13951386  }
    13961387}
  • trunk/include/template.class.php

    r8075 r8126  
    354354
    355355    $this->smarty->assign( 'ROOT_URL', get_root_url() );
    356     $this->smarty->assign( 'TAG_INPUT_ENABLED',
    357       ((is_adviser()) ? 'disabled="disabled" onclick="return false;"' : ''));
     356    $this->smarty->assign( 'TAG_INPUT_ENABLED', '');
    358357
    359358    $save_compile_id = $this->smarty->compile_id;
  • trunk/include/ws_functions.inc.php

    r7782 r8126  
    893893function ws_images_setPrivacyLevel($params, &$service)
    894894{
    895   if (!is_admin() || is_adviser() )
     895  if (!is_admin())
    896896  {
    897897    return new PwgError(401, 'Access denied');
     
    936936  // position
    937937
    938   if (!is_admin() || is_adviser() )
     938  if (!is_admin())
    939939  {
    940940    return new PwgError(401, 'Access denied');
     
    11401140
    11411141  global $conf;
    1142   if (!is_admin() || is_adviser() )
     1142  if (!is_admin())
    11431143  {
    11441144    return new PwgError(401, 'Access denied');
     
    12091209{
    12101210  global $conf;
    1211   if (!is_admin() || is_adviser() )
     1211  if (!is_admin())
    12121212  {
    12131213    return new PwgError(401, 'Access denied');
     
    15851585function ws_categories_add($params, &$service)
    15861586{
    1587   if (!is_admin() or is_adviser())
     1587  if (!is_admin())
    15881588  {
    15891589    return new PwgError(401, 'Access denied');
     
    16091609function ws_tags_add($params, &$service)
    16101610{
    1611   if (!is_admin() or is_adviser())
     1611  if (!is_admin())
    16121612  {
    16131613    return new PwgError(401, 'Access denied');
     
    16301630  global $conf;
    16311631 
    1632   if (!is_admin() or is_adviser())
     1632  if (!is_admin())
    16331633  {
    16341634    return new PwgError(401, 'Access denied');
     
    17061706function ws_images_checkFiles($params, &$service)
    17071707{
    1708   if (!is_admin() or is_adviser())
     1708  if (!is_admin())
    17091709  {
    17101710    return new PwgError(401, 'Access denied');
     
    17911791{
    17921792  global $conf;
    1793   if (!is_admin() || is_adviser() )
     1793  if (!is_admin())
    17941794  {
    17951795    return new PwgError(401, 'Access denied');
     
    20742074{
    20752075  global $conf;
    2076   if (!is_admin() || is_adviser() )
     2076  if (!is_admin())
    20772077  {
    20782078    return new PwgError(401, 'Access denied');
     
    21482148  global $conf;
    21492149
    2150   if (!is_admin() or is_adviser())
     2150  if (!is_admin())
    21512151  {
    21522152    return new PwgError(401, 'Access denied');
  • trunk/picture.php

    r6712 r8126  
    277277    case 'set_as_representative' :
    278278    {
    279       if (is_admin() and !is_adviser() and isset($page['category']))
     279      if (is_admin() and isset($page['category']))
    280280      {
    281281        $query = '
  • trunk/plugins/LocalFilesEditor/admin.php

    r5272 r8126  
    165165  case 'tpl':
    166166    // New file form creation
    167     if ($newfile_page and !is_adviser())
     167    if ($newfile_page)
    168168    {
    169169      $filename = isset($_POST['tpl_name']) ? $_POST['tpl_name'] : '';
     
    281281// |                           Load backup file
    282282// +-----------------------------------------------------------------------+
    283 if (isset($_POST['restore']) and !is_adviser())
     283if (isset($_POST['restore']))
    284284{
    285285  $edited_file = $_POST['edited_file'];
     
    293293// |                            Save file
    294294// +-----------------------------------------------------------------------+
    295 if (isset($_POST['submit']) and !is_adviser())
     295if (isset($_POST['submit']))
    296296{
    297297  if (!is_webmaster())
  • trunk/plugins/admin_multi_view/controller.php

    r8012 r8126  
    3131if ( isset($_GET['view_as']) )
    3232{
    33   if ( is_adviser() and $user['id']!=$_GET['view_as'] and $conf['guest_id']!=$_GET['view_as'])
    34     die('security error');
    3533  if ($user['id']===$_GET['view_as'])
    3634    pwg_unset_session_var( 'multiview_as' );
     
    112110$query = '
    113111SELECT '.$conf['user_fields']['id'].' AS id,'.$conf['user_fields']['username'].' AS username
    114 FROM '.USERS_TABLE;
    115 if (is_adviser())
    116 {
    117   $query .='
    118   WHERE '.$conf['user_fields']['id']. ' IN ('.$user['id'].','.$conf['guest_id'].')
    119 ';
    120 }
    121 $query .='
     112FROM '.USERS_TABLE.'
    122113  ORDER BY CONVERT('.$conf['user_fields']['username'].',CHAR)
    123114;';
Note: See TracChangeset for help on using the changeset viewer.