mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Arreglado el inscribir un nuevo usuario
This commit is contained in:
@ -50,9 +50,12 @@ class Integration extends BaseController
|
||||
if(!empty($user)){
|
||||
foreach (keywordEmail()??[] as $item){
|
||||
$field = str_replace(['[','user_',']'],'',$item);
|
||||
$body = str_replace('['.$item.']',$user[$field],$body);
|
||||
if(str_contains($body, $field)){
|
||||
$body = str_replace('['.$item.']',$user->{$field},$body);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($this->sendMail($subject,unescape($body),$email)){
|
||||
return $json ? json_encode(["return" => true]) : true;
|
||||
}else{
|
||||
|
||||
@ -365,7 +365,7 @@ class login extends BaseController
|
||||
$rules = [
|
||||
'first_name' => 'required',
|
||||
'last_name' => 'required',
|
||||
'email' => 'required|valid_email|is_unique[user.email]',
|
||||
'email' => 'required|valid_email|is_unique[auth_user.email]',
|
||||
'password' => 'required|min_length[8]'
|
||||
];
|
||||
$rules_error = [
|
||||
@ -385,9 +385,10 @@ class login extends BaseController
|
||||
'min_length' => lang("App.login_rules_password_m")
|
||||
]
|
||||
];
|
||||
|
||||
|
||||
if ($this->validate($rules,$rules_error)){
|
||||
if($listPost = $this->request->getPost()) {
|
||||
|
||||
if($settings['captcha_register']??false){
|
||||
if($settings['captcha_gateway'] == 'recaptcha'){
|
||||
if(isset($listPost['g-recaptcha-response'])){
|
||||
@ -426,8 +427,8 @@ class login extends BaseController
|
||||
}
|
||||
$phpass = new PasswordHash(8, true);
|
||||
$userToken = md5(uniqid(rand(), true));
|
||||
$this->user_model->save([
|
||||
'group' => $settings['default_role'],
|
||||
$this->user_model->skipValidation(true)->save([
|
||||
//'group' => $settings['default_role'],
|
||||
'first_name' => $listPost['first_name'],
|
||||
'last_name' => $listPost['last_name'],
|
||||
'mobile' => '',
|
||||
@ -438,7 +439,12 @@ class login extends BaseController
|
||||
'last_ip' => '::1',
|
||||
'language' => $settings['default_language'],
|
||||
'token' => $userToken,
|
||||
'status' => true
|
||||
'status' => 1,
|
||||
'address' => '',
|
||||
'city' => '',
|
||||
'state' => '',
|
||||
'country' => '',
|
||||
'zip_code' => '',
|
||||
]);
|
||||
//Get Data Template
|
||||
$templates = $this->template_model->findAll();
|
||||
@ -450,6 +456,7 @@ class login extends BaseController
|
||||
try {
|
||||
$this->integration->send_email($listPost['email'],$template['subject'],$template['body'],$phpass->HashPassword(MD5($listPost['email'])));
|
||||
}catch (\Exception $e){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user