aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorz0rglub <z0rglub@piwigo.org>2003-10-05 10:59:42 +0000
committerz0rglub <z0rglub@piwigo.org>2003-10-05 10:59:42 +0000
commitddcce44dfa124e29a8680f1e82a7ade63ff21a42 (patch)
treec88768e62344f006150859e1ba2b0db372ad7d13 /admin
parentc7910b967944d3b0c7b1ee7838287d3562eba85b (diff)
Webmaster mustn't have his status modified
git-svn-id: http://piwigo.org/svn/trunk@171 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin')
-rw-r--r--admin/user_modify.php32
1 files changed, 19 insertions, 13 deletions
diff --git a/admin/user_modify.php b/admin/user_modify.php
index 69104704e..92ea7188f 100644
--- a/admin/user_modify.php
+++ b/admin/user_modify.php
@@ -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'] ) )
+ {
+ $page['status'] = $_POST['status'];
+ }
+ $option = get_enums( PREFIX_TABLE.'users', 'status' );
+ for ( $i = 0; $i < sizeof( $option ); $i++ )
{
- $vtp->setVar( $sub, 'status_option.selected', ' selected="selected"' );
+ $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_option' );
+ $vtp->closeSession( $sub, 'status' );
}
// groups linked with this user
$query = 'SELECT id,name';