$add->first_name = $user['firstname']; $add->last_name = $user['lastname']; $add->email = $user['email']; $add->password = $user['password']; $add->gender = $user['gender']; $add->birthdate = $user['birthdate']; $add->usertype = $user['type']; if (!$add->isUsername($user['username'])) { ossn_trigger_message(ossn_print('username:error'), 'error'); redirect(REF); } if (!$add->isPassword()) { ossn_trigger_message(ossn_print('password:error'), 'error'); redirect(REF); } if ($add->isOssnUsername()) { ossn_trigger_message(ossn_print('username:inuse'), 'error'); redirect(REF); } if ($add->isOssnEmail()) { ossn_trigger_message(ossn_print('email:inuse'), 'error'); redirect(REF); } //check if email is valid email if (!$add->isEmail()) { ossn_trigger_message(ossn_print('email:invalid'), 'error'); redirect(REF); } if ($add->addUser()) { ossn_trigger_message(ossn_print('account:created'), 'success'); redirect(REF);