Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7069427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:26:40+00:00 2026-05-28T05:26:40+00:00

I’m not really sure what’s going on here. This is what I have in

  • 0

I’m not really sure what’s going on here. This is what I have in my app_controller.php:

<?php

class AppController extends Controller {

var $components = array('Auth');
var $helpers = array('Form', 'Session');

function beforeFilter() {

    $this->Auth->allow('register');
    $this->Auth->userScope = array('User.activated' => true);
    $this->Auth->loginError = "<span style=\"color:#FF0000\">Wrong username or password</span>";
    $this->Auth->fields = array(            
        'username' => 'username',             
        'password' => 'password'
    );
    }
}

?>

and my users_controller.php:

<?php

class UsersController extends AppController {

var $name = 'Users';
var $components = array('Auth');
var $helpers = array('Form', 'Session');

function index() {



}

function login() {

    $this->set('title_for_layout', "Welcome to .com!");
    $this->layout = 'user_functions';

}

function logout() {

    $this->redirect($this->Auth->logout());

}

function register(){

    $this->set('title_for_layout', "Register Here!");
    $this->layout = 'user_functions';
    $date = date('Y');

    if (!empty($this->data)) {
        $user_check = $this->User->find('first', array('conditions' => array('username' => $this->data['User']['username'])));
        $email_check = $this->User->find('first', array('conditions' => array('e-mail' => $this->data['User']['e-mail'])));
        if (empty($user_check)) {
            if(empty($email_check)){
                if ($this->User->save($this->data)) {
                    $uuid_string = $this->data['User']['activation_hash'];
                    $email = //email
                    $to = $this->data['User']['e-mail'];
                    $subject = 'Welcome to .com!';
                    $headers = "MIME-Version: 1.0" . "\r\n";
                    $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
                    $headers .= 'From: '';

                    if (mail($to, $subject, $email, $headers)) {
                        $this->redirect('/');
                    }
                } else {
                    //$this->Session->setFlash('<p class="register_flash">Something went wrong. Please try again.</p>', 'flash_registration');
                    //$this->flash('', '/');
                }
            } else {

                //email exists

            }
        } else {

            //username exists

        }
    }   
}
}





?>

and here’s my view:

<div id="login">
<p>Please log in! <a id="register" href="register" alt="Register">Register</a></p>
<hr class="login"/>
<?php    
    echo $this->Session->flash('auth');    
    echo $this->Form->create('User');    
    echo $this->Form->input('username');
    echo $this->Form->input('password');
    echo "<hr class=\"login\"/>";
    echo $this->Form->end('Login');
    echo $this->Session->flash('flash_registration');
    echo "<pre>"; print_r($this->data); echo "</pre>";
?>

</div>

Basically, when I try to login using my login form, even if I use the password that I used when I registered, it says that the username or password is incorrect. However, when I changed the password stored in the database to ‘password’ in plain text, and tried logging in with that, it worked! I have no idea why this is happening. I also echoed out $this->data on the login view, and the username is right, but the password is empty. From what I can see , the password is just not hashing.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:26:40+00:00Added an answer on May 28, 2026 at 5:26 am

    EDIT

    I think you mean mask, not hash, the password at input time. This should be simple…

    echo $this->Form->input('password', array('type' => 'password'));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
This could be a duplicate question, but I have no idea what search terms
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.