cannot login

2 views
Skip to first unread message

Brewster

unread,
Apr 20, 2010, 4:14:43 AM4/20/10
to LilBlogs
i cannot seem to login. i have added the necessary lines to the
app_controller, i have imported the tables into my DB, routes &
core.php have the added lines, and i have the plugin directory in
place. no matter what i try, i cannot login. Login failed. Invalid
username or password.

what am i missing here? the instruction were really straight
forward. i figured there would be no issue. maybe its just getting
too late...

--
You received this message because you are subscribed to the Google Groups "LilBlogs" group.
To post to this group, send email to lilb...@googlegroups.com.
To unsubscribe from this group, send email to lilblogs+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/lilblogs?hl=en.

Miha Nahtigal

unread,
Apr 20, 2010, 4:57:41 AM4/20/10
to lilb...@googlegroups.com
I think you have a problem with Security.salt of your app. If you want to use default user with default password (from imported data eg. admin/admin), you have to ensure that Security.salt in app/config/core.php is the same as it was used for password encryption. You can find it in my sample app. I'll even post it here:

Configure::write('Security.salt', '40ab12cb6b2241ec7272030ac0b6f8d65cd8031a');

Option 2:
If you don't want to change your app's salt (the prefered way), you'll have to update admin's password. Set debug to "2" to see select queries after your attempted login. Update password field with encoded string that can be seen in one of the selects.

Please check also my sample app here http://lilblogs.googlecode.com/files/LilBlogs-1.2.1.zip
I've just rechecked it and everything (admin login included) works fine.

Cheers, m

Brewster

unread,
Apr 20, 2010, 12:05:24 PM4/20/10
to LilBlogs
debug only shows a series of DESCRIBE queries. no select statements.

On Apr 20, 1:57 am, Miha Nahtigal <miha.nahti...@gmail.com> wrote:
> I think you have a problem with Security.salt of your app. If you want to
> use default user with default password (from imported data eg. admin/admin),
> you have to ensure that Security.salt in app/config/core.php is the same as
> it was used for password encryption. You can find it in my sample app. I'll
> even post it here:
>
> Configure::write('Security.salt',
> '40ab12cb6b2241ec7272030ac0b6f8d65cd8031a');
>
> Option 2:
> If you don't want to change your app's salt (the prefered way), you'll have
> to update admin's password. Set debug to "2" to see select queries after
> your attempted login. Update password field with encoded string that can be
> seen in one of the selects.
>
> Please check also my sample app herehttp://lilblogs.googlecode.com/files/LilBlogs-1.2.1.zip
> I've just rechecked it and everything (admin login included) works fine.
>
> Cheers, m
>
>
>
>
>
> On Tue, Apr 20, 2010 at 10:14 AM, Brewster <brewster1...@gmail.com> wrote:
> > i cannot seem to login.  i have added the necessary lines to the
> > app_controller, i have imported the tables into my DB, routes &
> > core.php have the added lines, and i have the plugin directory in
> > place.  no matter what i try, i cannot login.  Login failed. Invalid
> > username or password.
>
> > what am i missing here?  the instruction were really straight
> > forward.  i figured there would be no issue. maybe its just getting
> > too late...
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "LilBlogs" group.
> > To post to this group, send email to lilb...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > lilblogs+u...@googlegroups.com<lilblogs%2Bunsubscribe@googlegroups.c om>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/lilblogs?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups "LilBlogs" group.
> To post to this group, send email to lilb...@googlegroups.com.
> To unsubscribe from this group, send email to lilblogs+u...@googlegroups.com.
> For more options, visit this group athttp://groups.google.com/group/lilblogs?hl=en.

Miha Nahtigal

unread,
Apr 20, 2010, 12:26:44 PM4/20/10
to lilb...@googlegroups.com
Hm, I cannot reproduce your error.

It is weird that no select queries are shown after login attempt. Please check beforeFilter() in your AppController (especially Auth component initialization - check my sample app for referece/sample), ensure that Auth component is present.

cheers

Brewster

unread,
Apr 20, 2010, 12:45:22 PM4/20/10
to LilBlogs
ah ok. i figured out why i couldnt see the SQL queries. so i took the
password string and dumped it into the DB, however, when i login i am
redirected to my home page, with no direction as to how to access
admin features.

the only thing i can find is an 'edit this post' link to '/lil_blogs/
posts/edit/1/admin:1'. however i get a missing method error.


Missing Method in PostsController

Error: The action edit is not defined in controller PostsController

Error: Create PostsController::edit() in file: app/controllers/
posts_controller.php.

<?php
class PostsController extends AppController {

var $name = 'Posts';


function edit() {

}

}
?>

Notice: If you want to customize this error message, create app/views/
errors/missing_action.ctp.
> > <lilblogs%2Bunsubscr...@googlegroups.c om>

Miha Nahtigal

unread,
Apr 20, 2010, 1:08:00 PM4/20/10
to lilb...@googlegroups.com
It seems that you don't use admin routing (admin prefixes).

You should uncomment Configure::write('Routing.admin', 'admin'); in your core.php file.

Hm, I should mention these gotchas in the documentation.

cheers

Miha Nahtigal

unread,
Apr 20, 2010, 2:45:13 PM4/20/10
to lilb...@googlegroups.com
Yes, actually that should be quite simple. Revert your Auth component settings to your previous configuration (with users table).

Add a new configuration line in core.php after your "include(APP.'plugins'.DS.'lil_blogs'.DS.'config'.DS.'core.php');" line:

Configure::write('LilBlogsPlugin.userTable', array('className'=>'Users', 'foreignKey'=>'author_id'));

That should do the trick. 


You can also check/set/modify other configuration directives:

// admin field in users table - this allows lilblogs to determine admin users; only a simple boolean check is performed
Configure::write('LilBlogsPlugin.authorAdminField', 'admin');
// author's name display field (authors title)
Configure::write('LilBlogsPlugin.authorDisplayField', 'name');
// table name that connects authors/users to their blogs
Configure::write('LilBlogsPlugin.authorsBlogTable', 'authors_blogs');

cheers


On Tue, Apr 20, 2010 at 8:26 PM, Brewster <brewst...@gmail.com> wrote:
that was it! thanks!

so now... :)
is it an easy modification to use the default Auth 'users' DB for
login credentials?  i already have my site and users authenticating
against it.

i crudely tried moving the app_controller code in
lil_blogs_app_controller, and updating the login view & the controller
with the User model information, but with undesirable results.  i can
login against the User db, but the admin/lil_blogs functions are still
restricted.

Brewster

unread,
Apr 20, 2010, 3:27:55 PM4/20/10
to lilb...@googlegroups.com
ok. i think it is all setup as directed.  but now i am getting:

Missing Database Table
Error: Database table blogs_users for model BlogsUser was not found.

On Tue, Apr 20, 2010 at 12:20 PM, Miha Nahtigal <miha.n...@gmail.com> wrote:
Yes, revert to your previous setup. I guess you are already using Auth component? Lilblogs require auth component to be present   



On 20.4.2010, at 21:10, Brewster <brewst...@gmail.com> wrote:

when you say revert, you mean revert back to before i installed the lil_blogs plugin?  or revert back to the auth code on the site that should go into the app_controller?

and can i put it into lil_blogs_app_controller to avoid locking down access to all my other controllers?

Brewster

unread,
Apr 20, 2010, 2:26:55 PM4/20/10
to LilBlogs
that was it! thanks!

so now... :)
is it an easy modification to use the default Auth 'users' DB for
login credentials? i already have my site and users authenticating
against it.

i crudely tried moving the app_controller code in
lil_blogs_app_controller, and updating the login view & the controller
with the User model information, but with undesirable results. i can
login against the User db, but the admin/lil_blogs functions are still
restricted.

Miha Nahtigal

unread,
Apr 20, 2010, 3:20:05 PM4/20/10
to lilb...@googlegroups.com
Yes, revert to your previous setup. I guess you are already using Auth component? Lilblogs require auth component to be present   



On 20.4.2010, at 21:10, Brewster <brewst...@gmail.com> wrote:

when you say revert, you mean revert back to before i installed the lil_blogs plugin?  or revert back to the auth code on the site that should go into the app_controller?

and can i put it into lil_blogs_app_controller to avoid locking down access to all my other controllers?
On Tue, Apr 20, 2010 at 11:45 AM, Miha Nahtigal <miha.n...@gmail.com> wrote:

Brewster

unread,
Apr 20, 2010, 3:10:42 PM4/20/10
to lilb...@googlegroups.com
when you say revert, you mean revert back to before i installed the lil_blogs plugin?  or revert back to the auth code on the site that should go into the app_controller?

and can i put it into lil_blogs_app_controller to avoid locking down access to all my other controllers?
On Tue, Apr 20, 2010 at 11:45 AM, Miha Nahtigal <miha.n...@gmail.com> wrote:

Brewster

unread,
Apr 20, 2010, 9:32:54 PM4/20/10
to lilb...@googlegroups.com
so i made a little headway, i copied the DB authors_blogs to blogs_users, and now i can login, but with no admin functions.  even with adding an admin field to my users DB set to 1  also, when i am viewing the blog, my site shows that i am logged in, but i dont have the 'Edit This Post' option, so there is definitely something not talking to something else. do we need to link users and authors together with a table?  im sort of just taking some shots in the dark! ;)

thanks so much for all this help BTW...... 

Miha Nahtigal

unread,
Apr 21, 2010, 3:49:41 AM4/21/10
to lilb...@googlegroups.com
Hm, I see there's a problem in auth helper. It has sessionKey and user model hardcoded.

You'll have to modify plugin\lil_blogs\views\helpers\auth.php

change lines:

$this->sessionKey = 'Auth.Author';
$this->userModel = 'Author';

to 

$this->sessionKey = 'Auth.User';
$this->userModel = 'User';

i'll fix this in my project.

Brewster

unread,
Apr 21, 2010, 8:53:55 PM4/21/10
to lilb...@googlegroups.com
excellent! i think i have it working!  again, i really appreciate your responsiveness with this.  and i just realized at some point i started replying directly through email to you instead of the group..... should i post everything we did to the group in case it will help others?
Reply all
Reply to author
Forward
0 new messages