61
Mods & Plugins (Requests & Discussions) / Re: Rotating picture by user online
« on: February 17, 2006, 03:39:36 PM »
//is there an image_id and does the user have permission to delete the image? If not, send them back to the index page!
OK that is what the problem is. I logged in as the user (family site) and it allowed to rotate. Let me go back and check the code...wow that was a fast response!
I think this is the problem. I can delete as an admin I just checked.
Would there be a snippet of code that could replace this to just check if it's user owner or admin?
Oh Wait! If I have it setup that users can delete their own posts, then I don't even need this code, correct? Cause it checks here:
Does that make sense?
OK that is what the problem is. I logged in as the user (family site) and it allowed to rotate. Let me go back and check the code...wow that was a fast response!
Code: [Select]
//is there an image_id and does the user have permission to delete the image? If not, send them back to the index page!
if (!$image_id || ($config['user_delete_image'] != 1)) {
header("Location: ".$site_sess->url(ROOT_PATH."index.php", "&"));
exit;
}
I think this is the problem. I can delete as an admin I just checked.
Would there be a snippet of code that could replace this to just check if it's user owner or admin?
Oh Wait! If I have it setup that users can delete their own posts, then I don't even need this code, correct? Cause it checks here:
Code: [Select]
//is the user a registered user and the 'owner' of the image? If not, send them back to the index page!
if ($user_info['user_level'] == ADMIN OR !$image_row || $image_row['user_id'] <= USER_AWAITING || ($user_info['user_id'] = $image_row['user_id'])) {
Does that make sense?