Jump to content
Killersites Forums

Login Not Working Cms Build Tut


Dbarr
 Share

Recommended Posts

Hello, I'm trying to login to the cms i i built with the tutorial.

 

I get Invalid username or password!

 

In the temp i put

 

<?php

 

echo md5('admin' . 'denver');

 

that gave me abb7619d2271090e75725e046315fdbe so i put that in my php db in the auth php file i have

 

class Auth

{

private $salt = 'denver';

 

 

But its not logging in.

 

Hope you can help Denver

Link to comment
Share on other sites

The first thing I would do would be to check the Javascript Console for Javascript errors -- it will tell you about incorrectly linked files, misspellings in your Javascript code, etc. http://www.netmagazine.com/tutorials/javascript-debugging-beginners

 

 

I'm getting a no database selected with all the db connections set right. here http://22twenty.com/mycms Any ideas?

 

fixed that but still have the popup problem.

Edited by Denver
Link to comment
Share on other sites

When I look at the console, I see these two errors:

 

-- Uncaught TypeError: Cannot read property 'msie' of undefined colorbox.js:4 (colorbox.js)

-- Uncaught TypeError: Object [object Object] has no method 'live'

 

I also see that you have used jQuery's NoConflict functionality, but there is code at the bottom of the page that doesn't properly follow jQuery's NoConflict rules:

 

<script type="text/javascript">

var currentYear = (new Date).getFullYear();

$(document).ready(function() {

$("#year").text( (new Date).getFullYear() );

});

</script>

 

Personally, I would start by fixing the above code. Then I would look at the "live" issue -- apparently in the latest version of jQuery, that functionality has been depreciated and they intend you to use "on" instead (check the jquery documentation). You can either switch to use "on" rather than "live" (check the documentation), or you'll need to load a version of jquery earlier than the current 1.7 version.

 

I'm not sure what the colorbox error is, and a quick search isn't turning much up, but try fixing the other two errors first and perhaps that one will resolve itself.

Link to comment
Share on other sites

When I look at the console, I see these two errors:

 

-- Uncaught TypeError: Cannot read property 'msie' of undefined colorbox.js:4 (colorbox.js)

-- Uncaught TypeError: Object [object Object] has no method 'live'

 

I also see that you have used jQuery's NoConflict functionality, but there is code at the bottom of the page that doesn't properly follow jQuery's NoConflict rules:

 

<script type="text/javascript">

var currentYear = (new Date).getFullYear();

$(document).ready(function() {

$("#year").text( (new Date).getFullYear() );

});

</script>

 

Personally, I would start by fixing the above code. Then I would look at the "live" issue -- apparently in the latest version of jQuery, that functionality has been depreciated and they intend you to use "on" instead (check the jquery documentation). You can either switch to use "on" rather than "live" (check the documentation), or you'll need to load a version of jquery earlier than the current 1.7 version.

 

I'm not sure what the colorbox error is, and a quick search isn't turning much up, but try fixing the other two errors first and perhaps that one will resolve itself.

 

Removing that code doesn't change anything. :(

Link to comment
Share on other sites

Just removing or fixing that code won't necessarily be enough to fix things. That's just something I noticed -- not a significant error that the Console was complaining about. Next up would be to fix the "live" issue as I talked about.

 

The error is talking specifically about:

 

$('#fp_cancel').live('click', function(e){

e.preventDefault();

$.colorbox.close();

});

Link to comment
Share on other sites

Just removing or fixing that code won't necessarily be enough to fix things. That's just something I noticed -- not a significant error that the Console was complaining about. Next up would be to fix the "live" issue as I talked about.

 

The error is talking specifically about:

 

$('#fp_cancel').live('click', function(e){

e.preventDefault();

$.colorbox.close();

});

 

 

So I should change the .live to .on?

 

and you said you didn't know what this was -- Uncaught TypeError: Cannot read property 'msie' of undefined colorbox.js:4 (colorbox.js)?

 

Thanks

 

Denver

Edited by Denver
Link to comment
Share on other sites

Then I would look at the "live" issue -- apparently in the latest version of jQuery, that functionality has been depreciated and they intend you to use "on" instead (check the jquery documentation). You can either switch to use "on" rather than "live" (check the documentation), or you'll need to load a version of jquery earlier than the current 1.7 version.

 

I'm not sure what the colorbox error is, and a quick search isn't turning much up, but try fixing the other two errors first and perhaps that one will resolve itself.

Link to comment
Share on other sites

As I said, check the documentation:

 

http://api.jquery.com/live/

http://api.jquery.com/on/

 

on switch to an earlier version of jquery (anything before 1.7):

 

http://code.jquery.com/jquery-1.6.4.min.js

 

 

Ok so that seems to be working however now the colorbox wont close on submit for anything(login, edit, save) etc and i'm wondering if theres any way to use mecury editor instead of tinymce?

 

Thanks

 

Denver

Link to comment
Share on other sites

What browser are you viewing the site in? Using Chrome (Chrome 24, Mac) I've logged into your CMS and tested your site, and everything seems to be working correctly for me -- the popups are opening and closing correctly.

 

In regards to using Mercury, yes, you could switch out TinyMCE for something else. I can't really provide support for that process though -- I've never used Mercury and I'm not familiar with Rails.

Link to comment
Share on other sites

What browser are you viewing the site in? Using Chrome (Chrome 24, Mac) I've logged into your CMS and tested your site, and everything seems to be working correctly for me -- the popups are opening and closing correctly.

 

In regards to using Mercury, yes, you could switch out TinyMCE for something else. I can't really provide support for that process though -- I've never used Mercury and I'm not familiar with Rails.

 

 

That was a old link here is another where the problem persists.

 

http://22twenty.com/cms

 

 

Chrome: Version 24.0.1312.56

 

also wondering if theres a way with php to add a user to mysql, add database etc.

 

Thanks

Edited by Denver
Link to comment
Share on other sites

The browser can't find these files:

 

http://localhost/frontcms/app/resources/css/fp_style.css

Failed to load resource http://localhost/frontcms/app/resources/javascript/colorbox/colorbox.js

Failed to load resource http://localhost/frontcms/app/resources/javascript/colorbox/colorbox.css

 

Looks like they are all pointing to a localhost location rather than your live site.

 

also wondering if theres a way with php to add a user to mysql, add database etc.

For example, to help with the install process on a CMS? I don't think so, though I haven't really done any research on the subject. Wordpress might be a good example to follow: they have an installer where the user enters the database details, and then the system automatically sets up the required database tables and an admin user.

Link to comment
Share on other sites

The browser can't find these files:

 

http://localhost/frontcms/app/resources/css/fp_style.css

Failed to load resource http://localhost/frontcms/app/resources/javascript/colorbox/colorbox.js

Failed to load resource http://localhost/frontcms/app/resources/javascript/colorbox/colorbox.css

 

Looks like they are all pointing to a localhost location rather than your live site.

 

 

For example, to help with the install process on a CMS? I don't think so, though I haven't really done any research on the subject. Wordpress might be a good example to follow: they have an installer where the user enters the database details, and then the system automatically sets up the required database tables and an admin user.

 

 

Fixed the pointing but its still not closing.

 

Thanks

Link to comment
Share on other sites

The main thing that appears not to be working is your jQuery on() function.

 

$('#fp_cancel').on('click', function(e){
		e.preventDefault();
		$.colorbox.close();
	});

Note this section in the documentation (especially the first sentence):

 

Event handlers are bound only to the currently selected elements; they must exist on the page at the time your code makes the call to .on(). To ensure the elements are present and can be selected, perform event binding inside a document ready handler for elements that are in the HTML markup on the page. If new HTML is being injected into the page, select the elements and attach event handlers after the new HTML is placed into the page. Or, use delegated events to attach an event handler, as described next.

 

Delegated events have the advantage that they can process events from descendant elements that are added to the document at a later time. By picking an element that is guaranteed to be present at the time the delegated event handler is attached, you can use delegated events to avoid the need to frequently attach and remove event handlers. This element could be the container element of a view in a Model-View-Controller design, for example, or document if the event handler wants to monitor all bubbling events in the document. The document element is available in the head of the document before loading any other HTML, so it is safe to attach events there without waiting for the document to be ready.

#fp_cancel elements are added to the page after the page is loaded, so you need to change your on() call to use a delegated events to attach an event handler (it's inserted at the end of the document, so you'd likely need to use "body". The documentation provides this example -- you'd need to follow this as an example:

 

$("#dataTable tbody").on("click", "tr", function(event){

alert($(this).text());

});

 

http://api.jquery.com/on/

 

Hope that helps?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...