Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-18-2015, 08:10 PM
Chaya_ Chaya_ is offline
 
Join Date: Apr 2014
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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 ?
Reply With Quote
  #2  
Old 01-18-2015, 08:12 PM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 01-18-2015, 08:14 PM
Chaya_ Chaya_ is offline
 
Join Date: Apr 2014
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #4  
Old 01-18-2015, 08:16 PM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You would need to ask the developer of the plugin what the issues may be.
Reply With Quote
  #5  
Old 01-18-2015, 08:18 PM
Chaya_ Chaya_ is offline
 
Join Date: Apr 2014
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 !
Reply With Quote
  #6  
Old 01-18-2015, 08:20 PM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Did you happen to look into how vBulletin generates the salt?
Reply With Quote
  #7  
Old 01-18-2015, 08:22 PM
Chaya_ Chaya_ is offline
 
Join Date: Apr 2014
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Pls Check your PM, i am german boy, i cant write good in english !
Reply With Quote
  #8  
Old 01-18-2015, 08:24 PM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry, I don't offer unsolicited support requets via PM.
Reply With Quote
  #9  
Old 01-18-2015, 08:26 PM
Chaya_ Chaya_ is offline
 
Join Date: Apr 2014
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

WTF ...

I only need show you my problem... OMG !
Reply With Quote
  #10  
Old 01-18-2015, 08:28 PM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:06 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.04853 seconds
  • Memory Usage 2,269KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete