aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/acp')
-rw-r--r--phpBB/includes/acp/acp_board.php2
-rw-r--r--phpBB/includes/acp/acp_captcha.php2
-rw-r--r--phpBB/includes/acp/acp_styles.php7
-rw-r--r--phpBB/includes/acp/acp_users.php59
4 files changed, 46 insertions, 24 deletions
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index 3013906785..58b55eeddb 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -386,6 +386,8 @@ class acp_board
'referer_validation' => array('lang' => 'REFERER_VALID', 'validate' => 'int:0:3','type' => 'custom', 'method' => 'select_ref_check', 'explain' => true),
'check_dnsbl' => array('lang' => 'CHECK_DNSBL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'email_check_mx' => array('lang' => 'EMAIL_CHECK_MX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
+ 'max_pass_chars' => array('lang' => 'PASSWORD_LENGTH', 'validate' => 'int:8:255', 'type' => false, 'method' => false, 'explain' => false,),
+ 'min_pass_chars' => array('lang' => 'PASSWORD_LENGTH', 'validate' => 'int:1', 'type' => 'custom', 'method' => 'password_length', 'explain' => true),
'pass_complex' => array('lang' => 'PASSWORD_TYPE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_password_chars', 'explain' => true),
'chg_passforce' => array('lang' => 'FORCE_PASS_CHANGE', 'validate' => 'int:0', 'type' => 'text:3:3', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']),
'max_login_attempts' => array('lang' => 'MAX_LOGIN_ATTEMPTS', 'validate' => 'int:0', 'type' => 'text:3:3', 'explain' => true),
diff --git a/phpBB/includes/acp/acp_captcha.php b/phpBB/includes/acp/acp_captcha.php
index 4367ea4c9c..51b5dd3301 100644
--- a/phpBB/includes/acp/acp_captcha.php
+++ b/phpBB/includes/acp/acp_captcha.php
@@ -95,7 +95,7 @@ class acp_captcha
}
else if ($submit)
{
- trigger_error($user->lang['FORM_INVALID'] . adm_back_link(), E_USER_WARNING);
+ trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
else
{
diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php
index a38254838c..4f6b22fa14 100644
--- a/phpBB/includes/acp/acp_styles.php
+++ b/phpBB/includes/acp/acp_styles.php
@@ -257,6 +257,7 @@ version = {VERSION}
global $user, $template, $db, $config, $phpbb_root_path, $phpEx;
$sql_from = '';
+ $sql_sort = 'LOWER(' . $mode . '_name)';
$style_count = array();
switch ($mode)
@@ -284,6 +285,9 @@ version = {VERSION}
case 'theme':
$sql_from = STYLES_THEME_TABLE;
break;
+
+ default:
+ trigger_error($user->lang['NO_MODE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$l_prefix = strtoupper($mode);
@@ -307,7 +311,8 @@ version = {VERSION}
);
$sql = "SELECT *
- FROM $sql_from";
+ FROM $sql_from
+ ORDER BY $sql_sort ASC";
$result = $db->sql_query($sql);
$installed = array();
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index d505f79a9f..a282ef1d7f 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -119,7 +119,7 @@ class acp_users
// Build modes dropdown list
$sql = 'SELECT module_mode, module_auth
FROM ' . MODULES_TABLE . "
- WHERE module_basename = 'users'
+ WHERE module_basename = 'acp_users'
AND module_enabled = 1
AND module_class = 'acp'
ORDER BY left_id, module_mode";
@@ -2338,46 +2338,61 @@ class acp_users
}
/**
- * Optionset replacement for this module based on $user->optionset
+ * Set option bit field for user options in a user row array.
+ *
+ * Optionset replacement for this module based on $user->optionset.
+ *
+ * @param array $user_row Row from the users table.
+ * @param int $key Option key, as defined in $user->keyoptions property.
+ * @param bool $value True to set the option, false to clear the option.
+ * @param int $data Current bit field value, or false to use $user_row['user_options']
+ * @return int|bool If $data is false, the bit field is modified and
+ * written back to $user_row['user_options'], and
+ * return value is true if the bit field changed and
+ * false otherwise. If $data is not false, the new
+ * bitfield value is returned.
*/
function optionset(&$user_row, $key, $value, $data = false)
{
global $user;
- $var = ($data) ? $data : $user_row['user_options'];
+ $var = ($data !== false) ? $data : $user_row['user_options'];
- if ($value && !($var & 1 << $user->keyoptions[$key]))
- {
- $var += 1 << $user->keyoptions[$key];
- }
- else if (!$value && ($var & 1 << $user->keyoptions[$key]))
- {
- $var -= 1 << $user->keyoptions[$key];
- }
- else
- {
- return ($data) ? $var : false;
- }
+ $new_var = phpbb_optionset($user->keyoptions[$key], $value, $var);
- if (!$data)
+ if ($data === false)
{
- $user_row['user_options'] = $var;
- return true;
+ if ($new_var != $var)
+ {
+ $user_row['user_options'] = $new_var;
+ return true;
+ }
+ else
+ {
+ return false;
+ }
}
else
{
- return $var;
+ return $new_var;
}
}
/**
- * Optionget replacement for this module based on $user->optionget
+ * Get option bit field from user options in a user row array.
+ *
+ * Optionget replacement for this module based on $user->optionget.
+ *
+ * @param array $user_row Row from the users table.
+ * @param int $key option key, as defined in $user->keyoptions property.
+ * @param int $data bit field value to use, or false to use $user_row['user_options']
+ * @return bool true if the option is set in the bit field, false otherwise
*/
function optionget(&$user_row, $key, $data = false)
{
global $user;
- $var = ($data) ? $data : $user_row['user_options'];
- return ($var & 1 << $user->keyoptions[$key]) ? true : false;
+ $var = ($data !== false) ? $data : $user_row['user_options'];
+ return phpbb_optionget($user->keyoptions[$key], $var);
}
}