vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Salt Create error ! (https://vborg.vbsupport.ru/showthread.php?t=316759)

Chaya_ 01-18-2015 08:10 PM

Salt Create error !
 
PHP Code:

<?php

class Vbulletin extends Plugin
{
    
/**
     * Runtime values
     */
    
private $username;
    private 
$password;
    private 
$email;
    private 
$db;

    
/**
     * Receive the user information
     * @param String $username
     * @param String $password
     * @param String email
     */    
    
public function register($username$password$email)
    {
        
$this->username $username;
        
$this->password $password;
        
$this->email $email;
        
        
$this->db $this->CI->load->database($this->CI->config->item('bridge'), TRUE);

        
$this->process();
    }

    
/**
     * Add the account
     */
    
private function process()
    {
        
$salt $this->fetch_user_salt(30);

        
$password $this->encryptPassword($salt);
        
$this->db->query("INSERT INTO ".$this->CI->config->item('forum_table_prefix')."user(`usergroupid`, `username`, `password`, `email`, `joindate`, `salt`) VALUES ('2', ?, ?, ?, ?, ?)", array($this->username$password$this->emailtime(), $salt));
    }

    
/**
     * Encrypt the password with a specific algorithm
     * @return String
     */
    
private function encryptPassword($salt)
    {
        return 
md5(md5($salt) .md5$this->password ));            
    }

    private function 
fetch_user_salt($length 30)
    {
            
$salt '';
            for (
$i 0$i $length$i++)
            {
                
$salt .= chr(rand(33126));
            }
            return 
$salt;
    }  
}

What is wrong in this script ?

ozzy47 01-18-2015 08:12 PM

Where is that from, and what is it supposed to be doing?
What is it not doing?

You need to provide more information as to the problems.

Chaya_ 01-18-2015 08:14 PM

it creates an account wth fusion cms !

This is a plugin module ...

the problem is the salt... i create the account from users, that all works fine, but the salt is wrong or login works not

ozzy47 01-18-2015 08:16 PM

You would need to ask the developer of the plugin what the issues may be.

Chaya_ 01-18-2015 08:18 PM

i am the dev LoL !

I ask the community what is wrong with my script, why salt is wrong ?!

This script input userdatas in the users table ... like this ...

`usergroupid`, `username`, `password`, `email`, `joindate`, `salt`)

But Salt is wrong !

ozzy47 01-18-2015 08:20 PM

Ahh, ok, did not know you were the developer. :)

Did you happen to look into how vBulletin generates the salt?

Chaya_ 01-18-2015 08:22 PM

Pls Check your PM, i am german boy, i cant write good in english !

ozzy47 01-18-2015 08:24 PM

Sorry, I don't offer unsolicited support requets via PM. :)

Chaya_ 01-18-2015 08:26 PM

WTF ...

I only need show you my problem... OMG !

ozzy47 01-18-2015 08:28 PM

I did not ask you to PM me. Support is handled out here in the forums, unless someone asks you to PM them something. :)

Chaya_ 01-18-2015 08:30 PM

you understandf me or ? i cannot write all in english ?! Understand that ?

ozzy47 01-18-2015 08:33 PM

Irregardless, my original point still stands. " Sorry, I don't offer unsolicited support requets via PM. :) "

Perhaps someone will come along in this thread and ask you to pm them a link to your desktop, and have a look. :)

ozzy47 01-18-2015 08:36 PM

Or since your native language is German, perhaps ask here, http://www.vbulletin-germany.org/forum.php

There is some real good coders over there.

kh99 01-18-2015 09:11 PM

Try this:
Code:

    private function encryptPassword($salt)
    {
        return md5(md5( $this->password ). $salt);           
    }



All times are GMT. The time now is 02:52 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01158 seconds
  • Memory Usage 1,758KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (14)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete