mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-11 13:58:54 +00:00
bah ... went the sheep
git-svn-id: file:///svn/phpbb/trunk@4787 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
e2862f3ebd
commit
40931f12ba
1 changed files with 45 additions and 45 deletions
|
@ -238,53 +238,53 @@ function marklist(match, status)
|
||||||
trigger_error($user->lang['NO_GROUP']);
|
trigger_error($user->lang['NO_GROUP']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$name = request_var('group_name', '');
|
|
||||||
$desc = request_var('group_description', '');
|
|
||||||
$type = request_var('group_type', 0);
|
|
||||||
|
|
||||||
$colour = request_var('group_colour', '');
|
|
||||||
$rank = request_var('group_rank', 0);
|
|
||||||
|
|
||||||
$data['uploadurl'] = request_var('uploadurl', '');
|
|
||||||
$data['remotelink'] = request_var('remotelink', '');
|
|
||||||
$delete = request_var('delete', '');
|
|
||||||
|
|
||||||
if (!empty($_FILES['uploadfile']['tmp_name']) || $data['uploadurl'] || $data['remotelink'])
|
|
||||||
{
|
|
||||||
$data['width'] = request_var('width', '');
|
|
||||||
$data['height'] = request_var('height', '');
|
|
||||||
|
|
||||||
// Avatar stuff
|
|
||||||
$var_ary = array(
|
|
||||||
'uploadurl' => array('string', true, 5, 255),
|
|
||||||
'remotelink' => array('string', true, 5, 255),
|
|
||||||
'width' => array('string', true, 1, 3),
|
|
||||||
'height' => array('string', true, 1, 3),
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!($error = validate_data($data, $var_ary)))
|
|
||||||
{
|
|
||||||
$data['user_id'] = "g$group_id";
|
|
||||||
|
|
||||||
if ((!empty($_FILES['uploadfile']['tmp_name']) || $data['uploadurl']) && $can_upload)
|
|
||||||
{
|
|
||||||
list($avatar_type, $avatar, $avatar_width, $avatar_height) = avatar_upload($data, $error);
|
|
||||||
}
|
|
||||||
else if ($data['remotelink'])
|
|
||||||
{
|
|
||||||
list($avatar_type, $avatar, $avatar_width, $avatar_height) = avatar_remote($data, $error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if ($delete)
|
|
||||||
{
|
|
||||||
$avatar = '';
|
|
||||||
$avatar_type = $avatar_width = $avatar_height = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Did we submit?
|
// Did we submit?
|
||||||
if ($update)
|
if ($update)
|
||||||
{
|
{
|
||||||
|
$group_name = request_var('group_name', '');
|
||||||
|
$group_desc = request_var('group_description', '');
|
||||||
|
$group_type = request_var('group_type', 0);
|
||||||
|
|
||||||
|
$colour = request_var('group_colour', '');
|
||||||
|
$rank = request_var('group_rank', 0);
|
||||||
|
|
||||||
|
$data['uploadurl'] = request_var('uploadurl', '');
|
||||||
|
$data['remotelink'] = request_var('remotelink', '');
|
||||||
|
$delete = request_var('delete', '');
|
||||||
|
|
||||||
|
if (!empty($_FILES['uploadfile']['tmp_name']) || $data['uploadurl'] || $data['remotelink'])
|
||||||
|
{
|
||||||
|
$data['width'] = request_var('width', '');
|
||||||
|
$data['height'] = request_var('height', '');
|
||||||
|
|
||||||
|
// Avatar stuff
|
||||||
|
$var_ary = array(
|
||||||
|
'uploadurl' => array('string', true, 5, 255),
|
||||||
|
'remotelink' => array('string', true, 5, 255),
|
||||||
|
'width' => array('string', true, 1, 3),
|
||||||
|
'height' => array('string', true, 1, 3),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!($error = validate_data($data, $var_ary)))
|
||||||
|
{
|
||||||
|
$data['user_id'] = "g$group_id";
|
||||||
|
|
||||||
|
if ((!empty($_FILES['uploadfile']['tmp_name']) || $data['uploadurl']) && $can_upload)
|
||||||
|
{
|
||||||
|
list($avatar_type, $avatar, $avatar_width, $avatar_height) = avatar_upload($data, $error);
|
||||||
|
}
|
||||||
|
else if ($data['remotelink'])
|
||||||
|
{
|
||||||
|
list($avatar_type, $avatar, $avatar_width, $avatar_height) = avatar_remote($data, $error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ($delete)
|
||||||
|
{
|
||||||
|
$avatar = '';
|
||||||
|
$avatar_type = $avatar_width = $avatar_height = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (($avatar && $group_avatar != $avatar) || $delete)
|
if (($avatar && $group_avatar != $avatar) || $delete)
|
||||||
{
|
{
|
||||||
avatar_delete($group_avatar);
|
avatar_delete($group_avatar);
|
||||||
|
@ -293,7 +293,7 @@ function marklist(match, status)
|
||||||
// Only set the rank, colour, etc. if it's changed or if we're adding a new
|
// Only set the rank, colour, etc. if it's changed or if we're adding a new
|
||||||
// group. This prevents existing group members being updated if no changes
|
// group. This prevents existing group members being updated if no changes
|
||||||
// were made.
|
// were made.
|
||||||
foreach (array('name', 'desc', 'type', 'rank', 'colour', 'avatar', 'avatar_type', 'avatar_width', 'avatar_height') as $test)
|
foreach (array('rank', 'colour', 'avatar', 'avatar_type', 'avatar_width', 'avatar_height') as $test)
|
||||||
{
|
{
|
||||||
${'group_' . $test} = ($action == 'add' || (isset($$test) && $$test != ${'group_' . $test})) ? $$test : false;
|
${'group_' . $test} = ($action == 'add' || (isset($$test) && $$test != ${'group_' . $test})) ? $$test : false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue