Ignore:
Timestamp:
Nov 14, 2020, 4:04:43 PM (4 years ago)
Author:
ddtddt
Message:

[reset_level] only webmaster can reset

Location:
extensions/reset_level
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • extensions/reset_level/index.php

    r31521 r32333  
    11<?php
     2// +-----------------------------------------------------------------------+
     3// | This file is part of Piwigo.                                          |
     4// |                                                                       |
     5// | For copyright and license information, please view the COPYING.txt    |
     6// | file that was distributed with this source code.                      |
     7// +-----------------------------------------------------------------------+
     8
     9// Recursive call
    210$url = '../';
    311header( 'Request-URI: '.$url );
  • extensions/reset_level/initadmin.php

    r31521 r32333  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | reset level plugin for piwigo                                         |
     3// | reset level plugin for piwigo by TEMMII                               |
    44// +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2011-2016 ddtddt               http://temmii.com/piwigo/ |
     5// | Copyright(C) 2011-2020 ddtddt               http://temmii.com/piwigo/ |
    66// +-----------------------------------------------------------------------+
    77// | This program is free software; you can redistribute it and/or modify  |
     
    4646</ul>
    4747    <ul>
    48           <li><a href="{$U_RESETLEVEL}" title="{\'delle_all\'|@translate}" onclick="return confirm(\'{\'Are you sure?\'|@translate|@escape:javascript}\');"><span class="icon-arrows-cw"></span>{\'delle_purgeall\'|@translate}</a></li>
     48          <li><a href="{$U_RESETLEVEL}" title="{\'Discount level of confidentiality for all photos in the gallery: for all\'|@translate}" onclick="return confirm(\'{\'Are you sure?\'|@translate|@escape:javascript}\');"><span class="icon-arrows-cw"></span>{\'Reset levels of privacy\'|@translate}</a></li>
    4949    </ul>';
    5050  return preg_replace($search, $replacement, $content);
     
    5353function plugrlaction(){
    5454  if (isset($_GET['resetlevel'])){
    55   //$admin_base_url=explode('&resetlevel', $_SERVER['REQUEST_URI']);
    56   $query = 'UPDATE ' . IMAGES_TABLE . ' SET level= \'0\';';
    57   $result = pwg_query($query);
    58   invalidate_user_cache();
    59   $_SESSION['page_infos'] = array(l10n('delle_totalok'));
    60   redirect(get_root_url().'admin.php?page=maintenance');
    61   }
     55        if (is_webmaster()){
     56          $query = 'UPDATE ' . IMAGES_TABLE . ' SET level= \'0\';';
     57          $result = pwg_query($query);
     58          invalidate_user_cache();
     59          $_SESSION['page_infos'] = array(l10n('All Photos now have a level of confidentiality "for all "'));
     60        }else{
     61          $_SESSION['page_errors'] = array(l10n('Only webmaster can be reset privacy level'));
     62        }
     63        redirect(get_root_url().'admin.php?page=maintenance'); 
     64  }
    6265}
  • extensions/reset_level/language/en_UK/index.php

    r31521 r32333  
    11<?php
     2// +-----------------------------------------------------------------------+
     3// | This file is part of Piwigo.                                          |
     4// |                                                                       |
     5// | For copyright and license information, please view the COPYING.txt    |
     6// | file that was distributed with this source code.                      |
     7// +-----------------------------------------------------------------------+
     8
     9// Recursive call
    210$url = '../';
    311header( 'Request-URI: '.$url );
  • extensions/reset_level/language/en_UK/plugin.lang.php

    r31521 r32333  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | reset level plugin for piwigo                                         |
     3// | reset level plugin for piwigo by TEMMII                               |
    44// +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2011-2016 ddtddt               http://temmii.com/piwigo/ |
     5// | Copyright(C) 2011-2020 ddtddt               http://temmii.com/piwigo/ |
    66// +-----------------------------------------------------------------------+
    77// | This program is free software; you can redistribute it and/or modify  |
     
    1919// | USA.                                                                  |
    2020// +-----------------------------------------------------------------------+
    21 $lang['delle_all'] = 'Discount level of confidentiality for all photos in the gallery: for all';
    22 $lang['delle_purgeall'] = 'Reset levels of privacy';
    23 $lang['delle_totalok'] = 'All Photos now have a level of confidentiality "for all "';
    24 
     21$lang['Discount level of confidentiality for all photos in the gallery: for all'] = 'Discount level of confidentiality for all photos in the gallery: for all';
     22$lang['Reset levels of privacy'] = 'Reset levels of privacy';
     23$lang['All Photos now have a level of confidentiality "for all "'] = 'All Photos now have a level of confidentiality "for all "';
     24$lang['Only webmaster can be reset privacy level'] = 'Only webmaster can be reset privacy level';
    2525?>
  • extensions/reset_level/language/fr_FR/index.php

    r31521 r32333  
    11<?php
     2// +-----------------------------------------------------------------------+
     3// | This file is part of Piwigo.                                          |
     4// |                                                                       |
     5// | For copyright and license information, please view the COPYING.txt    |
     6// | file that was distributed with this source code.                      |
     7// +-----------------------------------------------------------------------+
     8
     9// Recursive call
    210$url = '../';
    311header( 'Request-URI: '.$url );
  • extensions/reset_level/language/fr_FR/plugin.lang.php

    r31521 r32333  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | reset level plugin for piwigo                                         |
     3// | reset level plugin for piwigo by TEMMII                               |
    44// +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2011-2016 ddtddt               http://temmii.com/piwigo/ |
     5// | Copyright(C) 2011-2020 ddtddt               http://temmii.com/piwigo/ |
    66// +-----------------------------------------------------------------------+
    77// | This program is free software; you can redistribute it and/or modify  |
     
    1919// | USA.                                                                  |
    2020// +-----------------------------------------------------------------------+
    21 $lang['delle_all'] = 'Remise du niveau de confidentialité pour toutes les photos de la galerie à : pour tous';
    22 $lang['delle_purgeall'] = 'Réinitialisation des niveaux de confidentialité';
    23 $lang['delle_totalok'] = 'Toutes les photos ont maintenant un niveau de confidentialité à "pour tous"';
    24 
     21$lang['Discount level of confidentiality for all photos in the gallery: for all'] = 'Remise du niveau de confidentialité pour toutes les photos de la galerie à : pour tous';
     22$lang['Reset levels of privacy'] = 'Réinitialisation des niveaux de confidentialité';
     23$lang['All Photos now have a level of confidentiality "for all "'] = 'Toutes les photos ont maintenant un niveau de confidentialité à "pour tous"';
     24$lang['Only webmaster can be reset privacy level'] = 'Seul un webmaster peut réinitialiser les niveaux de confidentialitées';
    2525?>
  • extensions/reset_level/language/index.php

    r31521 r32333  
    11<?php
     2// +-----------------------------------------------------------------------+
     3// | This file is part of Piwigo.                                          |
     4// |                                                                       |
     5// | For copyright and license information, please view the COPYING.txt    |
     6// | file that was distributed with this source code.                      |
     7// +-----------------------------------------------------------------------+
     8
     9// Recursive call
    210$url = '../';
    311header( 'Request-URI: '.$url );
  • extensions/reset_level/language/it_IT/index.php

    r31521 r32333  
    11<?php
     2// +-----------------------------------------------------------------------+
     3// | This file is part of Piwigo.                                          |
     4// |                                                                       |
     5// | For copyright and license information, please view the COPYING.txt    |
     6// | file that was distributed with this source code.                      |
     7// +-----------------------------------------------------------------------+
     8
     9// Recursive call
    210$url = '../';
    311header( 'Request-URI: '.$url );
  • extensions/reset_level/language/it_IT/plugin.lang.php

    r31521 r32333  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | reset level plugin for piwigo                                         |
     3// | reset level plugin for piwigo by TEMMII                               |
    44// +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2011-2016 ddtddt               http://temmii.com/piwigo/ |
     5// | Copyright(C) 2011-2020 ddtddt               http://temmii.com/piwigo/ |
    66// +-----------------------------------------------------------------------+
    77// | This program is free software; you can redistribute it and/or modify  |
     
    1919// | USA.                                                                  |
    2020// +-----------------------------------------------------------------------+
    21 $lang['delle_all'] = 'Reinizializzare il livello di confidenzialità a tutte le foto della galleria a : per tutti';
    22 $lang['delle_purgeall'] = 'Reinizializzare i livelli di confidenzialità';
    23 $lang['delle_totalok'] = 'Tutte le foto sono ora impostate su un livello di confidenzialità a "per tutti"';
     21$lang['Discount level of confidentiality for all photos in the gallery: for all'] = 'Reinizializzare il livello di confidenzialità a tutte le foto della galleria a : per tutti';
     22$lang['Reset levels of privacy'] = 'Reinizializzare i livelli di confidenzialità';
     23$lang['All Photos now have a level of confidentiality "for all "'] = 'Tutte le foto sono ora impostate su un livello di confidenzialità a "per tutti"';
    2424
    2525?>
  • extensions/reset_level/main.inc.php

    r31521 r32333  
    1010
    1111// +-----------------------------------------------------------------------+
    12 // | reset level plugin for piwigo                                         |
     12// | reset level plugin for piwigo by TEMMII                               |
    1313// +-----------------------------------------------------------------------+
    14 // | Copyright(C) 2011-2016 ddtddt               http://temmii.com/piwigo/ |
     14// | Copyright(C) 2011-2020 ddtddt               http://temmii.com/piwigo/ |
    1515// +-----------------------------------------------------------------------+
    1616// | This program is free software; you can redistribute it and/or modify  |
Note: See TracChangeset for help on using the changeset viewer.