Changeset 11318


Ignore:
Timestamp:
Jun 11, 2011, 5:00:32 PM (9 years ago)
Author:
Eric
Message:

Bug 2336 fixed - New feature : Add [Kdays] autotext flag to insert the number of days until expiration.
Version 2.20.11 hard coded for publication.

Location:
extensions/UserAdvManager/trunk
Files:
11 edited

Legend:

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

    r11018 r11318  
    3333$UAM_Password_Test_Score = 0;
    3434$UAM_Exclusionlist_Error = false;
     35$UAM_Illegal_Flag_Error1 = false;
     36$UAM_Illegal_Flag_Error2 = false;
     37$UAM_Illegal_Flag_Error3 = false;
    3538
    3639$dump_download = '';
     
    111114    //General configuration settings
    112115                $_POST['UAM_MailInfo_Text'] = str_replace('\"', '"', str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_MailInfo_Text'])));
    113    
     116
    114117                $_POST['UAM_ConfirmMail_Text'] = str_replace('\"', '"', str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_ConfirmMail_Text'])));
    115118
     
    135138    // Consistency check between ConfirmMail and AutoMail - We cannot use GTAutoMail if ConfirmMail is disabled
    136139    $conf_UAM = unserialize($conf['UserAdvManager']);
     140    $conf_UAM_ConfirmMail = unserialize($conf['UserAdvManager_ConfirmMail']);
    137141   
    138142    if (((isset($conf_UAM['1']) and ($conf_UAM['1'] == 'false' or $conf_UAM['1'] == 'local')) or ($_POST['UAM_Confirm_Mail'] == 'false' or $_POST['UAM_Confirm_Mail'] == 'local')) and $_POST['UAM_GTAutoMail'] == 'true')
     
    141145      $_POST['UAM_GTAutoMail'] = $newvalue;
    142146      array_push($page['errors'], l10n('UAM_Error_GTAutoMail_cannot_be_set_without_ConfirmMail'));
     147    }
     148
     149    // Check if [Kdays] flag is used in a legal way (ConfirmMail Time out have to be set)
     150    if (isset($conf_UAM_ConfirmMail[0]) and $conf_UAM_ConfirmMail[0] == 'false' and preg_match('#\[Kdays\]#i',$_POST['UAM_ConfirmMail_Text']) != 0)
     151    {
     152      $UAM_Illegal_Flag_Error1 = true;
     153      array_push($page['errors'], l10n('UAM_Error_Using_illegal_Kdays'));
    143154    }
    144155
     
    193204   
    194205    $_POST['UAM_ConfirmMail_Custom_Txt2'] = str_replace('\"', '"', str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_ConfirmMail_Custom_Txt2'])));
     206
     207    // Check if [Kdays] flag is used in a legal way (ConfirmMail Time out have to be set)
     208    if (isset($conf_UAM_ConfirmMail[0]) and $conf_UAM_ConfirmMail[0] == 'false' and preg_match('#\[Kdays\]#i',$_POST['UAM_ConfirmMail_ReMail_Txt1']) == 1)
     209    {
     210      $UAM_Illegal_Flag_Error2 = true;
     211      array_push($page['errors'], l10n('UAM_Error_Using_illegal_flag'));
     212    }
     213    elseif (isset($conf_UAM_ConfirmMail[0]) and $conf_UAM_ConfirmMail[0] == 'false' and preg_match('#\[Kdays\]#i',$_POST['UAM_ConfirmMail_ReMail_Txt2']) == 1)
     214    {
     215      $UAM_Illegal_Flag_Error3 = true;
     216      array_push($page['errors'], l10n('UAM_Error_Using_illegal_flag'));
     217    }
    195218   
    196219          $newconf_UAM_ConfirmMail = array (
     
    433456    'UAM_HIDEPASSW_FALSE'            => $conf_UAM[34]=='false' ?  'checked="checked"' : '' ,
    434457                'UAM_PASSWORD_TEST_SCORE'        => $UAM_Password_Test_Score,
    435     'UAM_ERROR_REPORTS4'             => $UAM_Exclusionlist_Error,
     458    'UAM_ERROR_REPORTS1'             => $UAM_Exclusionlist_Error,
     459    'UAM_ERROR_REPORTS2'             => $UAM_Illegal_Flag_Error1,
     460    'UAM_ERROR_REPORTS3'             => $UAM_Illegal_Flag_Error2,
     461    'UAM_ERROR_REPORTS4'             => $UAM_Illegal_Flag_Error3,
    436462                'UAM_CONFIRMMAIL_TIMEOUT_TRUE'   => $conf_UAM_ConfirmMail[0]=='true' ?  'checked="checked"' : '' ,
    437463                'UAM_CONFIRMMAIL_TIMEOUT_FALSE'  => $conf_UAM_ConfirmMail[0]=='false' ?  'checked="checked"' : '' ,
  • extensions/UserAdvManager/trunk/admin/template/global.tpl

    r11018 r11318  
    135135          </li>
    136136
    137           {if $UAM_ERROR_REPORTS4}     
     137          {if $UAM_ERROR_REPORTS1}     
    138138            <div id="uam_leftmargin">
    139139              <textarea class="uam_textfields" name="UAM_MailExclusion_List" id="UAM_MailExclusion_List" rows="3" style="color: red" {$TAG_INPUT_ENABLED}>{$UAM_MAILEXCLUSION_LIST}</textarea>
     
    283283              </label>
    284284            <br><br>
     285            {if $UAM_ERROR_REPORTS2}
     286                <textarea class="uam_textfields" name="UAM_ConfirmMail_Text" id="UAM_ConfirmMail_Text" rows="10" style="color: red" {$TAG_INPUT_ENABLED}>{$UAM_CONFIRMMAIL_TEXT}</textarea>
     287            {else}
    285288                <textarea class="uam_textfields" name="UAM_ConfirmMail_Text" id="UAM_ConfirmMail_Text" rows="10" {$TAG_INPUT_ENABLED}>{$UAM_CONFIRMMAIL_TEXT}</textarea>
     289            {/if}
    286290            <br><br>
    287291            </li>
     
    427431                  </label>
    428432                <br><br>
     433                {if $UAM_ERROR_REPORTS3}
     434                    <textarea class="uam_textfields" name="UAM_ConfirmMail_ReMail_Txt1" id="UAM_ConfirmMail_ReMail_Txt1" rows="10" style="color: red" {$TAG_INPUT_ENABLED}>{$UAM_CONFIRMMAIL_REMAIL_TXT1}</textarea>
     435                {else}
    429436                    <textarea class="uam_textfields" name="UAM_ConfirmMail_ReMail_Txt1" id="UAM_ConfirmMail_ReMail_Txt1" rows="10" {$TAG_INPUT_ENABLED}>{$UAM_CONFIRMMAIL_REMAIL_TXT1}</textarea>
     437                {/if}
    430438                <br><br>
    431439                </li>
     
    443451                  </label>
    444452                <br><br>
     453                {if $UAM_ERROR_REPORTS4}
     454                    <textarea class="uam_textfields" name="UAM_ConfirmMail_ReMail_Txt2" id="UAM_ConfirmMail_ReMail_Txt2" rows="10" style="color: red" {$TAG_INPUT_ENABLED}>{$UAM_CONFIRMMAIL_REMAIL_TXT2}</textarea>
     455                {else}
    445456                    <textarea class="uam_textfields" name="UAM_ConfirmMail_ReMail_Txt2" id="UAM_ConfirmMail_ReMail_Txt2" rows="10" {$TAG_INPUT_ENABLED}>{$UAM_CONFIRMMAIL_REMAIL_TXT2}</textarea>
     457                {/if}
    446458                <br>
    447459                </li>
  • extensions/UserAdvManager/trunk/changelog.txt.php

    r11255 r11318  
    257257-- 2.20.9 : Bug fixed on installation from scratch (unable to save config)
    258258
    259 -- 2.20.10 : Bug 2324 fixed - New feature : Add [days] flag to insert maximum numbers of days between two visits set in plugin's GhostTracker in GhostTracker reminder email.
     259-- 2.20.10 : Bug 2324 fixed - New feature : Add [days] autotext flag to insert maximum numbers of days between two visits set in plugin's GhostTracker in GhostTracker reminder email.
     260
     261-- 2.20.11 : Bug 2336 fixed - New feature : Add [Kdays] autotext flag to insert the number of days until expiration.
    260262*/
    261263?>
  • extensions/UserAdvManager/trunk/include/functions.inc.php

    r11255 r11318  
    860860    if (isset($conf_UAM[9]) and $conf_UAM[9] <> '')
    861861    {
    862       // Management of Extension flags ([username], [mygallery], [myurl])
     862      // Management of Extension flags ([username], [mygallery], [myurl], [Kdays])
    863863      $patterns[] = '#\[username\]#i';
    864864      $replacements[] = $username;
     
    867867      $patterns[] = '#\[myurl\]#i';
    868868      $replacements[] = $conf['gallery_url'];
     869     
     870      if (isset($conf_UAM_ConfirmMail[0]) and $conf_UAM_ConfirmMail[0] == 'true') // [Kdays] replacement only if related option is active
     871      {
     872        $patterns[] = '#\[Kdays\]#i';
     873        $replacements[] = $conf_UAM_ConfirmMail[1];
     874      }
    869875     
    870876      if (function_exists('get_user_language_desc'))
     
    949955      if (isset($conf_UAM_ConfirmMail[2]) and $conf_UAM_ConfirmMail[2] <> '' and isset($conf_UAM_ConfirmMail[3]) and $conf_UAM_ConfirmMail[3] == 'true' and $confirm)
    950956      {
    951         // Management of Extension flags ([username], [mygallery], [myurl])
     957        // Management of Extension flags ([username], [mygallery], [myurl], [Kdays])
    952958        $patterns[] = '#\[username\]#i';
    953959        $replacements[] = $username;
     
    956962        $patterns[] = '#\[myurl\]#i';
    957963        $replacements[] = $conf['gallery_url'];
     964
     965        if (isset($conf_UAM_ConfirmMail[0]) and $conf_UAM_ConfirmMail[0] == 'true') // [Kdays] replacement only if related option is active
     966        {
     967          $patterns[] = '#\[Kdays\]#i';
     968          $replacements[] = $conf_UAM_ConfirmMail[1];
     969        }
    958970
    959971        if (function_exists('get_user_language_desc'))
     
    985997      if (isset($conf_UAM_ConfirmMail[4]) and $conf_UAM_ConfirmMail[4] <> '' and isset($conf_UAM_ConfirmMail[3]) and $conf_UAM_ConfirmMail[3] == 'true' and !$confirm)
    986998      {
    987         // Management of Extension flags ([username], [mygallery], [myurl])
     999        // Management of Extension flags ([username], [mygallery], [myurl], [Kdays])
    9881000        $patterns[] = '#\[username\]#i';
    9891001        $replacements[] = $username;
     
    9921004        $patterns[] = '#\[myurl\]#i';
    9931005        $replacements[] = $conf['gallery_url'];
     1006
     1007        if (isset($conf_UAM_ConfirmMail[0]) and $conf_UAM_ConfirmMail[0] == 'true') // [Kdays] replacement only if related option is active
     1008        {
     1009          $patterns[] = '#\[Kdays\]#i';
     1010          $replacements[] = $conf_UAM_ConfirmMail[1];
     1011        }
    9941012       
    9951013        if (function_exists('get_user_language_desc'))
  • extensions/UserAdvManager/trunk/language/de_DE/plugin.lang.php

    r11018 r11318  
    328328$lang['UAM_HidePassw'] = 'Passwort im Klartext in der Informations-E-Mail';
    329329// --------- End: New or revised $lang ---- from version 2.20.4
     330
     331
     332// --------- Starting below: New or revised $lang ---- from version 2.20.11
     333/*TODO*/$lang['UAM_Error_Using_illegal_flag'] = 'Syntax error ! The [Kdays] AutoText flag is used as the "Anmeldeschluss Validierung beschränkt" option was not activated. Please activate the option or correct the text field(s) colored in red.';
     334// --------- End: New or revised $lang ---- from version 2.20.11
    330335?>
  • extensions/UserAdvManager/trunk/language/en_UK/plugin.lang.php

    r11018 r11318  
    330330$lang['UAM_HidePassw'] = 'Password in clear text in the information email';
    331331// --------- End: New or revised $lang ---- from version 2.20.4
     332
     333
     334// --------- Starting below: New or revised $lang ---- from version 2.20.11
     335$lang['UAM_Error_Using_illegal_flag'] = 'Syntax error ! The [Kdays] AutoText flag is used as the "Deadline for registration validation limited" option was not activated. Please activate the option or correct the text field(s) colored in red.';
     336// --------- End: New or revised $lang ---- from version 2.20.11
    332337?>
  • extensions/UserAdvManager/trunk/language/es_ES/plugin.lang.php

    r11018 r11318  
    368368$lang['UAM_HidePassw'] = 'Contraseña en texto claro en la información del correo electrónico';
    369369// --------- End: New or revised $lang ---- from version 2.20.4
     370
     371
     372// --------- Starting below: New or revised $lang ---- from version 2.20.11
     373/*TODO*/$lang['UAM_Error_Using_illegal_flag'] = 'Syntax error ! The [Kdays] AutoText flag is used as the "Plazo para la validación de registro limitado" option was not activated. Please activate the option or correct the text field(s) colored in red.';
     374// --------- End: New or revised $lang ---- from version 2.20.11
    370375?>
  • extensions/UserAdvManager/trunk/language/fr_FR/plugin.lang.php

    r11018 r11318  
    329329$lang['UAM_HidePassw'] = 'Mot de passe en clair dans le mail d\'information';
    330330// --------- End: New or revised $lang ---- from version 2.20.4
     331
     332// --------- Starting below: New or revised $lang ---- from version 2.20.11
     333$lang['UAM_Error_Using_illegal_flag'] = 'Erreur de syntaxe ! Le drapeau d\'insertion automatique [Kdays] est utilisé alors que l\'option "Limitation du délai de validation d\'inscription" n\'a pas été activée. Veuillez activer l\'option ou corriger le(s) champ(s) marqué(s) en rouge.';
     334// --------- End: New or revised $lang ---- from version 2.20.11
    331335?>
  • extensions/UserAdvManager/trunk/language/it_IT/plugin.lang.php

    r11060 r11318  
    329329$lang['UAM_HidePassw'] = 'Password in chiaro nelle email d\'informazione';
    330330// --------- End: New or revised $lang ---- from version 2.20.4
     331
     332
     333// --------- Starting below: New or revised $lang ---- from version 2.20.11
     334/*TODO*/$lang['UAM_Error_Using_illegal_flag'] = 'Syntax error ! The [Kdays] AutoText flag is used as the "Termine per la validazione dell\'iscrizione limitato" option was not activated. Please activate the option or correct the text field(s) colored in red.';
     335// --------- End: New or revised $lang ---- from version 2.20.11
    331336?>
  • extensions/UserAdvManager/trunk/language/lv_LV/plugin.lang.php

    r11018 r11318  
    365365/*TODO*/$lang['UAM_HidePassw'] = 'Clear password in information email';
    366366// --------- End: New or revised $lang ---- from version 2.20.4
     367
     368
     369// --------- Starting below: New or revised $lang ---- from version 2.20.11
     370/*TODO*/$lang['UAM_Error_Using_illegal_flag'] = 'Syntax error ! The [Kdays] AutoText flag is used as the "Reģistrācijas apstiprināšanas limita robežlīnija" option was not activated. Please activate the option or correct the text field(s) colored in red.';
     371// --------- End: New or revised $lang ---- from version 2.20.11
    367372?>
  • extensions/UserAdvManager/trunk/main.inc.php

    r11255 r11318  
    22/*
    33Plugin Name: UserAdvManager
    4 Version: 2.20.10
     4Version: 2.20.11
    55Description: Renforcer la gestion des utilisateurs - Enforce users management
    66Plugin URI: http://piwigo.org/ext/extension_view.php?eid=216
Note: See TracChangeset for help on using the changeset viewer.