diff options
author | z0rglub <z0rglub@piwigo.org> | 2003-07-26 12:55:14 +0000 |
---|---|---|
committer | z0rglub <z0rglub@piwigo.org> | 2003-07-26 12:55:14 +0000 |
commit | c0d1ed215cdd610b16ed806db81ff07f6e65a43f (patch) | |
tree | 3c51dcc48a681200258d95eb32252b2cb2855dd1 /picture.php | |
parent | a7eb0781cf7d5e6d3ba5673b2105656c5bca6712 (diff) |
Possiblity to forbid simple guests to add their comments
git-svn-id: http://piwigo.org/svn/trunk@42 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'picture.php')
-rw-r--r-- | picture.php | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/picture.php b/picture.php index ae8282e1b..01ff49db1 100644 --- a/picture.php +++ b/picture.php @@ -624,20 +624,27 @@ if ( $conf['show_comments'] ) } $vtp->closeSession( $handle, 'comment' ); } - // form action - $action = str_replace( '&', '&', $_SERVER['REQUEST_URI'] ); - $vtp->setGlobalVar( $handle, 'form_action', $action ); - // display author field if the user is not logged in - if ( !$user['is_the_guest'] ) - { - $vtp->addSession( $handle, 'author_known' ); - $vtp->setVar( $handle, 'author_known.value', $user['pseudo'] ); - $vtp->closeSession( $handle, 'author_known' ); - } - else + + if ( !$user['is_the_guest'] + or ( $user['is_the_guest'] and $conf['comments_forall'] ) ) { - $vtp->addSession( $handle, 'author_field' ); - $vtp->closeSession( $handle, 'author_field' ); + $vtp->addSession( $handle, 'add_comment' ); + // form action + $action = str_replace( '&', '&', $_SERVER['REQUEST_URI'] ); + $vtp->setGlobalVar( $handle, 'form_action', $action ); + // display author field if the user is not logged in + if ( !$user['is_the_guest'] ) + { + $vtp->addSession( $handle, 'author_known' ); + $vtp->setVar( $handle, 'author_known.value', $user['pseudo'] ); + $vtp->closeSession( $handle, 'author_known' ); + } + else + { + $vtp->addSession( $handle, 'author_field' ); + $vtp->closeSession( $handle, 'author_field' ); + } + $vtp->closeSession( $handle, 'add_comment' ); } $vtp->closeSession( $handle, 'comments' ); } |