Ignore:
Timestamp:
Sep 19, 2011, 9:48:39 PM (13 years ago)
Author:
Eric
Message:
  • Bug 2415 fixed - New feature added : Privacy level can now be set for unvalidated / validated users.
  • Small admin panel refactory : Ghost users management and other misc options are splitted.
  • Plugin database upgrade : maintain.inc.php and upgradedb.inc.php
  • Language files refactory (EN and FR)
  • Preparing version 2.30.0 (actually 2.30.0RC1) for compliance with Piwigo 2.3.0
File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/UserAdvManager/trunk/admin/UAM_admin.php

    r11318 r12189  
    190190      $_POST['UAM_Stuffs'],
    191191      $_POST['UAM_HidePassw'],
     192      (isset($_POST['UAM_No_Valid_Level'])?$_POST['UAM_No_Valid_Level']:''),
     193      (isset($_POST['UAM_Valid_Level'])?$_POST['UAM_Valid_Level']:''),
     194      (isset($_POST['UAM_Downgrade_Level'])?$_POST['UAM_Downgrade_Level']:''),
    192195      );
    193196
     
    382385            );
    383386        }
     387
     388
     389  //Level setting for unvalidated, validated users and downgrade status
     390  $level_options[-1] = '------------';
     391  $No_Valid_Level = -1;
     392  $Valid_Level = -1;
     393  $Downgrade_Level = -1;
     394
     395  // Get unvalidated privacy levels values
     396  foreach ($conf['available_permission_levels'] as $level)
     397  {
     398    $level_options[$level] = l10n(sprintf('Level %d', $level));
     399          if (isset($conf_UAM[35]) and $conf_UAM[35] == $level)
     400          {
     401            $No_Valid_Level = $level;
     402          }
     403      //Template initialization for unvalidated users level
     404      $template->assign(
     405        'No_Valid_Level',
     406        array(
     407                                        'Level_options' => $level_options,
     408                                'Level_selected' => $No_Valid_Level
     409                                        )
     410                        );
     411  }
     412
     413  // Get validated privacy levels values
     414  foreach ($conf['available_permission_levels'] as $level)
     415  {
     416    $level_options[$level] = l10n(sprintf('Level %d', $level));
     417          if (isset($conf_UAM[36]) and $conf_UAM[36] == $level)
     418          {
     419            $Valid_Level = $level;
     420          }
     421      //Template initialization for unvalidated users level
     422      $template->assign(
     423        'Valid_Level',
     424        array(
     425                                        'Level_options' => $level_options,
     426                                'Level_selected' => $Valid_Level
     427                                        )
     428                        );
     429  }
     430
     431  // Get downgrade privacy levels values
     432  foreach ($conf['available_permission_levels'] as $level)
     433  {
     434    $level_options[$level] = l10n(sprintf('Level %d', $level));
     435          if (isset($conf_UAM[37]) and $conf_UAM[37] == $level)
     436          {
     437            $Downgrade_Level = $level;
     438          }
     439      //Template initialization for unvalidated users level
     440      $template->assign(
     441        'Downgrade_Level',
     442        array(
     443                                        'Level_options' => $level_options,
     444                                'Level_selected' => $Downgrade_Level
     445                                        )
     446                        );
     447  }
    384448
    385449  //Save last opened paragraph in configuration tab
     
    455519    'UAM_HIDEPASSW_TRUE'             => $conf_UAM[34]=='true' ?  'checked="checked"' : '' ,
    456520    'UAM_HIDEPASSW_FALSE'            => $conf_UAM[34]=='false' ?  'checked="checked"' : '' ,
     521                'UAM_NO_VALID_LEVEL'             => $conf_UAM[35],
     522                'UAM_VALID_LEVEL'                => $conf_UAM[36],
     523    'UAM_DOWNGRADE_LEVEL'            => $conf_UAM[37],
    457524                'UAM_PASSWORD_TEST_SCORE'        => $UAM_Password_Test_Score,
    458525    'UAM_ERROR_REPORTS1'             => $UAM_Exclusionlist_Error,
Note: See TracChangeset for help on using the changeset viewer.