From: Rob S. <fa...@ra...> - 2004-05-17 23:53:46
|
Hey Shawn, Let's say your pagekit website is http://www.some.com/app/ /app/ being pagekit controlled. so /app/ or /app/index would bring up View/Default/index.tmpl Say you wanted a page called /app/foo, you'd make a tmpl file named View/Default/foo.tmpl which in turn would invoke foo() inside your MyModel.pm file (or where ever you have pk looking). You don't need to write code to password protect stuff. The framework does that for you. For example, if you want to force people to login to see /app/foo, you simply add: <PAGE id="foo" require_login="recent"/> To the PAGES section inside Config.xml. Of course restricting access per page is not really a good idea and should be done per section or directory. For example, you have an admin area, /app/Admin/ which is a directory View/Default/Admin/, you'd add: <SECTION id='Admin' require_login='yes'/> To the SECTIONS section in Config.xml Requesting /app/Admin/something, pagekit will see that 'require_login' is set to yes for the section, redirect the user to login1.tmpl and force them to auth. Once the user auths, pagekit will set the right cookie, redirect them to the page they wanted, /app/Admin/something. The two subs that handle the auth process are called pkit_auth_credential() and pkit_auth_session_key and usually reside in Common.pm. Also, as per the docs (http://www.pagekit.org/guide/authentication.html), View/Default/index.tmpl and View/Default/login1.tmpl can never be password protected without hacking Pagekit. Hope that helps, Rob Shawn Poulson wrote: > Hi again, > > With some help from Boris, I was able to get the eg site to work. > Thanks again, Boris. > > Now I'm trying to learn the framework but I'm really kind of boggled. > The documentation is honestly a little weak in explaining the bare > essentials. Studying the eg site doesn't give me a clear indication of > what happens on each request. > > I was able to create a View/Default/index.tmpl file that displays > properly. Now I want to create a login page, but no matter what I > append on the base url, it always shows the index page. How do I show > different templates? And moreover, how do I write code in the model to > handle the login request? > > ===== > --- > Shawn Poulson > spo...@co... > > > ------------------------------------------------------- > This SF.Net email is sponsored by: SourceForge.net Broadband > Sign-up now for SourceForge Broadband and get the fastest > 6.0/768 connection for only $19.95/mo for the first 3 months! > http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click > _______________________________________________ > Pagekit-users mailing list > Pag...@li... > https://lists.sourceforge.net/lists/listinfo/pagekit-users |