floridave, thank you very much for your help and your quick response.
My level of php is very low, but I made the following changes and I managed to limit so that only administrators can add album...
Quote:
if (identity::active_user()->admin) {
if ($item->is_album()) {
$add_menu->append(Menu::factory("dialog")
->id("add_album_item")
->label(t("Add an album"))
->url(url::site("form/add/albums/$item->id?type=album")));
} }
Initially everything works perfectly. Only admins can add album, but...
Can you tell me if they are correct?
Or maybe I did something crazy?
floridave
Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2011-10-15 04:05
Looks OK to me.
If you manually edited core files you will have to continue to do a patch. Writing a simple module like the one I made, will allow you to just enable/disable/install/uninstall your module during an upgrade.
Posts: 27300
I wrote a module so that the admin is the only one to chnage permissions so I guess you culd use it as an example of how to override the add album link.
http://gallery.menalto.com/node/103795#comment-382315
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 3
floridave, thank you very much for your help and your quick response.
My level of php is very low, but I made the following changes and I managed to limit so that only administrators can add album...
... and I've disabled this part of the code ...
Initially everything works perfectly. Only admins can add album, but...
Can you tell me if they are correct?
Or maybe I did something crazy?
Posts: 27300
Looks OK to me.
If you manually edited core files you will have to continue to do a patch. Writing a simple module like the one I made, will allow you to just enable/disable/install/uninstall your module during an upgrade.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 3
Ok, floridave, thank you very much for your help and for your time.