aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-11-02 15:23:33 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-11-02 15:23:33 +0000
commita3bf1ed63ec7aa281b0d47d6f3e87eeeeafbaff5 (patch)
treee13dd92e386cb98de51bd0730fdd569efe6e5f36 /phpBB/includes/acp
parent21a002e4ac28f8e65e2c865eb171a44ac4054044 (diff)
downloadforums-a3bf1ed63ec7aa281b0d47d6f3e87eeeeafbaff5.tar
forums-a3bf1ed63ec7aa281b0d47d6f3e87eeeeafbaff5.tar.gz
forums-a3bf1ed63ec7aa281b0d47d6f3e87eeeeafbaff5.tar.bz2
forums-a3bf1ed63ec7aa281b0d47d6f3e87eeeeafbaff5.tar.xz
forums-a3bf1ed63ec7aa281b0d47d6f3e87eeeeafbaff5.zip
some updates; and hopefully not completely breaking redirects (again). :D You know, i like breaking things.
git-svn-id: file:///svn/phpbb/trunk@6544 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/acp')
-rw-r--r--phpBB/includes/acp/acp_profile.php36
-rw-r--r--phpBB/includes/acp/acp_users.php11
2 files changed, 38 insertions, 9 deletions
diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php
index 45ded74f5d..9ce7f3ed92 100644
--- a/phpBB/includes/acp/acp_profile.php
+++ b/phpBB/includes/acp/acp_profile.php
@@ -530,7 +530,8 @@ class acp_profile
}
}
- if ($submit && $step == 1)
+ // Check for general issues in every step
+ if ($submit) // && $step == 1
{
// Check values for step 1
if ($cp->vars['field_ident'] == '')
@@ -553,12 +554,14 @@ class acp_profile
$error[] = $user->lang['EMPTY_USER_FIELD_NAME'];
}
- if ($field_type == FIELD_BOOL || $field_type == FIELD_DROPDOWN)
+ if ($field_type == FIELD_DROPDOWN && !sizeof($cp->vars['lang_options']))
{
- if (!sizeof($cp->vars['lang_options']))
- {
- $error[] = $user->lang['NO_FIELD_ENTRIES'];
- }
+ $error[] = $user->lang['NO_FIELD_ENTRIES'];
+ }
+
+ if ($field_type == FIELD_BOOL && (empty($cp->vars['lang_options'][0]) || empty($cp->vars['lang_options'][1])))
+ {
+ $error[] = $user->lang['NO_FIELD_ENTRIES'];
}
// Check for already existing field ident
@@ -756,12 +759,20 @@ class acp_profile
ORDER BY field_order';
$result = $db->sql_query($sql);
+ $s_one_need_edit = false;
while ($row = $db->sql_fetchrow($result))
{
$active_lang = (!$row['field_active']) ? 'ACTIVATE' : 'DEACTIVATE';
$active_value = (!$row['field_active']) ? 'activate' : 'deactivate';
$id = $row['field_id'];
+ $s_need_edit = (sizeof($lang_defs['diff'][$row['field_id']])) ? true : false;
+
+ if ($s_need_edit)
+ {
+ $s_one_need_edit = true;
+ }
+
$template->assign_block_vars('fields', array(
'FIELD_IDENT' => $row['field_ident'],
'FIELD_TYPE' => $user->lang['FIELD_' . strtoupper($cp->profile_types[$row['field_type']])],
@@ -769,15 +780,22 @@ class acp_profile
'L_ACTIVATE_DEACTIVATE' => $user->lang[$active_lang],
'U_ACTIVATE_DEACTIVATE' => $this->u_action . "&amp;action=$active_value&amp;field_id=$id",
'U_EDIT' => $this->u_action . "&amp;action=edit&amp;field_id=$id",
+ 'U_TRANSLATE' => $this->u_action . "&amp;action=edit&amp;field_id=$id&amp;step=3",
'U_DELETE' => $this->u_action . "&amp;action=delete&amp;field_id=$id",
'U_MOVE_UP' => $this->u_action . "&amp;action=move_up&amp;order={$row['field_order']}",
'U_MOVE_DOWN' => $this->u_action . "&amp;action=move_down&amp;order={$row['field_order']}",
- 'S_NEED_EDIT' => (sizeof($lang_defs['diff'][$row['field_id']])) ? true : false)
+ 'S_NEED_EDIT' => $s_need_edit)
);
}
$db->sql_freeresult($result);
+ // At least one option field needs editing?
+ if ($s_one_need_edit)
+ {
+ $template->assign_var('S_NEED_EDIT', true);
+ }
+
$s_select_type = '';
foreach ($cp->profile_types as $key => $value)
{
@@ -858,10 +876,10 @@ class acp_profile
foreach ($options as $field => $field_type)
{
$value = ($action == 'create') ? request_var('l_' . $field, array(0 => ''), true) : $cp->vars['l_' . $field];
-
+
if ($field == 'lang_options')
{
- $var = ($action == 'create' || !is_array($cp->vars['l_lang_options'][$lang_id])) ? $cp->vars['l_lang_options'] : $cp->vars['l_lang_options'][$lang_id];
+ $var = ($action == 'create' || !is_array($cp->vars['l_lang_options'][$lang_id])) ? $cp->vars['lang_options'] : $cp->vars['lang_options'][$lang_id];
switch ($field_type)
{
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index 7728df6275..6b817235b2 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -708,6 +708,17 @@ class acp_users
// Setting a normal member to be a founder
if ($data['user_founder'] && $user_row['user_type'] != USER_FOUNDER)
{
+ // Make sure the user is not setting an Inactive or ignored user to be a founder
+ if ($user_row['user_type'] == USER_IGNORE)
+ {
+ trigger_error($user->lang['CANNOT_SET_FOUNDER_BOT'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
+ }
+
+ if ($user_row['user_type'] == USER_INACTIVE)
+ {
+ trigger_error($user->lang['CANNOT_SET_FOUNDER_INACTIVE'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
+ }
+
$sql_ary['user_type'] = USER_FOUNDER;
}
else if (!$data['user_founder'] && $user_row['user_type'] == USER_FOUNDER)