Icy Phoenix

     
 


Post new topic  Reply to topic 
Page 1 of 1
 
 
Reply with quote Download Post 
Post 027-0012 Bug In Posting Images Authorization 
 
I have found and fixed a bug with the authorization to upload images while posting. I discovered it because a moderator on my forum uploaded an image when supposedly I had configured IP to only allow upload images to admins.

Well, let's see. In "includes/constants.php" we have the following:
Code: [Download] [Hide]
  1. // Auth settings - Levels  
  2. define('AUTH_NONE', -1);  
  3. define('AUTH_LIST_ALL', 0);  
  4. define('AUTH_ALL', 0);  
  5. define('AUTH_REG', 1);  
  6. define('AUTH_ACL', 2);  
  7. define('AUTH_MOD', 3);  
  8. define('AUTH_JADMIN', 4);  
  9. define('AUTH_ADMIN', 5);  
  10. // Self AUTH - BEGIN  
  11. define('AUTH_SELF', 9);  
  12. // Self AUTH - END 


Then in "includes/mod_settings/mod_img_posting.php" we have the following:
Code: [Download] [Hide]
  1. 'auth_view_pic_upload' => array(  
  2.         'lang_key' => 'IP_auth_view_pic_upload',  
  3.         'type' => 'LIST_RADIO_BR',  
  4.         'default' => 'CFG_REG',  
  5.         'values' => array(  
  6.             'CFG_ALL' => 0,  
  7.             'CFG_REG' => 1,  
  8.             'CFG_MOD' => 2,  
  9.             'CFG_ADMIN' => 3,  
  10.             ),  
  11.         ), 


According to that definition, if I select ALL or REG all is fine, but when I select MOD I'm saying ACL indeed, and when I select ADMIN I'm saying MOD.

It can be fixed by few changes:
Code: [Download] [Hide]
  1. #    
  2. #-----[ OPEN ]------------------------------------------    
  3. #  
  4.  
  5. includes/mods_settings/mod_img_posting.php  
  6.  
  7. #    
  8. #-----[ FIND ]------------------------------------------    
  9. #  
  10.  
  11.             'CFG_ALL' => 0,  
  12.             'CFG_REG' => 1,  
  13.             'CFG_MOD' => 2,  
  14.             'CFG_ADMIN' => 3,  
  15.  
  16. #    
  17. #-----[ REPLACE WITH ]------------------------------------------    
  18. #  
  19.  
  20.             'CFG_ALL' => AUTH_ALL,  
  21.             'CFG_REG' => AUTH_REG,  
  22.             'CFG_MOD' => AUTH_MOD,  
  23.             'CFG_ADMIN' => AUTH_ADMIN, 


That's all. What I don't know is if there is more places on the code where this kind of direct assignment with incorrect values is being used. I hope no, because it would allow to moderators make things that only admins should.
 



 
hal9000Send private message  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post Re: BUG - Bug In Posting Images Authorization 
 
You are right... I have fixed this in my dev pack.

I'm adding this in the bugs section.

Thanks
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Post new topic  Reply to topic  Page 1 of 1
 


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events


  

 

  cron