Changeset 12886 for trunk/admin


Ignore:
Timestamp:
Jan 14, 2012, 4:02:02 PM (12 years ago)
Author:
mistic100
Message:

feature:2021 change contents of the mail + add option on admin/user_list

Location:
trunk/admin
Files:
3 edited

Legend:

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

    r12885 r12886  
    286286        <label>
    287287          <input type="checkbox" name="send_password_by_mail" checked="checked">
    288           {'Send my password by email'|@translate}
     288          {'Send my connection settings by email'|@translate}
    289289        </label>
    290290      </td>
  • trunk/admin/themes/default/template/user_list.tpl

    r12877 r12886  
    1414                {/if}
    1515                <label>{'Email address'|@translate} <input type="text" name="email"></label>
     16    <label>{'Send connection settings by email'|@translate} <input type="checkbox" name="send_password_by_mail" value="1" checked="checked"></label>
    1617    <label>&nbsp; <input class="submit" type="submit" name="submit_add" value="{'Submit'|@translate}"></label>
    1718  </fieldset>
  • trunk/admin/user_list.php

    r12877 r12886  
    241241    }
    242242  }
     243}
     244
     245// email notification
     246if (
     247  isset($_POST['submit_add'])
     248  and count($page['errors']) == 0 
     249  and !empty($_POST['email'])
     250  and isset($_POST['send_password_by_mail'])
     251  )
     252{
     253  include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
     254       
     255  $keyargs_content = array(
     256    get_l10n_args('Hello %s,', $_POST['login']),
     257    get_l10n_args('Thank you for registering at %s!', $conf['gallery_title']),
     258    get_l10n_args('', ''),
     259    get_l10n_args('Here are your connection settings', ''),
     260    get_l10n_args('Username: %s', $_POST['login']),
     261    get_l10n_args('Password: %s', $_POST['password']),
     262    get_l10n_args('Email: %s', $_POST['email']),
     263    get_l10n_args('', ''),
     264    get_l10n_args('If you think you\'ve received this email in error, please contact us at %s', get_webmaster_mail_address()),
     265    );
     266   
     267  pwg_mail(
     268    $_POST['email'],
     269    array(
     270      'subject' => '['.$conf['gallery_title'].'] '.l10n('Registration'),
     271      'content' => l10n_args($keyargs_content),
     272      'content_format' => 'text/plain',
     273      )
     274    );
    243275}
    244276
Note: See TracChangeset for help on using the changeset viewer.