diff options
Diffstat (limited to 'lisp/service')
| -rw-r--r-- | lisp/service/users-service.lisp | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/lisp/service/users-service.lisp b/lisp/service/users-service.lisp index 965fee6..78cf065 100644 --- a/lisp/service/users-service.lisp +++ b/lisp/service/users-service.lisp @@ -76,7 +76,7 @@ (setf registration (get-registration-by-id auth-pkg id))) (handler-case (let ((text-message (format nil - "Hello ~a ~a and welcome to the ~a website!~%~%A user account registration has been created for you. It expires in 3 days.~%~%Please click the following link to complete the registration:~%~%~a://~a/register/~a~%" + "Hello ~a ~a and welcome to the ~a website!~%~%A user account registration has been created for you. It expires in 3 days.~%~%Please click the following link to complete the registration:~%~%~a://~a/register?hash=~a~%" (name *webapp*) (first_name registration) (last_name registration) @@ -170,30 +170,29 @@ registration) (registrations-gc auth-pkg) (setf registration (get-registration-by-hash auth-pkg hash)) - (org-ckons-json::objects-to-json - `(,(if registration - (if (string= pwd pwd2) - (let ((user (make-instance 'user - :username username - :pwd pwd - :first_name (first_name registration) - :last_name (last_name registration) - :email (email registration) - :phone phone - :active t))) - (if (insert-user auth-pkg user) - (progn - (loop for role-group in (union '("profile-admin") - (cl-ppcre:split "\\|" (role_groups registration)) - :test 'string=) - do (insert-user-role-group auth-pkg (make-instance 'user-role - :user_id (id user) - :role_group_name role-group))) - (delete-registration auth-pkg hash) - (setf (session-value :message) "Registration completed successfully.")) - (setf (session-value :errormsg) "Error while completing registration."))) - (setf (session-value :errormsg) "Error: passwords do not match.")) - (setf (session-value :errormsg) "Error while completing registration.")))))))) + (if registration + (if (string= pwd pwd2) + (let ((user (make-instance 'user + :username username + :pwd pwd + :first_name (first_name registration) + :last_name (last_name registration) + :email (email registration) + :phone phone + :active t))) + (if (insert-user auth-pkg user) + (progn + (loop for role-group in (union '("profile-admin") + (cl-ppcre:split "\\|" (role_groups registration)) + :test 'string=) + do (insert-user-role-group auth-pkg (make-instance 'user-role + :user_id (id user) + :role_group_name role-group))) + (delete-registration auth-pkg hash) + (setf (session-value :message) "Registration completed successfully.")) + (setf (session-value :errormsg) "Error while completing registration."))) + (setf (session-value :errormsg) "Error: passwords do not match.")) + (setf (session-value :errormsg) "Error while completing registration.")))))) (defclass users/modify-service (users/add-service) () |
