Search Results

Search found 2 results on 1 pages for 'msanford'.

Page 1/1 | 1 

  • Performing user authentication in a CodeIgniter controller constructor?

    - by msanford
    In "The Clean Code Talks -- Unit Testing" (http://youtu.be/wEhu57pih5w), Miško Hevery mentions that "as little work as possible should be done in constructors [to make classes more easily testable]'. It got me thinking about the way I have implemented my user authentication mechanism. Having delved into MVC development through CodeIgniter, I designed my first web application to perform user authentication for protected resources in controllers' constructors in cases where every public function in that controller requires the user to be authenticated. For controllers with public methods having mixed authentication requirements, I would naturally move the authentication from the constructor to each method requiring authentication (though I don't currently have a need for this). I made this choice primarily to keep the controller tight, and to ensure that all resources in the controller are always covered. As for code longevity and maintainability: given the application structure, I can't foresee a situation in which one of the affected controllers would need a public method that didn't require user authentication, but I can see this as a potential drawback in general with this implementation (i.e., requiring future refactoring). Is this a good idea?

    Read the article

  • How can I extract data from Toshiba Satellite with a dead Windows installation?

    - by msanford
    I've got a Toshiba Satellite (unknown model number but bought early 2010) running Windows Vista which throws a kernel error on boot. We don't have the restore/recovery CD any more to restore the Windows partition. I have managed to boot to a Live CD version of Ubuntu 10.10 and have mounted the internal hard drive (which takes nearly 8 minutes). I suspect that the hard drive is malfunctioning, however, because copy tasks of even 30 megs of data to an attached and mounted USB flash drive takes over an hour, and some files are mysteriously inaccessible (not a permissions issue). When browsing folders, it takes many minutes to populate the folder window even with a single tiny file. During the copy tasks, the hard disk sounds like it tries to sleep several times in rapid succession, then continues accessing, it sounds, at full throughput. I initially tried using scp (from the shell) to copy data but I encountered the same local problems. I don't know the S.M.A.R.T. status of the hard disk, either. Is there a more effective way of going about recovering the data on the internal disk, assuming that I can't use a recovery CD and am too cheap to bring it in (for now, at least)?

    Read the article

1