Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function addUser($param)
- {
- if ($this->checkData($param) == 'admin')
- {
- $validate = $this->validator->isValidateRegistration($param);
- if ($validate === true)
- {
- $userName = $this->pdo->quote($param['username']);
- $id_role = $this->pdo->quote($param['id_role']);
- $login = $this->pdo->quote($param['login']);
- $pass = md5(md5(trim($param['pass'])));
- $pass = $this->pdo->quote($pass);
- $email = $this->pdo->quote($param['email']);
- $sql = 'INSERT INTO users (id_role, login, pass, username, email) VALUES ('.$id_role.', '.$login.', '.$pass.', '.$userName.', '.$email.')';
- $result = $this->execQuery($sql);
- if ($result === false)
- {
- return ERR_LOGIN;
- }
- return $result;
- }
- return $validate;
- }
- return ERR_ACCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement