Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Added account deletion and suspension #608

Merged
merged 21 commits into from
Jul 7, 2015
Merged

[Feature] Added account deletion and suspension #608

merged 21 commits into from
Jul 7, 2015

Conversation

jjkirkpatrick
Copy link
Contributor

I have added the ability to soft delete and account so you don't need to delete valuable user information, also added account suspension based on timestamps

@panique
Copy link
Owner

panique commented Feb 11, 2015

@jjkirkpatrick
Copy link
Contributor Author

There is currntly no way for the user to suspend or delete and account as that would be an admin feature and we don't have that, and yeah scrutinizer isn't happy with me concatenating the time left on the suspension with the text from Text::get in Session::add, i guess i could split it up but i don't actually see anything wrong with the way i have done this

@panique
Copy link
Owner

panique commented Feb 11, 2015

:) Yeah scrutinizer is really bitchy sometimes with totally good code!

Does this feature make sense when there's currently no way to really use it ? What do the others say, any opinions ? Personally I think account stopping / deletion is useful.

@jjkirkpatrick
Copy link
Contributor Author

i think it's definitely useful, even without an nice flashy admin page peoples account can be suspended and or soft deleted from the database now, which wasn't a possibility before, this just gives that little bit more control over users out of the box. Would love to know what others think

@jjkirkpatrick
Copy link
Contributor Author

Separated the time left from the Session::Add, Let's see if it's happy with that.

Still say's it got worse, I don't know what it's bitching for any ideas?

I think it's pure basing this on

Complexity                         Complexity                         

Conditions  10                  Conditions  12
Paths   288                        Paths    1152

from the addition of two If statements, this complexity system seems stupid to me.

@panique
Copy link
Owner

panique commented Feb 14, 2015

Hmm, I'm unsure as this is basically "dead code", as it's not used anywhere. You know, there's no possibility to delete users or to suspend them in any way yet, and this might confuse people more than it helps them.

I think we should only release fully working features. Other opinions ?

@jjkirkpatrick
Copy link
Contributor Author

well the features can be accessed by changing data in the database, yes this is not desirable, i can work on an admin feature if you want, however without proper roles it wont be great and it's not really a login feature, however suspensions and deletions of account is, it's a tricky one.

@jjkirkpatrick
Copy link
Contributor Author

What does this need now to be merged?

@panique
Copy link
Owner

panique commented Feb 23, 2015

There's absolutly no possibility to delete a user, and there's also no way to suspend a user right now. Practically this is unused / dead code.

@mtaylorsherwood
Copy link
Contributor

Would it not make more sense to create a basic 'admin' section? Use the existing functions and alter them to allow people to create an account, change username/email. Could tie into the discussion about roles and locking it down away from 'standard' users.

Once that's in place you can look at adding suspension and deletion in a nice clean way without needing to manipulate the database directly.

@jjkirkpatrick
Copy link
Contributor Author

Added very basic admin feature

@panique
Copy link
Owner

panique commented Mar 5, 2015

Thanks, this looks awesome! 👍 I'll have a deeper look in the next weeks and merge this within March 2015.

@ldmusic
Copy link

ldmusic commented Mar 5, 2015

Hi, if I see this correctly, you only restrict the visibility of the link to the new admin page for user with account type "2". But I think you should restrict it in the controler. But I may have missed something.

@jjkirkpatrick
Copy link
Contributor Author

I would tend to agree, however as there are talks of a roles system that would need to be reworked anyway, up to @panique

@ldmusic
Copy link

ldmusic commented Mar 5, 2015

Hi, you're right. I only wanted to note that, 'cause sometimes user use Developer Versions. Perhaps in the meantime something like

If(Session::get('user_account_type') != 2) Redirect::home();

in AdminController.php can be a workaround.

@jjkirkpatrick
Copy link
Contributor Author

Added that little bit of restriction to the controller

@ldmusic
Copy link

ldmusic commented Mar 5, 2015

Cool! Thank you!

@panique
Copy link
Owner

panique commented Mar 13, 2015

@oisian1 Thank you very much, looks good! This needs some tiny fixes but it's really a great feature!

Interesting security thing, maybe useful for everybody reading this. Doing a redirect will STILL run the code after the redirect (!!), so

if (Session::get('user_account_type') != 2) {
    Redirect::home();
}
echo 123;

will ask the browser to redirect to home AND it will also echo 123 ! Redirects are just a command sent to the browser afaik, and not really something that will stop your code from going on. If the user parses your page without a browser (maybe with curl) you'll definitly see this, try it out :)
Really a weird thing, I was shocked the first time.

@jjkirkpatrick
Copy link
Contributor Author

If you wan't to put comments through the bits that need fixing in the commits section ill get them sorted

@jjkirkpatrick
Copy link
Contributor Author

What does this need to be merged?

@panique panique merged commit e518d9b into panique:develop Jul 7, 2015
panique added a commit that referenced this pull request Jul 7, 2015
@panique
Copy link
Owner

panique commented Jul 7, 2015

Thank you very much, this awesome feature is now part of the develop branch! I've added some tiny improvements (spelling, code convention, file name change etc). Please gimme some days to test this properly :)

panique added a commit that referenced this pull request Jul 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants