Ticket #56 (defect)

Opened 2 years ago

Last modified 1 year ago

weird elseif and else blocks in admin/admins

Status: closed (fixed)

Reported by: grahack Assigned to: grahack
Priority: major Milestone:
Component: core Version: 1.0.4
Keywords: Cc:

weird elseif and else blocks in admin/admins here

I had problems once in the console and it could come from this

  • in the elseif, no flashMsg($msg); and redirect(); is used
  • in the else, $msg is set twice (and once after the flashMsg($msg);)

Change History

05/23/07 02:20:22: Modified by grahack

  • status changed from new to assigned.
  • owner changed from danfreak to grahack.
  • milestone changed from 1.0.6 to 1.0.5.

I'd like to take care of this, or you could when I'm done with #29 (avoid conflicts).

I'll try to get the purpose of these strange line, but I think that ir's just a mistake.

  • for the elseif, I'd add the missing flashMsg($msg); and redirect();
  • for the else, I'd remove one of the $msg setting

tell me if it's right

05/23/07 03:49:22: Modified by danfreak

ok, test it after the change

05/25/07 10:50:24: Modified by grahack

  • description changed.

well, I changed my mind...

I think that there is a simpler behaviour:

  • it's just not allowed to delete a superadmin
  • there is a mean to delete a superadmin, and it's a 2 step process: change his role, then delete him
  • BUT, nobody can change the role of an admin, except himself

so

  • del() function tests the role and deletes only simple admins
  • edit() function allows nobody to change the role of a superadmin, except himself, and he can do it only if there's another superadmin

what do you think ?

05/25/07 10:56:58: Modified by danfreak

"BUT, nobody can change the role of an admin, except himself" I don't agree.

Let's take for example I'm the superadmin of my site, and I have an admin for news. What's if I have arguments with him and I don't wanna let him manage my news anymore?

With your approach the only way is to delete him right from the DB.

05/25/07 11:08:05: Modified by grahack

sorry, I meant superadmin

05/29/07 10:37:56: Modified by danfreak

If you think this works go for it.

Dan

05/31/07 10:51:05: Modified by grahack

  • status changed from assigned to closed.
  • resolution set to fixed.

fixed in [279]

flags that control the display of the edit/delete links are now set in the controllers

$can_edit_user and $can_delete_user in the detail.php view

show_edit_link and show_delete_link in the list.php view

06/27/07 08:23:29: Modified by

  • milestone deleted.

Milestone 1.0.5 deleted