Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Ipb 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();
- $this->authenticate();
- }
- /**
- * Add the account
- */
- private function process()
- {
- $this->db->query("INSERT INTO ".$this->CI->config->item('forum_table_prefix')."xf_user(`username`, `email`, `visible`, `user_group_id`, `register_date`) VALUES(?, ?, '1', ?, ?)", array($this->username, $this->email, time()));
- }
- private function process()
- {
- $salt = str_replace( '\\', "\\\\", $salt );
- $password = $this->encryptPassword($salt);
- }
- /**
- * Encrypt the password with a specific algorithm
- * @return String
- */
- private function encryptPassword($salt)
- {
- return sha256(sha256($salt) . sha256($this->password));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement