File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -695,7 +695,11 @@ function image_edit($message = '', $id = '')
695695 if ($ rs ) {
696696 extract ($ rs );
697697
698- if (!has_privs ('image.edit ' ) && !has_privs ('image.edit.own ' )) {
698+ $ can_edit = has_privs ('image.edit ' ) || ($ author === $ txp_user && has_privs ('image.edit.own ' ));
699+ $ can_delete = has_privs ('image.delete ' ) || ($ author == $ txp_user && has_privs ('image.delete.own ' ));
700+ $ can_upload = $ can_edit && is_dir (IMPATH ) && is_writeable (IMPATH );
701+
702+ if (!$ can_edit ) {
699703 require_privs ('image.edit ' );
700704
701705 return ;
@@ -750,9 +754,6 @@ function image_edit($message = '', $id = '')
750754
751755 $ imageBlock = array ();
752756 $ thumbBlock = array ();
753- $ can_edit = has_privs ('image.edit ' ) || ($ author === $ txp_user && has_privs ('image.edit.own ' ));
754- $ can_delete = has_privs ('image.delete ' ) || ($ author == $ txp_user && has_privs ('image.delete.own ' ));
755- $ can_upload = $ can_edit && is_dir (IMPATH ) && is_writeable (IMPATH );
756757 $ imagetypes = get_safe_image_types ();
757758 $ delete = ($ can_delete )
758759 ? form (
You can’t perform that action at this time.
0 commit comments