Changeset 12885


Ignore:
Timestamp:
Jan 14, 2012, 2:08:43 PM (13 years ago)
Author:
mistic100
Message:

feature:2021 email notification on user creation, add checkboxes on register and install pages

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/themes/default/template/install.tpl

    r12427 r12885  
    279279      <td>{'Options'|@translate}</options>
    280280      <td colspan="2">
    281 <label>
    282 <input type="checkbox" name="newsletter_subscribe"{if $F_NEWSLETTER_SUBSCRIBE} checked="checked"{/if}>
    283 <span class="cluetip" title="{'Piwigo Announcements Newsletter'|@translate}|{'Keep in touch with Piwigo project, subscribe to Piwigo Announcement Newsletter. You will receive emails when a new release is available (sometimes including a security bug fix, it\'s important to know and upgrade) and when major events happen to the project. Only a few emails a year.'|@translate|@htmlspecialchars|@nl2br}">{'Subscribe %s to Piwigo Announcements Newsletter'|@translate|@sprintf:$EMAIL}</span>
    284 </label>
    285 <br>
     281        <label>
     282          <input type="checkbox" name="newsletter_subscribe"{if $F_NEWSLETTER_SUBSCRIBE} checked="checked"{/if}>
     283          <span class="cluetip" title="{'Piwigo Announcements Newsletter'|@translate}|{'Keep in touch with Piwigo project, subscribe to Piwigo Announcement Newsletter. You will receive emails when a new release is available (sometimes including a security bug fix, it\'s important to know and upgrade) and when major events happen to the project. Only a few emails a year.'|@translate|@htmlspecialchars|@nl2br}">{'Subscribe %s to Piwigo Announcements Newsletter'|@translate|@sprintf:$EMAIL}</span>
     284        </label>
     285        <br>
     286        <label>
     287          <input type="checkbox" name="send_password_by_mail" checked="checked">
     288          {'Send my password by email'|@translate}
     289        </label>
    286290      </td>
    287291    </tr>
  • trunk/install.php

    r12883 r12885  
    462462   
    463463    // email notification
    464     include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
    465          
    466     $keyargs_content = array(
    467       get_l10n_args('Hello %s,', $admin_name),
    468       get_l10n_args('Welcome to your new installation of Piwigo!', ''),
    469       get_l10n_args('', ''),
    470       get_l10n_args('Here is your password: %s', $admin_pass1),
    471       get_l10n_args('', ''),
    472       get_l10n_args('Don\'t hesitate to consult our forums for any help: %s', PHPWG_URL),
    473       );
    474      
    475     pwg_mail(
    476       $admin_mail,
    477       array(
    478         'subject' => 'Just another Piwigo gallery',
    479         'content' => l10n_args($keyargs_content),
    480         'content_format' => 'text/plain',
    481         )
    482       );
     464    if (isset($_POST['send_password_by_mail']))
     465    {
     466      include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
     467           
     468      $keyargs_content = array(
     469        get_l10n_args('Hello %s,', $admin_name),
     470        get_l10n_args('Welcome to your new installation of Piwigo!', ''),
     471        get_l10n_args('', ''),
     472        get_l10n_args('Here is your password: %s', $admin_pass1),
     473        get_l10n_args('', ''),
     474        get_l10n_args('Don\'t hesitate to consult our forums for any help: %s', PHPWG_URL),
     475        );
     476       
     477      pwg_mail(
     478        $admin_mail,
     479        array(
     480          'subject' => 'Just another Piwigo gallery',
     481          'content' => l10n_args($keyargs_content),
     482          'content_format' => 'text/plain',
     483          )
     484        );
     485    }
    483486  }
    484487}
  • trunk/language/en_UK/common.lang.php

    r12883 r12885  
    308308$lang['searched words : %s'] = "searched words : %s";
    309309$lang['Sent by'] = "Sent by";
     310$lang['Send my password by email'] = 'Send my password by email';
    310311$lang['set as album representative'] = "set as album thumbnail";
    311312$lang['Show file metadata'] = "Show file metadata";
  • trunk/language/fr_CA/common.lang.php

    r12883 r12885  
    372372$lang['Here is your password: %s'] = 'Votre mot de passe est : %s';
    373373$lang['If you think you\'ve received this email in error, please contact us at %s'] = 'Si vous pensez avoir reçu cet email par erreur, veuillez nous contacter %s';
    374 $lang['Successfully registered, an email with your password has been sent to you. Welcome!'] = 'Inscription terminée, un email avec votre mot de passe vient de vous être envoyé. Bienvenue !';
     374$lang['Successfully registered, an email with your password has been sent to you. Welcome!'] = 'Inscription réussie, un email avec votre mot de passe vient de vous être envoyé. Bienvenue !';
     375$lang['Send my password by email'] = 'Recevoir mon mot de passe par email';
    375376
    376377?>
  • trunk/language/fr_FR/common.lang.php

    r12883 r12885  
    308308$lang['searched words : %s'] = 'mots recherchés : %s';
    309309$lang['Sent by'] = 'Envoyé par';
     310$lang['Send my password by email'] = 'Recevoir mon mot de passe par email';
    310311$lang['set as album representative'] = 'Choisir comme représentante de cet album';
    311312$lang['Show file metadata'] = 'Montrer les méta-données du fichier';
     
    318319$lang['Sort by'] = 'Trier selon';
    319320$lang['Sort order'] = 'Ordre de tri';
    320 $lang['Successfully registered, an email with your password has been sent to you. Welcome!'] = 'Inscription terminée, un email avec votre mot de passe vient de vous être envoyé. Bienvenue !';
     321$lang['Successfully registered, an email with your password has been sent to you. Welcome!'] = 'Inscription réussie, un email avec votre mot de passe vient de vous être envoyé. Bienvenue !';
    321322$lang['Specials'] = 'Spéciales';
    322323$lang['SQL queries in'] = 'requêtes SQL en';
  • trunk/register.php

    r12883 r12885  
    6161  {
    6262    // email notification
    63     include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
    64          
    65     $keyargs_content = array(
    66       get_l10n_args('Hello %s,', $_POST['login']),
    67       get_l10n_args('Thank you for registering at %s!', $conf['gallery_title']),
    68       get_l10n_args('', ''),
    69       get_l10n_args('Here is your password: %s', $_POST['password']),
    70       get_l10n_args('', ''),
    71       get_l10n_args('If you think you\'ve received this email in error, please contact us at %s', get_webmaster_mail_address()),
    72       );
    73      
    74     pwg_mail(
    75       $_POST['mail_address'],
    76       array(
    77         'subject' => '['.$conf['gallery_title'].'] '.l10n('Registration'),
    78         'content' => l10n_args($keyargs_content),
    79         'content_format' => 'text/plain',
    80         )
    81       );
     63    if (isset($_POST['send_password_by_mail']) and isset($_POST['mail_address']))
     64    {
     65      include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
     66           
     67      $keyargs_content = array(
     68        get_l10n_args('Hello %s,', $_POST['login']),
     69        get_l10n_args('Thank you for registering at %s!', $conf['gallery_title']),
     70        get_l10n_args('', ''),
     71        get_l10n_args('Here is your password: %s', $_POST['password']),
     72        get_l10n_args('', ''),
     73        get_l10n_args('If you think you\'ve received this email in error, please contact us at %s', get_webmaster_mail_address()),
     74        );
     75       
     76      pwg_mail(
     77        $_POST['mail_address'],
     78        array(
     79          'subject' => '['.$conf['gallery_title'].'] '.l10n('Registration'),
     80          'content' => l10n_args($keyargs_content),
     81          'content_format' => 'text/plain',
     82          )
     83        );
     84       
     85      $_SESSION['page_infos'][] = l10n('Successfully registered, an email with your password has been sent to you. Welcome!');
     86    }
    8287   
    8388    // log user and redirect
    8489    $user_id = get_userid($_POST['login']);
    8590    log_user($user_id, false);
    86     $_SESSION['page_infos'][] = l10n('Successfully registered, an email with your password has been sent to you. Welcome!');
    8791    redirect(make_index_url());
    8892  }
  • trunk/themes/default/template/register.tpl

    r12764 r12885  
    4747      {/if}
    4848      </li>
     49      <li>
     50        <span class="property">
     51          <label for="send_password_by_mail">{'Send my password by email'|@translate}</label>
     52        </span>
     53        <input type="checkbox" name="send_password_by_mail" id="send_password_by_mail" value="1" checked="checked">
     54      </li>
    4955    </ul>
    5056
Note: See TracChangeset for help on using the changeset viewer.