Ejemplo n.º 1
0
 function submit_register_form($form)
 {
     $notifications = new notifications();
     $node = node::add_new('title', $form['fields']['name']['value'], 1);
     $node->add_field('email', $form['fields']['email']['value']);
     $node->add_field('password', sha1($form['fields']['password']['value']));
     // Create the activation code.
     $activation_code = uniqid() . rand();
     $node->add_field('activation_code', $activation_code);
     // Then send the code to the new user.
     $reg_email = array('from' => '*****@*****.**', 'from_name' => 'Serum Core', 'is_html' => true, 'to' => $form['fields']['email']['value'], 'subject' => 'Activate your Serum Core login', 'message' => 'Activation code: ' . $activation_code);
     $notifications->mail($reg_email);
     header('location:' . base_path() . 'register/2/' . $node->id);
 }