Webmaster mustn't have his status modified

git-svn-id: http://piwigo.org/svn/trunk@171 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
z0rglub 2003-10-05 10:59:42 +00:00
parent c7910b9679
commit ddcce44dfa
2 changed files with 23 additions and 13 deletions

View file

@ -137,22 +137,28 @@ if ( $display_form )
$page['mail_address'] = $_POST['mail_address'];
}
$vtp->setVar( $sub, 'form.user:mail_address', $page['mail_address'] );
if ( isset( $_POST['status'] ) )
// change status only if the user is not the webmaster
if ( $page['username'] != $conf['webmaster'] )
{
$page['status'] = $_POST['status'];
}
$option = get_enums( PREFIX_TABLE.'users', 'status' );
for ( $i = 0; $i < sizeof( $option ); $i++ )
{
$vtp->addSession( $sub, 'status_option' );
$vtp->setVar( $sub, 'status_option.value', $option[$i] );
$vtp->setVar( $sub, 'status_option.option',
$lang['adduser_status_'.$option[$i]] );
if( $option[$i] == $page['status'] )
$vtp->addSession( $sub, 'status' );
if ( isset( $_POST['status'] ) )
{
$vtp->setVar( $sub, 'status_option.selected', ' selected="selected"' );
$page['status'] = $_POST['status'];
}
$vtp->closeSession( $sub, 'status_option' );
$option = get_enums( PREFIX_TABLE.'users', 'status' );
for ( $i = 0; $i < sizeof( $option ); $i++ )
{
$vtp->addSession( $sub, 'status_option' );
$vtp->setVar( $sub, 'status_option.value', $option[$i] );
$vtp->setVar( $sub, 'status_option.option',
$lang['adduser_status_'.$option[$i]] );
if( $option[$i] == $page['status'] )
{
$vtp->setVar( $sub, 'status_option.selected', ' selected="selected"' );
}
$vtp->closeSession( $sub, 'status_option' );
}
$vtp->closeSession( $sub, 'status' );
}
// groups linked with this user
$query = 'SELECT id,name';

View file

@ -40,6 +40,8 @@
<td>{#mail_address}</td>
<td><input type="text" name="mail_address" value="{#user:mail_address}" /></td>
</tr>
<!--VTP_status-->
<tr>
<td>{#adduser_status}</td>
<td>
@ -50,6 +52,8 @@
</select>
</td>
</tr>
<!--/VTP_status-->
<!--VTP_groups-->
<tr>
<td valign="top">{#menu_groups}</td>