Skip to content
Browse files

Add users to uploaders group after signup.

No checks were being done by the admins before adding people to this
group, so it just generated extra work and delays for no benefit.
  • Loading branch information...
1 parent 786730e commit 0cbe6b3c6c895c5e48f9c189223472d17754ef27 @hesselink hesselink committed
Showing with 9 additions and 3 deletions.
  1. +1 −0 Distribution/Server/Features.hs
  2. +8 −3 Distribution/Server/Features/UserSignup.hs
View
1 Distribution/Server/Features.hs
@@ -107,6 +107,7 @@ initHackageFeatures env@ServerEnv{serverVerbosity = verbosity} = do
userSignupFeature <- initUserSignupFeature env
usersFeature
userDetailsFeature
+ uploadFeature
legacyPasswdsFeature <- initLegacyPasswdsFeature env
usersFeature
View
11 Distribution/Server/Features/UserSignup.hs
@@ -11,9 +11,11 @@ import Distribution.Server.Framework.Templating
import Distribution.Server.Framework.BackupDump
import Distribution.Server.Framework.BackupRestore
+import Distribution.Server.Features.Upload
import Distribution.Server.Features.Users
import Distribution.Server.Features.UserDetails
+import Distribution.Server.Users.Group
import Distribution.Server.Users.Types
import qualified Distribution.Server.Users.Users as Users
@@ -267,9 +269,10 @@ resetInfoToCSV (SignupResetTable tbl)
initUserSignupFeature :: ServerEnv
-> UserFeature
-> UserDetailsFeature
+ -> UploadFeature
-> IO UserSignupFeature
initUserSignupFeature env@ServerEnv{serverStateDir, serverTemplatesDir, serverTemplatesMode}
- users userdetails = do
+ users userdetails upload = do
-- Canonical state
signupResetState <- signupResetStateComponent serverStateDir
@@ -283,7 +286,7 @@ initUserSignupFeature env@ServerEnv{serverStateDir, serverTemplatesDir, serverTe
, "ResetEmailSent.html", "ResetConfirm.html" ]
let feature = userSignupFeature env users userdetails
- signupResetState templates
+ upload signupResetState templates
return feature
@@ -291,11 +294,12 @@ initUserSignupFeature env@ServerEnv{serverStateDir, serverTemplatesDir, serverTe
userSignupFeature :: ServerEnv
-> UserFeature
-> UserDetailsFeature
+ -> UploadFeature
-> StateComponent AcidState SignupResetTable
-> Templates
-> UserSignupFeature
userSignupFeature ServerEnv{serverBaseURI} UserFeature{..} UserDetailsFeature{..}
- signupResetState templates
+ UploadFeature{uploadersGroup} signupResetState templates
= UserSignupFeature {..}
where
@@ -515,6 +519,7 @@ userSignupFeature ServerEnv{serverBaseURI} UserFeature{..} UserDetailsFeature{..
uid <- updateAddUser username userauth
>>= either errNameClash return
updateUserDetails uid acctDetails
+ liftIO $ addUserList uploadersGroup uid
seeOther (userPageUri userResource "" username) (toResponse ())
where
lookPasswd = body $ (,) <$> look "password"

0 comments on commit 0cbe6b3

Please sign in to comment.
Something went wrong with that request. Please try again.