';
-
+ // FIXME - switch to external JS, jQuery support
e107::getJs()->requireCoreLib('scriptaculous/controls.js', 2);
//TODO - external JS
e107::getJs()->footerInline("
@@ -716,6 +716,8 @@ class e_form
function password($name, $value = '', $maxlength = 50, $options = array())
{
+ if(is_string($options)) parse_str($options, $options);
+
if(vartrue($options['generate']))
{
$addon .= ' Generate | Show ';
@@ -1139,6 +1141,15 @@ class e_form
return "get_attributes($options, $name, $value)." />";
}
+ /**
+ * Alias of admin_button, adds the etrigger_ prefix required for UI triggers
+ * @see e_form::admin_button()
+ */
+ function admin_trigger($name, $value, $action = 'submit', $label = '', $options = array())
+ {
+ return $this->admin_button('etrigger_'.$name, $value, $action, $label, $options);
+ }
+
/**
*
* @param string $name
@@ -2403,9 +2414,17 @@ class e_form
case 'bool':
case 'boolean':
- $lenabled = vartrue($parms['enabled'], 'LAN_ENABLED');
- $ldisabled = vartrue($parms['disabled'], 'LAN_DISABLED');
- unset($parms['enabled'], $parms['disabled']);
+ if(varset($parms['label']) === 'yesno')
+ {
+ $lenabled = 'LAN_YES';
+ $ldisabled = 'LAN_NO';
+ }
+ else
+ {
+ $lenabled = vartrue($parms['enabled'], 'LAN_ENABLED');
+ $ldisabled = vartrue($parms['disabled'], 'LAN_DISABLED');
+ }
+ unset($parms['enabled'], $parms['disabled'], $parms['label']);
$ret = $this->radio_switch($key, $value, defset($lenabled, $lenabled), defset($ldisabled, $ldisabled),$parms);
break;
diff --git a/e107_handlers/user_model.php b/e107_handlers/user_model.php
index 8e291a970..1588cc468 100644
--- a/e107_handlers/user_model.php
+++ b/e107_handlers/user_model.php
@@ -1045,8 +1045,8 @@ class e_system_user extends e_user_model
* 'mail_options' -> optional, available for all types, any additional valid mailer option as described in e107Email::sendEmail() phpDoc help (options above can override them)
* All standard user fields from the DB (user_name, user_loginname, etc.)
*
+ * @param string $type signup|notify|email|quickadd
* @param array $userInfo
- * @param string $type signup|notify|email
* @return array
*/
public function renderEmail($type, $userInfo)
@@ -1060,7 +1060,7 @@ class e_system_user extends e_user_model
$ret = $userInfo['mail_options'];
}
- // required for signup email type
+ // required for signup and quickadd email type
e107::coreLan('signup');
// FIXME convert to the new template to avoid include on every call
@@ -1083,6 +1083,11 @@ class e_system_user extends e_user_model
else $template = $SIGNUPEMAIL_TEMPLATE;
$ret['template'] = false; // Don't allow additional headers (mailer)
break;
+
+ case 'quickadd':
+ $template = $QUICKADDUSER_TEMPLATE;
+ $ret['template'] = 'email'; // Don't allow additional headers (mailer)
+ break;
case 'notify': //emailer changes
if(vartrue($userInfo['mail_body'])) $template = $userInfo['mail_body'];//$NOTIFY_HEADER.$userInfo['mail_body'].$NOTIFY_FOOTER;
@@ -1097,11 +1102,11 @@ class e_system_user extends e_user_model
if(!$template) return array();
+ $pass_show = varset($userInfo['user_password']);
+
// signup email only
if($type == 'signup')
{
- $pass_show = $userInfo['user_password'];
-
$ret['mail_recipient_id'] = $userInfo['user_id'];
if (vartrue($SIGNUPEMAIL_CC)) { $ret['mail_copy_to'] = $SIGNUPEMAIL_CC; }
if (vartrue($SIGNUPEMAIL_BCC)) { $ret['mail_bcopy_to'] = $SIGNUPEMAIL_BCC; }
@@ -1114,7 +1119,7 @@ class e_system_user extends e_user_model
$replace[0] = intval($pref['allowEmailLogin']) === 0 ? $userInfo['user_loginname'] : $userInfo['user_email'];
$search[1] = '{PASSWORD}';
- $replace[1] = $pass_show;
+ $replace[1] = $pass_show ? $pass_show : '******';
$search[2] = '{ACTIVATION_LINK}';
$replace[2] = '';
@@ -1201,6 +1206,10 @@ class e_system_user extends e_user_model
$replace[6] = vartrue($userInfo['user_website']) ? $userInfo['user_website'] : "";
$ret['mail_subject'] = str_replace($search, $replace, $subject);
+
+ $search[7] = '{PASSWORD}';
+ $replace[7] = $pass_show ? $pass_show : '******';
+
$ret['send_html'] = TRUE;
$ret['mail_body'] = e107::getParser()->parseTemplate(str_replace($search, $replace, $template));
$ret['preview'] = $ret['mail_body']; // Non-standard field
diff --git a/e107_languages/English/admin/lan_users.php b/e107_languages/English/admin/lan_users.php
index 13652ae1a..9440da79e 100644
--- a/e107_languages/English/admin/lan_users.php
+++ b/e107_languages/English/admin/lan_users.php
@@ -187,7 +187,7 @@ define('USRLAN_181', 'Send confirmation email with password to new user');
define('USRLAN_182', 'Invalid characters in login name'); // duplicate - USRLAN_92, used for 'verify' user action
define('USRLAN_183', 'That login name already in use'); // wrong used with 'reqverify' user action
define('USRLAN_184', 'Length of login name outside limits');
-define('USRLAN_185', 'A user account has been created for you at {SITEURL} with the following login: Login Name: {LOGIN} Password: {PASSWORD}
');
+define('USRLAN_185', 'A user account has been created for you at {SITEURL} with the following login: Login Name: {LOGINNAME} Password: {PASSWORD}
');
define('USRLAN_186', 'Please go to the site as soon as possible and log in, then change your password using the \'Settings\' option.
You can also change other settings at the same time.
Note that your password cannot be recovered if you lose it.');
define('USRLAN_187', 'Access to website: ');
@@ -195,7 +195,7 @@ define('USRLAN_188', 'Email sent successfully');
define('USRLAN_189', 'Error sending email');
define('USRLAN_190', 'New user probationary period (days)');
-define('USRLAN_191', '(admin can impose restrictions during this period in some areas)');
+define('USRLAN_191', 'Administrator can impose restrictions during this period in some areas');
define('USRLAN_192', ''); // was 'days' use value in lan_date.php instead.
define('USRLAN_193', 'Nothing changed - not saved');
define('USRLAN_194', 'Signature may be modified by');