$types = array('normal', 'admin'); if (!in_array($user['type'], $types)) { ossn_trigger_message(ossn_print('account:create:error:admin'), 'error'); redirect(REF); } $user['birthdate'] = "{$user['bdd']}/{$user['bdm']}/{$user['bdy']}"; $add = new OssnUser(); $add->username = $user['username']; $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); }