Welcome Guest, Not a member yet? Register   Sign In
MeNeedz Auth
#61

[eluser]davidbehler[/eluser]
But you can see the form to login?
#62

[eluser]SaSHka[/eluser]
[quote author="waldmeister" date="1227337181"]But you can see the form to login?[/quote]

Yes!
#63

[eluser]davidbehler[/eluser]
What happens when you click the submit button?
Do you see the form again or just a white page?
#64

[eluser]SaSHka[/eluser]
I see the form again
Also I see the debugger information
Code:
URI STRING  
/welcome/login
CLASS/METHOD  
welcome/login
MEMORY USAGE  
1,864,760 bytes
BENCHMARKS  
Loading Time Base Classes      0.0392
Controller Execution Time ( Welcome / Login )      0.0899
Total Execution Time      0.1293
  GET DATA  
No GET data exists
  POST DATA  
$_POST['user_name']       nosize
$_POST['user_password']       111222
$_POST['mysubmit']       Submit Post!
  DATABASE:  XXXX   QUERIES: 2  
0.0014      SELECT *
FROM (`ci_sessions`)
WHERE `session_id` = '0fdd9c7c3344b333167473e54fa26e1a'
AND `user_agent` = 'Mozilla/5.0 (Windows; U; Windows NT 6.0; ru; rv:1.'
0.0005      
SELECT *
FROM (`user`)
WHERE `user_name` = 'nosize'
AND user_password =md5(concat(user_salt,'111222'))
LIMIT 1
#65

[eluser]davidbehler[/eluser]
Have you checked your config?
Whats the value for the password in the database? Have you created the user by hand or used the registration function?
#66

[eluser]SaSHka[/eluser]
For registration I use the controller
Code:
function register()
    {
        if($this->auth->is_logged_in())
        {
            echo "logged in";
        }
        else
        {
            $register = $this->auth->register();
            if($register)
            {
                redirect('welcome/register');
            }
            else
            {
                $this->load->view('register');
            }
        }
    }

View

Code:
<html>
<head>
<title>Welcome to CodeIgniter</title>

<body>
<?
    echo form_open('welcome/register');
    $data = array(
                  'name'        => 'user_name',
                  'id'          => 'user_name',
                  'maxlength'   => '50',
                  'size'        => '50'
                );
    echo form_input($data);
?>
<br/>
&lt;?
    $data = array(
                  'name'        => 'user_password',
                  'id'          => 'user_password',
                  'maxlength'   => '50',
                  'size'        => '50'
                );
    echo form_password($data);
?&gt;
<br/>
&lt;?
    $data = array(
                  'name'        => 'user_email',
                  'id'          => 'user_email',
                  'maxlength'   => '50',
                  'size'        => '50'
                );
    echo form_input($data);
?&gt;
<br/>
&lt;?
    echo form_submit('mysubmit', 'Submit Post!');
    echo form_close();
?&gt;
&lt;/body&gt;
&lt;/html&gt;

User table
user_id user_name user_password user_salt user_group user_email
1 sashka a1e55335d2c4014f4467d9eef8d6a1bc 8634679e0cdba42fd6971091b41afd13 [email protected]
3 nosize 7c16d0582f688a785a1f878964a2c3da 0fb09f0dbfe4dc61cbf58f1c6a8077d5 [email protected]
4 gfhfgh 7d1b267c66f8fbf77bd91c3d4b6c51d9 0db38019664205938378b9fb7222065e 54@dfg,com
#67

[eluser]SaSHka[/eluser]
At switching-off use_encryption preference all has earned!
#68

[eluser]davidbehler[/eluser]
Congratulations, you have just found a bug in my library Smile

I have fixed it and uploaded the new version.

If you don't want to download the new version you can just replace line 238:
Code:
$password_hash = $encryption_method(str_replace("%password%", $this->CI->db->escape($user_password), str_replace("%salt%", $this->CI->db->escape($salt), str_replace(".", "", $this->encryption_order))));
with
Code:
$password_hash = $encryption_method(str_replace("%password%", $user_password, str_replace("%salt%", $salt, str_replace(".", "", $this->encryption_order))));

You have to delete all existing users and register them again. After that it should work just fine with and without encryption.
#69

[eluser]SaSHka[/eluser]
Thanks! Smile
And in User guide in a database in the table member the column group_id has corrected?
#70

[eluser]davidbehler[/eluser]
Yeah, I have updated the user guide and the library and change the default group foreign key column consistently to group_id.




Theme © iAndrew 2016 - Forum software by © MyBB