Basically in the past Ive been a mostly front-end design/dev guy and Im making the leap into back-end. Right now Im working in the Codeigniter framework and my first project is coming along swimmingly. Im noticing that in my controllers I seem to be repeating some lines of code. Mostly related to determining if a user is logged in and serving them the proper views. Is that considered bad practice?<p>For example in my main controller I have an index function and a single entry function. Both functions have the same conditional checking if a user is logged in and showing the proper views. Would DRY only come into play while working in 1 function or would that someone apply to all the functions I create? If so, anything I should keep in mind to remedy that?