Thanks NaX, well what I need is when a user logs in is to check the db for something. If this is true it should show some buttons, if false, they shouldn’t be visible. At the moment I just have some logic in the view, which should be avoided I know, which checks a condition, if it’s true it displays some buttons, if not they are not displayed. Its not a function though, if I put that code in a function I guess I could call it with ajax. Does that make any sense?