Changeset 5256


Ignore:
Timestamp:
Mar 22, 2010, 1:42:42 PM (11 years ago)
Author:
patdenice
Message:

Editor Only webmasters can create or modify local files.

Location:
trunk/plugins/LocalFilesEditor
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/LocalFilesEditor/admin.php

    r5218 r5256  
    295295if (isset($_POST['submit']) and !is_adviser())
    296296{
    297   $edited_file = $_POST['edited_file'];
    298   $content_file = stripslashes($_POST['text']);
    299   if (get_extension($edited_file) == 'php')
    300         {
    301     $content_file = eval_syntax($content_file);
    302   }
    303   if ($content_file === false)
    304         {
    305     array_push($page['errors'], l10n('locfiledit_syntax_error'));
    306   }
    307         else
    308         {
    309     if ($page['tab'] == 'plug' and !is_dir(PHPWG_PLUGINS_PATH . 'PersonalPlugin'))
    310     {
    311       @mkdir(PHPWG_PLUGINS_PATH . "PersonalPlugin");
    312     }
    313     if (file_exists($edited_file))
    314     {
    315       @copy($edited_file, get_bak_file($edited_file));
    316       array_push($page['infos'], sprintf(l10n('locfiledit_saved_bak'), substr(get_bak_file($edited_file), 2)));
    317     }
    318    
    319     if ($file = @fopen($edited_file , "w"))
    320                 {
    321       @fwrite($file , $content_file);
    322       @fclose($file);
    323       array_unshift($page['infos'], l10n('locfiledit_save_config'));
    324       $template->delete_compiled_templates();
    325     }
    326                 else
    327     {
    328       array_push($page['errors'], l10n('locfiledit_cant_save'));
     297  if ($user['status'] != 'webmaster')
     298  {
     299    array_push($page['errors'], l10n('locfiledit_webmaster_only'));
     300  }
     301  else
     302  {
     303    $edited_file = $_POST['edited_file'];
     304    $content_file = stripslashes($_POST['text']);
     305    if (get_extension($edited_file) == 'php')
     306    {
     307      $content_file = eval_syntax($content_file);
     308    }
     309    if ($content_file === false)
     310    {
     311      array_push($page['errors'], l10n('locfiledit_syntax_error'));
     312    }
     313    else
     314    {
     315      if ($page['tab'] == 'plug' and !is_dir(PHPWG_PLUGINS_PATH . 'PersonalPlugin'))
     316      {
     317        @mkdir(PHPWG_PLUGINS_PATH . "PersonalPlugin");
     318      }
     319      if (file_exists($edited_file))
     320      {
     321        @copy($edited_file, get_bak_file($edited_file));
     322        array_push($page['infos'], sprintf(l10n('locfiledit_saved_bak'), substr(get_bak_file($edited_file), 2)));
     323      }
     324     
     325      if ($file = @fopen($edited_file , "w"))
     326      {
     327        @fwrite($file , $content_file);
     328        @fclose($file);
     329        array_unshift($page['infos'], l10n('locfiledit_save_config'));
     330        $template->delete_compiled_templates();
     331      }
     332      else
     333      {
     334        array_push($page['errors'], l10n('locfiledit_cant_save'));
     335      }
    329336    }
    330337  }
  • trunk/plugins/LocalFilesEditor/language/de_DE/plugin.lang.php

    r5196 r5256  
    5353$lang['locfiledit_model_error'] = 'Sie müssen ein Modell wählen.';
    5454$lang['locfiledit_empty_filename'] = 'Sie müssen einen Dateiname eingeben.';
     55/* TODO */ $lang['locfiledit_webmaster_only'] = 'Only webmasters can create or modify local files.';
    5556
    5657?>
  • trunk/plugins/LocalFilesEditor/language/en_UK/plugin.lang.php

    r5196 r5256  
    5353$lang['locfiledit_model_error'] = 'You must choose a model.';
    5454$lang['locfiledit_empty_filename'] = 'You must fill file name.';
     55$lang['locfiledit_webmaster_only'] = 'Only webmasters can create or modify local files.';
    5556
    5657?>
  • trunk/plugins/LocalFilesEditor/language/es_ES/plugin.lang.php

    r5196 r5256  
    5353$lang['locfiledit_model_error'] = 'Por favor, seleccione un modelo.';
    5454/* TODO */ $lang['locfiledit_empty_filename'] = 'Por favor, indique un nombre de fichero.';
     55/* TODO */ $lang['locfiledit_webmaster_only'] = 'Only webmasters can create or modify local files.';
    5556
    5657?>
  • trunk/plugins/LocalFilesEditor/language/fr_FR/plugin.lang.php

    r5196 r5256  
    5353$lang['locfiledit_model_error'] = 'Veuillez sélectionner un modèle.';
    5454$lang['locfiledit_empty_filename'] = 'Veuillez indiquer un nom de fichier.';
     55$lang['locfiledit_webmaster_only'] = 'Seuls les webmasters sont autorisés à créer ou modifier les fichiers locaux.';
    5556
    5657?>
  • trunk/plugins/LocalFilesEditor/language/hu_HU/plugin.lang.php

    r5196 r5256  
    5353$lang['locfiledit_model_error'] = 'A típust ki kell választani.';
    5454$lang['locfiledit_empty_filename'] = 'A fájlnevet ki kell tölteni.';
     55/* TODO */ $lang['locfiledit_webmaster_only'] = 'Only webmasters can create or modify local files.';
    5556
    5657?>
  • trunk/plugins/LocalFilesEditor/language/it_IT/plugin.lang.php

    r5196 r5256  
    5353$lang['locfiledit_model_error'] = 'Selezionare un modello.';
    5454$lang['locfiledit_empty_filename'] = 'Indicate un nome di file.';
     55/* TODO */ $lang['locfiledit_webmaster_only'] = 'Only webmasters can create or modify local files.';
    5556
    5657?>
  • trunk/plugins/LocalFilesEditor/language/pl_PL/plugin.lang.php

    r5196 r5256  
    5353$lang['locfiledit_model_error'] = 'Musisz wybrać model.';
    5454$lang['locfiledit_empty_filename'] = 'Musisz wpisać nazwę pliku.';
     55/* TODO */ $lang['locfiledit_webmaster_only'] = 'Only webmasters can create or modify local files.';
    5556
    5657?>
Note: See TracChangeset for help on using the changeset viewer.