Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Elger Lindgren

    (@elle_)

    What I actually want is letting the site users have many photos in their albums, but choose only to show a few (5-6) of them at a time and after a while change to an other set of photos.
    Is that possible, or do they have to delete photos not to be shown?

    /Elger Lindgren

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    This is not a javascript error, but a security check.

    You are right about the inconsistency, if the user sees a selection box ( wppa admin rights ) he must be able to change the status.

    If you are capable of editing a file in the plugin dir:

    edit wppa-ajax.php, line 1022-1023:

    case 'status':
    if ( ! current_user_can( 'wppa_moderate' ) ) die( 'Security check failure #78' );

    change to:

    case 'status':
    if ( ! current_user_can( 'wppa_moderate' ) && ! current_user_can( 'wppa_admin' ) ) die( 'Security check failure #78' );

    i.e. add: && ! current_user_can( 'wppa_admin' )

    Else ( not capable of editing ):

    De-activate and delete the plugin, then re-install and activate as if it was a new plugin.

    Thread Starter Elger Lindgren

    (@elle_)

    Can I also limit the status to only pending and publish for the users?

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    You can edit wppa-photo-admin-autosave.php line 680:

    <select id="status-<?php echo $photo['id'] ?>" onchange="wppaAjaxUpdatePhoto( <?php echo $photo['id'] ?>, 'status', this ); wppaPhotoStatusChange( <?php echo $photo['id'] ?> ); ">
    	<option value="pending" <?php if ( $photo['status']=='pending' ) echo 'selected="selected"'?> ><?php _e( 'Pending', 'wppa' ) ?></option>
    	<option value="publish" <?php if ( $photo['status']=='publish' ) echo 'selected="selected"'?> ><?php _e( 'Publish', 'wppa' ) ?></option>
    	<option value="featured" <?php if ( $photo['status']=='featured' ) echo 'selected="selected"'?> ><?php _e( 'Featured', 'wppa' ) ?></option>
    	<option value="gold" <?php if ( $photo['status'] == 'gold' ) echo 'selected="selected"' ?> ><?php _e( 'Gold', 'wppa' ) ?></option>
    	<option value="silver" <?php if ( $photo['status'] == 'silver' ) echo 'selected="selected"' ?> ><?php _e( 'Silver', 'wppa' ) ?></option>
    	<option value="bronze" <?php if ( $photo['status'] == 'bronze' ) echo 'selected="selected"' ?> ><?php _e( 'Bronze', 'wppa' ) ?></option>
    	<option value="scheduled" <?php if ( $photo['status'] == 'scheduled' ) echo 'selected="selected"' ?> ><?php _e( 'Scheduled', 'wppa' ) ?></option>
    </select>

    and remove the <option ... </option> ‘s that you do not want, but will have to keep the modification for re-implementation after an update.

    Thread Starter Elger Lindgren

    (@elle_)

    Thanks, it works.
    But I think it’s wrong to delete the plugin because then the whole wppa folder disapeared as well.
    Lucily I saved the wppa-ajax.php file first and after installing the plugin I inserted my file before activating.

    Then I edited wppa-photo-admin-autosave.php.

    Once again, thanks!

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    If you delete the plugin, all photos, albums db tables and settings will survive. The …/uploads/wppa/ folder will stay in place.

    You can always delete the plugin and re-install. I even have no tool to delete the content of the wppa system. for security reasons to not accidently loose anything.

    On a second thought, i may implement your wish in the next version, to have the ‘advanced’ statusses optionally being ‘restricted’ ( i.e. you must be administrator to have them enabled ). Please follow the changelog on the next updates to see when it will be available.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Error when non admin user change photo status’ is closed to new replies.